Question

This might seem like a simple question but Id like to know the fastest technique for converting an RGBA image to a grayscale image in OpenGL WITHOUT using GLSL. I.e. How do I take an RGBA texture and convert it to a plain single channel texture using the following formula: output=0.3*RED + 0.59*GREEN + 0.11*Blue

Was it helpful?

Solution

You might be able to convince GL_DOT3_RGB to do what you want.

OTHER TIPS

Well I don't know about "fastest", but you should be able to do the opposite of this tutorial and get the greyscale image you're looking for. The techniques are the same just backwards.

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=37

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top