Black and White

g’day to you all,

Is there a way to changes a scene from being coloured (by textures) to black and white without changing all the textures? Changing the hue perhaps?

DP

That would be saturation. And I don’t know any way for doing that with plain opengl. (You could do something like that with shaders - similar to ATI’s post processing effects in their newer drivers).

Edit: Well you could have a b/w copy of the image in the texture’s alpha channel or you could use two textures at the same time and fade across.

Thats a good suggestion about the alpha channel (png dependant, but thats ok).

The alpha channel in png isn’t used in OpenGL. its usually black that signifies alpha. So i think it should be OK.

Looks like a fair bit of coding is due…unless theres another option? Vertex programs?

DP

Well, OpenGL will automatically convert RGB into a Luminance value in some pixel-transfer operations. I suspect you’ll want to write RGB to a pbuffer, read it back as Luminance, and texture that as a full-screen quad. I’ve not played with that kind of thing myself, so I can’t help you with the specifics, I’m afraid!

There are usually gamma adjustments and similar settings that can be adjusted. But I don’t know if there are any standard APIs to get at those parameters. If you can get at them then you might be able to take out all the chroma info that way.

thx for all the help, I think it might just be easier to keep it colour and add a little tint perhaps (red or green, haven’t decided yet).

If anybody can come up with a more concrete answer, id be exstatic.

DP