[osg-users] AutoTransform, ROTATE_TO_SCREEN and small feature culling

Robert Osfield robert.osfield at gmail.com
Wed Mar 28 01:58:44 PDT 2018


Hi Hartwig,

On 27 March 2018 at 17:44, Hartwig Wiesmann <hartwig.wiesmann at skywind.eu> wrote:
> I was not talking about the cullingActive flag but the method isCullingActive! isCullingActive checks besides the cullingActive flag if the boundary sphere is valid. As long as the boundary sphere is invalid isCullingActive() returns false. This is the problem I reported.

This is by design, you can't cull something that doesn't have a valid
bounding volume as culling tests are based on the bounding volume.

For AutoTransform the bounding volume change per frame, especially so
if it's being scaled to screen space as it's size can grow and shrink,
so in this case leaving it undefined is the one safe thing to do.

As for children of an AutoTransform not being culled, this is
incorrect, the children's culling will be done in their own right,
what happens to the parents will no affect this.

As a general note, AutoTransform is not something I would recommend
using for large numbers of objects in your scene as it not only
presents issues with cullng itself but also forces the cull traversal
to transform the view frustum into the children coordinate frame, this
involves pushing/popping view frustum state on and off a stack as
well.

I don't know the specifics of your scene graph or the particular
performance issues you are trying to address, but it may well be that
pushing the task of rotating/scaling to a vertex or geometry shader
might be the best way to refactor your scene graph for best
performance.

Robert.


More information about the osg-users mailing list