Re: [osg-users] large VBOs for multiple Drawables

2011-05-09 Thread Fred Smith
Paul Martz wrote: On 5/6/2011 4:05 AM, Fred Smith wrote: You usually want to create GL batches that are as large as possible. 10 draw calls of 100 elements will be slower than 1 draw call of 1000 elements. Something else I have noticed a little while ago was that the stateset

Re: [osg-users] large VBOs for multiple Drawables

2011-05-09 Thread Chris 'Xenon' Hanson
On 5/9/2011 5:49 AM, Fred Smith wrote: OSG is a great piece of code, don't get me wrong - but I see a weakness here. What, exactly, does that mean? -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS.

Re: [osg-users] large VBOs for multiple Drawables

2011-05-09 Thread Fred Smith
It means that there seems to be a cost in doing state changes with OSG. GL state changes do not necessarily incur any cost - this is implementation specific anyway - whereas OSG state changes seem to always incur one, as even going through empty statesets does incur a cost. Is that clear

Re: [osg-users] large VBOs for multiple Drawables

2011-05-09 Thread Robert Osfield
Hi Fred, On Mon, May 9, 2011 at 3:42 PM, Fred Smith osgfo...@tevs.eu wrote: It means that there seems to be a cost in doing state changes with OSG. Indeed there is!! It's written to be lightweight, using pointer rater than content comparisons where possible, but you can't ever disappear CPU

Re: [osg-users] large VBOs for multiple Drawables

2011-05-09 Thread Fred Smith
Hi Robert, The stateset performance issue, if ever encountered, can easily be worked around with a draw callback using applyAttribute/applyTextureAttribute prior to rendering every drawable. This is a very slim point where there might be room for improvement, and what you said perfectly makes

Re: [osg-users] large VBOs for multiple Drawables

2011-05-06 Thread Riccardo Corsi
Hi All, Paul, I think I've done some of the benchmark you're referring to on my end right before starting this thread =) In my example I replicate the same geometric primitive many times. The geometric object is a little cube counting 40 vertex and 66 triangles all rendered as a single

Re: [osg-users] large VBOs for multiple Drawables

2011-05-06 Thread Robert Osfield
Hi Ricky, Given you have 20,000 instances their will and cull and draw dispatch bottleneck. Sharing VBO's won't really share this much. The big elephant in the room is the number of seperate objects to traverse in the cull and draw traversals and the number of seperate GL calls that will have

Re: [osg-users] large VBOs for multiple Drawables

2011-05-06 Thread Riccardo Corsi
Hi Robert, thank you for your advice, but I used 20.000 only for benchmarking purposes, I'll balance better the scenegraph in the real application. Even so, with the scenario number 2, I was hoping to achieve performances closer to scenario 3 than 1, as the stats scale quite in linear way with

Re: [osg-users] large VBOs for multiple Drawables

2011-05-06 Thread Fred Smith
You usually want to create GL batches that are as large as possible. 10 draw calls of 100 elements will be slower than 1 draw call of 1000 elements. Something else I have noticed a little while ago was that the stateset processing engine of OSG might be slow. One thing I have been surprised with

Re: [osg-users] large VBOs for multiple Drawables

2011-05-06 Thread Robert Osfield
Hi Ricccardo, On Fri, May 6, 2011 at 10:53 AM, Riccardo Corsi riccardo.co...@kairos3d.it wrote: Do you think the approach you suggest, avoiding explicit buffer unbind, would provide some benefit? It's unlikely to make a big difference as it's only one small part of all the operations being

Re: [osg-users] large VBOs for multiple Drawables

2011-05-06 Thread Paul Martz
On 5/6/2011 4:05 AM, Fred Smith wrote: You usually want to create GL batches that are as large as possible. 10 draw calls of 100 elements will be slower than 1 draw call of 1000 elements. Something else I have noticed a little while ago was that the stateset processing engine of OSG might be

Re: [osg-users] large VBOs for multiple Drawables

2011-05-05 Thread Riccardo Corsi
www.reallyslick.com Message: 3 Date: Sun, 2 Jan 2011 21:28:12 -0500 From: Jason Beverage jasonbever...@gmail.com To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] large VBOs for multiple Drawables Message-ID: aanlktin2mdb

Re: [osg-users] large VBOs for multiple Drawables

2011-05-05 Thread Glenn Waldron
-users] large VBOs for multiple Drawables Message-ID: aanlktin2mdb-vewdrpkp0rwjxcok2jm4o0vdx31ao...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 Hi Terry, You can pack the verts of your small objects into a single osg::Vec3Array and share that array across multiple

Re: [osg-users] large VBOs for multiple Drawables

2011-05-05 Thread Riccardo Corsi
...@gmail.com To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] large VBOs for multiple Drawables Message-ID: aanlktin2mdb-vewdrpkp0rwjxcok2jm4o0vdx31ao...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 Hi Terry, You can pack

Re: [osg-users] large VBOs for multiple Drawables

2011-05-05 Thread Glenn Waldron
: Jason Beverage jasonbever...@gmail.com To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] large VBOs for multiple Drawables Message-ID: aanlktin2mdb-vewdrpkp0rwjxcok2jm4o0vdx31ao...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1

Re: [osg-users] large VBOs for multiple Drawables

2011-05-05 Thread Paul Martz
On 5/5/2011 9:51 AM, Glenn Waldron wrote: AFAIK, OSG doesn't maintain VBO/EBO bindings as part of its sortable state. So I believe they will be bound and unbound for each Geometry, even if they are shared. Somebody correct me if I'm wrong. (See Geometry::drawImplementation.) This is my

Re: [osg-users] large VBOs for multiple Drawables

2011-05-05 Thread Glenn Waldron
On Thu, May 5, 2011 at 12:59 PM, Paul Martz pma...@skew-matrix.com wrote: On 5/5/2011 9:51 AM, Glenn Waldron wrote: AFAIK, OSG doesn't maintain VBO/EBO bindings as part of its sortable state. So I believe they will be bound and unbound for each Geometry, even if they are shared. Somebody

Re: [osg-users] large VBOs for multiple Drawables

2011-05-05 Thread Paul Martz
On 5/5/2011 11:26 AM, Glenn Waldron wrote: On Thu, May 5, 2011 at 12:59 PM, Paul Martz pma...@skew-matrix.com mailto:pma...@skew-matrix.com wrote: On 5/5/2011 9:51 AM, Glenn Waldron wrote: AFAIK, OSG doesn't maintain VBO/EBO bindings as part of its sortable state. So I

Re: [osg-users] large VBOs for multiple Drawables

2011-05-05 Thread Robert Osfield
HI All, Current the OSG does unbind VBO's at the end of osg::Geometry::drawImplementation(..) so that VBO and EBO state doesn't leak into adjoining Drawables. If an implementation is known to only use VBO's, with no display lists then potentially we could not bother with the unbind at the end

Re: [osg-users] large VBOs for multiple Drawables

2011-01-03 Thread Terry Welsh
www.reallyslick.com Message: 3 Date: Sun, 2 Jan 2011 21:28:12 -0500 From: Jason Beverage jasonbever...@gmail.com To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] large VBOs for multiple Drawables Message-ID:        aanlktin2mdb-vewdrpkp0rwjxcok2jm4o0vdx31ao

Re: [osg-users] large VBOs for multiple Drawables

2011-01-03 Thread Jason Beverage
jasonbever...@gmail.com To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: Re: [osg-users] large VBOs for multiple Drawables Message-ID:        aanlktin2mdb-vewdrpkp0rwjxcok2jm4o0vdx31ao...@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1 Hi Terry, You can pack

Re: [osg-users] large VBOs for multiple Drawables

2011-01-02 Thread Jason Beverage
Hi Terry, You can pack the verts of your small objects into a single osg::Vec3Array and share that array across multiple osg::Geometry objects then use DrawElements for each geometry with the correct indices. I've just recently done this actually for a project I'm working on and it's worked out

[osg-users] large VBOs for multiple Drawables

2011-01-01 Thread Terry Welsh
I found some email threads that hinted at this a little, but nothing seemed very specific. I have scenes where display lists perform a bit better than VBOs. My best guess is because my objects have relatively small vertex counts (usually between 20 and 200). Is there any way in OSG to use one