- Home /
Mobile Transparent Vertex Color Depth Issue
I have two objects with a textures that have alpha channels. I used the Mobile/Transparent/Vertex Color shader on both. I have the person texture placed behind the bench texture but depending on the angle the person is in front of the bench. Note that this same issue can be recreated with Transparent/Vertex Color shader as well (im just using the mobile because this is for the iOS).
As you can see the person is behind the bench. (Side view)
Still behind the bench
Now in front of the bench when camera is at this angle.
Answer by cupsster · May 02, 2012 at 12:42 PM
Make copy of shader you are ussing and to rendering tag "Transparent+1". Then use this shader for objects that need to be in front. +1 will force them to be rendered later and thus in front of bench. You can use different number if you like. Option #2 would be to create separate cammera and let it render only object that need to be in front. Whan using camera for this set yaour camera depth higher than main camera which is usually 0 so set your guy camera to depth 1 and clear flags to depth only. Dont forget to setup culling layers and put your objects on coresponding layers.
Your answer
Follow this Question
Related Questions
GUI.depth factors 1 Answer
HELP GUI zindex 0 Answers
Objects behind transparent objects (sometimes) not drawn. 0 Answers
Displaying a gameobject over gui issues 0 Answers
Shader - Writing to Depth issues 0 Answers