Layers and Culling mask

Hi,

Is it possible to have 2 layers and set the camera to see the first one over the second?
How do I configure the culling mask to show the first one over the second one?

These are not ordered layers that are available for each game object in the inspector.
Ordered layers are only for sprites??
I have to use a shader to achieve this functionality?

I think what you want to do is set up two cameras. One can be set so it’s culling mask shows everything except for a separate layer (let’s call it layer 2). The second camera’s culling mask should be set so only layer 2 is shown. Then assign the objects that you want to display in front by the second camera to layer 2.

You can adjust the Depth option on the cameras to change the order they are shown, in this case I’d try setting the second camera to a higher depth (positive integer).

You might have to adjust the Clear Flags on one of the cameras as well: I can’t quite remember.

But multiple cameras and the Culling Mask, Depth, and (possibly) Clear Flags options are things you should have to fiddle with to get this working.

2 Likes

Or you can change the depth test, which still requires messing with material definitions but not actual shader code (from memory).