<div dir="ltr">Hi Altin,<div>just a few remarks:</div><div><br></div><div>you wrote:</div><div>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> >Steeping through the code, It seems that uploading the image is done by applyTexImage_subload() called from within</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> >TextureRectangle::apply(state) called from a GraphicsThread. And this operation is triggered by renderingTraversals(). It just doesn't upload in</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> >time and the background rectangle drawn by this renderingTraversal() uses the previous image.</span><br style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">

That's not how it works, openGL will upload the image before using it to render. This might be slow for a big image, but the old image will not be used. You might be tricked by a tripple buffering driver, where at the next buffer swap you will see a render containing the old image.</div><div><br></div><div>2> test singlethreaded. I've seen no hint that you marked the stateset containing the imageStream texture as DYNAMIC,  so the renderingTraversal might return before the texture or uniform has been apply'ed - trusting the (default) STATIC promise. </div><div style="text-align:left"><br></div><div style="text-align:left">Regards, Laurens.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 8, 2018 at 1:48 PM, Robert Osfield <span dir="ltr"><<a href="mailto:robert.osfield@gmail.com" target="_blank">robert.osfield@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Altin,<br>
<span class=""><br>
<br>
<br>
On 8 March 2018 at 12:18, Altin Gjata <<a href="mailto:altingjataj@gmail.com">altingjataj@gmail.com</a>> wrote:<br>
> I use (the default) DrawThreadPerContext for the moment.<br>
<br>
</span>The first thing you need to try is SingleTheaded:<br>
<br>
  viewer.setThreadingModel(<wbr>osgViewer::Viewer::<wbr>SingleTheaded);<br>
<br>
I can't stress this enough, this is the biggest variable to test.  I<br>
didn't suggest you do this in my previous email for no reason.<br>
<span class=""><br>
> Steeping through the code, It seems that uploading the image is done by applyTexImage_subload() called from within TextureRectangle::apply(state) called from a GraphicsThread. And this operation is triggered by renderingTraversals(). It just doesn't upload in time and the background rectangle drawn by this renderingTraversal() uses the previous image.<br>
><br>
> Is there any way I can trigger applyTexImage_subload() sooner?<br>
<br>
</span>The subload will be happening as sooner as is necessary to properly<br>
reflect the updates to the osg::ImageStream, it's a pretty widely<br>
fleshed out part of the OSG, this won't be the problem, the problem<br>
will be elsewhere.  If the subload is not happening soon enough for<br>
you then it's because the updated dirty of the image stream isn't<br>
happening soon enough.<br>
<span class=""><br>
> Would it help if I used another camera that also uses the same ImageStream as texture and renders to a small texture, and set its rendering order before that of the camera that renders the background?<br>
<br>
</span>No. Coming up with ever more complicated solutions to a problem you<br>
don't yet understand is only going to take you further away from the<br>
solution.<br>
<br>
The key to a solution is understanding the problem.  Without actual<br>
code to look or even better test there really isn't too much we can do<br>
apart from give you general pointers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Robert.<br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<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>
</div></div></blockquote></div><br></div>