I have recently began to use Irrlicht as it is much easier to use than OpenGL by itself but have been unable to implement Rendering depth to a texture. In OpenGL I was able to accomplish this and I have read many forum posts but none have been able give an answer. Currently I am able to render to a texture and then apply a shader to it but I have been unable to render depth to it.
This code creates the texture.
Code: Select all
rt = Driver->addRenderTargetTexture(core::dimension2d<u32>(Driver->getScreenSize().Width,Driver->getScreenSize().Height),"RTT1");
This code currently draws the scene to the texture.
Code: Select all
Driver->setRenderTarget(rt,true,true,video::SColor(0,0,0,0));
Smgr->drawAll();
I am looking for any help to provide/point me in the direction of solving this. I believe I am correct in saying that the setup is what needs the changes to get depth.
Any help would be greatly appreciated