Thanks for the rework of the code. This is a joint effort now! :-)

Especially thanks for placing the extension support check in State. I
disliked having it in the draw() method, but wasn't sure where it should go.

I'm updating and building now. I'll let you know if I find any issues.

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Robert Osfield
Sent: Tuesday, January 06, 2009 8:19 AM
To: OpenSceneGraph Submissions
Subject: Re: [osg-submissions] Support for draw_instanced

Hi Paul,

On Tue, Jan 6, 2009 at 3:01 PM, Paul Martz <[email protected]> wrote:
> Interesting. The example should probably display an error and exit if 
> it can't find the file. After I update and get your merge, I'll make 
> this change. Anyhow, glad it runs for you.

On merging your changes and do testing I've also reflected on the
implementation, and feel that integrating num instances support directly
into the base PrimitiveSet base class and adding support for draw instanced
GL into the DrawArrays*, DrawElements* class would be the neatest approach.
I've gone ahead an implemented this, as well as support for the NumInstances
member variable into the .osg and .ive formats that is backwards compatible.

With my changes I've also moved the extension set and calling into
osg::State, this means the extensions are set up per graphics context rather
than per object as in your implementation, something that should avoid
issues with using multiple graphics contexts under Windows as the function
pointers can be different per context.

I've changed your example to work with the the original class names - its
just a straight renamed from DrawArrayInstanced to DrawArrays in one line in
your code.  I also added a writeNodeFile to test out the writing & reading
of .osg and .ive files, this is commented out right now as it's there only
to test.  It's a really nice little example BTW, especially cool that it
serialises in and out so easily so you can run the demo in a standard OSG
app like osgviewer.

All these changes are now checked into SVN.  Could you test them out?

One thing I haven't implemented is high level reporting of lack of support
for this extension - all I've done is implement a fallback to glDrawArrays
etc without error reporting.  Given this is a fine grained operation it's
not ideal to go adding lots of reporting code in their.  Ideally we'd have a
formal high level mechansim for reporting on the required extensions for a
specific scene graph vs what is supported by the various graphics contexts.
This is something for a osg-users discussion for future rev's of the OSG.

Many thanks for the effort on this extension, I had assumed that support
would be more awkward than you've shown it to be.  Knowledge is King!
Sharing Knowledge is a great Virtue! ;-)

Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.
org

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to