<div dir="ltr"><div><div><div>Hi Farshid,<br><br></div>Added a if call on an inner loop of the draw dispatch traversal just for the purpose of niche debugging isn't something I feel is justifying as there will be CPU cost for everyone, even though very few people will use that feature.<br><br></div>This type of customization would be better done via a custom RenderBin that overrides the RenderBin::drawImplementation(..); This way only those who need this customization would pay the extra cost of it.<br><br></div>Robert.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 26 May 2015 at 18:24, Farshid Lashkari <span dir="ltr"><<a href="mailto:flashk@gmail.com" target="_blank">flashk@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">Hi Robert,<div><br></div><div>I've run into the situation multiple times where having a global draw callback would have been very convenient. It's mostly been for debugging scenarios, but I can also see other situations where being able to globally augment draw calls would also be useful.</div><div><br></div><div>What are your thoughts on having a global draw callback part of the osg::State object? It doesn't seem like much code would need to be changed, and the performance impact should be minimal. </div><div><br></div><div>Essentially, osgUtil::RenderLeaf would be modified to call:</div><div><br></div><div>state.draw(_drawable, renderInfo);</div><div><br></div><div>And osg::State::draw would look like:</div><div><br></div><div>if(_drawCallback.valid()) _drawCallback->draw(_drawable, renderInfo);</div><div>else _drawable->draw(renderInfo);</div><div><br></div><div>Does this seem like a reasonable feature to add? I can work on a patch if you feel it's appropriate.</div><div><br></div><div>Cheers,</div><div>Farshid</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" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br></div>