E
E
E_R_u_S2014-03-12 09:37:55
Shaders
E_R_u_S, 2014-03-12 09:37:55

How to write a shader for a transparent object in Unity3d so that objects behind it also become invisible in the camera?

Can you please tell me how to write a shader for a transparent object in Unity3d, so that objects behind it also become invisible in the camera?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Leopotam, 2014-07-24
@E_R_u_S

you need to specify the following in the pass:
ZWrite On
ColorMask 0
and in the tags of the pass:
"Queue" = "Geometry-1"
This will disable writing to the color buffer (the object will become invisible), but will fill the depth buffer to clip the geometry.

N
NuMooLe, 2014-05-21
@NuMooLe

You can't write such a shader. This should be done with renderer.enabled = false;
answers.unity3d.com/questions/8637/appeardisappear...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question