Hi,

I'm running osgviewer (2.0 and 2.2) with the attached OSG file.

The file is composed of 4 drawables. Each drawable defines its own StateSet.
The last drawable material is:

Material {
  DataVariance UNSPECIFIED
  ColorMode OFF
  ambientColor 1 1 1 1
  diffuseColor 1 0 0 1
  specularColor 0 0 1 1
  emissionColor 0 1 0 1
  shininess 10
}

But the emissive part is not taken into account.
Curiously, the first frame is correct. The corresponding quad is yellow.
In the other frames, the quad is red.

If I remove one or more drawable, or if I change the order of the drawables
in the file, the quad is correctly rendered.


The bad image:


What it should be (I've removed the first drawable):


Please help !!!
Group {
  DataVariance UNSPECIFIED
  name "dummy:root"
  nodeMask 0xffffffff
  cullingActive TRUE
  num_children 1
  Geode {
    DataVariance UNSPECIFIED
    name "dummy:geode"
    nodeMask 0x10000
    cullingActive TRUE
    num_drawables 4
    Geometry {
      DataVariance STATIC
      name "dummy:geode:geom0"
      StateSet {
        DataVariance STATIC
        rendering_hint DEFAULT_BIN
        renderBinMode INHERIT
                  GL_LIGHTING ON
        Material {
          DataVariance UNSPECIFIED
          name "INH18L75.rgbvisible"
          ColorMode AMBIENT_AND_DIFFUSE
          ambientColor 1 1 1 1
          diffuseColor 1 1 1 1
          specularColor 0 0 0 1
          emissionColor 0 0 0 1
          shininess 0
        }
      }
      useDisplayList TRUE
      useVertexBufferObjects FALSE
      PrimitiveSets 1
      {
        DrawElementsUByte QUADS 4
        {
          0 1 2 3
        }
      }
      VertexArray Vec3Array 4
      {
        -30 -30 0
                  0 -30 0
                  0 0 0
                  -30 0 0
      }
      NormalBinding PER_VERTEX
      NormalArray Vec3Array 4
      {
        0 0 1
        0 0 1
        0 0 1
        0 0 1
      }
    }
    Geometry {
      DataVariance STATIC
      name "dummy:geode:geom1"
      StateSet {
        DataVariance STATIC
        rendering_hint DEFAULT_BIN
        renderBinMode INHERIT
                  GL_LIGHTING ON
        Material {
          DataVariance UNSPECIFIED
          name "RAIL1.rgbvisible"
          ColorMode AMBIENT_AND_DIFFUSE
          ambientColor 1 1 1 1
          diffuseColor 1 1 1 1
          specularColor 0 0 0 1
          emissionColor 0 0 0 1
          shininess 0
        }
      }
      useDisplayList TRUE
      useVertexBufferObjects FALSE
      PrimitiveSets 1
      {
        DrawElementsUByte QUADS 4
        {
          0 1 2 3
        }
      }
      VertexArray Vec3Array 4
      {
                  0 -30 0
                  30 -30 0
                  30 0 0
                  0 0 0
      }
      NormalBinding PER_VERTEX
      NormalArray Vec3Array 4
      {
        0 0 1
        0 0 1
        0 0 1
        0 0 1
      }
    }
    Geometry {
      DataVariance STATIC
      name "IMM:geode0::geom"
      StateSet {
        DataVariance STATIC
        rendering_hint DEFAULT_BIN
        renderBinMode INHERIT
        GL_LIGHTING ON
        Material {
          DataVariance UNSPECIFIED
          ColorMode OFF
          ambientColor 1 1 1 1
          diffuseColor 1 1 1 1
          specularColor 0 0 0 1
          emissionColor 0 0 0 1
          shininess 0
        }
      }
      useDisplayList TRUE
      useVertexBufferObjects FALSE
      PrimitiveSets 1
      {
        DrawArrays QUADS 0 4
      }
      VertexArray Vec3Array 4
      {
        -13.5 0 26
        -6 0 26
        -6 0 27
        -13.5 0 27
      }
      NormalBinding PER_VERTEX
      NormalArray Vec3Array 4
      {
        0 -1 0
        0 -1 0
        0 -1 0
        0 -1 0
      }
    }
    Geometry {
      DataVariance STATIC
          name "IMM:geode1:geom"
      StateSet {
        DataVariance STATIC
        rendering_hint DEFAULT_BIN
        renderBinMode INHERIT
        GL_LIGHTING ON
        Material {
          DataVariance UNSPECIFIED
          ColorMode OFF
          ambientColor 1 1 1 1
          diffuseColor 1 0 0 1
          specularColor 0 0 1 1
          emissionColor 0 1 0 1
          shininess 10
        }
      }
      useDisplayList TRUE
      useVertexBufferObjects FALSE
      PrimitiveSets 1
      {
        DrawArrays QUADS 0 4
      }
      VertexArray Vec3Array 4
      {
                  -15 -15 3
                  15 -15 3
                  15 15 3
                  -15 15 3
      }
      NormalBinding PER_VERTEX
      NormalArray Vec3Array 4
      {
        0 0 1
        0 0 1
        0 0 1
        0 0 1
      }
    }
  }
}
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to