PDA

View Full Version : Contrast on texture



bishop
05-02-2002, 11:07 AM
I have divided and mapped an image on several quads, and I'm looking for a way of controlling contrast, brightness, etc to it.

I know the equation to use, but I don't know how to access the texture data without reallocating everything.

Thanks!

knackered
05-02-2002, 12:58 PM
Keep the image data in your own structure, as well as creating a texture from it.
Then, mess around with your own personal copy of the image data, and when you're finished, use glTexSubImage2d to move your changed data to the texture.
Just search for an explaination of glTexSubImage2d for the details.

[This message has been edited by knackered (edited 05-02-2002).]

AdrianD
05-06-2002, 08:57 AM
if you have a Geforce:
you could also programm your Register Combiners to do your calculations at rendering time...
usualy this feature is used to do per-pixel-lighting, but you are free to calculate whatever you want with it.