Performance Optimization: Getting 60+ FPS with Beautiful Water
Beautiful water shouldn't mean sacrificing performance. This guide shows you how to achieve both.
π― Performance Goalsβ
Before optimizing, define your targets:
| Platform | Target FPS | GPU Budget |
|---|---|---|
| PC High-End | 60-144 | 8-12ms |
| PC Mid-Range | 60 | 12-16ms |
| Console | 30-60 | 16-33ms |
| VR | 90 | 11ms |
Profile first, optimize second. Never guess β measure actual bottlenecks.
π Profiling Your Waterβ
Essential Console Commandsβ
stat gpu // GPU timing breakdown
stat unit // Frame timing overview
stat scenerendering // Render thread details
profilegpu // Detailed GPU profiler
stat memory // Memory usage
What to Look Forβ
| Stat | Target | If Too High |
|---|---|---|
| GPU Time | Under 12ms | Reduce visual quality |
| Game Thread | Under 8ms | Optimize BP logic |
| Draw Calls | Under 2000 | Enable instancing |
| Triangles | Under 5M | Adjust QuadTree |
π Wave System Optimizationβ
FFT Resolution (NextGen)β
The FFT grid resolution has the biggest performance impact:
| Resolution | Quality | Performance Cost |
|---|---|---|
| 512x512 | Best | High |
| 256x256 | Great | Medium |
| 128x128 | Good | Low |
How to adjust:
- Select your Ocean actor
- Find FFT Settings category
- Lower Resolution value
Wave Layers (Legacy)β
Legacy uses layered Gerstner waves:
| Layers | Quality | Cost |
|---|---|---|
| 4 | Full detail | 1.0x |
| 3 | Very good | 0.75x |
| 2 | Acceptable | 0.5x |
| 1 | Minimal | 0.25x |
Recommendation: Start with 2 layers, add more only if needed.
π² QuadTree LOD Settingsβ
The QuadTree mesh system is key to performance:
Distance-Based LODβ
Adjust how quickly detail reduces with distance:
Near LOD Distance: 1000 // Full detail within 10m
Mid LOD Distance: 5000 // Medium detail 10-50m
Far LOD Distance: 20000 // Low detail 50-200m
Tessellation Settingsβ
| Setting | Performance Impact | Visual Impact |
|---|---|---|
| Max Tessellation | High | Wave detail |
| LOD Multiplier | Medium | Distance quality |
| Screen Size Threshold | Medium | Mesh density |
Quick optimization:
- Halve
Max Tessellationβ 2x performance gain - Double
LOD Distancesβ Significant FPS boost
ποΈ Shore Effects Optimizationβ
Shore effects can be expensive. Here's how to optimize:
Foamβ
| Setting | Value | Impact |
|---|---|---|
| Foam Samples | 8β4 | -30% GPU |
| Foam Resolution | 512β256 | -40% memory |
| Update Frequency | Every frameβEvery 2 frames | -50% cost |
Shore Wavesβ
- Disable if your scene doesn't have beaches
- Reduce wave segments from 32 to 16
- Limit shore wave distance to nearby camera areas
π Buoyancy Optimizationβ
Pontoon Countβ
More pontoons = more accurate floating = more CPU cost
| Object Type | Recommended Pontoons |
|---|---|
| Small debris | 1 |
| Barrels/crates | 3-4 |
| Boats | 5-8 |
| Ships | 8-12 |
Query Optimizationβ
// In your buoyancy component
Buoyancy Update Frequency: 0.02 // Every 20ms instead of every frame
Use Async Queries: true // Non-blocking water height queries
Cullingβ
Disable buoyancy for off-screen objects:
// In your game mode or manager
OnActorOutOfRange β Disable Buoyancy Component
OnActorInRange β Re-enable Buoyancy Component
π Visual Quality Settingsβ
Reflection Settingsβ
| Mode | Quality | Cost |
|---|---|---|
| Lumen | Best | High |
| Screen Space | Good | Medium |
| Planar | Great | Medium-High |
| Cubemap Only | Acceptable | Low |
Recommendation: Use Screen Space for most games.
Refractionβ
| Setting | Impact |
|---|---|
| Refraction Quality | Medium β Low saves 1-2ms |
| Depth Sampling | Half-res saves 20% |
π± Platform-Specific Tipsβ
PC Scalabilityβ
Create multiple quality presets:
// UltraQuality
FFT_Resolution: 512
WaveLayers: 4
MaxTessellation: 64
ReflectionMode: Lumen
// HighQuality
FFT_Resolution: 256
WaveLayers: 3
MaxTessellation: 32
ReflectionMode: ScreenSpace
// MediumQuality
FFT_Resolution: 128
WaveLayers: 2
MaxTessellation: 16
ReflectionMode: Cubemap
// LowQuality
Use Oceanology Legacy instead
Console Optimizationβ
For PS5/Xbox Series X:
- Use NextGen with Medium settings
- Enable Variable Rate Shading (VRS)
- Use Async Compute for FFT
For PS4/Xbox One:
- Use Oceanology Legacy
- Limit to 2 wave layers
- Reduce QuadTree density
VR Optimizationβ
VR is demanding β every millisecond counts:
- Use Oceanology Legacy (not NextGen)
- Disable post-processing underwater effects
- Reduce all distances by 50%
- Use fixed foveated rendering if available
- Target 90 FPS minimum
β‘ Quick Optimization Checklistβ
Immediate Wins (Big Impact, Easy)β
- Lower FFT resolution (512β256)
- Reduce wave layers (4β2)
- Increase LOD distances
- Disable unused shore effects
Medium Effortβ
- Optimize QuadTree settings
- Reduce pontoon counts
- Enable async buoyancy queries
- Cull off-screen water interaction
Advancedβ
- Profile GPU to find exact bottlenecks
- Create scalability presets
- Implement distance-based quality switching
- Custom LOD for different water bodies
π Expected Performance Gainsβ
Following this guide, expect:
| Change | FPS Gain |
|---|---|
| FFT 512β256 | +20-30% |
| Wave layers 4β2 | +15-25% |
| QuadTree optimization | +10-20% |
| Buoyancy async | +5-10% |
| Combined | +50-80% |
π§ Debugging Performanceβ
If still having issues:
-
Isolate the water
- Create empty level with only ocean
- Measure baseline FPS
- Add elements one by one
-
Check for conflicts
- Other water plugins?
- Heavy post-processing?
- Particle systems?
-
GPU vs CPU bound
stat unitshows which is limiting- GPU: reduce visual quality
- CPU: reduce complexity/queries
π More Resourcesβ
- QuadTree Documentation
- Presets Guide
- Community Discord β #optimization channel
Performance optimization is iterative. Start with the biggest wins and work down. Your players will thank you for smooth, beautiful water!