Hi David,

I've just reviewed your changes to PrimitiveSet and as things stand I
don't think it would be appropriate to merge them as it adds an extra
level of call nesting to all usage of PrimitiveSet when in normal
usage the number of instances will be 1 so not needed.  Your approach
basically adds a call overhead for everyone to support a very niche
usage.

I understand where you are coming from with this functionality and am
open to discussion about how you'd like to use the general feature of
primitive instancing.  For instance if the number of instances
required is something that will vary independently from the primitive
data itself then decoupling the numInstances value complete from
osg::PrimitiveSet would be appropriate. This would add extra
complexity and breaking API's though so we'd want to really have to
justify this, avoiding data duplication is nice but it if it's only a
a few MB of data then it really is rather pointless.   Could you
explain the actual usage model you have in mind that is problematic
with the existing code?  Have you done benchmarking on it?

Also any final solution if we do come up with one will have to be zero
cost for other users that don't have this niche need.

Robert.

On 17 April 2012 20:37, David Callu <[email protected]> wrote:
> Hi Robert,
>
>
> PrimitiveSet can use multiple instance but If I need to use the same
> PrimitiveSet with different number of instance,
> I have to duplicate the PrimitiveSet and potentially use many memory just
> for one integer.
>
> I submit a new function that allow user to specify how many instance to draw
> on draw call.
>
> void osg::PrimitiveSet::draw(State& state, bool useVertexBufferObjects,
> unsigned int numInstances);
>
>
> Cheers
> David
>
> _______________________________________________
> 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