> For the complete documentation index, see [llms.txt](https://docs.shadersource.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shadersource.io/assets-and-plugins/ocean-tool-2/tutorials/performance-and-scalability.md). Agents can also search and read this documentation through its [MCP server](https://docs.shadersource.io/~gitbook/mcp).

# Performance and Scalability

What the ocean's quality settings cost, and the quickest ways to win back frame time.

An ocean fills the screen, so it is worth knowing what it spends your frame on. This page shows where the settings are, which ones matter most, and what to turn down first.

Everything here is on the **Perf** page of the **Simple** tab unless it says otherwise.

![The Perf page](https://2855220899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mk51ACJUA5E3mZvLb9h%2Fuploads%2FO4h5krwp5AOAgOHKG3lf%2Fperf_page.png?alt=media)

## How quality is chosen

By default an ocean follows the engine's scalability settings, so it already scales with your game's graphics options.

{% stepper %}
{% step %}

### Look at Match engine scalability

It is ticked for a new ocean. The line under it tells you what the ocean is using right now:

* The engine's **View Distance** quality sets the ocean's **mesh quality** - how many triangles draw the surface.
* The engine's **Shading** quality sets the ocean's **shading quality** - how much work each pixel does.
  {% endstep %}

{% step %}

### Or choose the quality yourself

Untick **Match engine scalability** and set **Mesh quality** and **Shading quality** by hand. There are five tiers: **Low**, **Medium**, **High**, **Epic** and **Cinematic (offline)**.
{% endstep %}

{% step %}

### Read the readout

Under **Quality Scale**, four lines report what the ocean is doing at this moment: the size of its triangles on screen and how many it is drawing, how wide the detailed surface is, the resolution of the waves, and the size of the caustics maps.

Change a setting and watch the numbers move. It is the quickest way to learn what each one does.
{% endstep %}
{% endstepper %}

## What to turn down first

Work down this list and stop when you have the frame time you need. The first few cost little or nothing in looks.

### 1. Compute the shoreline

Tick **Compute shoreline**.

On High, Epic and Cinematic shading the shoreline's waves are worked out for every pixel of water. With this ticked they are computed once a frame on the GPU, and the water samples the result instead - much less GPU time near a coast. Distant breaking lips are a little softer; you are unlikely to notice.

Medium and Low shading, Shader Model 5 and Vulkan always compute the shoreline: the row is greyed there, and its tooltip says why.

### 2. Shorten the shoreline draw distance

**Shoreline draw distance** is how far from the camera the shoreline is drawn; beyond it the water is plain open sea and skips the shoreline's work. It fades over the last fifth of the distance.

| Shading quality | Default distance |
| --------------- | ---------------- |
| Epic and High   | 6,250 m          |
| Medium          | 1,000 m          |
| Low             | 500 m            |
| Cinematic       | Unlimited        |

Type a distance to override the tier, or zero for unlimited; reset the row to follow the tier again. If your coast is only ever seen from nearby, try a shorter distance.

### 3. Choose the cheaper caustics

On the **Underwater** page, set **Caustics** to **Animated pattern (cheap)** instead of **Traced light**. It traces no light, and still moves with the waves.

### 4. Turn off what the camera never sees

* **Underwater view** (the **Underwater** page) - off if the camera never goes under. It already sleeps by itself while the waves stay clear of the lens.
* **Whitecap Spray** (**Surface > Particles**) and **Breaking Spray** (**Shore > Particles**) - off for a distant or top-down camera.
* **Wakes** (the **Buoyancy & Wakes** page) - off unless something makes them.

Ocean painting, the simulated shore, the cinematic volumetric spray and the Debug tab's pictures already cost nothing while they are off.

### 5. Lower the quality scales

Under **Quality Scale**, each of these multiplies one part of the ocean's cost. 1 is the tier's own.

| Scale                    | What it changes                                                                   |
| ------------------------ | --------------------------------------------------------------------------------- |
| **Mesh density**         | The surface's triangle count. 0.5 is about half.                                  |
| **LOD distance**         | How far each level of mesh detail reaches.                                        |
| **Wave resolution**      | The resolution of the FFT waves, in steps of two.                                 |
| **Wave detail distance** | How far small waves keep their detail.                                            |
| **Effects quality**      | The caustics' resolution, the light shafts' samples, and how far the motes reach. |

### 6. Pick a cheaper ray tracing mode

**Ray tracing** decides what ray-traced reflections and lighting see of the water: **Full**, **Light** (the default, and much cheaper) or **Off**, which leaves the water out of ray tracing altogether.

### 7. Draw the water opaque

**Default Lit** draws the water with the engine's Default Lit shading instead of Single Layer Water. It is cheaper, and you lose what makes water look deep: translucency, refraction, and caustics seen from above. Good for stylized seas and distant oceans.

### 8. Use simple water on Low

**Simple water on Low** swaps the whole surface for a simple one whenever shading quality is Low: the waves still move and are lit, in the style's deep colour, but foam, spray, caustics, wet sand and the underwater view are hidden. At the Island's beach at 1080p it saves about 4.5 ms a frame.

Your settings come back the moment shading quality rises.

## The simulated shore

The **Simulated** shore model is the most expensive thing the ocean can do, and its cost scales with its detail.

| Setting                 | Where                      | What to try                                                                                                                                                                                                                                 |
| ----------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Simulation detail**   | **Perf > Simulated Shore** | It follows mesh quality by default (Low 256 cells, Medium and High 512, Epic 1024). Each step up costs about four times as much.                                                                                                            |
| **Simulation distance** | **Perf > Simulated Shore** | Not a way to save time: the number of cells is **Simulation detail**'s. Shorter makes them finer, which can cost a little more; further reaches more coast with coarser cells.                                                              |
| **3D foam detail**      | **Perf > Simulated Shore** | Lower it, or turn **Foam volume** off on **Shore > Shoreline**.                                                                                                                                                                             |
| **3D foam distance**    | **Perf > Simulated Shore** | Not a way to save time either: its rings and particles are **3D foam detail**'s. Shorter makes the foam finer, with more and smaller particles near the camera, which can cost a little more; further reaches more coast with coarser foam. |
| **Turbidity**           | **Shore > Shoreline**      | 0 is off and costs nothing.                                                                                                                                                                                                                 |

If you do not need the water to react to things, **Authored** or **Simple** gives you a shoreline for far less. See [Baked or Simulated Shoreline?](https://docs.shadersource.io/assets-and-plugins/ocean-tool-2/tutorials/baked-or-simulated-shoreline.md).

## Scaling per platform

To scale every ocean in the project from a device profile or `Scalability.ini`, use the console variables. The first five multiply every ocean's own settings. The three that default to -1 leave each ocean's own setting alone at -1, and replace it when set.

| Variable                               | Default | What it scales                                                                         |
| -------------------------------------- | ------- | -------------------------------------------------------------------------------------- |
| `r.Ocean2.Quality.MeshDensity`         | 1       | The surface's triangle count                                                           |
| `r.Ocean2.Quality.LodDistance`         | 1       | How far each mesh detail level reaches                                                 |
| `r.Ocean2.Quality.WaveResolution`      | 1       | The waves' resolution                                                                  |
| `r.Ocean2.Quality.DetailDistance`      | 1       | How far small waves keep their detail                                                  |
| `r.Ocean2.Quality.Effects`             | 1       | Caustics, light shafts and motes                                                       |
| `r.Ocean2.Quality.WaterlineMeshDetail` | -1      | Extra mesh levels round a camera at the water (-1: the ocean's own; 0 to 3: that many) |
| `r.Ocean2.Quality.ShoreSimDetail`      | -1      | The simulated shore's detail (-1: the ocean's own; 0 Low to 4 Cinematic)               |
| `r.Ocean2.Quality.ParticleFoamDetail`  | -1      | The simulated shore's 3D foam (-1: the ocean's own; 0 Low to 4 Cinematic)              |

[Scalability and Console Variables](https://docs.shadersource.io/assets-and-plugins/ocean-tool-2/technical-information/scalability-and-console-variables.md) lists them all, with memory figures.

## Measuring

* **`ProfileGPU`** in the console (or **Ctrl + Shift + ,**) lists the GPU time of every pass in the frame. The ocean's are named `Ocean2`.
* **`stat unit`** shows the frame, game, draw and GPU times.
* **Show ocean triangles** (**Perf > Mesh Preview**) draws the surface's triangles, so you can see how dense the mesh is and where it changes level.

Measure in a packaged build or in **Standalone Game** for numbers that mean something: the editor's own panels cost frame time too.

{% hint style="info" %}
**A game can change quality while it runs.** When the engine's scalability changes during play, the ocean follows it. Effects that were hidden at a low tier - caustics, wet sand, spray, the waterline - come back by themselves when the tier rises.
{% endhint %}

## Shader Model 5 and DirectX 11

The full ocean needs Shader Model 6. On Shader Model 5 - DirectX 11, or a project still set to SM5 - the plugin draws its simple water instead: moving, lit waves in the style's deep colour, with no foam, spray, caustics, wet sand or underwater view.

A project that targets both cooks both, and each player gets the one their graphics card runs. See [Troubleshooting](https://docs.shadersource.io/assets-and-plugins/ocean-tool-2/tutorials/troubleshooting.md) if the sea looks plain in your editor.

## Where next

* [Scalability and Console Variables](https://docs.shadersource.io/assets-and-plugins/ocean-tool-2/technical-information/scalability-and-console-variables.md) - the reference, with every variable and memory figure.
* [Sequencer and Movie Render Queue](https://docs.shadersource.io/assets-and-plugins/ocean-tool-2/tutorials/sequencer-and-movie-render-queue.md) - the opposite problem: the best quality, whatever it costs.
