This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Dithering on SGS2/Mali400MP

Note: This was originally posted on 19th June 2011 at http://forums.arm.com

Hi,

I was just investigating a color banding issue in a gles2 application on Samsung Galaxy S II and noticed that GL_DITHER was disabled by default, and could not be enabled either.
Is this a known problem? Intentional? Driver or android/platform issue?

Regards,
Peter
Parents
  • Note: This was originally posted on 20th June 2011 at http://forums.arm.com

    Hi Peter,

    OK I have looked into this and I have a workaround but I need to investigate further.

    Even with the app as it is, I do see dithering between colour levels in screenshots from DDMS:



    Though I agree, the colour banding is very clear.

    My suspicion is that on other platforms you are requesting RGB565 but getting a higher colour depth returned. The EGL spec allows this, as does Android's setEGLConfigChooser() method.

    Leaving the request at 565 but modifying the onCreate() method in SimpleGL.java:


    glView = new GLView(this);
    glView.getHolder().setFormat(PixelFormat.RGBA_8888); // Gives smooth gradient.
    setContentView(glView);


    Taking a screenshot via DDMS I now see smooth shading whilst still seeing dithering (though it's much harder to see, may need to zoom in):



    The logcat output remains the same:

    06-20 14:40:02.120: INFO/nena(1579): onCreate()
    06-20 14:40:02.130: INFO/GLThread(1579): starting tid=10
    06-20 14:40:02.270: INFO/(1579): !@Mali Android API Version : 7 [1308577202]
    06-20 14:40:02.305: INFO/ActivityManager(2701): Displayed se.nena.simplegl/.SimpleGL: +244ms
    06-20 14:40:02.335: INFO/nena(1579): initializeGL()
    06-20 14:40:02.335: INFO/nena(1579): Bits: RGB565 A0 [dither false true]
    06-20 14:40:02.345: INFO/nena(1579): Vertex:
    06-20 14:40:02.345: INFO/nena(1579): Fragment:
    06-20 14:40:02.345: INFO/nena(1579): Program:
    06-20 14:40:02.345: INFO/nena(1579): Locations 0 1
    06-20 14:40:02.345: INFO/nena(1579): onSurfaceChanged 480x724

    I still need to investigate whether this addition is correct and necessary, and also your point about glGet() but in the meantime, does this change produce the same results across platforms for you?

    Cheers, Pete
Reply
  • Note: This was originally posted on 20th June 2011 at http://forums.arm.com

    Hi Peter,

    OK I have looked into this and I have a workaround but I need to investigate further.

    Even with the app as it is, I do see dithering between colour levels in screenshots from DDMS:



    Though I agree, the colour banding is very clear.

    My suspicion is that on other platforms you are requesting RGB565 but getting a higher colour depth returned. The EGL spec allows this, as does Android's setEGLConfigChooser() method.

    Leaving the request at 565 but modifying the onCreate() method in SimpleGL.java:


    glView = new GLView(this);
    glView.getHolder().setFormat(PixelFormat.RGBA_8888); // Gives smooth gradient.
    setContentView(glView);


    Taking a screenshot via DDMS I now see smooth shading whilst still seeing dithering (though it's much harder to see, may need to zoom in):



    The logcat output remains the same:

    06-20 14:40:02.120: INFO/nena(1579): onCreate()
    06-20 14:40:02.130: INFO/GLThread(1579): starting tid=10
    06-20 14:40:02.270: INFO/(1579): !@Mali Android API Version : 7 [1308577202]
    06-20 14:40:02.305: INFO/ActivityManager(2701): Displayed se.nena.simplegl/.SimpleGL: +244ms
    06-20 14:40:02.335: INFO/nena(1579): initializeGL()
    06-20 14:40:02.335: INFO/nena(1579): Bits: RGB565 A0 [dither false true]
    06-20 14:40:02.345: INFO/nena(1579): Vertex:
    06-20 14:40:02.345: INFO/nena(1579): Fragment:
    06-20 14:40:02.345: INFO/nena(1579): Program:
    06-20 14:40:02.345: INFO/nena(1579): Locations 0 1
    06-20 14:40:02.345: INFO/nena(1579): onSurfaceChanged 480x724

    I still need to investigate whether this addition is correct and necessary, and also your point about glGet() but in the meantime, does this change produce the same results across platforms for you?

    Cheers, Pete
Children
No data