Fade scene to monochrome

Started by
1 comment, last by WillPash 18 years, 1 month ago
Hi Peeps Just wondering if there is a way to fade a colour 24/32 bit scene in OpenGL to monochrome (just like when the screensaver begins when you open the close prompt in WindowsXP!). I dont know how to handle this, can anyone help... Thanks
Dave 'Kit' Wilson - Reliant Code
Advertisement
search for how to calc a pixels luminance (theres a few diff methods)
eg (from memory, not correct)
float lum = R*0.3 + G*0.6 + B*0.1

then do
final_color = mix( vec3(lum), color, fade_amount );

change fade_amount from 0.0 -> 1.0 slowly + youll see the screen go from greyscale to color (or the opposite)
Thanks Zed I will try that out... Cheers mate
Dave 'Kit' Wilson - Reliant Code

This topic is closed to new replies.

Advertisement