How do I convert a photo from color to black and white using OpenGL?
Lets say we see an image of people watching tv in color and when I add the OpenGL code it turns into this:
What is the code to convert the phot开发者_如何转开发o from color to black and white?
Temptative answer : use a glsl shader
float luminance = (in.r+in.g+in.b)/3.0;
gl_FragColor = vec4(luminance, luminance, luminance, 1.0);
but this is one lame question
精彩评论