Hi all -- While digging into an issue with multiple nested Camera nodes in
2.8.x, I came across this old thread in the archives and wanted to follow up, as
it appears no one ever solved the mystery. I imagine there is more up-to-date
information, or possibly even fixes on trunk? If so, please let me know.
Camera nodes have a 1-to-1 mapping with RenderStage objects, and the first thing
that happens in RenderStage::draw() is a check to ensure that the RenderStage
only draws once per frame. (This is necessary because the RenderStage is
inserted twice into the render graph: Once as a pre-render RenderStage, then
once again as a regular child of the top-level Camera.) See RenderStage.cpp line
1109 on trunk.
That's almost always what you want, except in Felix's case (see quoted text). In
his situation, he has a scene that uses osgShadow (which uses a child Camera to
implement the pre-render pass). Because a RenderStage can only draw once per
frame, there is no way to render an osgShadow scene twice per frame: once to a
texture (using an RTT Camera) and once again to some other framebuffer.
Thoughts?
-Paul
On Aug 6 2009, 8:32 am, "Felix Heide" <[email protected]> wrote:
> Hey folks,
>
> i have a problem with using theosgShadownodekit together with nestedRTT-Cams.
A scenegraph as illustrated in the following image works fine:
>
> [Image:http://img7.imageshack.us/img7/5274/sgwithoutrttcam.png]
>
> But problems arise, when i use anRTT-Cam to render this scenegraph to an FBO.
The FBO is used as a texture which is put on a simple quad-geode. The quad-geode
is then rendered by the Viewers-Camera with orthogonal projection. In fact all
this stuff is done to apply warping in the fragment shader pass. The resulting
scenegraph is illustrated in the following figure:
>
> [Image:http://img9.imageshack.us/img9/8421/sgwithrttcam.png]
>
> The results are strange shadow artifacts. The shadows move with
theRTT-Cameras viewpoint. In addition sometimes flickering in the shadows can be
noticed. Except the shadows, the whole scene is rendered as it should be.
>
> At first, i thought it would have something to do with the shadowMap's cam.
Line 192 in ShadowMap.cpp (osg 2.8.0) is
>
> Code:
> _camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT);
>
> If i understand the Reference Frame concept right, this line makes the
shadowMaps cam inherit its viewpoint from the viewers cam and not the
nestedrtt-cam, which would be the right one. So i tried to set the Referende
Frame to ABSOLUTE_RF by accessing the current camera in a cull-callback attached
to the ShadowScene node. That did not help.
>
> Hope someone has a tip for me.
>
> Cheers,
> Felix
>
> ------------------
> Read this topic online
here:http://forum.openscenegraph.org/viewtopic.php?p=15921#15921
>
> _______________________________________________
> osg-users mailing list
>
[email protected]http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph...
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org