Grayscale and Alpha Rendering
This might be a stupid question, but how would you go about rendering an array of a grayscale value and an alpha value? Is glColor3ub(ga[0], ga[0], ga[0], ga[1]) the only way to do it? It would be much more convenient to have a function like glGrayscale2ubv(ga).
Yes, I could do that, but it would be much better to use OGL's way of doing it. But, since you are sort implying that there isn't a way, I guess I'll have to go that route.
Uh... there's a glColor4ubv() function:
void glColor4ubv(const GLubyte *v);
Is that what you're looking for?
John B
void glColor4ubv(const GLubyte *v);
Is that what you're looking for?
John B
Quote:Original post by JohnBSmall
Uh... there's a glColor4ubv() function:
void glColor4ubv(const GLubyte *v);
Is that what you're looking for?
John B
I think he's looking for a function that will repeat the rgb values for a grayscale color. [smile]
Personally I think, yes you should write an inline function that takes intensity + alpha, calls glColor4* with (intensity/3, intensity/3, intensity/3, alpha)
/edit: If you are using shaders BTW, it will possibly be faster with a shader and more elegant.
Quote:Original post by deavikQuote:Original post by JohnBSmall
Uh... there's a glColor4ubv() function:
void glColor4ubv(const GLubyte *v);
Is that what you're looking for?
John B
I think he's looking for a function that will repeat the rgb values for a grayscale color. [smile]
Oh, right. My bad.
John B
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement