[osg-users] what is better

2008-02-08 Thread Ahmed Nawar
Dear All,

What is better for performance (and/or) memory?

1- Share a sphere geometry between more than one node after transform and 
scale. 
   Or build a new sphere with the correct size and place.


Thanks,
Ahmed Nawar 
winmail.dat___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] what is better

2008-02-08 Thread Jean-Sébastien Guay
Hello Ahmed,

 What is better for performance (and/or) memory?

 1- Share a sphere geometry between more than one node after transform and 
 scale. 
Or build a new sphere with the correct size and place.
   

In general it is preferable to share geometry and use transforms if the 
objects are identical, since this will mean that the vertex data can be 
sent to the video card once and used for both objects. Transforms are 
generally not much of a performance problem since the OpenGL pipeline 
will transform all vertices anyways, so if you add a few transforms, it 
just translates into a few additional matrix multiplications, which the 
hardware is very optimized for.

Though unless your spheres are extremely tessellated (osgOQ demo anyone? 
:-) ) it won't make much difference in this simple case on modern hardware.

Hope this helps,

J-S

-- 
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org