asc_grain
ASCENSION's airborne sand. Up to 45 000 grains, and the entire flight happens in the vertex stage off material scalars — the pattern `fyr_ember` established and `asc_spark` refined — so the swarm costs no per-frame CPU.
asc_grain
ASCENSION's airborne sand. Up to 45 000 grains, and the entire flight happens in
the vertex stage off material scalars — the pattern fyr_ember established and
asc_spark refined — so the swarm costs no per-frame CPU.
Three things are this object's own:
- A wrapped tile around the camera. Each grain's authored position is a
point in a lattice; the vertex stage re-tiles it into the tile centred on the
camera with
rel -= 2R * round(rel / 2R). The grain does not move with the camera —roundpicks WHICH COPY of a world-fixed lattice you are looking at, and the lattice itself only travels onwind_accum. Near the tile boundary the grain fades, so the copy that swaps is never one you can see. Every flight parameter is hashed off the seed rather than read off the authored position, which frees those coordinates to span the AABB the flight needs. - A streak whose length is the gust. The quad is spanned on the wind
direction and on the axis perpendicular to both the wind and the view, so a
grain is a capsule lying along
windDirthat foreshortens correctly. Its base size is a constant number of PIXELS:size_kis target-pixels-per-unit-of-range and the vertex stage multiplies by distance. - An inflow. Inside
tor_reacha grain is drawn toward the axis, turned byspin(the sameaux.torSpinAccumin revolutions the fill and the sparks turn by, so the three objects turn together) and lifted.
count_frac is a threshold on a uniformly distributed seed, so the beat sheet's
2 k → 24 k → 45 k → 6 k curve is exact and costs one float a frame.
Blends additive, premultiplied by the grain's own radial falloff. The storm is TEXTURE in the beats the tornado is hero in, and a sprite that can only add light cannot punch a hole in the fire behind it.
Driven by preseed.asc.asc_dust.
Scoped to this part · feeds back into the world's score.