SETTING UP WATERLINE
In the ninja project, there is no built-in support for waterline - read more here. But, we have tips for building waterline feature.
We have two ways to set up a waterline: Discord
-
The stencil buffer method: we can set up objects to write to stencil buffer (where the object is visible for the camera, we have a “true” value / any other parts of the screen: false ) - and we can access this mask in postprocess materials --- so, in case we are able to set up an object - or a set of objects - that covers the underwater, we can use this to mask our postprocess volume. Hew ever: it has remained a mystery, how we set up such object(s): Discord
-
The heightmap method: we capture a small heightmap of the water surface (as small as the camera frustrum) using a top-down SceneCaptureCamera, and transform the captured height into camera space - and use THAT as a mask for the postprocess volume.