Hi, Chris

If its doable try to break mesh to fit into ushorts indices. You can even try 
using triangle list without indexes(if generated indexees are not make use of 
vertex cache or there are duplicate vertices etc.). Also you can try normalized 
shorts instead of floats for texture coords if precision allows this. I'm not 
sure that vbo's make any difference if you change geometry each frame, ofc 
they'll help if you render your stuff with multiple passes though.

Cheers,
Sergey.

20.03.2011, 06:05, "Chris 'Xenon' Hanson" <xe...@alphapixel.com>:
>   In my work with Kinect, one of the tasks is to cram a LOT of dynamic 
> geometry (and
> sometimes texture) down through OSG onto the display. This can be a point 
> cloud or a
> polygonal mesh.
>
>   Ignoring the complexity of assembling a reasonable mesh, once I have the 
> mesh, I want to
> get it onscreen as efficiently as possible.
>
>   I wanted to post this here, to ask -- Am I doing everything right? Are 
> there any other
> tricks I should be employing to make this run more efficiently?
>
>   In the case of displaying a polygonal mesh, I'm using a single Geode, with 
> a Geometry as
> its child. The Geometry has a vertex array (osg::Vec3Array) and a per-vertex 
> texcoord
> array (osg::Vec2Array) as well as BIND_OVERALL color and normal (we don't use 
> lighting
> with the pre-lit video texture). For the primitiveset I have a
> DrawElementsUIntPrimitiveType (because I could have 307200 verts, more than 
> 64k).
>
>   On the first frame, I allocate all of these. On subsequent frames I clear() 
> (but do not
> force deallocation of) and dirty() the vertices and texcoord arrays. I also 
> clear() the
> DrawElementsUInt, and dirty() the primitiveset.
>
>   Finally, I load the current frame's vertices, texcoords and primitive 
> indices into the
> arrays.
>
>   Anything I should do differently here? I saw some OLD discussion of 
> VertexBufferObject
> profile = DYNAMIC_DRAW, but the only mention of it with regard to OSG seemed 
> to be someone
> saying they couldn't find a way to employ it:
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg00485.html
>
>   And I couldn't find GL_DYNAMIC_DRAW_ARB mentioned in the OSG VBO source.
>
> --
> Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
> http://www.alphapixel.com/
>  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
> Contracting.
>    "There is no Truth. There is only Perception. To Perceive is to Exist." - 
> Xen
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to