<div dir="ltr"><div>Luckily I was able to quickly locate some code. Its a little different to what I described earlier because its using 2 cull callbacks (no render callback) and dummy group to update PreRenderCamera texture sizes but in general its same approach. I have cleaned it a bit from proprietary stuff. So rather treat it as an example code blurb. I did not try to compile it. But in generally this approach worked for me. I think that cull callback attached to PreRenderGroup can be replaced by some callback in main camera. But for some reason we could not do it (I do not recall why, maybe main cam had some other callbacks attached) and instead just added it in dummy group.<br></div><div><div><br></div><div>Cheers,</div><div>Wojtek Lewandowsk</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-12-23 10:43 GMT+01:00 James Turner <span dir="ltr"><<a href="mailto:zakalawe@mac.com" target="_blank">zakalawe@mac.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><br><div><span class=""><br><blockquote type="cite"><div>On 23 Dec 2017, at 09:28, Wojciech Lewandowski <<a href="mailto:w.p.lewandowski@gmail.com" target="_blank">w.p.lewandowski@gmail.com</a>> wrote:</div><br class="m_657962189165614085Apple-interchange-newline"><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">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::_<wbr>cameraRequiresSetup was the crucial ingredient to solve that problem back then.</div></div></blockquote><div><br></div></span><div>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. </div><span class=""><br><blockquote type="cite"><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">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. </div></div></blockquote></span></div><br><div>I might do that, but it can wait - thank again for your help.</div><div><br></div><div>Kind regards,</div><div>James</div><div><br></div></div><br>______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
<br></blockquote></div><br></div>