I am working in GPGPU.
I have some 16bit data in my red channel on a texture with this specification:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, size, size, 0, GL_RED, GL_UNSIGNED_BYTE, Data);
This is clamped between 0-1. I want to make some calculation on it in the shader. Problem is that if i make any computations they are completely wrong because of the fact they are clamped. Or thats what i think.
I tried to use:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, size, size, 0, GL_RED, GL_FLOAT, DATA);
but this creates a stack overflow while creating the input texture. Is there a way to use that unsigned chae* as a float?
Or anyone can explain me, if on the Shader the clamped inputs can be used even if in one point their values gets bigger than 1?
And how can i take the clamped results back in normal form?
I tried to read with a texture of this type:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, size, size, 0, GL_RED, GL_FLOAT, NULL);
The values were clamped if use the input with the GL_UNSIGNED_BYTE. I tried multiplying it with 2^16-1 but the results were completely off.