Page 1 of 1

IOS Ogre Render Vuforia QCAR VideoBackground

Posted: Wed Jun 17, 2015 6:28 am
by android88
:cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: Hello, I tried to Ogre engine and Qualcomm's Vuforia QCAR SDK in combination ios platform. But encountered some problems, I hope the high-pass rendering video data to the bottom, Ogre scene content rendering is superimposed onto the video data. I tried many methods, but can not do it. Either the current video is displayed, but the content has not show ogre, ogre or displayed, but the video can not be displayed. The following code can be video displayed, it is not possible ogre appear superimposed on the video. Here, I sincerely seek your great God, wanted to help me solve this problem, thanks again! This problem is especially urgent, but also look to know friends help out. :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry:

Code: Select all


void AROgreFramework::renderFrame(Ogre::Real time)
{
    QCAR::State state = QCAR::Renderer::getInstance().begin();

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    QCAR::Renderer::getInstance().drawVideoBackground();

    const QCAR::CameraCalibration& cameraCalibration = QCAR::CameraDevice::getInstance().getCameraCalibration();

    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_CULL_FACE);

    if (QCAR::Renderer::getInstance().getVideoBackgroundConfig().mReflection == QCAR::VIDEO_BACKGROUND_REFLECTION_ON) {
        glFrontFace(GL_CW); //Front camera
    }
    else {
        glFrontFace(GL_CCW); //Back camera
    }

    m_pViewport->setClearEveryFrame(true, Ogre::FBT_DEPTH | Ogre::FBT_STENCIL);

    glDisable(GL_BLEND);
    glDisable(GL_DEPTH_TEST);
    glDisable(GL_CULL_FACE);

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

Please help me, thank you friends :!: :!: :!: :!: :!: :!: :!: :!:

Re: IOS Ogre Render Vuforia QCAR VideoBackground

Posted: Wed Jun 24, 2015 6:42 pm
by dark_sylinc
I integrated QCAR with Ogre for Android a few years ago, and sadly I can't share the code.

However I do remember that Vuforia messed up a lot more OpenGL state than what the documentation said; including bound textures.
The amount of state you're resetting is not enough. Furthermore you need to restore the state to what Ogre left it in the previous frame.
Also advisable, until you get it running, first disable the GLES state tracker from CMake and rebuild.

Re: IOS Ogre Render Vuforia QCAR VideoBackground

Posted: Thu Jul 23, 2015 11:01 am
by cose
if this can help ( android code for NxGraphics Engine ) just to look initialization and texture format, etc

https://github.com/nxgraphics/NxGraphic ... ample.java
look for: Renderer.getInstance().bindVideoBackground

and
https://github.com/nxgraphics/NxGraphic ... o/main.cpp