Config.glTrilinear making transparent textures look weird

Started by zammbi, July 12, 2012, 01:42:42 AM

Previous topic - Next topic

zammbi

Just letting you know that I tried Config.glTrilinear on the galaxy S2 and it messes up transparent textures.

Without:


With:


Though I guess it might be because glTrilinear isn't ready to be used yet?

P.S: Seems texture colours is 8bit when using OpenGL 2.0 for the S2  ???

EgonOlsen

I've no influence on the result of trilinear filtering...which color depth have your textures? If it's 16bit (i.e. 4bpp), have you tried to use 32bit instead?

The mali chipsets (on which the S2 and S3 are sadly based on) are rendering pretty inaccurate in the fragment shaders...maybe that causes this effect. You might want to try to set http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#glDither to true (before creating the FrameBuffer) to see if that helps!?

zammbi

QuoteI've no influence on the result of trilinear filtering.
Ah ok. Might just leave that option then.

For the S2 it should have the highest of settings on.
I can count the colours on that texture... 7 heh.

I did have glDither on but not before the FrameBuffer. It does help.

Found that replacing:
aa = new AAConfigChooser(mGLView, true);
with:
aa = new AAConfigChooser(mGLView, false);

Improves it a little more. But still really looks 8bit.

EgonOlsen

Quote from: zammbi on July 12, 2012, 07:45:30 AM
Improves it a little more. But still really looks 8bit.
I've no idea why the addition of an alpha channel should improve accuracy in the fragment shader. But i have an idea why i think that Mali chips actually suck somehow. Anyway, you can try the following:


  • unzip the jpct_ae.jar
  • replace each of  occurrence of mediump with highp in the default shader files
  • create a new jar with the modified files
  • see if that helps

zammbi

QuoteI've no idea why the addition of an alpha channel should improve accuracy in the fragment shader.
Isn't false turning it off?

EgonOlsen

Yes, my bad...whatever...it doesn't make much sense either...