Link Search Menu Expand Document

Page last modified: Apr 11 2022.

Underwater Camera Roadmap (Work in Progress)

Turbidity and Light Attenuation

Turbidity and light attenuation are important underwater effects that give water its volume. In order to get some effects (volumetric shadows, god rays, etc…) working, water must be rendered as a volume / participating medium.

image image

It becomes much more difficult to see at depths so a light source near the camera may need to be implemented. Attenuation and in-scattering can be adjusted to an amount that doesn’t degrade visibility at depths.

Approach 1: In-scattering with atmosphere (treat it like fog)

Create a fragment shader that calculates the in-scattering between the camera and the current fragment. Calculate the reflectance of the fragment surface and combine the two calculations to get the output color.

Backscatter

Reflections from particles / dust floating around in water produces backscatter. To best demonstrate the effect, the particles should be animated and should also have their reflections attenuated.

image image

Approach 1: Create seamless animated spherical textures

To simulate movement, one will create multiple different animated textures that contain backscatter with a transparent background. After rendering the scene normally, a subpass will be created that will render multiple spheres with the backscatter texture applied. The spheres should be rendered around the camera with increasing radii. As the camera moves around, the sphere that has just been passed through by the camera will be repositioned and rescaled. With proper fading values, the transition between spheres will be seamless.

Approach 2: Generate a group of primitives to be rotationally rendered into the scene

Before the renderpass, generate a group of primitives that will represent the particles in the backscatter. Add a subpass after the original renderpass that will render the generated primitives with a given shader.

Water Refraction (God Rays)

Requires: Turbidity and Light Attenuation for a participating media

Underwater Volumetric Shadows

Requires: Turbidity and Light Attenuation for a participating media

Since the turbidity effect renders water as a volume, lights should be able to cast shadows on the volume.

image image

Approach 1: Ray-marching with shadow volumes

Underwater Caustics

Approach 1: Apply texture to ground surface

Approach 2: Physically accurate caustics (hard)

Underwater Color Distortion

A simple solution is to add a hue compositor, but in order to get a physically accurate representation of color distortion, one would need to calculate the water light absorption given a wavelength. This approach is more viable through ray tracing and monte carlo sampling but will be much harder to implement through a raster engine.

Approach 1: Hue compositor

Approach 2: Ray tracing with Monte Carlo sampling

Underwater Camera Distortion

Camera distortion is already implemented in both Gazebo Classic and Ignition. Parameters can set the lens to have a barrel or pincushion distortion.

Approach 1: Already implemented

To create either a pincushion or barrel distortion, adjust the SDF distortion values for the camera.

Underwater Lights

image image