Log in or register to post comments

OpenGL Blocking UIKit animations

August 16, 2012 - 5:36am #1

Hi,

I have the arview and on top of it a UIScrollView Controller. When I try to scroll the performance of the UIScroll view is very bad.

 

This is because the renderFrame is on the main run loop. A solution given was to use NSRunLoopCommonModes.

[displayLink addToRunLoop:[NSRunLoop currentRunLoop]

                  forMode:NSRunLoopCommonModes];

http://stackoverflow.com/questions/4876488/animation-in-opengl-es-view-freezes-when-uiscrollview-is-dragged-on-iphone

How can achieve this?  

OpenGL Blocking UIKit animations

August 20, 2012 - 1:38am #4

If you look in say ImageTargets,

- (void)renderFrameQCAR   - this controls what gets rendered /displayed

 

QCAR::Renderer::getInstance().drawVideoBackground();         - this draws the video


..and below this is the tracking/rendering code for OpenGL.


You could try experimenting with the code by omitting certain parts of this loop.  However you might find that the video is still taking up significant resource.


HTH


N

OpenGL Blocking UIKit animations

August 17, 2012 - 10:08am #3

Thanks for replying. 

Yes, I need to display the video and top of that a scrollview menu with the items to look for. 

Actually I don't need to do any OPENGL atm, only show the video live feed and find the trackables. 

Is there a way to stream the video output, and still use the tracking without having to render it in OPENGL?  

I guess if I'd have a static view, the lag would dissappear. 

 

OpenGL Blocking UIKit animations

August 17, 2012 - 1:40am #2

Hi designlapp,

Generally there are perfomance problems when trying to integrate UIKit features to run in conjunction with apps that utilise OpenGL ES, possibly via 3rd party libraries.  In the past I have overlayed a UITableView (subclass of UIScrollView) on top of a Cocos2D layer, and the performance was always far from satisfactory.

I checked with the dev team and your description of renderFrame being on the main run loop is not strictly accurate.  In fact it runs on a background thread, and also, displayLink is not used in the Vuforia samples.

Not sure what to suggest - do you need the ARView active at the same time as the Scrollview ?

N

Log in or register to post comments