- Home /
(Fade shader) Visual glitches within a model on opaque section
I have the model of hand I want to fade at the bottom, where the wrist connects with the arm. To achieve this, I've mapped a texture with a white to transparent gradient to the lower part of the model, and set the rest of the model's UV to a single non-transparent white pixel in the texture. In unity, I used the standard shader in 'fade' mode.
However, from certain angles, some parts of the model render on top of others, even though they are further away. The weird thing is that this is only happening in the opaque part of the model (I double-checked that). Objects in the background can also be seen in the affected areas. You can see the effect below:
The model's normals are fine, there are no inverted faces, so I've been left clueless as to how to solve this problem and would appreciate any help you could provide. If you have any questions post them in the comments below and I'll answer them as soon as possible.
Thank you.
Even if the alpha is set to 1 at that point, the shader is still considered and rendered as semi-transparent. These issues are common with transparency in general in realtime engines, however I myself have not dealt with them directly, as I never really work with transparency and complex objects. I believe someone wrote a shader which allows for proper depth testing within transparent shaders, but this would require writing your own:
http://forum.unity3d.com/threads/transparent-depth-shader-good-for-ghosts.149511/