Is there a way for a camera to cull an object that doesn't have a MeshRenderer?

Hello, I’m trying to write my own projector because the built in one can’t do what I need it to.

The problem I’m having is that I don’t want the projection to draw needlessly if the projector volume doesn’t fall inside the main camera view. I can leverage the culling system built into a camera, but it means having to create a MeshRenderer for my projector, which is going to draw to the screen as a big box.

I don’t need the mesh to render, I just need to cull the projector if it’s not in view.

The only method I’ve found is one that means drawing the mesh but with the ColorMask set to 0, and ZWrite set to Off. This is a great quick fix just to get this working, but I’d rather not execute a shader at all.

Does anyone know of a better method than this?

Thanks!

I found a reasonable solution. I created a two vertex mesh made up of the min and max extents of the projection frustum. This in turn creates the proper AABB that the camera needs to do its culling with, but doesn’t give the renderer enough to draw with :).

If you have a better solution I’d love to hear it!