[Solved] Culling Performance Issues

classic Classic list List threaded Threaded
6 messages Options
boy2melo boy2melo
Reply | Threaded
Open this post in threaded view
|

[Solved] Culling Performance Issues

This post was updated on .
Dear all,

I have a performance issue with culling.



In order to visualise the visibility within a certain perimeter I use six RTT cameras that concurrently render the scene from a given observation point. When I activate the RTT cameras, the time needed for culling increases tremendously reducing the frame rate.

I first thought that it is because I use six cameras simultaneously, so I only used one camera at a time, choosing another one each frame. Still same issue occurs.

I also tried to identify which camera causes the problem. However, when I only use one camera the whole time, i.e. no change in subsequent frames, the issue disappears.

Does somebody have an idea, what might cause this problem?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Culling Performance Issues

Does the cull time increase linearly as you add cameras?
Glenn Waldron / Pelican Mapping
boy2melo boy2melo
Reply | Threaded
Open this post in threaded view
|

Re: Culling Performance Issues

Yes it does. Is there any way how to improve the performance of culling?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Culling Performance Issues

I asked because: if the culling time increases linearly with each camera you add, then your logic for switching on one camera at a time per frame is probably not working properly.

It looks like you are doing a viewshed analysis. Since you know the maximum distance, one way to speed up culling would be to force a far clipping plane on the RTT cameras instead of letting OSG automatically calculate it.

Camera::setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);

And then set the near/far planes in your projection matrix.
Glenn Waldron / Pelican Mapping
boy2melo boy2melo
Reply | Threaded
Open this post in threaded view
|

Re: [Solved] Culling Performance Issues

Thanks for your help.

Turning off the automatic near-far computation improved the performance.

However, I still add to change the CullMode of each RTT camera to also perform near-far culling:
camera->setCullingMode(osg::Camera::CullingModeValues::ENABLE_ALL_CULLING);
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: [Solved] Culling Performance Issues

Good point, I forgot that wasn't the default.
Glenn Waldron / Pelican Mapping