I am trying to integrate a closed source piece of software that sets the view and projection matrices, and is capable of edge blending and warping images using shaders in order to have a large number of projectors produce a nicely aligned image with the correct perspective. Setting the view and project matrices works flawlessly. However, when I call the function to perform the blending and warping, all I get is a black screen (while if I comment this call out, I get the unwarped and unblended image with the correct frustum). I am using Irrlicht 1.8 / OpenGL on Windows7. This whole concept works fine when used with other engines such as openscenegraph.
The documentation says that the postDraw() call will warp the back buffer when in double buffering mode (default when creating an Irrlicht device). It should be called after the last GL call right before swapping the buffers. Basically my code is this:
Code: Select all
closedSourceWarper *myWarper = new closedSourceWarper();
myWarper->initialize("some values");
while(device->run())
{
driver->setViewPort(rect<s32>(0, 0, ResX, ResY));
driver->beginScene(true, true, SColor(255, 0, 0, 255));
smgr->setActiveCamera(cam0);
driver->setViewPort(rect<s32>(0, 0, ResX, ResY));
smgr->drawAll();
// perform warping and blending
myWarper->postDraw();
driver->endScene();
}
Did I place the postDraw() call in the right spot?
Is Irrlicht rendering directly to the backbuffer? Or should I make Irrlicht render to a texture first and point the closedSourceWarper to that render target?
Can I expect that endScene() just swaps the buffers (I see glFlush() and a SwapBuffers(HDc) call in COpenGLDriver.cpp)
I am kinda hitting a dead end here so any help is appreciated!
Thanks!