www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: K24A3 on September 30, 2012, 04:19:54 pm

Title: setTransparency precision
Post by: K24A3 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).
Title: Re: setTransparency precision
Post by: Thomas. on September 30, 2012, 05:01:13 pm
There are two attributes for transparency. trans=offset+objTrans*mul
Code: [Select]
Config.glTransparencyMul
Config.glTransparencyOffset
Title: Re: setTransparency precision
Post by: K24A3 on September 30, 2012, 06:12:58 pm
ok thanks I'll give them a try,
Title: Re: setTransparency precision
Post by: EgonOlsen 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.
Title: Re: setTransparency precision
Post by: K24A3 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.