Materials & Shaders
Every pixel pays for its material every frame. This is the audit pass: shader complexity, samplers, translucency, overdraw, WPO, and runaway permutations.
4.1Shader Complexity - A First Pass

Use Shader Complexity to find areas worth investigating, then confirm their cost with GPU profiling. Look at large layered surfaces, expensive shading models, two-sided foliage, and overlapping translucent effects. The view is a guide, rather than a direct timing measurement.
4.2Translucency And Overdraw

Opaque pixels shade once. Translucent pixels shade once per overlapping layer. Ten stacked smoke sprites means the same pixels get paid ten times. That's overdraw, a common source of VFX rendering cost. Check it with Quad Overdraw. Fixes are practical: fewer and smarter particles, tighter sprite geometry, masked instead of translucent where possible, and the cheapest translucency Lighting Mode the effect can survive. Two-sided doubles rasterisation, so save it for foliage and cloth.
4.3Samplers, Instructions, And WPO
- Texture samplers - the material editor stats panel shows the count; channel-pack (ORM) instead of sampling three greyscale maps. Use Shared samplers to stretch the limit of 16.
- Instruction counts - a relative health metric; watch the delta when you add features, especially on materials covering big screen areas (skies, landscapes, water).
- World Position Offset - vertex animation adds work to the affected geometry, plus shadow and culling side-effects. Distance-fade it out.
4.4Permutations: The Invisible Cost
Every static switch, usage flag, and quality level multiplies what a master material compiles into. The symptoms are hour-long shader compiles, huge shader libraries, and PSO hitches at runtime. The discipline is boring and effective: fewer masters, budgeted switches, and material instances for variation. One wasteful master used by 300 instances is a tax on the whole project.
From the audit framework: reduce two-sided materials, fix translucent overdraw, reduce texture samplers, simplify complexity on high-usage masters. Prioritise the changes that address the measured bottleneck.
