Don't Render Custom Depth Pass through Certain Meshes

So right now I’m trying to make a game involving a searchlight, where planes will fly over, but shouldn’t be visible unless behind the searchlight. Right now I’ve made a post process material that uses custom depth to render the plane when it is behind something, following this tutorial. And while thinking of a way I can keep the plane hidden unless the spotlight is over it, I thought I could just hide the plane behind the background, and stop the background from being able to block the planes custom depth. However, I have no clue how to do this. For a quick representation, heres what it looks like now:


And here’s what I want it to look like:

Nevermind, I found that if you disable Render in Depth Pass and Render in Main Pass on the mesh, it will be hidden, but the custom depth will still work. Using this solution, I simply put the plane in front of the background and behind the searchlight, which works great.

Hi there @anonymous_user_b3b1b525, hope you’re well!

This topic has been moved from International to Rendering.

When posting, please review the categories to ensure your topic is posted in the most relevant space.

Thanks and happy developing! :slight_smile: