Page 1 of 1

Test of culling

Posted: Tue Aug 13, 2019 12:52 pm
by kubatp
Hello,
Is there a way how to check/see what is being culled (partially out of curiousity and partially out of checking)?
I would imagine it like this - set camera and call a function, which stops updating the culled space, so I can rotate camera and see what is and what isnt rendered,
Any advices?
Thank you

Re: Test of culling

Posted: Thu Aug 15, 2019 5:54 pm
by dark_sylinc
Hi!

On Ogre 2.1+

1. Scene passes have cull_reuse_data / mReuseCullData to reuse the culling from a previous scene pass in a subsequent pass.

2. Culling data is stored in RenderQueue::mRenderQueues[ i].mQueuedRenderables until it gets cleared, if you want to manually access it (after you've already rendered a scene pass)

3. You can use cameraPostRenderScene listener, which allows you to modify the camera after culling has already happened but before rendering starts. I never attempted to do so, so I don't know if that would work as expected though.

Cheers
Matias

Re: Test of culling

Posted: Wed Aug 28, 2019 8:05 pm
by kubatp
Hello dark_sylinc,
thank you for the tip! I am still stuck with Ogre 1.7.4. but as far as I understand these options, they should also work for this version, right?
I will definitely give them a try!

Re: Test of culling

Posted: Thu Aug 29, 2019 4:33 am
by dark_sylinc
Hi!

No, these features are spefici to Ogre 2.1+

While looking into frustum culling code since I posted it, I found out two more things:

Ogre 2.1/2.2:
There's the setting of "culling camera", which can be different from the rendering camera. It is set from Scene pass definition. It will achieve the desired result.

Ogre 1.7:
Use Camera::setCullingFrustum, which allows to set a different Frustum (a Camera is a type of Frustum) for frustum culling. As per the documentation:
By calling this method, you can tell the camera to perform culling
against a different frustum to it's own. This is mostly useful for
debug cameras that allow you to show the culling behaviour of another
camera, or a manual frustum instance.
Cheers
Matias