Gamma Correction

Hey guys,

I have a question regarding gamma correction when reading texture files.

My textures are stored in non-linear space and so when I read them in I need to convert them to linear space before doing my lighting calculations. I can do this in my shader with:


vec4 texColor = texture(m_Texture, texCoord); = pow(, 2.2);


However according to the OpenGL spec, I can used sRGB textures and the hardware will perform this conversion for me automatically:


I did a search in the JME code and found nowhere that GL.GL_SRGB8_ALPHA8 is being used.

So my question is:

Does JME have a way for me to tell it that a Texture is sRGB and thus when I use the texture(tex, coords) function in the shader, OpenGL will automatically apply the gamma correction?

not sure it works like that.

look at this thread

@remorhaz gave valuable insight about gamma correction and how he was using it with JME.

There are also source articles about gamma correction that are very interesting.