x


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?

more ▼

asked Jun 13 '11 at 02:57 AM

raminsh gravatar image

raminsh
173 15 15 21

Do not post on two different sites without crosslinks.

Jun 13 '11 at 12:46 PM Jessy
(comments are locked)
10|3000 characters needed characters left

4 answers: sort voted first

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.

more ▼

answered Jun 15 '11 at 01:52 AM

raminsh gravatar image

raminsh
173 15 15 21

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.

Jun 15 '11 at 02:23 AM Jessy

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

Jun 17 '11 at 06:14 AM raminsh

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 Metroid: Other M is a recent game that used only alpha testing and no blending. Very ugly foliage!

Jun 17 '11 at 01:40 PM Jessy
(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Jun 13 '11 at 03:33 PM

raminsh gravatar image

raminsh
173 15 15 21

(comments are locked)
10|3000 characters needed characters left

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!

more ▼

answered Jun 13 '11 at 02:37 PM

DanjelRicci gravatar image

DanjelRicci
380 17 20 31

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Nov 27 '12 at 11:44 PM

CgShady gravatar image

CgShady
103 13 15 22

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3001
x2199
x1655
x245

asked: Jun 13 '11 at 02:57 AM

Seen: 2778 times

Last Updated: Nov 27 '12 at 11:44 PM