# Overview

<figure><img src="https://2237393798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmyMovt6gEgotygp1N9oc%2Fuploads%2FvxfWkJqHDIpho06Lpplh%2Fimage.png?alt=media&#x26;token=ec0d9b9e-f3c6-4651-b218-41a257fb79fe" alt=""><figcaption></figcaption></figure>

{% embed url="<https://www.fab.com/listings/ea195c94-00af-43fb-bb1d-85a478320a27>" %}
Planetary Oceans of Fab
{% endembed %}

{% embed url="<https://discord.gg/SvHcuCcjMX>" %}
Our Discord
{% endembed %}

{% hint style="success" %}
The plugin is targeted at Unreal Engine versions 5.5, 5.6, 5.7+.
{% endhint %}

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:

***

## FFT Waves

The plugin uses **FFT waves** to simulate realistic ocean. The resulting wave data (World Position Offset (WPO) and normals) is bent around 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 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. Mesh geometry is computed on a **background thread** for efficiency, and the data is passed to the GPU though a vertex factory. This approach ensures that mesh generation is **extremely fast and reliable**, even for large-scale oceans.

All calculations are done in 64-bit doubles, and once computed, transformed into a camera relative space (mesh origin rebasing), converted to 32-floats and sent to the GPU. This allows to have an ocean sphere of virtually any size without precision errors. Ocean material also utilizes camera relative space and periodic world space to avoid precision issues with WPO and normals.

## Buoyancy

Buoyancy is calculated by applying physics at specific locations. **Buoyancy points**, defined by the user around a vessel, sample ready-to-use waves data on the CPU which is updated in parallel using ISPC task system and doesn't block the game thread.

## Other features

* **Multiple atmospheres**: The plugin includes a custom multiple atmosphere system that also includes space background.
* **Underwater effects**: causitics, fog with ray-marching screen space occlusion, distortion etc.
* **Fog Effects**: Screen-space depth-based fog (both linear and exponential) is supported, but somewhat experimental.
