Page 1 of 1

ZDepth information is missing when Render To Texture

Posted: Wed May 12, 2010 12:51 pm
by sylpheed
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.

Posted: Wed May 12, 2010 1:00 pm
by sylpheed
It would be related with my problem:

http://irrlicht.sourceforge.net/phpBB2/ ... ht=zbuffer

I'm using Irrlicht 1.7.1. Have been fixed?

Posted: Wed May 12, 2010 1:42 pm
by hybrid
The issues should have been fixed in 1.7 versions, at least I never had any problems anymore.

Posted: Thu May 13, 2010 9:55 am
by sylpheed
It's strange, the problem is at AntiAlias in SIrrlichtCreationParemeters. When AntiAlias is off, renderbuffer it's OK, when it's on, renderbuffer ignores zbuffer.

Another problem: I tried to render with OpenGL and I have the same problems tha this guy: http://irrlicht.sourceforge.net/phpBB2/ ... ure+format

I will try going back to 1.7.0 version.

Posted: Fri May 14, 2010 6:20 am
by sylpheed
No luck with 1.7.0 version :(

Posted: Fri May 14, 2010 9:13 am
by hybrid
Could you please tell me which example you use to reproduce this. I'll need to check this once more. Hopefully it's not just a specific GPU/driver which has these problems.

Posted: Thu May 20, 2010 2:20 pm
by sylpheed
Sorry for posting so late, I have been very busy working.

The example I use to reproduce the it's the same as writtern in first post. Just creating two spheres and render them using render buffers. Then using a textured quad to represent the scene.

My graphic cards are dual 9600GT in SLI mode.

Device is created with these parameters:

param.WindowId = w_handle;
param.DriverType = EDT_OPENGL;
param.AntiAlias = 8;
param.Stencilbuffer = true;
irr_device = createDeviceEx (param);

Posted: Thu May 20, 2010 3:58 pm
by Mel
I had similar troubles.

Currently, we can't have antialiasing when rendering to a rendertarget.

A program reproducing the error should:

-enable the antialiasing
-create a render texture
-load a model and enable the antialiasing to its materials.
-Render to the RTT
-Render the RTT to the screen.