[info-performer] Inventor loader caches old transparency values

New Message Reply Date view Thread view Subject view Author view

From: Bram Stolk (bram++at++sara.nl)
Date: 06/12/2002 02:50:14


Hello,

I think there is a bug in the inventor loader that causes
non-transparent geometry to be designated as transparent.

This will result in a situation where a lot of opaque objects
are put in the transparent sorting bin. This causes visual
artefacts, as they are no longer rendered before all transparent
objects are rendered.

Both IRIX and Linux versions of performer are affected by this bug.
However, somehow our Onyx IR2 manages to cope with the incorrectly
'binned' objects a lot better than our linux machines can.

For an example .iv file, see below. It has 3 objects, with
the 2nd object being transparent.
After loading in performer, object 2+3 are designated as transparent:

Found 3 gstates
GeoState at 0x41ae8480, transp=0, textured=0
GeoState at 0x41ae8c38, transp=1, textured=0
GeoState at 0x41ae93e8, transp=1, textured=0

If I put the transparent obj last in the file, only obj3 is designated
as transparent (correct).
If I put the transparent obj first in the file, all objects are
designated as transparent (2 false positives).

I tracked it down in the sources of the iv loader, and it seems
that a line has been uncommented, which should not be uncommented.

from /usr/share/Performer/src/lib/libpfdb/libpfiv/pfiv.C:

    // Set transparency mode
    if (transparency > 0.0f)
        cbd->dummyGState->setMode(PFSTATE_TRANSPARENCY, PFTR_ON);
    // else inherit from the global default which should be PFTR_OFF
    // cbd->dummyGState->setMode(PFSTATE_TRANSPARENCY, PFTR_OFF);

I think this last line should be put back in the code.
In my tst.iv, there are Seperator codes that should avoid the inheritance
of cached transparencies.

Also note, that expicitly setting transparency of opaque objs to 0
has no effect on the bug.

#Inventor V2.0 ascii

Separator {
  Separator {
    Material {
      ambientColor 1 0 0
      diffuseColor 1 0 0
      transparency 0
    }
    Coordinate3 {
      point [ -5 10 5,
               5 10 5,
               5 0 5,
              -5 0 5 ]
    }
    IndexedFaceSet {
      coordIndex [ 0, 3, 2, 1, -1 ]
    }
  }
}

Separator {
  Separator {
    Material {
      ambientColor 0 1 0
      diffuseColor 0 1 0
      transparency 0.5
    }
    Coordinate3 {
      point [ -5 10 3,
               5 10 3,
               5 0 3,
              -5 0 3 ]
    }
    IndexedFaceSet {
      coordIndex [ 0, 3, 2, 1, -1 ]
    }
  }
}

Separator {
  Separator {
    Material {
      ambientColor 0 0 1
      diffuseColor 0 0 1
      transparency 0
    }
    Coordinate3 {
      point [ -5 10 1,
               5 10 1,
               5 0 1,
              -5 0 1 ]
    }
    IndexedFaceSet {
      coordIndex [ 0, 3, 2, 1, -1 ]
    }
  }
}

-- 
------------------------------------------------------------------------------
 Bram Stolk, VR Specialist.
 SARA Academic Computing Services Amsterdam, PO Box 94613, 1090 GP  AMSTERDAM
 email: bram++at++sara.nl   Phone +31-20-5923059  Fax +31-20-6683167

"I heard if you play the NT-4.0-CD backwards, you get a satanic message." "Thats nothing, if you play it forward, it installs NT-4.0" ------------------------------------------------------------------------------


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Jun 12 2002 - 02:50:37 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.