[osg-users] Global draw callback

Farshid Lashkari flashk at gmail.com
Tue May 26 15:16:03 PDT 2015


Hi Robert,

I understand not wanting to add extra overhead. I'll look into the custom
RenderBin approach. Also, I noticed the "RenderLeaf::render" method is
virtual, but I don't see any way to provide a custom RenderLeaf class. The
creation seems to be hard-coded within CullVisitor. Was this class
originally designed to allow custom implementations?

Cheers,
Farshid


On Tue, May 26, 2015 at 10:29 AM, Robert Osfield <robert.osfield at gmail.com>
wrote:

> Hi Farshid,
>
> 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.
>
> 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.
>
> Robert.
>
> On 26 May 2015 at 18:24, Farshid Lashkari <flashk at gmail.com> wrote:
>
>> Hi Robert,
>>
>> 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.
>>
>> 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.
>>
>> Essentially, osgUtil::RenderLeaf would be modified to call:
>>
>> state.draw(_drawable, renderInfo);
>>
>> And osg::State::draw would look like:
>>
>> if(_drawCallback.valid()) _drawCallback->draw(_drawable, renderInfo);
>> else _drawable->draw(renderInfo);
>>
>> Does this seem like a reasonable feature to add? I can work on a patch if
>> you feel it's appropriate.
>>
>> Cheers,
>> Farshid
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150526/6361f773/attachment-0003.htm>


More information about the osg-users mailing list