Android 上的 OpenGL 渐变带

发布于 2024-12-23 06:11:14 字数 405 浏览 4 评论 0原文

我在市场上有一个动态壁纸,它使用 OpenGL 渲染一些基本形状和平面。简单的照明在整个平面上创建了渐变效果,在大多数设备上看起来都很好。不过,三星 Galaxy S2 系列在渲染渐变时似乎遇到了一些麻烦,正如您在此屏幕截图中看到的那样:

banding on GS2

色带看起来很糟糕,尤其是与 Incredible 的屏幕截图相比:

no banding on DInc

我正在使用两种情况下的 565 EGL 配置,所以我相信这只是 GS2 设备的显示问题。有人能证实这个怀疑吗?

条带有什么解决办法吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

水染的天色ゝ 2024-12-30 06:11:14

您能否确认,尽管您申请了 565,但您确实获得了 565?有 EGL 函数可以确认您最终得到的结果。我指的是在两台设备上进行检查,因为您可能会在 Incredible 和其他设备上获得 888,因此显示效果更好。

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.

要走就滚别墨迹 2024-12-30 06:11:14

看起来确实是 GS2 的显示屏,或者更准确地说,是它的抖动算法。我尝试将我请求的配置升级为 RGB888,这就是我得到的(从我的测试用户的手机):

No banding GS2

因此,当尝试将 888 空间中的颜色映射到 565 配置时,GS2 确实表现得非常糟糕。

现在我不确定是否要在所有设备上将配置提高到 888(质量更好,但性能受到影响),还是仅在我知道抖动效果不佳的设备上。嗯。

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.

熟人话多 2024-12-30 06:11:14

您是否尝试过禁用 GL 中的抖动?这可能会有所帮助。

GLES20.glDisable(GLES20.GL_DITHER);

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

GLES20.glDisable(GLES20.GL_DITHER);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文