Hi Aurelien, On 3 June 2013 11:10, Aurelien Albert <[email protected]> wrote: > I had his example to implement : > > - 100 instances to draw, with 100 different instances data stored into a > VertexAttrib using VertexAttribDivisor. > - "normal" draw => ok > - "odd/even" draw => here I need to draw each odd instance in red, each even > instance in green > => I'm still using the same data array, but with a glVertexAttribDivisor of > 2, and I use 2 drawables : > first with "red" shader and 0 offset > second with "green" shader and 1 instance offset > > I know this is a very special case, and I can live by handling this by myself > using draw callbacks
Playing such reuse games sound like a recipe for running out of array bounds by accident for one of the usages. Avoiding such issue really does require a level of mental dexterity to understand and keeping understanding throughout the lifecycle of the application and by all those who might review/modifying it. Sometimes being "clever" like this isn't clever overall. >> It probably is time for a general discussion on osg-users about this topic. > > > I think so. For the moment, I see instancing as an "openGL trick" and "user > should exactly know the consequences to use it". Instancing is still pretty new, but we've been using vertex shaders for a long time now and still the OSG has rather cludged over it - the bounding volume issue is one big cludge that we really need to sort out. Robert. _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
