- Home /
make masked object transparant
Hi,
I am using unity water and want to use depth mask on object which will be basically half in the water and half above water with use of depth mask I want it to show above water .
I know depth mask require one object which will not let camera render anything behind it after it gets render.
So I have set up water, I added its render queue to 3000, then I added my prefab on water which will be half in the water, and set its render queue to 1500, and then I created material,created game object added that material on newly created game object, then finally added depth shader provided here in unity wiki to that material and set its render queue to 1800.
It works perfectly as I wanted, but the thing is the masked object (on which I used depth masked shader) do not get transparant, it gets the color set in camera setting > background i.e., default blue color
What I want is it should get transparent not that default blue color to it...I tried to modify that depth mask shader and added alpha bending to it but then the object which has masked shader gets disappear completely and with that the camera do not render the object which is half in the water too...
Anyone know how to do it? plz help em ,I'm stuck here from days...
I'll see if I can get someone who knows shaders better than I do to respond, but you may also want to dig thru this (very long) thread on making water. There are a number of variations that people have tried over time, which do include solutions to the problem you have: http://forum.unity3d.com/threads/wanted-ocean-shader.16540/
And there are some links here: http://wiki.unity3d.com/index.php/Ocean_Shader_Project
Your answer
Follow this Question
Related Questions
Custom water shader and SSR 0 Answers
Help me understand stencil shader logic 1 Answer
Local position in vertex shader? 1 Answer
Addition to Standard Shader stopping it from batching? 0 Answers
Flat Shading / No Vertex Interpolation 2 Answers