Grayscale and Alpha Rendering

Started by
4 comments, last by intransigent-seal 18 years, 1 month ago
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).
Advertisement
why not make glGrayscale2ubv() yourself and have it call glColor3ub()
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
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
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 deavik
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]

Oh, right. My bad.

John B
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.

This topic is closed to new replies.

Advertisement