Wind-Grown Physics Sand Dunes
By @KanaWorks_AI. Made with Claude Opus 5.5. Watch the original post.
Prompt
Make a realistic, physics-driven desert in Godot 4 (Forward+). Do the computation in GPU compute shaders. The terrain is 3 stacked layers of "height grids" ・Far: about 1km square on a 0.5m grid ・Mid: about 33m square on a 1.6cm grid ・Underfoot: about 4m square that follows the character, on a 2mm grid ・Do not draw the coarser layer inside a finer layer (prevents flickering at the seams) Do not draw the dunes; grow them with wind (Werner-type model) ・A 512m periodic domain on a 0.5m grid, 3000 steps ・Each step: from cells that are not inside the 10-15° "wind shadow" cast by higher ground upwind, lift a little sand and drop it about 4m downwind ・Sand always deposits inside the shadow. It deposits easily on sand and less easily on bare ground ・Collapse slopes steeper than 33° ・Finally, round the crests slightly and set the slip faces to 31-33°. Cache the result Footprints and slumping ・Press the height down in the shape of the shoe sole and pile the displaced amount onto the rim (volume conserved) ・Every frame, flow sand to the 8 neighbors by only the amount that is too steep. Sand at rest holds up to 34°; once it starts flowing it slumps down to 28° ・Make wet sand harder to collapse Blowing sand ・Turn exactly the same volume that was removed into particles and launch them; when they land, add them back into the height with integer atomics (the total amount of sand never changes) ・Gravity + air resistance + wind ・Dust in 3 layers (dense core / outer / long-lingering layer), with self-shadowing and terrain shadows Look (custom shaders) ・Normals = height + two wind ripple patterns with different wavelengths and directions, mixed with noise + pixel-sized grain bumps ・Diffuse: d'Eon's Lambert-sphere + Hapke ・In the shadows, blue light from the sky and warm bounce light from the sunlit areas around them ・Glints: sub-1px points fixed in world space that light up only where the half vector between the sun and the view direction is close to the ripple normal (this creates a band of light on the sun side) ・Self-shadowing by ray marching the height field Light and camera ・Place a low sun (13-16°) on the downwind side so the crests split light from shadow ・Several layers of aerial perspective fog ・Render the video at 120fps and average every 4 frames in linear light to get 30fps (natural motion blur)