Builtin Library
- ..
- README.md1.3 KB
- bindings.yaml627 B
- shader.wgsl11.2 KB
README.md
ocean_floor_texture
Grows the three tiling maps the seabed is built from: sand, rock, and the
caustic web the sun draws on both of them. Albedo goes in rgb and height in
a; the caustics map carries two independent phases in r and g.
Generated rather than shipped as images. A stored texture is a binary, content-addressed asset, and a material blocked on a texture reference that never resolves never prepares — which leaves its entire uniform block unwritten and the surface black. Generating keeps the seabed on the same compute-texture path the cascade maps and the foam patterns already use.
Run once per map at startup, each with its own seed. Every map tiles: each octave hashes its lattice modulo a period that divides the texture size.
The caustics are constructed rather than painted. Sunlight refracting through a
wavy surface lands as the light a patch gathers divided by the area it spreads
over — the reciprocal Jacobian determinant of the refraction map. Writing the
surface as a height field makes that map p + k grad h, so the determinant is
that of I + k H; inverting it produces the sharp filaments and their crossing
cusps, which are the places the determinant approaches zero and a finite bundle
of light lands on almost nothing.