OpenGL gradient banding on Android

半城伤御伤魂 提交于 2019-11-28 01:58:48

问题


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:

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

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?


回答1:


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.




回答2:


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):

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.




回答3:


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

GLES20.glDisable(GLES20.GL_DITHER);


来源:https://stackoverflow.com/questions/8669765/opengl-gradient-banding-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!