Hi Robert,

I'm sorry If my explanation wasn't clear enough but it seems to be to be a
serious issue so I will take more time to make myself clear.

In the file osgLight.cpp previously attached there is a piece of code in
main function at line 397 to 400 :

    ///////////////////////////////////////////
    // SLAVE CAM REMOVE LIGHT
    osg::ref_ptr<osg::Camera> camera = new osg::Camera;
    camera->setGraphicsContext(view->getCamera()->getGraphicsContext());
    camera->setViewport(new osg::Viewport(0, 0 , traits->width/2,
traits->height/2));
    view->addSlave(camera.get(), osg::Matrixd(), osg::Matrixd());
    ///////////////////////////////////////////

If you launch this sample file by this piece of code the scene is well
lighted, but if you try to launch the same file without commenting those
lines, the scene isn't well lighted.

It seems to me that when we add a slave camera to an osg::View the lighting
from the scene is corrupt.

I hope I was clear enough.

Kind regards,

2009/1/26 Robert Osfield <[email protected]>

> HI Alexandre,
>
> I can't find the code you are referring to in the osglight.cpp you
> provided.
>
> I'm afraid I really don't understand what you are trying to achieve,
> and what is happening that is wrong.  Given this there is nothing I
> can do till you provide a clear example code and a better explanation.
>
> Robert.
>
> On Mon, Jan 26, 2009 at 8:29 AM, Alexandre Amalric
> <[email protected]> wrote:
> > Hi osg-users,
> >
> > I recently have found something weird about adding slave camera to
> > osgViewer::View when managing my own lightning.
> >
> > I'm using OSG SVN version.
> >
> > I derived osgLight example to show you my problem, please compile
> attached
> > code with uncommenting following lines :
> > // Adding slave camera, uncomment to show bug !!
> > and you'll see that lighting has disappear...
> >
> > when you remove comments scene isn't lighted has expected because of
> adding
> > slave camera...
> >
> > Kind regards,
> >
> > --
> > 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
>



-- 
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

Reply via email to