Overview
Last updated
Was this helpful?
Last updated
Was this helpful?
The plugin is targeted at Unreal Engine versions 5.3, 5.4, 5.5+.
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:
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.
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 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.
The plugin is designed to handle massive scales. For example, the ocean sphere in the provided images has a 100 km radius (10,000,000 Unreal units), which prevents floating-point precision issues when viewed up close. At larger scales, some vertex jittering may occur when viewed from very close distances, but this is not noticeable from a distance or when viewing the ocean from space.
The plugin supports multiple oceans in the level, their movement and rotation at runtime.
Runtime Movement and Rotation: The ocean can be moved and rotated 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.