PDA

View Full Version : Black&White scene



Arath
10-16-2000, 01:14 AM
hi,

I would like to switch a scene in black&white without reloading all my texture or changing screen mode?

Is there any solution with alpha-blending (multiplicative or add) ? or even a solution?

If someone has got an iD ...

Cheers
Arath

Dodger
10-16-2000, 07:35 PM
I assume you mean greyscaled by b/w...

Only thing I can think of is reading back the color buffer, converting it to greyscale and writing the result to the color buffer again. If the greyscale conversion is supposed to be quick, just add r, g and b of each pixel (keep conversion in mind for 24bit color buffer - 3*8=24bit so use 32bit integer to store the result), divide by 3 and write the result to r, g and b of each pixel. If it's supposed to look good, use an optical correct greyscale conversion.

Maybe, if you're not using alpha channels in your textures, you could use the alpha to store the greyscale values (8 bit alpha gives you 256 shades) in your textures. Then render the scene and copy the alpha buffer to the color buffer?

10-16-2000, 09:05 PM
in the first result it should be

.30r+.59g+.11b=image

or it wont look right
this is what bw tv does

DFrey
10-17-2000, 04:35 AM
In Windows, depending upon the dynamic range of colors used in the scene, playing around with SetDeviceGammaRamp(...) may be able to acheive a mono-color effect (not necessarily B&W). But this effect applies to the display device in general so you'd only want to do that in fullscreen mode.


[This message has been edited by DFrey (edited 10-17-2000).]