Author Topic: Object3D.setTransparency range?  (Read 907 times)

Offline Uwe Siems

  • byte
  • *
  • Posts: 5
    • View Profile
Object3D.setTransparency range?
« on: August 17, 2011, 08:25:51 pm »
What is the expected value range for Object3D.setTransparency?
I'm experiencing that objects are completely opaque at value 5 and reasonable transparent at 0. I would have expected that they are opaque at 255 and invisible at 0.

And it seems that the additional color set with setAdditionalColor is multiplied with the base color instead of added to it, so an object with a black texture will still be black, regardless of the additional color, and an object with a green texture and an additional red color will stay green. Is this intentional?


Regards,
Uwe

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Object3D.setTransparency range?
« Reply #1 on: August 18, 2011, 07:09:07 am »
The default transparency for these values is choosen in a way that hardware and software renderer create similar results for the same value. Transparency in the software renderer is much more coarse than it has to be with hardware, which is why you might want to modify the formula which calculates the actual transparency if you are using OpenGL only. Have a look here: http://www.jpct.net/doc/com/threed/jpct/Config.html#glTransparencyOffset and here: http://www.jpct.net/doc/com/threed/jpct/Config.html#glTransparencyMul