View Full Version : grayscale via glTeximage2d

01-27-2003, 05:16 PM
Hi all,

I have an array of floats in the range of -1 to 1 and would like to know the best way to load it with glTexImage2d?

I have tried
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0, GL_LUMINANCE, GL_FLOAT, data);

But this doesn't work, it turns out gray (the whole image).

The best results i have so far are to convert my array into RGB and upload that.

01-27-2003, 05:22 PM
oops fixed it my bad.. needed to scale -1,1 to 0,1..

*pulls away in silently*