Skip to main content

Oceanology Legacy — QuadTree CPU

Last updated: 2025-12-06

Overview

The QuadTree CPU system is the core mesh generation technology that powers Oceanology Legacy's infinite ocean. It dynamically generates and manages the ocean surface mesh using a quadtree subdivision algorithm, providing seamless Level of Detail (LOD) transitions based on camera distance.

This system ensures optimal performance by rendering high-detail geometry only where it's needed (close to the camera) while using progressively lower detail for distant water, all without visible seams or popping artifacts.

How QuadTree Works

A quadtree is a hierarchical spatial data structure where each node can subdivide into four child nodes. In the context of ocean rendering:

  1. Root Level — The ocean starts as a grid of large tiles covering the entire visible area.
  2. Subdivision — Tiles closer to the camera subdivide into smaller tiles with more geometric detail.
  3. LOD Transitions — As the camera moves, tiles dynamically subdivide or collapse to maintain optimal detail levels.
  4. Seamless Stitching — Adjacent tiles of different LOD levels are stitched together to prevent gaps or T-junctions.

The result is a continuous ocean surface that appears highly detailed up close while maintaining excellent performance for vast ocean expanses.

QuadTree mesh visualization

The wireframe visualization above shows the QuadTree in action:

  • Foreground (bottom) — Dense tessellation with small triangles for detailed wave displacement.
  • Midground (center) — Medium tessellation as detail becomes less critical.
  • Background (top) — Coarse tessellation for distant water where individual waves aren't distinguishable.

Prerequisites

  • Unreal Engine 5.6 or newer.
  • Oceanology Legacy installed and configured (see the Setup page).
  • A level with BP_OceanologyInfiniteOcean placed in the scene.

Notes

  • The QuadTree system runs on the CPU, calculating tile subdivisions each frame based on camera position. This offloads the GPU for wave displacement and shading.
  • All QuadTree settings are found on the BP_OceanologyInfiniteOcean actor in the Quad Tree category.
  • Changes to QuadTree settings take effect immediately in the editor and at runtime.
  • The system includes a Far Mesh option for rendering extremely distant ocean without QuadTree overhead.

Step-by-step

1. Select the Infinite Ocean actor

In the Outliner, locate and select BP_OceanologyInfiniteOcean. This is the main ocean actor that contains all QuadTree settings.

The actor hierarchy shows:

  • Default Scene Root — The root transform component.
  • Underwater Box Volume Component — Defines the underwater region for post-processing.
  • Underwater Post Process Component — Handles underwater visual effects.
  • Volumetric Fog Mesh Component — Optional volumetric fog for atmosphere.

In the Details panel, scroll down to find the Quad Tree category. This contains all mesh generation settings.

BP_OceanologyInfiniteOcean selection and QuadTree settings

2. Configure Quad Tree Settings

Expand the Quad Tree Settings subcategory to access all parameters:

Core Tile Settings

PropertyDefaultExplanation
Tile Size2400.0The base size of each ocean tile in Unreal units. Larger values create bigger tiles that cover more area but with less granular LOD control. Smaller values provide finer LOD transitions but increase CPU overhead.
Extent in Tiles64, 64The total ocean coverage expressed as a grid of tiles. With Tile Size = 2400 and Extent = 64×64, the ocean covers 153,600 × 153,600 units (approximately 1.5 km × 1.5 km). Increase for larger playable ocean areas.

Tessellation and LOD

PropertyDefaultExplanation
Tessellation Factor6Controls the geometric density within each tile. Higher values produce more triangles per tile, resulting in smoother wave shapes but higher vertex count. Range: 1-8 recommended.
LODScale0.5Multiplier for LOD distance thresholds. Lower values (e.g., 0.25) cause tiles to subdivide at closer distances, saving performance. Higher values (e.g., 1.0) maintain detail further from the camera.
Force Collapse Density Level-1Forces all tiles to collapse to a specific LOD level. Set to -1 to disable (normal adaptive LOD). Set to 0 for maximum detail everywhere, or higher numbers for forced lower detail. Useful for debugging or specific visual styles.

Update Behavior

PropertyDefaultExplanation
Force Update Count10Number of frames to force QuadTree recalculation after significant camera movement. Higher values ensure smooth transitions during fast camera motion but increase CPU load.
Check for Update Interval0.0Time interval (in seconds) between QuadTree update checks. 0.0 means check every frame. Increase to reduce CPU usage at the cost of slightly delayed LOD transitions.

Wave Height

PropertyDefaultExplanation
Max Wave Height Multiplier5000.0Maximum vertical displacement for wave height calculations. This value affects how the QuadTree accounts for wave peaks when determining tile visibility and culling. Increase if waves are being incorrectly culled at screen edges.

Far Distance Mesh

The Far Mesh system renders extremely distant ocean beyond the QuadTree's range using a simple, low-cost mesh.

PropertyDefaultExplanation
Use Far Mesh✅ EnabledEnables the far distance mesh for rendering ocean beyond the QuadTree extent. Disable only if your game never shows distant ocean views.
Far Distance Mesh Extent200000.0Size of the far mesh in Unreal units. With default value, the far mesh extends 200 km in each direction, ensuring the ocean reaches the horizon in any camera orientation.
Far Distance Center Mesh Extent1.0Scale factor for the center portion of the far mesh. Adjust to control blending between QuadTree and far mesh.
Far Distance Mesh Height Offset-10.0Vertical offset for the far mesh relative to the main ocean surface. Negative values place it slightly below the QuadTree mesh to prevent z-fighting at the transition boundary.

Understanding the Parameters

Tile Size vs. Extent in Tiles

These two parameters work together to define your ocean's total coverage:

Total Ocean Size = Tile Size × Extent in Tiles

Example (default values):
2400.0 × 64 = 153,600 Unreal units per axis
153,600 × 153,600 = ~1.5 km × 1.5 km playable ocean

Recommendations:

Use CaseTile SizeExtentCoverage
Small lake/pond120016×16~19 km²
Coastal area240032×32~77 km²
Open ocean (default)240064×64~153 km²
Massive ocean2400128×128~307 km²

Tessellation Factor Impact

The Tessellation Factor dramatically affects both visual quality and performance:

FactorTriangles per TileVisual QualityPerformance Impact
2LowBlocky wavesMinimal
4MediumAcceptableLow
6High (default)Smooth wavesModerate
8Very HighUltra-smoothHigh

Tip: For mobile or VR projects, consider Tessellation Factor 4. For cinematic quality, use 6-8.

LODScale Behavior

LODScale controls how aggressively the QuadTree reduces detail with distance:

LODScaleBehaviorBest For
0.25Aggressive LOD, detail only very closePerformance-critical, VR
0.5Balanced (default)Most projects
0.75Extended detail rangeCinematic, photoreal
1.0Maximum detail at all distancesScreenshots, film

Performance Optimization

CPU Considerations

The QuadTree runs on the CPU. Monitor these factors:

  1. Extent in Tiles — Larger extents require more subdivision calculations.
  2. Check for Update Interval — Set to 0.016 (60 FPS) or 0.033 (30 FPS) to reduce CPU load.
  3. Force Update Count — Lower values reduce sustained CPU spikes after camera movement.

GPU Considerations

While QuadTree runs on CPU, it affects GPU workload:

  1. Tessellation Factor — Directly increases vertex count and vertex shader load.
  2. Tile Size — Smaller tiles mean more draw calls (batching mitigates this).
  3. Far Mesh — Enabling this adds one additional draw call but prevents rendering the full QuadTree to the horizon.
PlatformTile SizeExtentTessellationLODScale
High-end PC240064×646-80.5-0.75
Mid-range PC240064×644-60.5
Console (PS5/XSX)240064×6460.5
Console (PS4/XB1)240032×3240.25-0.5
Mobile/VR120032×322-40.25

Troubleshooting Common Issues

ProblemLikely CauseSolution
Ocean doesn't reach horizonFar Mesh disabled or extent too smallEnable Use Far Mesh, increase Far Distance Mesh Extent
Visible seams between tilesT-junction artifactsThis shouldn't happen with Oceanology — report as bug
Waves clipped at screen edgesMax Wave Height Multiplier too lowIncrease Max Wave Height Multiplier
Low framerateTessellation too high or extent too largeReduce Tessellation Factor, increase LODScale
Ocean LOD pops visiblyLODScale too aggressiveIncrease LODScale for smoother transitions
Flickering at horizonZ-fighting with far meshAdjust Far Distance Mesh Height Offset (more negative)
CPU usage spikes when movingForce Update Count too highReduce Force Update Count

Debugging the QuadTree

To visualize the QuadTree structure:

  1. Wireframe Mode — In the editor viewport, press Alt + 2 or select View Mode > Wireframe to see the mesh tessellation.
  2. LOD Coloring — Use the Ocean material's debug features to color-code LOD levels.
  3. Stat Commands — Use stat oceanology in the console to view QuadTree statistics (if available).

The wireframe view clearly shows:

  • Tile boundaries as larger squares
  • Tessellation density within each tile
  • LOD transitions as tile size changes with distance

Summary

In this guide, you learned how to:

  1. Understand QuadTree fundamentals — How hierarchical subdivision creates efficient ocean meshes.
  2. Configure tile settings — Set Tile Size and Extent for your ocean coverage needs.
  3. Tune tessellation and LOD — Balance visual quality and performance with Tessellation Factor and LODScale.
  4. Enable far mesh — Extend ocean rendering to the horizon efficiently.
  5. Optimize for your platform — Apply recommended settings for different hardware targets.

The QuadTree CPU system is the foundation of Oceanology Legacy's infinite ocean. Proper configuration ensures your ocean looks great while maintaining excellent performance across all target platforms.


Quick Reference

ParameterDefaultRangeImpact
Tile Size2400.0600-4800Ocean coverage granularity
Extent in Tiles64×6416-256Total ocean area
Tessellation Factor61-8Mesh density per tile
LODScale0.50.1-1.0Detail distance falloff
Force Update Count101-30LOD transition smoothness
Check for Update Interval0.00.0-0.1CPU update frequency
Force Collapse Density Level-1-1 to 8Override LOD (-1 = auto)
Max Wave Height Multiplier5000.01000-10000Wave culling threshold
Use Far MeshOn/OffHorizon rendering
Far Distance Mesh Extent200000.050000-500000Far mesh coverage
Far Distance Mesh Height Offset-10.0-50 to 0Z-fighting prevention

End of QuadTree CPU Guide