I’m trying to create a plane that I can place over-top of the terrain which will hide the terrain but render all other things. For placing a cave under the terrain.
Disclaimer : Never done this before, but for a quick test just now.
Import the SetRenderQueue.cs script
Import the DepthMask shader (I changed Tags {“Queue” = “Geometry+200” } as in the video)
Create a material, name it MaskMaterial, set the shader to Masked/Mask
now set up the scene :
put in terrain and a directional light
create a plane, position it just above the terrain
drop the MaskMaterial onto the plane
drop the SetRenderQueue.cs script onto the plane, set the Queues elements to 1800
create a cube, position it just under the terrain (behind the plane!)
drop the SetRenderQueue.cs script onto the cube, set the Queues elements to 1500
Done! Hit play and move the camera around.
In both the video and the example project, there was no script on the mask plane, but I couldn’t get it to work without adding it and setting the Queues Elements to 1800
So anything you want to render under the terrain behind the mask, add the SetRenderQueue.cs script and set the Queues elements to 1500
As in my disclaimer, I only just tried this for the first time now. Let me know how it goes =]