- Home /
Is there a shader in Unity that prevents transparent parts from overlapping?
In my game, I use cube primitives in part of the 3D interface. They are transparent, and I use the "Transparent/Diffuse" shader. When two of these parts overlap, though, you can see their edges. When many are used in one thing, it is possible to see the edges through one another, illustrated below. Are there any shaders in Unity that could make each colored portion look like a solid part? If not, could one be feasibly
written?
Answer by tanoshimi · Oct 21, 2014 at 07:27 AM
You need to set the shader to write to the depth buffer:
ZWrite On
Your answer
Follow this Question
Related Questions
Rendering an entire object as transparent 1 Answer
Changing two different objects renderer colour 1 Answer
Changing Emission Scale UI with Script 0 Answers
Cannot change material on build 1 Answer
Cubemap on alpha texture? 0 Answers