Post-rendering manipulation

Started by
4 comments, last by biovenger 20 years, 8 months ago
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.
-----------------------------Final Frontier Trader
Advertisement
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
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.
-----------------------------Final Frontier Trader
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?
-----------------------------Final Frontier Trader
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.
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
Google for fragment shaders,... only for high-end cards though...
--------<a href="http://www.icarusindie.com/rpc>Reverse Pop Culture

This topic is closed to new replies.

Advertisement