[SOLVED] Problem with render to texture with Irrlicht.NET CP
Posted: Wed Jun 18, 2008 8:05 pm
I've tried searching Google and the forums, but haven't found anything.
I'm trying to render to texture and then display that texture using draw2DImage. However, I'm having some odd problems that look like drawing order problems when I render to a texture--and only when I render to a texture.
Here's an example output image:
That's what happens when I do:
I see a wall there, like you're supposed to, when just drawing straight to the framebuffer. I know that setting the render target back to the framebuffer works because I can see the default color if I don't make the Draw2DImage call.
I'm guessing that it has something to do with the way z-buffers for the render target are set up vs. the actual framebuffer, but I really have no idea (or no idea where to start looking). I've even followed the render-to-texture tutorial as it says.
Anyone know what's going on? Any help would be superbly appreciated.
I'm trying to render to texture and then display that texture using draw2DImage. However, I'm having some odd problems that look like drawing order problems when I render to a texture--and only when I render to a texture.
Here's an example output image:
That's what happens when I do:
Code: Select all
// _renderTarget is set up using CreateRenderTargetTexture earlier.
_device.VideoDriver.SetRenderTarget(_renderTarget, true, true, Color.Black);
_device.SceneManager.DrawAll();
_device.VideoDriver.SetRenderTarget(null, true, true, Color.Black);
// A little bit later...
Rect srcDest = new Rect(0, 0, _device.VideoDriver.ScreenSize.Width, _device.VideoDriver.ScreenSize.Height);
_device.VideoDriver.Draw2DImage(_renderTarget, srcDest, srcDest, Color.White, false);
I'm guessing that it has something to do with the way z-buffers for the render target are set up vs. the actual framebuffer, but I really have no idea (or no idea where to start looking). I've even followed the render-to-texture tutorial as it says.
Anyone know what's going on? Any help would be superbly appreciated.