Author Topic: Config.glTrilinear making transparent textures look weird  (Read 3815 times)

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Config.glTrilinear making transparent textures look weird
« on: July 12, 2012, 01:42:42 am »
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  ???
« Last Edit: July 12, 2012, 01:47:49 am by zammbi »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Config.glTrilinear making transparent textures look weird
« Reply #1 on: July 12, 2012, 07:15:08 am »
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!?

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Config.glTrilinear making transparent textures look weird
« Reply #2 on: July 12, 2012, 07:45:30 am »
Quote
I'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:
Code: [Select]
aa = new AAConfigChooser(mGLView, true);with:
Code: [Select]
aa = new AAConfigChooser(mGLView, false);
Improves it a little more. But still really looks 8bit.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Config.glTrilinear making transparent textures look weird
« Reply #3 on: July 12, 2012, 08:35:13 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

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Config.glTrilinear making transparent textures look weird
« Reply #4 on: July 12, 2012, 08:45:57 am »
Quote
I've no idea why the addition of an alpha channel should improve accuracy in the fragment shader.
Isn't false turning it off?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Config.glTrilinear making transparent textures look weird
« Reply #5 on: July 12, 2012, 08:49:56 am »
Yes, my bad...whatever...it doesn't make much sense either...