Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ipad 3 - openGL bug with kEAGLDrawablePropertyRetainedBacking and retina?

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.

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.

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.

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

any ideas ?

tia, orion

like image 618
orion elenzil Avatar asked Mar 17 '12 20:03

orion elenzil


2 Answers

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.

like image 152
Zev Eisenberg Avatar answered Oct 29 '22 05:10

Zev Eisenberg


This was a confirmed bug with retained backing and the Retina iPad in iOS 5.x. It has since been fixed in iOS 6.0 and higher.

like image 41
Brad Larson Avatar answered Oct 29 '22 03:10

Brad Larson