ZDepth information is missing when Render To Texture
Posted: Wed May 12, 2010 12:51 pm
Hi all, first of all sorry for my English.
I'm having a few troubles rendering to texture in DirectX. It seems like it does not use zdepth information when rendering to texture. For example, a mesh is painted overlaying other mesh that should be in front of first one.
If I render directly in backbuffer, everything is painted ok.
The code is pretty simple:
// Creation
ITexture *tex = driver->addRenderTargetTexture (size,"rtBackbuffer", ECF_A8R8G8B8);
.....
.....
driver->setRenderTarget (tex, true, true, SColor (255, 255, 255, 255));
smgr->drawAll ();
driver->setRenderTarget (0, true, true);
renderQuad (tex);
I hace searched in the forum, but I only found this:
http://irrlicht.sourceforge.net/phpBB2/ ... ndertarget
And nobody answered.
Thanks a lot for your help.
I'm having a few troubles rendering to texture in DirectX. It seems like it does not use zdepth information when rendering to texture. For example, a mesh is painted overlaying other mesh that should be in front of first one.
If I render directly in backbuffer, everything is painted ok.
The code is pretty simple:
// Creation
ITexture *tex = driver->addRenderTargetTexture (size,"rtBackbuffer", ECF_A8R8G8B8);
.....
.....
driver->setRenderTarget (tex, true, true, SColor (255, 255, 255, 255));
smgr->drawAll ();
driver->setRenderTarget (0, true, true);
renderQuad (tex);
I hace searched in the forum, but I only found this:
http://irrlicht.sourceforge.net/phpBB2/ ... ndertarget
And nobody answered.
Thanks a lot for your help.