[VFX Graph] Fix Performance Drops from Transparent Fog Overdraw
Solution
Unity 2019.4.x - Unity 6.3.x
Published 21 days ago
Significant performance degradation occurs when fog particles accumulate on screen. Even with simplified graph logic, a 20 FPS drop is observed, suggesting the rendering bottleneck is linked to particle visibility and pixel fill rate rather than computational complexity.
The primary cause of performance degradation in transparent VFX like fog is frequently attributed to overdraw. This occurs when multiple transparent surfaces are rendered on top of each other, forcing the GPU to process the same pixel multiple times.
To mitigate this, follow these steps:
- Optimize Alpha Textures: Ensure textures used for particles minimize empty space. Large transparent borders increase the overdraw cost without adding visual detail.
- Adjust Particle Geometry: In the
Output Particlecontext of your VFX graph, change the primitive shape fromQuadtoOctagon. This trims the transparent corners of the particle, reducing the total pixel area rendered per particle. - Simplify the
Shader Graph: Minimize the instruction count by removing complex lighting calculations. Use an unlit master stack and fake lighting using aSimple Noisenode or vertex colors. - Enable Low-Resolution Translucency: If using HDRP, navigate to your
HDRP Assetand enable theLow-Resolution Translucencypass. This renders high-density transparent elements like fog at a lower resolution buffer before upscaling. - Reduce Particle Density: Increase the individual size of your particles in the
Set Sizeblock while lowering theCapacityandSpawn Rate. Aim for the same visual volume with fewer overlapping layers to reduce overdraw.
Additional Tips
- Disable
Shadow CastingandShadow Receivingon theOutputblock to reduce the rendering overhead per particle. - For URP, implement a custom
Scriptable Render Featureto handle downsampled transparency if native low-res passes are unavailable. - Turn off
Sortin theOutputsettings if the fog density is high enough that per-particle depth order is visually negligible.
TL;DR
Performance issues in transparent fog are primarily caused by excessive transparent overdraw, which can be mitigated through texture cropping, geometry optimization, and resolution downsampling.
Related Posts Haven't quite found a solution to your problem? We think these posts might help you.
Content inspired by a Unity discussion post.