Performance Tips
intermediate performanceDynamic Fog & Mist 2 (Built-in) · Troubleshooting & FAQ
Overview
Dynamic Fog & Mist 2 is already lightweight — it uses optimized shaders with minimal texture samples. These tips help you squeeze out extra frames on mobile or lower-end hardware.
Choose the Right Variant
The single most impactful optimization is selecting the correct fog effect type for your platform:
| Target Platform | Recommended Variant | Reason |
|---|---|---|
| Desktop (PC/Mac) | Desktop Fog Plus + Sky Haze | Best visual quality with minimal desktop GPU cost. |
| Mid-range mobile | Mobile Fog + Sky Haze | Single noise texture, good quality/performance balance. |
| Low-end mobile | Mobile Fog (Simplified) or Basic | No noise textures — minimal GPU overhead. |
| Isometric/top-down | Orthogonal variants | Correct depth/height separation for non-standard perspectives. |
Optimization Checklist
| Optimization | Impact | Details |
|---|---|---|
| Use DynamicFogExclusive | High | The Exclusive variant includes a Downsampling parameter that renders fog at reduced resolution — significant speedup on mobile. |
| Use fog materials instead | High | Per-object fog materials avoid the full-screen blit entirely. Best option for old mobile devices. |
| Use FogOfWar prefab | High | For top-down fog of war, the mesh-based prefab is much faster than the image-effect approach. |
| Reduce fog-of-war texture size | Medium | Lower Texture Size in the fog-of-war settings. 256 is often sufficient for gameplay. |
| Disable sky haze | Medium | If you don't need atmospheric haze, pick a "No Sky Haze" variant to save a texture sample per pixel. |
| Remove unused shaders | Build size | Delete unused materials and shaders from DynamicFog/Resources to reduce build size and shader compile time. |
| Lower Quality in WebGL | Medium | Ensure Quality is set to Medium or higher in Project Settings > Quality to avoid rendering issues. |
Profiling
Use Unity's Frame Debugger (Window > Analysis > Frame Debugger) to measure the cost of the DynamicFog pass. Look for the OnRenderImage or post-processing pass and compare its duration against your per-frame budget.
Mobile rule of thumb: On low-end mobile devices, use Mobile Fog (Basic) or fog materials. For mid-range devices, Mobile Fog + Sky Haze with downsampling via DynamicFogExclusive offers the best quality/performance ratio.
Next Steps
- Fog Effect Types — detailed comparison of all shader variants.
- Troubleshooting — resolve common rendering issues.
Was this page helpful?
Suggest an improvement
Help us improve this documentation page.