"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Layering a second EAGL View on top of camera video

What is the proper way to add a second EAGL View on top of the QCAR camera video layer? I'm adding a library into my QCAR implementation to display 3D models. I'm having trouble getting it properly setup so I can view the QCAR camera and my 3D layer on top of that. I tried for a while to use the same EAGL context, but now I'm trying to keep them separate by setting up different layers using eagleview for QCAR and a view called glview for my 3D model. My 3D model render code is in C and it doesn't mix well with the C++ QCAR code base so to get them running they need to be in separate files. I can run them separately in the code, but when I try to load both I'm getting an error in renderFrameQCAR when my glView tries to draw on screen: QCAR::State state = QCAR::Renderer::getInstance().begin(); - EXC_BAD_ACCESS [CODE]eaglView = [[EAGLView alloc] initWithFrame: viewBounds]; glView = [[GLView alloc] initWithFrame: viewBounds]; //new EAGL View _glViewController = [[GLViewController alloc] init]; [_glViewController setView:glView]; [window addSubview:eaglview]; [window addSubview:_glViewController.view];[/CODE] Thanks for any help - this one has been a hard one to figure out!

Hi Zakharm, When trying out different configurations for test cases, I found that having an OpenGL view as the first child of a ViewConmtroller was problematic - it may be a good idea to add a parent view, with the OpenGL view was it's child.

[QUOTE=MoSR]When trying out different configurations for test cases, I found that having an OpenGL view as the first child of a ViewConmtroller was problematic - it may be a good idea to add a parent view, with the OpenGL view was it's child.

I changed the ordering of when I start my animation timer for my glView to after the camera has loaded and it has gotten rid of the error at the state check, but it is reporting back this error: [B" />after EAGLView renderFrameQCAR() glError (0x501)[/B" /> This post talks about glError 0x501 - GL_

[QUOTE=zakharm]It looks like what is happening here on my initialization of my renderer and QCAR is that my renderer blacks out the RenderBuffer or creates a layer on top of the RenderBuffer where QCAR is trying to copy the video texture into it. [/QUOTE] So you'll want to remove all render buffer

Thanks MoSR. Just so we're on the same page, I'm now doing everything in the one view and one EAGLView, setup programmatically without Interface Builder. Doing a capture of a GL frame I can see the spot where QCAR copies the video background to the renderbuffer, overwriting a black / blank frame.

The texture ID's are not hard coded anywhere so should work with any id they get. I suspect that you're changing something in the context that effects the placement of the quads that draw the background. Can you make your code only starts changing the context after a few frames, so that you can ch

Yeah, I've put my setup calls in the 2nd pass through of renderFrameQCAR and the video background does appear on the first pass and then my setup wipes it out on the second. Two questions: 1) Is there some kind of opengl clear that I can call after my setup is done that wipes the context / renderbu