设备 (iPad) 上 OpenGL 纹理中的视觉伪影 - 但模拟器上没有
我在 iPad 上使用 OpenGL 纹理,在设备上出现可怕的伪影,而模拟器则显示一切完美且流畅< /强>。我相信 iPhone 也会出现同样的伪影。
如果我查看标题,我会发现一旦包含 OpenGLES/ES2/gl.h,并在另一个文件 OpenGLES/ES1/*.h 中。这会是一个问题吗?
或者设备上出现伪影的原因可能是什么?
模拟器:
真实设备:
I am using an OpenGL texture on an iPad and get horrible artifacts on the device, while the Simulator shows all perfect and smooth. I believe the iPhone would show the same artifacts.
If I look at the headers, I see that once I include OpenGLES/ES2/gl.h, and in another file OpenGLES/ES1/*.h. Could this be a problem?
Or what may be the reason for the artifacts on the device?
Simulator:
Real device:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 ES 2.0,那么第一个猜测是您遇到了精度问题。 highp、mediump 和 lowp GLSL 精度说明符是提示,而不是绝对命令,因为它们指定所需的最低精度。模拟器给你的精度很可能比你明确要求的更高,但设备却没有。
如果你对此还不够科学,那么尝试将所有内容调高作为测试,然后慢慢调低并凭经验检查结果。
If you're using ES 2.0 then the first guess would be that you have a precision problem. The highp, mediump and lowp GLSL precision specifiers are hints, not absolute commands, as they specify the minimum required precision. It's quite possible that the simulator is giving you more precision than you've explicitly asked for but the device isn't.
If you haven't been scientific about it then try bumping everything to highp as a test, then slowly dial back down and check the results empirically.
可能是 XCode 在编译期间应用了 PNG 优化(尝试将其关闭);请参阅如何跳过压缩一个 PNG?
It could be the PNG optimization XCode applies during compilation (try turning it off); see How can I skip compressing one PNG?