Renderer · interface
CausticSheet
A surface lit by nearby water: the floor of a pool, the bottom of a flooded corridor, the underside of a bridge, an arch, a jetty, a cave mouth.
Explained in Hello world.
interface CausticSheetimport type { CausticSheet } from '@driftengine/core';In depth
The caller submits the lit surface and says which body of water is throwing the
light. Everything else — where the light lands, how sharp the net is, how it
moves — comes from the wave field in shaders/gerstner.ts, which is the same
field the water surface itself is displaced by.
Either side of the surface works. The overhead case came first and passed for the whole feature for a while, but a pool floor is the same optics and by far the more ordinary sight; the sheet simply lies under the water instead of over it.
Properties
| Name | Type | Description |
|---|---|---|
spans | readonly SheetSpan[] | Cross-sections of the lit surface, in order. |
waterY | number | Resting height of the water throwing the light.MorePer sheet rather than per draw, so one batch can carry surfaces above and below water at different heights — and so a caller cannot forget to keep the two in step, which is the whole contract of this feature: the pattern is only worth having because it is the crests the player can see. |