IOS Ogre Render Vuforia QCAR VideoBackground

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
android88
Gnoblar
Posts: 2
Joined: Thu Jun 11, 2015 3:59 am

IOS Ogre Render Vuforia QCAR VideoBackground

Post 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 :!: :!: :!: :!: :!: :!: :!: :!:
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5433
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1341

Re: IOS Ogre Render Vuforia QCAR VideoBackground

Post 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.
User avatar
cose
Halfling
Posts: 46
Joined: Thu Jul 24, 2008 5:48 pm
Location: Marseille

Re: IOS Ogre Render Vuforia QCAR VideoBackground

Post 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