Author Topic: setTransparency precision  (Read 2869 times)

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
setTransparency precision
« on: September 30, 2012, 04:19:54 pm »
Object3D.setTransparency(int trans) only seems to work from 0 to 15, anything over 15 defaults to the transparency of 15.

The difference between each level is quite a big jump. I need a smooth transition of a textured plane.

Is there a way to vary the transparency to 256 levels or a floating point value?
Can we add a new function that takes a float from 0.0 to 1.0? i.e. Object3D.setTransparency(float fTrans);

ps. The image already has alpha so I'm using the alpha flag when creating the texture (boolean useAlpha).

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: setTransparency precision
« Reply #1 on: September 30, 2012, 05:01:13 pm »
There are two attributes for transparency. trans=offset+objTrans*mul
Code: [Select]
Config.glTransparencyMul
Config.glTransparencyOffset

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
Re: setTransparency precision
« Reply #2 on: September 30, 2012, 06:12:58 pm »
ok thanks I'll give them a try,

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: setTransparency precision
« Reply #3 on: September 30, 2012, 10:29:26 pm »
A little background on this: The default setting isn't that way because i thought that it's particularly great that way but because the desktop version uses the same settings. And the reason for this is the software renderer. It has less precision in transparency and the hardware renderer reflects this by default. And because the Android version should be compatible to the desktop version as much as possible, this default setting hasn't changed.

Offline K24A3

  • long
  • ***
  • Posts: 231
    • View Profile
Re: setTransparency precision
« Reply #4 on: October 05, 2012, 02:32:23 pm »
ok thanks guys. Setting both values to 0.0039f seems to do the trick giving me 256 levels.