[osg-users] osgViewer/Renderer ctor set wrong defaults for SceneView

Robert Osfield robert.osfield at gmail.com
Wed Feb 3 02:19:19 PST 2016


Hi Christian,

I can't figure out exactly what change you are talking about, could
you have a look at the the github page to figure out the commit that
is relevant.

Also could you explain the problems you are seeing in your
application, which version of the OSG worked, which ones now fail.

Thanks,
Robert.

On 3 February 2016 at 09:33, Christian Ehrlicher <Ch.Ehrlicher at gmx.de> wrote:
> Hi,
>
> in r13604 osgUtils/SceneView got a new default value for
> SceneView::setDefaults():
>
> Added SceneView::Options enum enetries APPLY_GLOBAL_DEFAULTS and
> CLEAR_GLOBAL_STATESET to control whether a _globalStateSet->clear() and
> _globalStateSet->setGlobalDefaults() should be called.
>
> The problem seems to be that in osgViewer/Renderer.cpp those new enum values
> are not respected when sceneViewOptions for the scenes is calculated:
>
> Renderer.cpp:399
>
> unsigned int sceneViewOptions = osgUtil::SceneView::HEADLIGHT;
> if (view)
> {
>     switch(view->getLightingMode())
>     {
>         case(osg::View::NO_LIGHT): sceneViewOptions = 0; break;
>         case(osg::View::SKY_LIGHT): sceneViewOptions =
> osgUtil::SceneView::SKY_LIGHT; break;
>         case(osg::View::HEADLIGHT): sceneViewOptions =
> osgUtil::SceneView::HEADLIGHT; break;
>     }
> }
> ...
> _sceneView[0]->setDefaults(sceneViewOptions);
> _sceneView[1]->setDefaults(sceneViewOptions);
>
>
>
> This leads to a broken Scene in our application. As I've no idea about the
> internals of osg (I just searched this bug) I hope this is enough to fix the
> problem.
>
>
>
> Thx,
>
> Christian Ehrlicher
>
>
> _______________________________________________
> 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