Hi, Just 'resubmitting' my issue with a more simple question to see if anyone has any ideas.
What are the rules with viewport inheritance? - My understanding is: If a camera has a viewport set, this is used when rendering the cameras sub-graph. If it is not set, it uses the parent cameras viewport. - What I am seeing: My pre-render camera (rendering to a texture) has a viewport set but its sub-graph is being rendered using its parent cameras viewport. I have double checked that the viewport is set during the cull traversal. The pre-render cameras viewport is placed on the stack, and set on the RenderStage used to render the camera, yet it is still rendered using the parents viewport. - My question/s: What could cause this to occur? i.e. when is a local viewport ignored and 'overridden' by a parents viewport. What should I look at to debug this? I am not sure what to check after seeing the Renderstage apparently setup correctly. I am completely stumped now and this is proving a bit of a show-stopper for me. Any suggestions on what to look at would be greatly appreciated. Cheers, Brad -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Christiansen, Brad Sent: Tuesday, 12 January 2010 10:59 AM To: OpenSceneGraph Users Subject: [osg-users] Viewport inheritance and RTT Hi, I have a scene setup with a texture attached to a camera which is setup for pre-rendering. In my scene I set the viewport for the RTT camera to the dimensions of the texture. Despite having done this, the viewport for the RTT camera is being inherited from the main scenes camera, i.e. if the viewport of the main camera is (0,0,8000,600) then only this section of the texture is rendered, despite the viewport for the rtt camera being (0,0,1024,1024). I have stepped through the CullVistor with a debugger and have found that the viewport does seem to be setup correctly by the cull visitor. By the time I get to this section of the CullVisitor: switch(camera.getRenderOrder()) { case osg::Camera::PRE_RENDER: //In the following line the viewport for the camera and the rtts is correct getCurrentRenderBin()->getStage()->addPreRenderStage(rtts.get(),camera.g etRenderOrderNum()); break; default: getCurrentRenderBin()->getStage()->addPostRenderStage(rtts.get(),camera. getRenderOrderNum()); break; } the viewport seems to have been setup correctly. Both the rtts's viewport and the cameras viewport is (0,0,1024,1024), but when it is rendered this is not the viewport that is used. I am not quite sure where to go from here. Does anyone have any suggestions on what I may have done wrong or what area I should debug next? I am using version 2.9.5 of OSG. Cheers, Brad DISCLAIMER:------------------------------------------------------------- -------------- This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. ------------------------------------------------------------------------ -------------- _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g DISCLAIMER:--------------------------------------------------------------------------- This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. -------------------------------------------------------------------------------------- _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

