I’ve just started experimenting with post processing shaders in IRRLicht, and although there is no tutorial on this, I’ve somehow managed to figure it out...
Now I know how to RTT and then display the texture as a quad (in my case I’m just using driver->draw2DImage), but this is not the issue.
I have two problems.
First, there is no way to set the size of the quad in the texture that RTT is drawing to. Ex. lets say that I have a 512x512 texture, but I only want RTT to draw to a portion of that texture, let’s say 512x384.
My second issue is that IRRLicht won’t let me set a RTT texture bigger than the current resolution. So if my resolution is 800x600, I can’t use a bigger texture than 512x512.
I hope that someone can help me with this. Thanks in advance!
[SOLVED]Post processing shader help
[SOLVED]Post processing shader help
Last edited by LovehinaX on Tue Dec 19, 2006 10:55 am, edited 1 time in total.
You should be able to use a viewport for that. Something like this...First, there is no way to set the size of the quad in the texture that RTT is drawing to. Ex. lets say that I have a 512x512 texture, but I only want RTT to draw to a portion of that texture, let’s say 512x384.
Code: Select all
videoDriver->setRenderTarget(rttTexture);
const core::rect<s32> vp = videoDriver->getViewPort();
videoDriver->setViewPort(core::rect<s32>(0, 0, 512, 384));
// render stuff
videoDriver->setViewPort(vp);
videoDriver->setRenderTarget(0);
I don't know why this restriction is in place. I've seen the code in the CDirect3D9Driver::setRenderTarget() method, but I'm not sure why it is there.My second issue is that IRRLicht won’t let me set a RTT texture bigger than the current resolution. So if my resolution is 800x600, I can’t use a bigger texture than 512x512.
Travis