Unity 6000.5.1f1 — Custom ScriptableRendererFeature with RenderGraph: shader effect persists even when pass is not enqueued
I’m building a custom post-process effect (lens distortion + chromatic aberration + vignette) using a ScriptableRendererFeature with the RenderGraph API. Everything works when the effect is active, but I cannot get it to fully disable.
The problem:
When I uncheck my VolumeComponent in the Volume Profile inspector, the shader effect keeps running with whatever values were last set on the material — zoom stays at the old value, distortion persists, etc. The GPU appears to hold stale material property values from the last active frame.
What I’ve tried:
- Checking
VolumeComponent.active— confirmed from other forum threads this is unreliable when retrieved viaVolumeManager.instance.stack.GetComponent<>() - Early return inside
RecordRenderGraphwhen inactive — pass still seems to affect output - Not calling
renderer.EnqueuePass()at all when inactive — shader output still appears - Setting a bool flag
m_Activeon the pass and returning immediately at the top ofRecordRenderGraph— same result - Manually pushing neutral values (distortion=0, zoom=1) to the material when inactive — partially works but feels wrong and doesn’t solve the root issue
My current setup:
renderPassEvent = RenderPassEvent.AfterRenderingPostProcessing- Two raster render passes: one applies the shader to a temp texture, one copies back to active camera color
IsActive()uses a parameter value check (distortion > 0) per the pattern I found in other threads
The core question:
What is the correct Unity 6 RenderGraph pattern to completely stop a custom post-process pass from executing — including stopping it from affecting the camera output — when the user disables the VolumeComponent? Is there something specific to AfterRenderingPostProcessing + RenderGraph that keeps the pass alive even when not enqueued?