[osg-users] Resizing an FBO camera with OSG 3.2.0

James Turner zakalawe at mac.com
Sat Dec 23 01:43:46 PST 2017

> On 23 Dec 2017, at 09:28, Wojciech Lewandowski <w.p.lewandowski at gmail.com> wrote:
> Unfortunately I could not dig out the code I had to solve this problem. But I did fight with it on couple occasions. I do remember that often the solution I adopted had to use 2 callbacks (cull/update callback + prerender/render/or postrender callbace). One update/cull callback was needed to resize textures (they were tied to main window resolution) and second callback to invoke FBO update setup for new sizes. Somehow it was impossible to do that in one shot (probably because I could not access proper RenderStage in cull/update callback). That second callback had to be a camera PreRender or (some earlier render order camera PostRender or some other earlier render order drawable DrawCalback). Role of that second callback was to obtain proper RenderStage for FBO camera and set its _cameraRequiresSetup flag.   Once _cameraRequiresSetup flag was set to true, next rendering traversal was doing the rest. Really setting RenderStage::_cameraRequiresSetup was the crucial ingredient to solve that problem back then.

Thanks, that’s a big help. I was already aware that getting ‘_cameraRequiresSetup’ flag set was the critical piece - thst’s actually why I was trying detach() + attach() since that *should* set _cameraRequiresSetup to true. But your point about getting the correct RenderStage makes a lot of sense, and might explain the strange things I see indeed. 

> PS. If you are still fighting with it, but may wait till January, send me a private email and I will dig out the code. Unfortunately I cannot do it right away (I am swamped in December) but may be have more time to scan through my backups and find it in January. 

I might do that, but it can wait - thank again for your help.

Kind regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20171223/752253d4/attachment.html>

More information about the osg-users mailing list