Frustum Vs Umbra

Is it possible to differentiate an object being culled because it is outside of the frustum vs being culled by umbra? I’ve been searching and can’t find any scripting reference to the reason culling is happening to an object.

Thanks

Andrew

yes it is but not directly.

you can use OnDisable and in there check if you would have been in the Camera.main frustum. if you would have been its OC, otherwise Frustum

Question is on why it would be of importance as “not seeing” is “not seeing” and for both the implications and heuristical considerations on “is it coming back into view” are normally the same for any scenario where OC would be of use / gain I could think off

Wouldn’t something behind a wall still potentially be out of the camera’s view frustum but also be occluded? I want to know if I can actually get at that occlusion data since what you are saying works except for if the occluded object is outside the frustum as well.

Then the script has to do with loading light maps. We are trying to dynamically load them and don’t want to load them when ever the view changes only as a player moves. and previously occluded objects are no longer occluded. It’s just an experiment right now :slight_smile:

The camera frustum gives a damn about walls, thats why Umbra is needed.

View frustum really means “bounding box is in front of camera and between the near and far clip range”, thats it. No other factor is of any imporance.

If the object is outside the view frustum then occlusion culling will not handle it at all, OC is only active and relevant in front of Camera.main where “visibility tests” are done at all, outside the view frustum its granted to not be visible and it won’t need any visibility check.

As for your “I only want to load them as the player moves” sounds good, but will not work. Texture upload is blocking even if you use asset bundles and loadasync and with lightmaps that are not just 32bit ARGBs but 128bit you will get to feel it for sure, especially if you do the loading during normal moves and not during “little detail loading tunnels” where you can remove the old assets to load the new ones.

If you are really interested in anything like this with dynamically loading etc of textures, you will really want to look into the virtual texturing addon Amplify.

I’ve actually done loading of 1K hdr light maps using AssetLoad and the blocking was not noticeable on 3 year old hardware. Granted I have a good cpu but it will work to some degree. We tried it on a mac air which had more texture memory but a weaker cpu and saw some block but we were loading textures onRender which is pretty frequently.

I guess there is no way to find out what would have been occluded by umbra if frustum culling wasn’t a factor. Virtual textures sounds interesting I’ll look into that.