Question about draw2D Image in post processing

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Question about draw2D Image in post processing

Post by The_Glitch »

I've taken a look at some examples around Irrlicht and I've seen people taking a RTT texture and using draw2D on some of them. My question is, is this Irrlichts method of taking a rendered result of a screenquad and drawing it back into a render target?? If so this may be my issue as I have some shaders that need to use the new result on a image of the previous screenquad and I wasn't sure how to make a rendered screenquad effect back into a usable texture again.
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Question about draw2D Image in post processing

Post by The_Glitch »

Many sad faces LOL
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Question about draw2D Image in post processing

Post by mongoose7 »

It is difficult to understand what you mean. With Irrlicht's implementation, you can render to a RT and then, when you detach it, you can use it as an ordinary texture. So you can use it in draw2DImage. If you render such a texture into a screen quad, and you've set a render target, then you have a texture which is the result of the render. This is Irrlicht's *implementation* of render targets, but it is not Irrlicht's *method*, since the engine itself doesn't use render targets.

Anyway, a render target becomes a usable texture as soon as it is detached.
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Question about draw2D Image in post processing

Post by The_Glitch »

Okay I see.

Thanks

Let's say I have a render target

Code: Select all

video::ITexture* rt = 0; 

Code: Select all

 rt = driver->addRenderTargetTexture(core::dimension2d<u32>(512,512), "RTT1", video::ECF_A8R8G8B8);
now
I pass that to a full screenquad and it's blurred. My question is from there how can I put that result back into rt or even a new rt if that's not possible to reuse the old one. So I can pass it to a bloom shader which uses it as a texture register slot 1.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Question about draw2D Image in post processing

Post by mongoose7 »

Create another RT rt2. Render a screen quad into rt2 using rt. You now have two textures which you can apply to different purposes. Or you can just create rt2 in the same way you created rt.
Mel
Competition winner
Posts: 2293
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Question about draw2D Image in post processing

Post by Mel »

You need two rendertargets. While you render to one, you use the other, and viceversa, this allows to chain effects.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
The_Glitch
Competition winner
Posts: 523
Joined: Tue Jan 15, 2013 6:36 pm

Re: Question about draw2D Image in post processing

Post by The_Glitch »

LOL, Thanks but I figured out most or all the problems I was having.
Post Reply