Archived

This topic is now archived and is closed to further replies.

biovenger

Post-rendering manipulation

Recommended Posts

biovenger    122
Alright, I have a small problem here... Let''s say that you have rendered all your objects onscreen and that part is done, but you want to have a water effect to distort every object. Now, can you get the screen buffer, before it is drawn to the screen by OGL, but AFTER you have rendered your objects and manipulate it in some 2D fashion? The manipulation being pixelwise. A good example would be to blur the entire scene.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
one way is to render to a texture, then perform the pixel operations on the texture. finally, display a quad with your texutre on it

you can:
modify the texture using regular cpu operations (slow)
(you''ll likely have to use glReadPixels to get the colour info into system memory)

use a fragment program to perform your pixel ops while displaying the textured quad... (fast, and pretty easy once you have the extensions working)


you can also likely do some limited operations using the accumulation buffer, or some other tricks... have done much of this, but some are explained near the back of the red book...

good luck

Share this post


Link to post
Share on other sites
biovenger    122
Well, thanks for the info but that wasn''t exactly what I meant. What I want is to manipulate the finished SCENE. Meaning, after I reneder the terrain, objects and meshes, I want to take the finished picture (the one you actually see onscreen) and do something with it. Now how do I do that? It must be possible... I mean, how can you otherwise do, say a blur effect, over the whole screen? Or a water effect for that matter too.

Share this post


Link to post
Share on other sites
biovenger    122
Wait, I misunderstood your post, your method seems to work.

I have to render to a texture that is of screen width and height, right?

What commands do I use to render to a texture instead the screen?

Share this post


Link to post
Share on other sites
uber_n00b    122
http://www.gametutorials.com/download/OpenGL/RenderToTexture_OGL.zip Good tutorial on it

My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.

Share this post


Link to post
Share on other sites