framebuffer reading and re-color pixels

hi, all
i just wanna read all the pixels from a image in the scence fragment by fragment through framebuffer, then re-coloring pixels which i am interested in. Now i know how to read pixels by using glReadPixels() from a frame buffer, my questinon is how to modify those pixels’ information, for example, the depth value, the color and so on, and when i recolor all the fragment, does the image lose the realistic feeling? And the second question: whether using cg language is more efficient and easy implementable?

Big thanks

The way to do this is to render to a texture (possibly using FBO if you have that extension).

You can then feed this into a fragment shader as a texture on a quad you’ve drawn to the screen.

Your choice of language is up to you.

Cg is a C like NVIDIA API for vertex and fragment programs. Other options are ARB assembly style programs or the C like gl shading language ‘glslang’.

They’re all probably acceptable.