Log in or register to post comments

Irrlicht+Vuforia(QCAR) iOS issue(model rendering always red)

March 15, 2013 - 12:50am #1

 

Hi,
 
I am currently trying to integrate Irrlicht(ogl-es branch, rev 4477) with Vuforia, the AR engine from Qualcomm on iOS.
The model(water truck md2 model) is sticked on the target perfectly but the model is always red.(please see the screenshot link below.)
 
The model format is in MD2, I load the model in this way(see below)
[code=cpp] 
    mDevice = irr::createDevice(irr::video::EDT_OGLES2,
                                irr::core::dimension2d<irr::u32>(viewSize.width, viewSize.height), 32);
 
    mDriver = mDevice->getVideoDriver();
    mSceneManager = mDevice->getSceneManager();
 
    mSceneManager->setAmbientLight(
                                   irr::video::SColorf(0.85f,0.85f,0.85f));
    mSceneManager->addLightSceneNode(NULL,
                                     irr::core::vector3df(-150, 200, -50),
                                     irr::video::SColorf(1.0f, 1.0f, 1.0f), 4000.0f);
    
    mTransformationNode = mSceneManager->addDummyTransformationSceneNode();
    mCamera = mSceneManager->addCameraSceneNode();
 
    irr::scene::IMesh* mesh = mSceneManager->getMesh("watertruck.md2");
    mNode = mSceneManager->addMeshSceneNode(mesh, mTransformationNode);
 
    mNode->setMaterialTexture(0, mDriver->getTexture("watertruck.bmp"));
    mNode->setMaterialType(irr::video::EMT_SOLID);
    mNode->setMaterialFlag(irr::video::EMF_LIGHTING, true);
    mNode->setRotation(irr::core::vector3df(90, 0, 180));
 
    if (mCamera) {
        irr::core::matrix4 proj;
        proj.setM(projectionMatrix.data);
        mCamera->setProjectionMatrix(proj);
    }
 
    //Rendering
    mDriver->beginScene(false, true);
    mSceneManager->drawAll();
    mDriver->endScene();
 
 
I am using GLES2 in Vuforia/Irrlicht, I simply drag the Irrlicht shader files under media folder into the xcode project.
 
I suspect there might be some OpenGL state conflicts between Irrlicht and Vuforia.
 
Thanks!
Mason

Irrlicht+Vuforia(QCAR) iOS issue(model rendering always red)

March 15, 2013 - 5:07am #2

Hi mason

You might find this useful:

https://developer.vuforia.com/resources/dev-guide/opengl-state-changes-video-background-renderer

and also this thread where someone else has integrated another engine with Vuforia:

https://developer.vuforia.com/forum/rendering-opengl-es/using-vuforia-our-own-custom-render-engine

Worth looking at NinevehGL as well as that claims to have an integration sample with Vuforia.

 

HTH

N

Log in or register to post comments