Hi Roger,

Thanks for the test files.  The problem looks to be down to merge of
the indices not offset the incoming indices, instead just merging
directly.  I haven't worked out a solution yet, but its likely to
involve some extra code in
Optimizer::MergeGeometryVisitor::mergeGeometry(.) to handle proper
merging of geometries.

As a general note I'd strongly recommend against using vertex and
normal indices.  Use indices adds a bit more flexibility to
osg::Geometry but forces the OpenGL dispatch down on to OpenGL slow
paths, and its complicates the back ends which have to deal with them.
If you want indices then OpenGL and OSG have
glDrawElements/osg::DrawElements, this keeps everything on fast paths.

Indices made it into osg::Geometry to help with backwards
compatibility, at the time (four years ago now) I was very hesitant to
sully a clean and efficient osg::Geometry, but I did it, and have
regretted ever since - its confused many users over the years, and
complicated lots of osg::Geometry code and made maintainance a real
pain.   Going forward my plan is to move all the indices code out of
osg::Geometry into a osg::GeometryWithExtraIndices. The later may also
move out of the core OSG into one of the NodeKits.  This change isn't
imminent, probably post OpenSceneGraph-1.3. so not likely to happen
this year.

Robert.



On 10/28/06, Roger James <[EMAIL PROTECTED]> wrote:




Hmmm…



    if (lhs.getVertexIndices() && rhs.getVertexIndices())

    {



        base = lhs.getVertexIndices()->getNumElements();

        merger.merge(lhs.getVertexIndices(),rhs.getVertexIndices());



    }



Looks like Robert was already thinking of this but it fell through the
cracks.



Roger


 ________________________________


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Roger James
 Sent: 29 October 2006 00:31
 To: 'osg users'
 Subject: RE: [osg-users] Problem with osg::Optimizer MERGE_GEOMETRY



Aha .. looks like the vertex indices are not being modified to reflect the
new array.



Roger




 ________________________________


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Roger James
 Sent: 28 October 2006 21:36
 To: 'osg users'
 Subject: RE: [osg-users] Problem with osg::Optimizer MERGE_GEOMETRY



Oops meant to say OSG_OPTIMIZER=OFF below not NONE.



Roger




in osgviewer with OSG_OPTIMIZER=NONE you will see that second one has some
surfaces missing.


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to