Hi Simon,

Thanks for the promising link, but I don't think I'm misusing the projection matrix. I calculate the left, right, top and bottom values and set the projection matrix via osg::Camera's setProjectionMatrixAsFrustum. The view matrix is set with setViewMatrixAsLookAt using the head-tracked position and the direction towards the screen. I'm pretty sure this is the correct way to set up head-tracked stereo. The 3D effect works, just the lighting is wrong. :-(

Cheers,
Julian.

Simon Hammett wrote:
Just a quick guess, but are you putting rotation into your left &
right projection matrices?
If so that's what's mucking up your lighting:

http://sjbaker.org/steve/omniv/projection_abuse.html

2009/7/6 Julian Looser <li...@roarmot.co.nz>:
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






_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to