Hi Julian,
Have you tried using osg::LightModel to turn on
GL_LIGHT_MODEL_LOCAL_VIEWER?  It's often necessary in multi-wall setups....
--
Terry Welsh  /  mogumbo 'at' gmail.com
www.reallyslick.com  /  www.mogumbo.com



>
> Message: 3
> Date: Mon, 06 Jul 2009 16:28:10 +1200
> From: Julian Looser <li...@roarmot.co.nz>
> Subject: [osg-users] Consistent lighting across different cameras
> To: OpenSceneGraph Users <osg-users@lists.openscenegraph.org>
> Message-ID: <4a517d5a.5060...@roarmot.co.nz>
> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>
> Hi,
>
> I am using OSG in a multi-wall stereo rendering environment. We have
> three walls, and we render both a left and right eye view for each wall.
> To do this, in my application I create six osg::Cameras and update their
> projection and view matrices each frame based on head-tracking. I add
> the same subgraph under each camera, and I get a seamless 3D scene
> across the three walls. So far so good.
>
> My problem is with lighting. Although the 3D geometry is rendered in the
> right place, it isn't lit correctly. For example, sometimes the left
> view might be much brighter than the center view, which in turn is
> brighter than the right view. This has me confused because all six
> cameras are rendering the exact same scene, and the light is part of the
> scene (rather than a head-light of the viewer for example).
>
> My scene graph is set up basically like this (just showing three rather
> than six cameras). The cameras all share the same child subgraph, and
> just render to viewports next to each other across a window.
>
> root
> -- camera (mv & proj for left wall)
>  --- model
>  --- lightsource
> -- camera (mv & proj for center wall)
>  --- model
>  --- lightsource
> -- camera (mv & proj for right wall)
>  --- model
>  --- lightsource
>
> I've attached a picture of the effect I'm getting. What I expected would
> be that the object (just a long red box) would be smoothly lit along its
> length. However, when it spans across my three views, you can see it's
> darker or lighter in each view, suggesting that the lightsource isn't in
> the same place within each rendering.
>
> Am I putting my lightsource in the wrong place in the scene graph? I
> thought it should be a sibling to what you want lit? Even though the
> projection and view matrices are different for each camera, the lighting
> should be consistent, right?
>
> I'm using a composite viewer, and each view I create I've set the
> lighting mode to NO_LIGHT, so I don't think it's a default light causing
> any trouble. The only light should be the one in my scene.
>
> If you have any ideas why this is happening I would really appreciate
> hearing them! :-)
> Thanks,
> Julian.
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to