Robert et al.,

The topic of culling vis-a-vis shaders has come up a few times recently.

The issue is: if you transform or emit vertices in a vertex, geometry, or
tessellation shader, the new position information is not available to OSG's
culling mechanism. This may result in visible geometry being culled.

One approach is to artificially inflate the bounds of your geometry. Not
very elegant. Cull callbacks won't help, since the visibility logic is in
CullStack::isCulled() which executes before any cull callbacks.

What I would like to do is use a custom frustum for culling. In my app I
have just such a frustum, and I tried applying it the the current
osg::CullingSet; but that CullingSet is automatically kept in sync with the
Camera frustum and my changes get overwritten.

I think we need a general-purpose solution, since this topic is bound to
come up again. Here are a couple ideas:

1) Allow the user to customize CullStack::isCulled() in some way, either
with a callback, or by making the isCulled() variants virtual.

2) Allow the user to apply a custom visibility frustum to the
osg::CullingSet. (Calling CullingSet::setFrustum works, but gets
automatically overwritten when there are subsequent Transforms in the scene
graph.)

I look forward to your thoughts.


Glenn Waldron / @glennwaldron / osgEarth.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to