<div dir="ltr"><div><div>Hi Ricky,<br><br></div>This type of behaviour can be difficult to diagnose when you have all the data and software in front of you, when you only have reports from a 3rd party it's unfortunately next to impossible to diagnose.<br><br></div><div>Since I can't determine the problem there isn't anything I can suggest. If you can reproduce the problem in an OSG example that you can share then there is chance then that others can pitch in and see if they can spot the cause of the problem and what to do about it.<br></div><div><br></div>Robert.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 18 November 2015 at 17:46, Riccardo Corsi <span dir="ltr"><<a href="mailto:riccardo.corsi@kairos3d.it" target="_blank">riccardo.corsi@kairos3d.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Hi Robert,</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">with "flickering" I mean that the labels of my custom stats lines are always showing, </div><div class="gmail_default" style="font-family:tahoma,sans-serif">while the numeric value besides them disappear in some frames.</div><div class="gmail_default" style="font-family:tahoma,sans-serif">They apparently disappear under the conditions explained in my previous email.</div><div class="gmail_default" style="font-family:tahoma,sans-serif">This is true only for my custom stats, and not the default one updated by osg.</div><div class="gmail_default" style="font-family:tahoma,sans-serif">(with vsync disabled things improve, but sometimes the issue is still visible).</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">I might try to reproduce the issue with a heavy enough osg model loaded in the osguserstats example.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">As for the draw, disabling the vsync dramatically reduces the draw time shown in the stats.</div><div class="gmail_default" style="font-family:tahoma,sans-serif">Should I live with this blocking behavior when vsync is on?<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">The only drawback is a "fake" (and misleading) stats or there are real performance penalties?<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Thanks,</div><div class="gmail_default" style="font-family:tahoma,sans-serif">Ricky</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 18, 2015 at 6:28 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"><div dir="ltr"><div><div><div>Hi Ricky,<br><br></div>When you mean flickering, could it simply be that the frame timing stats is jumping between two extremes on alternate frames.<br><br></div>In certain circumstances the driver can block and draw dispatch times can suddenly go up massively even though that actual system shouldn't be overloaded. In the example you show this is happening. It could possibly be something else on the OSG side that is blocking. <br><br></div><div>As a sanity test try disabling vsync as this can change the behaviour of the driver w.r.t blocking.<span><font color="#888888"><br></font></span></div><span><font color="#888888"><div><br></div>Robert.<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 18 November 2015 at 16:20, Riccardo Corsi <span dir="ltr"><<a href="mailto:riccardo.corsi@kairos3d.it" target="_blank">riccardo.corsi@kairos3d.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Hi Robert,</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">yes for the flickering I refer to the stats on screen.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Here's what I've noticed:</div><div class="gmail_default" style="font-family:tahoma,sans-serif">- I place my stats update between event and update traversal</div><div class="gmail_default" style="font-family:tahoma,sans-serif">- the flickering appears when I use threading models other than singleThreaded (typically the default DrawThreadPerContext one) </div><div class="gmail_default" style="font-family:tahoma,sans-serif">AND the cull+draw time hits the frame duration time (around 16ms at 60Hz). </div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Like if the onscreen stats were "dropping" when the application doesn't keep 60Hz.</div><div class="gmail_default" style="font-family:tahoma,sans-serif">I don't tweak the render code in any way, just a regular osg loop with some custom code in between osg calls.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Side note: </div><div class="gmail_default" style="font-family:tahoma,sans-serif">the draw time shown in the stats almost always fills up the frame time when using threading scheme other than SingleThreaded,</div><div class="gmail_default" style="font-family:tahoma,sans-serif">even if the drawing thread has little to do.</div><div class="gmail_default" style="font-family:tahoma,sans-serif">SingleThreaded scheme does not suffer the same issue (see attached screenshot, simple osgviewer).</div><div class="gmail_default" style="font-family:tahoma,sans-serif">I presume this is due to OS + driver combination, <br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">I'm on Win7 64bits + nVidia 970 GTX.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Thank you,</div><div class="gmail_default" style="font-family:tahoma,sans-serif">Ricky</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Wed, Nov 18, 2015 at 4:46 PM, Robert Osfield <span dir="ltr"><<a href="mailto:robert.osfield@gmail.com" target="_blank">robert.osfield@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><span>On 18 November 2015 at 15:14, Riccardo Corsi <span dir="ltr"><<a href="mailto:riccardo.corsi@kairos3d.it" target="_blank">riccardo.corsi@kairos3d.it</a>></span> wrote:<br></span><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:tahoma,sans-serif">Hi all,</div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">in my project I'm using some custom statistics as in the osguserstats.cpp example. </div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">In the example, user stats are updated every frame between advance() and eventTraversal().</div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">In my case, I was trying to update my stats between eventTRaversal() and updateTraversal(), where I already execute some other code.</div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">But by doing so, stats do not always show up correctly - sometimes they "flicker" and do not show. </div><div style="font-family:tahoma,sans-serif">Is the one used in the example the only one safe place to update user stats?</div></div></blockquote><div><br></div></span><div>The osg::Stats object that is used for recording stats uses a mutex internally to make sure that setting and getting stats is thread safe. osg::Stats itself is just a container object though it doesn't do any rendering so itself can't "flicker".<br><br></div><div>When you say flicker I presume we are talking about onscreen stats. I haven't seen reports of them flickering before. Perhaps your usage model trips up the rendering code in some way. What threading model are you running the viewer with? Can you modify an OSG example to reproduce the issue?<span><font color="#888888"><br><br></font></span></div><span><font color="#888888"><div>Robert.<br></div><div> </div><div><br> </div></font></span></div></div></div>
<br></div></div>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br></div>