Overview

Planetary Oceans of Fab
Our Discord

The Planetary Ocean Plugin is designed to create highly customizable and scalable ocean systems for planetary environments. It leverages a combination of advanced techniques for wave simulation, mesh generation, buoyancy, and atmospheric effects, ensuring both visual fidelity and performance. Below is an overview of the core principles and architecture:


Waves

The plugin uses Gerstner waves to simulate realistic ocean waves. These waves are calculated for three flat planes (X, Y, and Z) of a cube, which is then transformed into a sphere. The resulting wave data (World Position Offset (WPO) and normals) is bent around the sphere to create a seamless ocean surface. Waves are mirrored at negative X, Y, and Z axes, and everything is combined using a triplanar mask to ensure smooth transitions and avoid visible seams.

Mesh

The ocean mesh is generated using 6 instances of a quadtree, one for each face of the cube. The quadtree dynamically adjusts the level of detail (LOD) based on the camera's distance, ensuring optimal performance. Mesh geometry is computed on a background thread for efficiency, and the data is passed to a custom mesh generator, which is a heavily modified version of Epic's Procedural Mesh Component. This approach ensures that mesh generation is extremely fast and reliable, even for large-scale oceans.

Buoyancy

Buoyancy is calculated by applying physics at specific locations. Buoyancy points, defined by the user around a vessel, sample the water height on the CPU using the same method as the vertex offset calculation on the GPU. While not an ideal solution, this approach is widely used (e.g., Unreal's Water plugin) and provides a balance between performance and accuracy.

Scalability

The plugin is designed to handle massive scales. Ocean utilizes several techniques (mesh origin rebasing, camera relative world position and periodic world space), that prevent floating-point precision issues.

The plugin supports multiple oceans in the level, their movement at runtime.

Other features

  • Runtime Movement: The ocean can be moved dynamically during gameplay, allowing for flexible integration into various scenarios.

  • Multiple atmospheres: The plugin includes a custom multiple atmosphere system that also includes space background.

  • Fog Effects: Screen-space depth-based fog (both linear and exponential) is supported.

Last updated

Was this helpful?