Smart Living Products
ISDN2001/2002: Second Year Design Project
Independent Study
Physical Parameter Mapping and Performance
Optimization for Real-time Underwater 3D
Rendering in UNITY
By Katniss
Abstract
This project establishes a physically accurate real-time rendering pipeline for underwater environments within the Unity game engine. Traditionally, underwater aesthetics in real-time applications rely on heuristic or purely artistic color adjustments, failing to replicate complex volumetric optical behavior. This study systematically maps physical optical laws—specifically the Beer-Lambert Law for absorption, Snell’s Law for surface refraction, and Mie Scattering for particle turbidity—to concrete Unity High Definition Rendering Pipeline (HDRP) and Universal Rendering Pipeline (URP) settings. Through a structured vertical depth profile experiment (y = 0m to y = 20m), I demonstrate authentic spectral attenuation where red wavelengths decay rapidly with depth, culminating in optical extinction. To ensure structural feasibility on constrained platforms, a decal-based caustics optimization technique was evaluated. The finalized system successfully balances physical credibility with rendering efficiency, reducing GPU frame latency by 67% while maintaining high-fidelity visual immersion at 60+ Frames Per Second (FPS).
1. Introduction
Replicating underwater environments in real-time 3D graphics presents a unique challenge: rendering must
account for the volumetric space within the fluid medium rather than merely shading bounding surfaces. Light
passing through water experiences severe wavelength degradation, scattering, and surface distortion that
fundamentally dictates depth perception and object contrast.
Many contemporary gaming and simulation applications utilize basic scene fog with uniform linear
attenuation to approximate underwater sightlines. However, this method produces a flat "gray wall" artifact, failing to reflect how different light spectra behave at variable depths. This arbitrary visual representation limits scientific validity and compromises simulator-based training accuracy.
This project bridges the gap between theoretical optical oceanography and real-time computer graphics. By
establishing a rigorous parameter mapping between real-world constants (e.g., Jerlov water classifications) and
Unity engine properties (such as Fog Attenuation Distance and Screen Space Refraction), I eliminate arbitrary guesswork for developers. This report details the underlying physics, the systematic implementation pipeline, a vertical visual depth evaluation, and performance benchmarking results designed for real-time applications.
2. Methodology and Physical Mapping
The rendering framework relies on translating three foundational optical phenomena into Unity properties:
2.1 Absorption (The Beer-Lambert Law)
As light penetrates water, its intensity (I) decays exponentially as a function of depth (z) and the medium's
specific extinction coefficient (α):

In Unity's volume system, this is mapped inversely via the Fog Attenuation Distance (d), defined as the
distance at which light intensity falls to e−1 (≈ 37%) of its initial value:

Using the Jerlov Water Type Classification, we calibrated our global volume settings to match empirical
oceanographic types as displayed below:

Table I: Jerlov Water Type to Unity Parameter Mapping Matrix
2.2 Scattering (Mie Theory)
Turbidity and water murkiness are driven by light colliding with suspended micro-particles. This is
implemented via Volumetric Fog under an Anisotropy phase function coefficient set to 0.8. This value biases light towards forward scattering, creating crisp, directional volumetric light shafts ("God Rays") near the surface that soften naturally into an ambient glow at deeper levels.
2.3 Refraction (Snell's Law)
To simulate the bending of light at the air-water boundary, the Surface Type was designated as Ocean, Sea or
Lake to engage a Screen Space Refraction (SSR) model. To capture the complex geometric distortion caused by
waves, high-density Tessellation was enabled (Max Tessellation Factor: 3, fading from 150m up to 1850m) to
guarantee smooth, continuous surface normal generation. The internal Index of Refraction (IOR) calculated by the shader is natively tracked to 1.33, matching the physical constant of water fluid.
3. Experimental Ssetup and Vertical Profile Results
To simulate the bending of light at the air-water boundary, the Surface Type was designated as Ocean, Sea or
Lake to engage a Screen Space Refraction (SSR) model. To capture the complex geometric distortion caused by
waves, high-density Tessellation was enabled (Max Tessellation Factor: 3, fading from 150m up to 1850m) to
guarantee smooth, continuous surface normal generation. The internal Index of Refraction (IOR) calculated by the shader is natively tracked to 1.33, matching the physical constant of water fluid.
3.1 Shallow Water Zone (y = 0m to y = 2m)

y = 0m: The surface control baseline. Light transmittance sits at 100%, showcasing true object colors with
maximum brightness and uninhibited visibility.

y = 1m: Immediate submersion artifacts occur. Chromatic dispersion is clear, and the light shifts instantly into
a high-intensity cyan hue due to initial water body interface filtering.

y = 2m: A minor drop in ambient white light is noted; red channel saturation begins draining from the object's
surface as ambient light paths lengthen.
3.2 Transition & Deep Water Zone (y = 5m to y = 15m)

y = 5m: The physical absorption threshold is crossed. Red wavelengths are down by over 60%, resulting in a
highly localized green-blue hue profile across all shaded polygons.

y = 10m: High environmental turbidity takes over. The surroundings shift to dark indigo, and the structural
contrast of the target sphere degrades significantly.

y = 15m: Near-total visibility collapse. Volumetric light rays fail to penetrate this deep, leaving only highly
diffused, low-intensity background scattering.
3.3 Total Optical Extinction (y = 20m)

At 20 meters deep, the object reaches the calculated saturation threshold. Due to the high density of the
participating medium, Mie scattering completely overlaps the geometric silhouette. The object's final contrast ratiovfalls below 0.05, blending seamlessly into the ambient dark background fog. This accurately validates the physical phenomenon where visibility drops exponentially into an absolute optical void.
4. Computational Performance Analysis
Achieving strict physical credibility is counterproductive if the system cannot run in real-time. Rendering
volumetric light scattering and complex real-time lighting caustic networks typically introduces massive GPU
frame performance penalties.
This study benchmarked a performance-saving optimization technique: swapping out expensive real-time
procedural caustic light shaders for specialized Decal Projection Mapping bound within the water framework.
Performance metrics were recorded on standard testing hardware to determine frame generation costs (GPU
Latency in milliseconds):

Table II: Rendering Technique Performance and Latency Metrics
The optimization profile confirms that by utilizing decal caustics and restricting volumetric light sampling
through a locked Max Fog Distance parameter, deep-water execution (y = 20m) maintains identical GPU
performance to shallow-water zones (y = 0m). Across all tested depth variables, the optimized scene comfortable sustained a stable output of 60+ FPS, proving its viability for resource-constrained interactive environments.
5. Conclusion
This project successfully demonstrates that physical optical accuracy can be achieved in real-time engine
environments without violating hardware rendering budgets. By defining clear relationships between physical
properties—such as Jerlov coefficients and Beer-Lambert attenuation—and Unity properties like fog distance, can built a highly reliable rendering pipeline.
The vertical profile tests confirm that the visual degradation of light over depth accurately matches empirical
oceanic expectations, concluding in total optical extinction at y = 20m. Furthermore, the implementation of decalmapped caustics eliminated processing bottlenecks, restoring a 67% performance margin on the GPU. Future work will extend this framework to analyze user pupil adjustments and contrast visibility thresholds within Virtual Reality (VR) head-mounted displays.
References
[1] N. G. Jerlov, Marine Optics, Elsevier Scientific Publishing Company, Amsterdam, 1976.
[2] Unity Technologies, "High Definition Render Pipeline (HDRP) Volumetric Effects Architecture," Unity Manual
v2022.3, 2023.
[3] E. Raunio, "Real-time water simulation and shader parameter optimization techniques," in Proceedings of
Siggraph Real-Time Live!, 2021, pp. 45–52.
[4] S. Pharr, W. Jakob, and G. Humphreys, Physically Based Rendering: From Theory to Implementation, 4th ed.
Morgan Kaufmann, 2023.