Hi, For the record, I have found a workaround for the issue.
To fix the problem, I did the following the RTT Camera: ss = rttCamera->getOrCreateStateSet(); osg::Viewport* vp = new osg::Viewport(0,0,textureSize,textureSize); ss->setAttributeAndModes(vp, osg::StateAttribute::OVERRIDE & osg::StateAttribute::ON); It was my understanding that this would have the same effect as just setting on the viewport on the camera. However, this works, but just setting the viewport doesn't. Cheers, Brad -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Christiansen, Brad Sent: Friday, 15 January 2010 8:55 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Viewport inheritance and RTT Hi, Thanks for your answer. In relation to your comment: > I'm still not sure why you want to use a slave? I remember something you > said about shadows, but don't understand why shadows should differ > between slave/not slave. Pre-render should work fine with just an RTT > camera placed somewhere in the graph and in this case you can set > everything manually. I am using an RTT camera placed somewhere in the graph and I am setting everything manually. As far as I can tell I am using a very simple, basic case for RTT (it doesn't actually involve shadows). This is why I am so stuck on what can be going wrong. I will modify one of the examples to match what I am doing so I can examine the issue in a very simple setup and go from there. I am really stuck on what to do to try and fix this. Thanks again for your help. Cheers, Brad -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of J.P. Delport Sent: Thursday, 14 January 2010 4:11 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Viewport inheritance and RTT Hi, Christiansen, Brad wrote: > 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. sorry, I can't answer all your questions. I don't think this goes as deep as renderstage. Have a look at View and Viewer and check the handling of slaves. Check where addSlave adds the View and then check where the list of views is used. > > 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. I'm still not sure why you want to use a slave? I remember something you said about shadows, but don't understand why shadows should differ between slave/not slave. Pre-render should work fine with just an RTT camera placed somewhere in the graph and in this case you can set everything manually. jp > > > 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.or g > -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. _______________________________________________ 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.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

