Thanks for your time on this, I do appreciate it.

Robert Osfield wrote:
From the sounds of it your have uncovered two unrelated bugs in
Optimizer and it'd be appropriate to fix both.  With a quick read
through your email I can't pinpoint what code is amiss and what to

I agree, probably two issues.

mix. Would it be possible to create a non proprietary dataset that
reproduces this problem?

Yes, I got it down to a small non-proprietary example. The attached scene graph renders a 4-vertex tri strip. The Geometry is parented to a static MatrixTransform that is instanced twice. The result: two tri strips should be rendered.

To see correct behavior, try this:
  export OSG_OPTIMIZER=OFF
  osgviewer test.osg

and bring up stats, you'll see 1 Drawable instanced twice, and 4 vertices for a total of 8 instanced vertices. This is all correct behavior.

To reproduce just the FLATTEN_STATIC_TRANSFORMS issue, try this.
  export OSG_OPTIMIZER=FLATTEN_STATIC_TRANSFORMS
  osgviewer test.osg

Again, bring up stats and see that the number of instanced Drawables and vertices has doubled. Close examination of a converted file will show that the Drawable has been added as a child twice to the same parent. This should be fixed, but I haven't tracked it down root cause yet.

Finally, to reproduce the MERGE_GEODES crash, try this:
  export OSG_OPTIMIZER=FLATTEN_STATIC_TRANSFORMS|MERGE_GEODES
  osgviewer test.osg

mergeGeodes() crashes when it encounters the same Geode added as a child twice to the same parent. This is a separate issue from the FST issue and should have its own fix, for robustness' sake.

I'll keep digging on FLATTEN_STATIC_TRANSFORMS to see if I can identify the code that is going awry.

Thanks again,
   -Paul


  Group {
    nodeMask 0xffffffff
    cullingActive TRUE
    num_children 2
    MatrixTransform {
      DataVariance STATIC
      nodeMask 0xffffffff
      cullingActive TRUE
      referenceFrame RELATIVE
      Matrix {
        10 0 0 0
        0 10 0 0
        0 0 10 0
        -3.73685 0 0.52 1
      }
      num_children 1
      MatrixTransform {
        UniqueID MatrixTransform_30
        DataVariance STATIC
        nodeMask 0xffffffff
        cullingActive TRUE
        referenceFrame RELATIVE
        Matrix {
          0.1 0 0 0
          0 0.1 0 0
          0 0 0.1 0
          0 0 0 1
        }
        num_children 1
        Geode {
          name "body #2"
          nodeMask 0xffffffff
          cullingActive TRUE
          num_drawables 1
          Geometry {
            DataVariance STATIC
            useDisplayList TRUE
            useVertexBufferObjects FALSE
            PrimitiveSets 1
            {
              DrawElementsUShort TRIANGLE_STRIP 4
              {
                0 1 2 3
              }
            }
            VertexArray Vec3Array 4
            {
              0 0 0
              1 0 0
              0 0 1
              1 0 1
            }
            ColorBinding OVERALL
            ColorArray Vec4Array 1
            {
              1 1 1 1
            }
          }
        }
      }
    }
    Use MatrixTransform_30
  }
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to