underwaterPost.shader
- .metadata312 B
- README.md1.1 KB
- preview.png12.7 KB
- properties.yaml2.0 KB
- shader.wgsl12.5 KB
README.md
underwaterPost
Tidewater's full-screen underwater pass, a post-process shader raised by
modules/underwater whenever the camera is below the surface of any Tidewater
water (ocean, lake, pond, pool, river). From scene depth alone it reconstructs
each pixel's world position and draws:
- depth fog in the body's own colour, absorbed per channel by distance and darkening with the viewer's depth and toward the bottom of the view;
- caustics: an animated tileable net projected down the sun direction onto every submerged surface, sharp in the shallows and spreading out with depth;
- light shafts: eight samples marched into the column, each reading the caustic net where its sun ray crossed the surface;
- a gentle wobble of the view;
- a waterline split: pixels whose near-plane point is above the rippling surface stay dry, with a meniscus line between the two halves.
Its properties are written each frame by the module from the body's registered
profile (Underwater.register(physicsName, { fogColor, density, absorption, causticStrength, ... })) and from the scene's sun.