Ocean

How to add an Ocean: right click in the Hierarchy window -> Effects -> KWS Water -> Ocean

This will automatically add:

  • A water settings module with default global water settings (if not already present)

  • An ocean module (infinite ocean with waves and foam simulation)

The Ocean module in KWS2 renders large-scale, infinite ocean surfaces using a physically-based FFT (Fast Fourier Transform) wave simulation. It is designed for open environments such as seas and oceans, combining real-time wave dynamics, foam, and lighting with efficient GPU-based rendering.

It works independently from dynamic water simulation zones, but both systems can coexist and visually blend together.

How the Ocean Works

KWS2 ocean uses a spectral wave system that generates realistic large-scale water movement. It combines multiple layers of waves (called cascades) to create natural variety — from tiny ripples near the camera to slow, rolling swells on the horizon.

Each cascade covers a different spatial scale:

  • Small cascades add fine surface detail

  • Medium cascades define main wave shapes

  • Large cascades create distant motion and overall sea dynamics

All layers are seamlessly blended together in world space, producing an infinite, continuous ocean surface that always looks natural from any distance.

The ocean surface itself is rendered using a procedural quadtree mesh that follows the camera and adjusts its level of detail automatically. This approach avoids visible tiling and ensures stable rendering even across huge distances

Mesh & Rendering

KWS2 uses a GPU-driven quadtree mesh system to render the ocean surface efficiently. The mesh is split into chunks with dynamic LOD (less detail at distance) and invisible parts culled. All chunks are drawn with instancing in a single draw call. This approach allows for vast ocean surfaces with minimal CPU and GPU overhead, less triangles and no visible tile boundaries.

Interaction & Integration

  • Dynamic simulation zones are not required for the ocean — it’s a purely visual, projected infinite surface optimized for large-scale performance.

  • However, dynamic simulation zones can be used together with the ocean:

    • Along shorelines, the ocean can drive local wave interactions inside simulation zones (e.g. breaking waves near the beach).

    • In the open ocean, movable dynamic zones allow localized interactions such as foam, splashes, or object interaction.

  • Dynamic simulation zones can connect to the ocean surface (e.g., river mouths)

  • Buoyancy and object motion are based on the current ocean displacement and dynamic simulation displacement, ensuring realistic floating behavior.

Advantages

  • Physically-based FFT ocean simulation

  • Infinite quadtree mesh with automatic LOD and instancing with 1 drawcall

  • Seamless transitions between near and far waves

  • Seamless transitions between ocean and dynamic simulation zones

  • Real-time foam and caustic rendering relative to wind speed

  • No CPU cost for wave deformation

  • Simulation and logic are updated once per frame (~60 fps). In multi-camera setups (e.g., mini-map or split-screen), visual rendering will still occur for each active view, but only one simulation state is calculated.

⚠️ Limitations

  • Single Shared Mesh All water surfaces (ocean, rivers, lakes, pools, etc.) are rendered using a single shared mesh. You cannot split this mesh or assign custom meshes to different water bodies. This design ensures seamless color blending and smooth transitions between water types — for example, rivers flowing into the ocean.

  • Non-Interactive Rendering Ocean water does not interact with scene geometry or dynamic objects. It is meant for non-simulated large-scale water bodies, backgrounds, and distant sea surfaces. However, dynamic simulation zones can be used together with the ocean.

  • Infinite Projection & Draw Distance The ocean uses quadtree rendering for infinite projection and level-of-detail near the camera. Its draw distance is always equal to the camera’s Far Clip Plane, and cannot be limited manually (e.g., to create a finite water body or “end” of the sea). This makes it ideal for background oceans but unsuitable for closed or bordered areas. For finite or localized water bodies, you can use Local Water Zones instead.

    They allow you to define custom shapes and boundaries — for example:

    • Lower the ocean level and place a Local Water Zone at a higher altitude for a lake or pond

    • Use a Custom Mesh zone to fill a specific 3D shape (like a pool, basin, or reservoir)

    • Combine with a Dynamic Simulation Zone to create flowing rivers, dams, or waterfalls

  • Shader and Texture Constraints Since all water sources are unified in a single material and pass, global parameters like absorption, caustics, or reflection are limited to one shared state. Use Local Water Zones if you need to override visuals (e.g., colored rivers or muddy lakes).

  • Planar Reflections and Water Height Planar reflections are tied to the Main Water's global height. Any other water surface located above or below the ocean will not reflect correctly when using planar reflection mode — use SSR or cubemaps in those cases.

  • Large storm waves above ~20 m may lose physical stability

  • Mobile GPUs are not supported due to compute shaders limitations and bugs on mobile platforms

Last updated