I want to render a 2d array of float point using texture mapping. The code is as follow.
float pixelBuf[512][512];
…
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_LUMINENCE, GL_FLOAT, pixelBuf);
But the result looks as if the value of pixel buffer is clamped to [0.0, 1.0], so the result is a binary image. I want to know if the float buffer must be scaled properly([0.0, 1.0]) before it can be passed to OpenGL? Because the pixelBuf is reused by later operation, does it mean that i must allocate another buffer and scale the value of original buffer to this new buffer? Is OpenGL support this scale in hardware?
Thank for any help.