The grass had a gust built from two sines; the trees had no gust term AT ALL, only a per-instance wobble. So the meadow rippled and the canopy above it swayed to an unrelated rhythm, and nothing ever crossed the valley. wind.glsl is prepended to every stage (programs.ludic, and shaders.ludic for the SPIR-V build) so grass, crowns and water read the same field at the same world position. It declares no uniforms on purpose: u_time and u_wind already exist in several of those files and redeclaring them is a compile error in whichever stage includes both. The wavelength is what made it work. At 0.030 the front was 209 m crest to crest - longer than the meadow you can see - so the whole frame sat in one phase and the gust read as everything breathing together. At 0.085 it is 74 m and a front crosses a view in a couple of seconds. R3D_DEBUG_WIND=1 paints the field on the ground. It is the only honest way to show a gust in a still image, and two shots 0.3 s apart move by 39/255. 400 frames: GL 6.9 s, VK 7.2 s. Backends agree to 0.68/255. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
25 lines
1.4 KiB
Markdown
25 lines
1.4 KiB
Markdown
bump: minor
|
|
type: feat
|
|
One wind, and everything in the valley is moved by it.
|
|
|
|
The grass had a gust built from two sines and the trees had NO gust term at all - just a
|
|
per-instance wobble - so the meadow rippled and the canopy above it swayed to an unrelated
|
|
rhythm and nothing ever crossed the valley. A real gust is a WAVE: you watch it come over
|
|
the grass, it reaches you, and it goes on into the trees behind you.
|
|
|
|
wind.glsl is prepended to EVERY stage, so the grass's vertex shader, the crown's vertex
|
|
shader and the water's fragment shader read the same field at the same world position and
|
|
cannot drift apart. No uniforms are declared in it on purpose - u_time and u_wind already
|
|
exist in several of those files and redeclaring them is a compile error in whichever stage
|
|
includes both - so the caller passes what it already has.
|
|
|
|
Two numbers mattered. The gust's WAVELENGTH has to fit inside a view or nothing is ever
|
|
seen to travel: the first cut was 209 m crest to crest, longer than the meadow you can see,
|
|
so the whole frame sat in one phase and read as everything breathing together. It is 74 m
|
|
now and a front crosses a normal view in a couple of seconds. And `stiff` lets one field
|
|
move a blade a long way and a bole hardly at all.
|
|
|
|
R3D_DEBUG_WIND=1 paints the field on the ground, which is the only way to SEE a gust in a
|
|
still: two shots a moment apart show the fronts and show them moving.
|
|
|
|
Measured: no cost. 400 frames, GL 6.9 s, VK 7.2 s.
|