Christian Sam wrote on Wednesday, May 13, 2009 3:19 PM: >>> according to documentation: "Fast paths use vertex arrays, and >>> glDrawArrays/glDrawElements." >>> >> >> Which documentation? > > - sorry, i meant "according to (doxygen) reference" > (http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs /a00267.html#fe139bb2f71cbafc1a8fc9e707ca5397) >
Thanks, it's good to know where you're starting from :) >>> 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); >>> >> >> 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. >> > > > - as far as i have understood "osg::Geometry::drawImplementation()": > regardless of what a indexed array is indexing (vertex, color, normals, etc.) > it will drop me into slow path mode. > but does type glDrawElements also falls under this rule - they are indexed > too? but according to reference: "Fast paths use vertex arrays, and > DrawArrays/glDrawElements." glDrawElements does not fall under this rule; it specifies the indices in the PrimitiveSet, you only fall into the slow path when you use an index array. > - whats the difference between BIND_PER_PRIMITIVE_SET and > BIND_PER_PRIMITIVE? in the tutorials these types are never used, but i assume > if i have a geometry consisting of 4 quads, i could define a colorarray with > 4 entries and bind them with BIND_PER_PRIMITIVE_SET, so the vertices of > quad_1 get color_1, quad_2's vertices color_2, and so on, meaning every quad > gets its own color. BIND_PER_PRIMITIVE_SET lets you set the color per PrimitiveSet (so if you have 2 PrimitiveSets added to the Geometry, you can specify a color for each); BIND_PER_PRIMITIVE lets you change the color of each primitive in each PrimitiveSet (so, for each quad). Both require using the slow path. I think it's a good thing the examples and tutorials don't use these; we want to encourage people to use the fast path! HTH, -- Bryan Thrall FlightSafety International bryan.thr...@flightsafety.com _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org