Hi Alexandre, Curious. If I comment out the view->setLightingMode(osg::View::NO_LIGHT); everything works as your scene graph sets out. But with no viewer light set it doesn't work...
I suspect much of these problems come about because to get osgViewer up and running more quickly I choose to reuse a very old class used for doing basic rendering of scenes - osgUtil::SceneView, it's not really a perfect for this role so there is a little jumping out with where various settings are made. The right thing to do would be to refactor osgViewer so that it didn't use SceneView at all, but... this is not a quick job, and well beyond the scope of work before OSG-2.8. So for the time being I'll look at what's happen with a view to making it more consistent. In your own code just don't bother the setting anything in view w.r.t lighting, just set it up in your own scene graph and things should work just fine. Robert. On Wed, Jan 28, 2009 at 2:37 PM, Alexandre Amalric <[email protected]> wrote: > Hi Robert, > > Sorry I've made in mistake with attaching an erronous file, here is the file > producing the bug. > > > 2009/1/28 Alexandre Amalric <[email protected]> >> >> Hi Robert, >> >> sorry to bother you again but it seems that the fix you've merged works >> for the previous osgLight.cpp file I have sent to you but not for my >> application. >> >> So I decided to write another osgLight.cpp (attached) file wich is more >> like my application lighting setup. >> >> The bug is appearring again with passing --addslave args. >> >> Kind regards, >> >> 2009/1/28 Alexandre Amalric <[email protected]> >>> >>> Hi Robert, >>> >>> Thank you for all those explanation, it's all make sense now. You're >>> perfectly right when you say that I want manage my own lighting, that's why >>> I told the viewer to bet set up with NO_LIGHT. I'm gonna update my svn >>> version from OSG and try the fix in my own application. >>> >>> Kind regards, >>> >>> 2009/1/27 Robert Osfield <[email protected]> >>>> >>>> Hi Alexandre, >>>> >>>> On Tue, Jan 27, 2009 at 5:29 PM, Robert Osfield >>>> <[email protected]> wrote: >>>> > Now, the question for me is why adding the slave fixes things, and why >>>> > without the slave the defaults are having an effect. It looks like an >>>> > order of initialisation issue - i.e. the master camera and it's >>>> > Renderer intialize with the defaults of the HEADLIGHT which enables >>>> > the GL_LIGHTING mode by default, but the later reset of the >>>> > LightingMode to be NO_LIGHT doesn't actively change the GL_LIGHTING >>>> > mode/enable disable. I will continue to look into this, but once I >>>> > do fix it the behaviour we should see is that there will be no >>>> > lighting enabled by default if you do NO_LIGHT. >>>> >>>> I have now tracked down the inconsitency to osgUtil::SceneView not >>>> passing on changes the GL_LIGHTING mode when the LightingMode is >>>> toggled on/off. I've now fixed this and checked it into svn/trunk. >>>> >>>> This fix, will mean that in your example both with and without the >>>> slave Camera will behave the same, both won't have GL_LIGHTING mode >>>> enabled - which is exactly what you've told the viewer to do, and >>>> since the scene graph doesn't explictly enable GL_LIGHTING then this >>>> mode remains off, so no OpenGL lighting is enabled. >>>> >>>> To enable it you simple enable it manually in the scene graph, since >>>> you are managing your lighting in the scene graph then it makes >>>> perfect sense that you you be enabling the GL_LIGHTING mode for the >>>> subgraphs that require OpenGL lighting. >>>> >>>> Robert. >>>> _______________________________________________ >>>> osg-users mailing list >>>> [email protected] >>>> >>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >>> >>> >>> >>> -- >>> Alexandre AMALRIC Ingénieur R&D >>> =================================== >>> PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille >>> http://www.pixxim.fr >> >> >> >> -- >> Alexandre AMALRIC Ingénieur R&D >> =================================== >> PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille >> http://www.pixxim.fr > > > > -- > Alexandre AMALRIC Ingénieur R&D > =================================== > PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille > http://www.pixxim.fr > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

