- Home /
transparent shader objects disappear on certain camera angles
Hello we just faced this problem which is quite weird. I have 2 groups of objects which have mobile/transparent vertex color shader assigned to their material. now the problem is in come certain camera angle these object either have weird cutoffs or just totally disappeared. now when I change the camera height or angle these objects appear or the cutoff problem is gone. having said that, our camera is stationary and we certainly do not like to relocate it. any solutions?
Answer by raminsh · Jun 15, 2011 at 01:52 AM
ok, I actually figured it out. just in case others have the same problem: when you are have 2 object in front of camera and in front of eachother and they both have transparency assigned specially if they have transparent texture like PNG files, make sure that at least the one behind is using alpha cut off not regular simple transparency shader.
That doesn't solve the problem. Your edges are either binary or will be sorted in the wrong order (and the latter requires two draw calls). You need to do something to control the sorting order unless that is acceptable.
you might be right but do you have a solution for it? because the only way that solved the issue was just that. using alpha cut of on one of them
Unless your edges were binary, you did not solve the problem; you only mitigated it. There is no universal solution; how to sort queues depends on your project, and may be practically impossible, which is why people take the approach you did. http://unity3d.com/support/documentation/Components/SL-AlphaTest.html $$anonymous$$etroid: Other $$anonymous$$ is a recent game that used only alpha testing and no blending. Very ugly foliage!
Answer by raminsh · Jun 13, 2011 at 03:33 PM
Have tried playing with near and far clip already no result there. Apparently it's an issue with two transparent objects in front of eachother.
Answer by rajeshraj · Dec 05, 2013 at 07:14 AM
problem solved...change the shader to transperant cutout....thanx raminsh
Answer by CgShady · Nov 27, 2012 at 11:44 PM
If you look into the last shader from the page http://docs.unity3d.com/Documentation/Components/SL-AlphaTest.html you can notice they turn off ZWrite.
Adding ZWrite off to every passes of your shader should do the trick. At least, it did for me.
Same problem here. ZWrite off is not acceptable for me.
Any further ideas are very welcomed - thanks very much!
Answer by DanjelRicci · Jun 13, 2011 at 02:37 PM
Sounds like a problem of Clipping Planes. Go to your Camera object, then both reduce the Near vale and increase Far value. This should solve the problem, let us know!
Your answer
Follow this Question
Related Questions
Make transparency ignore meshes inside? 1 Answer
Saving Texture at Run time and Reusing it 0 Answers
Is there a shader that will give me a range of transparencies for an unlit texture? 2 Answers
How do I blend or overlay a texture over the main texture? 1 Answer
Is there a shader in Unity that prevents transparent parts from overlapping? 1 Answer