modifying textures

Hello,
I would like to temporary change the way that texture is displayed. I want to remove the colors, so it will look like a grayscale, and i want to darken or brighten it at times. How can i do this? I could probably manipulate a buffered image and bind another texture but there is probably a better solution.

thanks

A fragment shader would be easiest, alternativly texture environment/texture combine extentions eould also work. What’s your target hardware?

Well, i would like my application to run even on very old graphics cards, since its not very hardware demanding 2d game ;).

http://www.opengl.org/sdk/docs/man/xhtml/glTexEnv.xml with GL_DOT3_RGB will get you greyscale.
http://oss.sgi.com/projects/ogl-sample/registry/EXT/secondary_color.txt will let you lighten a texture.
Regular vertex colours will let you darken a texture.

if your loading the textures in openGL:
A quick way would be, Instead of loading the textures as GL_RGB/GL_RGBA try doing it as GL_LUMINACE or whatever its called, that will make it gray scale
and for darking and brightning it, play around with the blending methods, and render the blended texture over black/white.