- Home /
Two shaders for one model
Is it possible to draw one shader on top of another?
That both the first and second shaders will be visible and the second will be on top of another irrespective of coordinates.
What exactly is the use case for this? You can draw multiple shader passes over the top of each other to this effect, but you would need to know how the two passes relate to each other. $$anonymous$$ore importantly, we want to try and limit the number of passes a shader has, so is there a reason that the functionality of the two shaders cannot be combined into a single one?
I want to achieve this effect) Could you suggest something (If this is Shader Passes, send link how to use it please)
Answer by JonPQ · Jul 10, 2020 at 10:12 PM
There is a way to do it, unless Unity has fixed it.... If you have a renderer with 1 material on it.... make a second material, and add it to the renderer, you can put a completely different shader in that material. It will draw the same mesh twice, using both materials. But it counts as 2 draw calls. The up side... is you can combine any shaders.... The down side... it counts as extra draw call per material and breaks batching.
Or you make a shader with 2 (or more) passes in it.
Answer by FiveFingerStudios · Jul 10, 2020 at 07:48 AM
Renderers can only use one shader per material.
If you want another effect on top of another, use another shader that supports both effects.
Are you talking about $$anonymous$$ultiple Passes? If yes, could you help me with link, how to do it. I have tried to do it, but failed. (I want to make something like effect double the object)