I have now started looking into what changes would be required to
osg::Geometry and have decided to make a copy of Geometry called
GoemetryNew and cut this down to see how easy it will be clean this
class up and what the knock on effects might be.  Now I have dived in
and begun the process one what is clear is just how much the
implementation of Geometry.cpp was complicated by the support for
indices - the size of GeometryNew.cpp text file is now 1982 bytes vs
2763 for the old Geometry.cpp.  Getting rid of indices will reduce
footprint and also will make the code faster as they will be less
checks to see if indices are there and need something special doing
for them.

Another element that jumps out as out of step with modern OpenGL is
support for PER_PRIMITIVE binding of arrays - this still forces OpenGL
slow paths and again complicates the code.  I believe that
osg::Geometry really should just support fast paths so as part of the
cleanup it would reasonable to drop this from GeometryNew.cpp as well.
 I will tackle the indices first though.

My current action plan is to get GeometryNew.cpp to build and run with
the osggeometry example, then look for feedback from the community.
If things look viable then the next step will be rename
GeometryNew.cpp to Geometry.cpp and renamed the existing Geometry.cpp
to GeometryDeprecated.cpp.  This step will require some games on the
serialization front to return backwards compatibility.

Another area of change would be looking at Geometry::ArrayData - this
currently contains array, indices, binding and normalize variables. My
first step is to simply remove indices, but I'm thinking that binding
and normalize might both be suitable for moving into osg::Array and
for ArrayData to be removed entirely.

Thoughts?
Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to