Hi all,
I am working on a system to determine whether any part of an object is directly visible by the player camera. My first try used OnBecameVisible() and OnBecameInvisible(), but it doesn’t work because those methods only take into account the camera direction, not any occlusion by other objects. I’ve done a lot of googling and have seen raycasting solutions suggested, but this doesn’t account for cases when only some part of the center of the object is visible like through a window. I’ve also seen some ideas of doing a render with certain colors for certain objects and checking that way, but that seems like it might run into performance issues.
Is there any way to do this accurately? I shouldn’t need a lot of objects to use this system at once.
Thanks!