How to get render image and modify it before displaying

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
kazymjir
Posts: 727
Joined: Sat Feb 20, 2010 4:05 pm
Location: Munich, Bayern

How to get render image and modify it before displaying

Post by kazymjir »

Hello!

I am interested in how can I get render data, modify it and display on screen in real-time.

Here is little illustration:
Image

I want to get pixels from "image plane", modify them, and send forward to "eye" (monitor).

Where can I find code responsible for that?
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

You can render your scene to a render target texture, which acts as your "image plane". You can then put it on a quad and run a shader on that quad to modify it as it is sent to the monitor.
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

Post by d3jake »

I don't mean to sound rude, I'm actually quite intrigued, but for what reason are you interested in doing this?
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
kazymjir
Posts: 727
Joined: Sat Feb 20, 2010 4:05 pm
Location: Munich, Bayern

Post by kazymjir »

Thanks again, Slavik!

D3Jake, I am thinking about to do some post-processing effects, something like in Compositor from Ogre.
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

For some great examples take a look at the code for XEffects, a post-processing library BlindSide put together.
akaz
Posts: 9
Joined: Sun Nov 01, 2009 7:52 pm

Post by akaz »

Thanks, I will take a look for XEffects.

I have one more question, how can I manipulate ITexture, pixel by pixel?
I founded this: http://www.irrlicht3d.org/wiki/index.ph ... alChapter3, but I don't know how to put updated data on void buf to ITexture t.

EDIT: aek here, i forgot that on second machine i have in cookies my old acc


EDIT2: Oh, it's pointer. Sorry, I have not sleep for 36 hours and miss that it is pointer
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I would recommend doing the "manipulation" like slavik262 described if it is possible otherwise it will be very very slow. I am sort of interested also in what kind of effects you want to perform.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
kazymjir
Posts: 727
Joined: Sat Feb 20, 2010 4:05 pm
Location: Munich, Bayern

Post by kazymjir »

I'll try this method with RTT.

I have on mind some interesting effects, but for now I don't want to say anything, it will be suprise for next Bored Programmer movie, if I succeed in coding this
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

Like BlindSide said, use a shader to manipulate your texture. Otherwise the modification will happen on the CPU and be really slow.
kazymjir
Posts: 727
Joined: Sat Feb 20, 2010 4:05 pm
Location: Munich, Bayern

Post by kazymjir »

Thanks, you have right.
I'll read some about shaders and try it.
Post Reply