great, but I’m doing GPGPU and I don’t care about floats. My texture type is GL_UNSIGNED_BYTE and I would like to be able to write :
gl_FragColor.x = 255;
All I can do right now is casting my int to float, divide it by 255, and let the hardware remultiply it by 255 so that it fits in the GL_UNSIGNED_BYTE.
All I can do right now is casting my int to float, divide it by 255, and let the hardware remultiply it by 255 so that it fits in the GL_UNSIGNED_BYTE.
Is there any possibility there ?
Not without GL 3.0. There, you can designate arbitrary outputs which you then map to particular FBO attach points. So you can create a ‘uvec4’ output that goes to a texture with an unsigned integer internal format.