ZDepth information is missing when Render To Texture

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
sylpheed
Posts: 25
Joined: Mon Nov 30, 2009 1:45 pm

ZDepth information is missing when Render To Texture

Post 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.
sylpheed
Posts: 25
Joined: Mon Nov 30, 2009 1:45 pm

Post 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?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The issues should have been fixed in 1.7 versions, at least I never had any problems anymore.
sylpheed
Posts: 25
Joined: Mon Nov 30, 2009 1:45 pm

Post 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.
sylpheed
Posts: 25
Joined: Mon Nov 30, 2009 1:45 pm

Post by sylpheed »

No luck with 1.7.0 version :(
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
sylpheed
Posts: 25
Joined: Mon Nov 30, 2009 1:45 pm

Post 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);
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post 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.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply