Log inGet started
Package

water_surface.shader

Newest version

README.md

water_surface

The underside of the North Atlantic, seen from four metres down — the only ordinary light in DEADLIGHT, and on screen for six seconds.

The plane is deformed by a sum of five travelling deep-water swells in vertex(), each moving at the speed its own wavelength gives it, and the same sum is differentiated analytically in fragment() for the normal. Shading and silhouette therefore agree, and the surface reports the motion of the swell rather than of the plane it is built on.

What a lens under water sees looking up is Snell's window: everything above the surface squeezed into a cone about 97 degrees across, with the interface a mirror outside it. The window's edge tears and scallops with the swell, and the sunball inside it wobbles and smears with the same water. Self-shading — this scene has no sun light in it, so the surface carries its own.