> > > On 2 April 2012 14:21, Frederic Bouvier <[email protected]> wrote: > > >> may I ask how a camera can inherit the viewpoint of a sister (slave) > > >> camera ? > > >> Or does it inherit the viewpoint of the master camera ? > > > > > >The OSG inherits state/settings from parents, there isn't any sibling > > >inheritance. > > > > One more thing: it happens that I implement cascaded shadow map with a > > single > > shadow map and 4 cascades. My scenegraph is like this : > > > > master camera > > => slave shadow camera (hold an fbo on a S x S depth texture) > > => cascade1 : child camera, viewport (S/2 x S/2 @ 0, 0) > > => cascade2 : child camera, viewport (S/2 x S/2 @ 0, S/2) > > => cascade3 : child camera, viewport (S/2 x S/2 @ S/2, 0) > > => cascade4 : child camera, viewport (S/2 x S/2 @ S/2, S/2) > > > > I want to know if the inherited viewpoint is propagated to the cascade > > camera > > if I set the reference frame of the main shadow camera and the 4 cascades > > to > > ABSOLUTE_RF_INHERIT_VIEWPOINT > > to complement the question, I am asking myself if the code in > SceneView::cullStage > line 972 of SceneView.cpp (v3.0.1) that reads : > > cullVisitor->pushModelViewMatrix(mv.get(),osg::Transform::ABSOLUTE_RF); > > is right. It seems to ignore the reference frame settings of the slave camera > and > assume ABSOLUTE_RF. Should I manually set the viewpoint of my main shadow > camera ? > and how ?
to end my jabber, and for the record, I fixed my issue by setting the reference frame of the main shadow camera to ABSOLUTE_RF and a dummy view matrix where the eye point is at viewer's position. This view matrix is updated every frame. Cascade cameras use ABSOLUTE_RF_INHERIT_VIEWPOINT reference frame. Initially my cascade was not drawn because the frustum culling on the main camera was in the way, so instead of setting a projection volume that enclose the 4 volumes of its child, I disable culling with setCullingMode(NO_CULLING) Hope that can help Regards, -Fred _______________________________________________ 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 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

