ipad 3 - 带有 kEAGLDrawablePropertyRetainedBacking 和视网膜的 openGL 错误? [英] ipad 3 - openGL bug with kEAGLDrawablePropertyRetainedBacking and retina?

查看:19
本文介绍了ipad 3 - 带有 kEAGLDrawablePropertyRetainedBacking 和视网膜的 openGL 错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 iOS openGL 应用程序,它使用 kEAGLDrawablePropertyRetainedBacking 属性在前一帧的顶部绘制当前帧.这是一种获得运动轨迹等效果的廉价方式.

i have an iOS openGL app which uses the kEAGLDrawablePropertyRetainedBacking property to draw the current frame on top of the previous frame. it's a cheap way of getting effects like motion trails.

它在所有设备(包括 iPhone w/retina)和所有设备模拟器上都运行良好,但在实际的 iPad 3 设备上,前一帧被垂直压缩到其前一尺寸的 75%.

it works great on all devices (including iPhone w/ retina) and all device simulators, but on the actual iPad 3 device, the previous frame is vertically squished to 75% of its previous size.

例如,如果我每帧在屏幕底部绘制一个 100 x 100 的正方形,然后在第 0 帧中我有一个正方形,在第 2 帧中有一个 100 x 75 的回声并向屏幕顶部偏移,在第 3 帧中有一个额外的回声,它是 100 x 56 (56 ~= 75 * 0.75) 并且更多向顶部偏移,依此类推.应该发生的是所有的回声都保持在原地.

for example, if i were to draw a 100 x 100 square at the bottom of the screen each frame, then in frame 0 i have one square, in frame 2 there's an echo that's 100 x 75 and offset towards the top of the screen, in frame three there's an additional echo that's 100 x 56 (56 ~= 75 * 0.75) and is more offset towards the top, and so-on. what should happen is that all the echoes remain in place.

我已经在两台设备上验证了该行为,所以我不认为这只是一台损坏的 iPad.

i've verified the behavior on two devices, so i don't think it's a just a broken iPad.

有什么想法吗?

tia,猎户座

推荐答案

我看到了这个错误.我对OpenGL一无所知,所以我无法像建议的那样用纹理来解决它,但在我的情况下,我能够根据来自的教程切换到非常快速的Quartz 2D绘图实现http://blog.effectiveui.com/?p=8105,以及如何制作它适用于 https://stackoverflow.com/a/10870188/255489 的 Retina.它实际上最终比我从 Apple 的 GLPaint 示例代码中借来的代码快得多.

I was seeing this bug. I don’t know anything about OpenGL, so I couldn’t really dig into solving it with textures, as has been suggested, but in my case I was able to switch to a very fast implementation of Quartz 2D drawing based on a tutorial from http://blog.effectiveui.com/?p=8105, plus how to make it work on Retina from https://stackoverflow.com/a/10870188/255489. It actually ended up being much faster than the code I had borrowed from Apple’s GLPaint sample code.

这篇关于ipad 3 - 带有 kEAGLDrawablePropertyRetainedBacking 和视网膜的 openGL 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆