Quantcast

Getting the count of nodes culled by occlusion culling

classic Classic list List threaded Threaded
4 messages Options
jbradford jbradford
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Getting the count of nodes culled by occlusion culling

Is there an easy way (or any way) to get the count of TrackNodes that are hidden due to occlusion culling?

For example, say I have 5 TrackNodes on screen and I rotate the map so that 2 are behind a mountain and subsequently hidden due to occlusion culling... is there some way I can figure out how many have been culled?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting the count of nodes culled by occlusion culling

You could perhaps attach a cull callback to each TrackNode; if the callback executes, the node was not occlusion-culled.
Glenn Waldron / Pelican Mapping
jbradford jbradford
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting the count of nodes culled by occlusion culling

Thanks for the suggestion Glenn, that got me on the right track. I was able to track which nodes were culled specifically by occlusion by adding a callback before and after the occlusion culler executes.

BTW, this revealed a bug in osgEarth (in 2.7 at least, as that's what we're on).

In OrthoNode::setOcclusionCulling(), if you pass in false (disable occlusion culling) the occlusion callback is never removed, and additional callbacks are added as you toggle occlusion on/off.

We fixed it by removing the if (_occlusionCulling) check in the else block.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting the count of nodes culled by occlusion culling

Thanks Jeremy. IIRC that logic has changed since then, so hopefully this is no longer an issue in osgEarth master branch.
Glenn Waldron / Pelican Mapping
Loading...