- Home /
What's the difference between .SetReplacementShader() , .ReplaceWithShader() functions in Unity?
Hi, What's the difference between .SetReplacementShader() , .ReplaceWithShader() functions in Unity?
Answer by Bunny83 · Nov 18, 2017 at 04:21 PM
Uhm there is not "ReplaceWithShader" method. Maybe you meant "RenderWithShader"?
The difference is that "RenderWithShader" manually renders the camera immediately (so this method can only be called during rendering) while "SetReplacementShader" sets a certain shader as replacement shader on the camera. So when the camera normally renders itself it will use the replacement shader.
This effect will persist until you call ResetReplacementShader.
Note that RenderWithShader is basically the same as Render but it uses a replacement shader.
Your answer
![](https://koobas.hobune.stream/wayback/20220612143002im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Help with multi-purpose replacement shader for camera 1 Answer
Best method for implementing alternative view modes? (like Cities: Skylines "Info View") 0 Answers
setGlobalFloat() doesn't initialise my shader parameters 0 Answers
Fresnel shader and mixed textures 0 Answers
Tutorials on shaders? 3 Answers