Irrlicht and closed source Blending/Warping software

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
heda
Posts: 10
Joined: Mon Jul 16, 2012 3:28 pm
Location: The Netherlands

Irrlicht and closed source Blending/Warping software

Post by heda »

Hi,

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();
   }
 
Can anybody help me out why the postDraw() call results in a black screen (note, the clear color is blue!)
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!
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht and closed source Blending/Warping software

Post by CuteAlien »

Well, Irrlicht is open-source which means you can just look if it does that :-) But basically yeah - endScene calls glFlush and SwapBuffers (and some stuff with updating hardware buffers in CNullDriver::endScene). And also it is rendering to the backbuffer. So I don't know what the problem is.

Also you don't need to call setViewPort all the time (but probably not your problem). Maybe your warper expects another rgb-mode or something like that?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
heda
Posts: 10
Joined: Mon Jul 16, 2012 3:28 pm
Location: The Netherlands

Re: Irrlicht and closed source Blending/Warping software

Post by heda »

Thanks for the confirmation, I'll contact the manufacturer.
Post Reply