is object visible?

Is it possible to check the visibility of an Object with out occlusion culling?
TIA and cheers

This could help ?

Edit : They seems to trigger upon specific events (became visible and became invisible). If the gameObject is in the frustum of the camera at the beginning, it will trigger OnBecameVisible. But if it is not in the frustum, it will NOT trigger OnBecameInvisible.

Plus, if the gameObject is behing something (and not visible), but is in the camera frustum, it will trigger OnBecameVisible and OnBecameInvisible…

thank you :slight_smile: I will test it!!

hi AkilaeTribe
the 2 methods OnBecameVisible and OnBecameInVisible are triggered only the GameObject is rendered or not. they can’t work whether it’s occluded. maybe you have anther good idea :smile:

Noob question : what is occluded ? You mean, when the object is not selected in a culling mask, and the camera do not render this culling mask ?

occlude meaning: a object in view frustum but it’s blocked by a other object which between in the first object and camera.

With 3.0 occlusion culling in a static scene, that will of-course change and these two events will always be accurate. Without occlusion culling though, you are still getting valuable data as the number of objects to consider is significantly reduced by the view frustum culling.

You could add to that distance culling (from your list of possibly visible objects, filter out those further than N units away). After this, when you need to consider a possibly visible object, you could do a final raycast to validate whether it is truly visible.

You sure ? I made the test with a barrel, in the FPS Tutorial. The barrel was not visible, behind a wall of the level, it triggered the OnBecameVisible and OnBecameInvisible…

which version have u used 3.0? in 2.0 it has not triggered

I am using 2.6.1.

Note : why are you still using an old version ?