Log inGet started
World

Tidewater: Oceans, Lakes, Rivers, Waterfalls, Swimming and Splashes Water Kit

Branchmain
Commit431c1b9967

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.