Christian Sam wrote on Wednesday, May 13, 2009 6:44 AM:
> according to documentation: "Fast paths use vertex arrays, and
> glDrawArrays/glDrawElements." 

Which documentation?

> - what is the difference between vertex arrays and glDrawArrays, or is
it
> meant as generic term for glDrawArrays/glDrawElements? 

Usually "vertex arrays" means using glVertexPointer() instead of a
series of glVertexf().

> will the use of something like this drop me into slow path mode?
> 
> 
> Code:
> 
> osg::TemplateIndexArray |unsigned int, osg::Array::UIntArrayType,4,4|
> *colorIndexArray; 
> colorIndexArray = new osg::TemplateIndexArray |unsigned int,
> osg::Array::UIntArrayType,4,4|; 
> colorIndexArray->push_back(0); // vertex 0 assigned color array
element 0
> ...

Using index arrays will drop you into slow path mode, as will binding
any of your data arrays PER_PRIMITIVE. See
osg::Geometry::drawImplementation() for the exact conditions.

> if not, i'm looking for a way to assign normals to vertices per
indexed
> array, like the colorindexarray above. does this work in the same way?

> 
> 
> Code:
> 
> osg::TemplateIndexArray |unsigned int, osg::Array::UIntArrayType,3,4|
> *normalsIndexArray; 
> normalsIndexArray = new osg::TemplateIndexArray|unsigned int,
> osg::Array::UIntArrayType,3,4|; 
> normalsIndexArray->push_back(0); // vertex 0 assigned normals array
element 0
> ...

It's most likely faster (because you'll be avoiding the slow path) to
copy your vertices and normals so you can bind the normals PER_VERTEX,
even though you'll get duplicates in the array. There was a thread on
the mailing list about how to do this recently; I suggest you search the
archives for it.

HTH,
-- 
Bryan Thrall
FlightSafety International
[email protected]
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to