Log in or register to post comments

QCAR + sio2 unable to render background video

August 16, 2012 - 12:55am #1

Hi i have integrated QCAR with sio2 renderer and stuck with rendering the video background. In the function - (void)renderFrameQCAR i am using the following code, the model renders and augments as expected with out video background. If i uncomment the 1st line model fails to appear. Please help me to fix this problem. 

        //QCAR::Renderer::getInstance().drawVideoBackground();
        sio2WindowUpdateFrame( sio2GetWindow() );

QCAR + sio2 unable to render background video

August 22, 2012 - 6:34am #7

Hi pradeep

Hard to say as few people have had success integrating 3rd party engines, so it's great that you are trying :)

Not sure about Android, however one possibility on iOS is that sio2 could be using it's own OpenGL ES context which might bear no relation to the one that QCAR might be using - and therefore nothing gets displayed.  You might need to check where sio2 initialises OpenGL ES and how it does this, so that it integrates properly with Vuforia.

I'm not sure of the best strategy here, as some have had success by grabbing the video feed and storing it in a texture and then displaying that within the 3rd party engine.  Here is a link to the thread which may or may not be useful:  https://ar.qualcomm.at/content/cocos2d-and-qcar-project-integration

Let me know how you get on.

N

QCAR + sio2 unable to render background video

August 22, 2012 - 6:24am #6

Hi Nalin,
Thanks a lot for your valuable reply. Sorry in my previous code snippet it was reversed.  Actually I was doing like this.
    ImageTargetsRenderer.getQuallcomRender().getModelViewMatrix(modelview,projection);
    ImageTargetsRenderer.getQuallcomRender().callDrawVideo();  --called between begin & end
    JNIHandler.getJNIHandler().callDraw(projection,modelview);   --called sio2 draw frame
I'm trying for both iOS & Android. Kindly suggest me what should I do to retain my rendering state for sio2 draw frame.

 

Pradeep

 

   

QCAR + sio2 unable to render background video

August 22, 2012 - 6:24am #5

Hi Nalin,
Thanks a lot for your valuable reply. Sorry in my previous code snippet it was reversed.  Actually I was doing like this.
    ImageTargetsRenderer.getQuallcomRender().getModelViewMatrix(modelview,projection);
    ImageTargetsRenderer.getQuallcomRender().callDrawVideo();  --called between begin & end
    JNIHandler.getJNIHandler().callDraw(projection,modelview);   --called sio2 draw frame
I'm trying for both iOS & Android. Kindly suggest me what should I do to retain my rendering state for sio2 draw frame.

 

Pradeep

 

   

QCAR + sio2 unable to render background video

August 22, 2012 - 5:08am #4

Hi pradeep,

Not sure about the Android code as I assumed it was iOS, as is this forum ;)

I would have thought that in the render loop one would draw the video first and then overlay the renders?  In the above code this situation is reversed so the video would wipe out what was rendered before it.

N

 

QCAR + sio2 unable to render background video

August 22, 2012 - 3:27am #3

 

I am unable to get the sio2 rendered models on camera overlay. What might be the problem? Whenever I call draw video for camera overlay from qualcomm,  sio2 objects are not drawing on the screen. Once at the beginning of the application the model appears and will go off. Only camera preview is rendering but there is no continuous drawing of sio2 objects on camera overlay.

 My code snippet for Android:

 public void onDrawFrame( GL10 gl )

 {

       callDraw(projection,modelview);  -- it calls sio2 draw_frame

       callDrawVideo();  -- called for drawing camera overlay between begin & end


       getModelViewMatrix(modelview,projection);  -- gets the model view  & projection matrix from qualcomm

}

QCAR + sio2 unable to render background video

August 16, 2012 - 4:05am #2

Hi pradeep,

We have no experience of the SIO2 engine, and I am not clear how you are integrating the two.

What does the render loop look like, and what is rendering the models?

Not also the renderFrameQCAR happens on a background thread which may complicate matters.

Also you need this around the QCAR code in this loop:

    // Render video background and retrieve tracking state

    QCAR::State state = QCAR::Renderer::getInstance().begin();

 

 

    QCAR::Renderer::getInstance().end();


N

Log in or register to post comments