I’m following along on a desaturate feature tutorial with the URP. (Intro Renderer Feature in Unity URP - Desaturate Post Process Effect ✔️ 2020.3 | Game Dev Tutorial - YouTube)
I’ve got it all set up the same way as in the video and I can see the desaturated image in the Frame Debugger. However, the “Render PostProcessing Effects” has a RenderTarget of “_AfterPostProcessingTexture” and the “Render Final PostProcessing Pass” reads from its “_BlitTex” which is also “_AfterPostProcessingTexture”, thus skipping over the “_CameraColorTexture” that my Feature is writing to. (What decides this?)
In AddRenderPass(ScriptableRenderer, RenderingData)
in the ScriptableRendererFeature
, if I manually make it use new RenderTargetIdentifier(Shader.PropertyToID("_AfterPostProcessTexture"))
instead of renderer.cameraColorTarget
, it works in the game view. However, this causes an error in the scene view because post processing effects aren’t rendered there, so this “_AfterPostProcessTexture” doesn’t exist and causes a warning.
What’s the right way to solve this problem? How do I tell the pipeline to apply the desaturation to whatever the right texture is at that time? Or is it right to be manually telling it the texture name and then disable the desaturate in the scene view? How do I disable it there?