What am I trying to do?
I have an object that is rendered with one type of material when it is culled b y the camera. when the object comes in view of the camera, I would like to switch the material on it.
My issue is figuring out when the camera is going to render that object. I am using RenderPipelineManager.beginContextRendering but it is always being called.
How can I get notified when my camera is about to or has, rendered my object?
This is the camera frustum culling, so when an objects enters/exits the camera point of view, not when it is behind other objects like you showed in the last message. It would make any sense to have a different material when to object is out of the frustum.
Yeah, I played with the “Local” Custom Pass Volume (I only want this effect on enemies) but it needs to be attached to a collider. Unfortunately, my colliders do not reflect the Mesh of the “enemies”. I only have ragdoll colliders.
That’s not how the local custom pass works. The “local” notion of it is to change where the custom pass affects the camera : if the camera is inside the volume of the custom pass bounds, it will affect it, else it will not.