2

I've got a live wallpaper out on the market which uses OpenGL to render some basic shapes and a flat plane. The simple lighting creates a gradient effect across the plane, which looks fine on most devices. The Samsung Galaxy S2 series seems to have some trouble rendering the gradient, though, as you can see in this screen shot:

banding on GS2

The color banding looks awful, especially compared to this screen shot from an Incredible:

no banding on DInc

I'm using a 565 EGL config in both cases, so I believe this is just a display issue with the GS2 devices. Can anyone confirm this suspicion?

Is there any solution to the banding?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Josh
  • 10,618
  • 2
  • 32
  • 36
  • All I can say is that I've seen similar banding happening on my SGS2 whilst playing with gradients. – harism Dec 29 '11 at 15:53
  • That type of banding is frequently seen when using dithering to reduce the number of colors in the image to those that can be displayed. – Charles Dec 29 '11 at 16:00

3 Answers3

2

Can you confirm that, though you request 565, that you are, in fact, getting 565? There are EGL functions for confirming what you end up getting. I refer to checking on both devices since you might be getting 888 on the Incredible and other devices, hence the better-looking display.

Jim Buck
  • 20,482
  • 11
  • 57
  • 74
  • I'll check the returned configs to make sure, thanks for the suggestion. – Josh Dec 29 '11 at 19:18
  • Looked into it and I was really getting 565 across all devices. This makes sense, because I had a bit of code checking the valid returned configs for the one which most closely matched my requested configuration. – Josh Dec 30 '11 at 17:42
  • +1 for the suggestion, though, as it helped me narrow down the problem. – Josh Dec 30 '11 at 17:48
  • Did you figure out the problem? I'm actually kind of surprised that you weren't getting 888. The banding you see is exactly what I would expect with 565. I've had similar banding with some smooth-gradient textures in a game I did for the PSP when I made them 5650, and I purposely had to make those textures 8888 as a result. – Jim Buck Dec 30 '11 at 19:07
1

Looks like it really is the GS2's display, or more accurately, its dithering algorithm. I tried upping my requested config to RGB888, and this is what I get (from my test user's phone):

No banding GS2

So it really seems like the GS2 just does a horrible job of dithering when trying to map colors in an 888 space to a 565 config.

Now I'm not sure if I want to up the config to 888 across all devices (better quality but a performance hit), or only on devices which I know to dither poorly. Hmmm.

Josh
  • 10,618
  • 2
  • 32
  • 36
0

Have you tried to disable dithering in GL? This might help a bit.

GLES20.glDisable(GLES20.GL_DITHER);
Alexis Andre
  • 141
  • 4