PDA

View Full Version : Manipulating color buffer



jpdamato
02-25-2004, 07:36 AM
Hi, is there any way to work straight with the buffer in order to apply post processing
effects?
No in the way of glGetPixels()... createTexture and then draw it.
The idea is to create a underwater view effect..
Regards
JyC

Relic
02-25-2004, 08:01 AM
The straight-forward way is to use glCopyTexImage which omits the host copy you outlined with glReadPixels().
Or more complex, if you render to a p-buffer texture rectangle target you can bind it as texture directly.

Jan
02-25-2004, 09:11 AM
There are ways to do post-processing effects, BUT there is no way to directly access a pixel like an array or so, without doing a glReadPixels.

Jan.

simongreen
02-25-2004, 11:08 AM
Typically post-processing effects are done using render-to-texture:
- Render your scene to an offscreen pbuffer
- Bind the pbuffer as a texture
- Process the image by looking up in the texture using a fragment program (or fixed functiont texturing)
- Write the results to the frame buffer
http://www.nvidia.com/dev_content/nvopenglspecs/WGL_ARB_render_texture.txt http://developer.nvidia.com/object/ogl_rtt.h
tml


Originally posted by Jan2000:
There are ways to do post-processing effects, BUT there is no way to directly access a pixel like an array or so, without doing a glReadPixels.

Jan.