[osg-users] Best way to cull object hidden by a mountain

Robert Osfield robert.osfield at gmail.com
Fri Jun 24 06:53:08 PDT 2016


HI Valerian,

The osg::OccluderNode is not appropriate for what you are trying to
achieve, it only works when you have convex planar occluder geometries
that you can use to do the culling.  It's useful for town or building
scenes where walls can form large occluders relative to screen space.
A terrain height field doesn't exhibit any proporties that fit with
being a convex planar occluder so it not useful in your case.

Using OpenGL occlusion query feature via the osg::OcclusionQueryNode
is more likely be to be helpful as it can handle a straight meshes
rather than contrained geometric primitives like osg::OccluderNode.
Have a look at the osgocclusionquery example to see how to set it up.

As a general point, do you really need to cull things behind the
terrain?  If you are getting a solid 60Hz you don't need to complicate
your scene graph with techniques like occlusion query.

Robert.

On 24 June 2016 at 13:39, Valerian Merkling <niarkoleptik at gmail.com> wrote:
> I might show some pieces but there is a lot of code and i'm not allowed to share it :(
>
> Right now I need to understand how occlusion culling is supposed to be used with HeightField (is it is possible). I made a few tests in my code but I did not keep them as nothing was working.
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67787#67787
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list