opengl - Luminance values clipped to [0, 1] during texture transfer? -


i uploading host-side texture opengl using like:

glfloat * values = new [nrows * ncols];  // initialize values (int = 0; < nrows * ncols; ++i) {     values[i] = (i % 201 - 100) / 10.0f; // values -10.0f .. + 10.0f }  gltexsubimage2d(gl_texture_2d, 0, 0, 0, nrows, ncols, gl_luminance, gl_float, values); 

however, when read texture using glgetteximage(), turns out values clipped range [0..1].

first, cannot find behavior documented (i using red book opengl 2.1).

second, possible change behavior , let values pass unchanged? want access unscaled, unclipped data in glsl shader.

i cannot find behavior documented

in actual specification, it's in section on pixel rectangles, titled transfer of pixel rectangles.

second, possible change behavior , let values pass unchanged?

yes. if want use "unscaled, unclamped" data, have use floating point image format. format of texture defined when created storage it, call glteximage2d. third parameter of function defines format. use proper floating-point format instead of integer one.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -