开发者

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:

How do I convert a photo from color to black and white using OpenGL?

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜