- Home /
Can one use Shader Replacement with Deferred shading
I guess the title says it all: Can one use Shader Replacement with Deferred Shading?
In my case as soon as I enable forward shading my replacement shaders work. Switch to Deferred and it breaks.
Any ideas?
Answer by Prince_of_Persia · Dec 13, 2013 at 07:47 PM
I had the same problem,But I was using a temporary camera to render with replaced shaders (Not main camera). So there is no reason for temporary camera to have deferred pipleline.
cam.CopyFrom(Camera.main);
cam.targetTexture = targetTex;
cam.renderingPath = RenderingPath.Forward;
cam.SetReplacementShader(ReplaceMentShader,null);
cam.Render();
Long time ago, but my goodness, you saved me. I wasted a lot of time because I was using cam.CopyFrom(Camera.main);
basically, but then was forgetting that my project uses Deferred, and so the temporary camera I was using also copied the Deferred rendering path, failing to use my shader replacement... haha. Thank you so much.
Your answer
![](https://koobas.hobune.stream/wayback/20220613133516im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make certain sections of a level grey scale at runtime. 1 Answer
how to get flat objects to look flat, not rounded 1 Answer
Maya > FBX > Unity: weird shading issue 0 Answers
How do I set up a smooth material with opaque stains? 0 Answers
Instanced meshes stop rendering when i rotate them 0 Answers