Log inGet started
World

Cold Start

Branchmain
Commitcfc095f0fc

README.md

preseed/tides/sky

The SKY lane of THE FARJAN (part 9, TIDES): the weather, the sky, the volumetric squall, the horizon and the rain veil.

What it owns

  • The scene's ProceduralSky — gradient, hour, sun disc and disc bearing, driven from preseed.tides.state. It drives the SCENE's sky entity and puts back what it found in M.exit; a part that spawns its OWN ProceduralSky beside it does not get a second sky, it gets a fight, because SkyConfig is one global record every Sky component pushes into.
  • The volumetric squall — a cellular cumulus field, raymarched, self-shadowed, with the sun attenuating through it.
  • The horizon — warm low height-fog that closes the sea/sky join and hides the ocean clipmap's far edge.
  • The rain veil from t = 25.

The pipeline is this part's own

tid_cloud_fill writes the density volume, tid_cloud_march marches it into tid_cloud_rt, and tid_cloud_composite resolves and blends it. None of the three is shared with any other part, and M.exit releases all of them.

It does not go through preseed.volume, and the reason is written at the top of init.luau: that module marches through preseed.emission_raymarch, which builds its ray from unproject(ndc, 0) -> unproject(ndc, 1) and tests depth < 1.0 for "a surface is here" — both correct before the engine's projection was reversed, and both wrong after it. Its target is also a single fixed 1600x900 buffer shared with every volume in the demo.

The numbers that are load-bearing

  • Every frequency in the fill is bounded by the VOXEL PITCH — 98 m horizontally, 63 m vertically at 224 x 72 x 224 over an 22 km box. A feature shorter than about three voxels does not resolve, it aliases, and because the cell map and the warp are functions of x and z only, that aliasing is constant down a column and reads as vertical fluting. Detail finer than that is added at MARCH time, where there is no grid.
  • The sun's extinction taps are a jittered cone, not a fixed ladder. Four fixed offsets comb-filter the medium along the sun's axis; with the sun near horizontal that axis is horizontal too, and the ripple lies in planes of constant X.
  • The march jitters WITHIN each step, not at the ray's start. The step grows with distance, so a start offset bounded by the near step leaves most of the quantisation coherent between neighbours out at the deck.

Contract

Reads State.weather, State.light, State.palette, State.sea (windDirection and windSpeed — the wind that moves the cloud is the wind that raises the sea) and State.sunDirection. Owns State.weather.

M.update must be called LAST in the part's update, after whatever moved the camera: the march builds its ray basis from the camera pose.