[Solved] Need help with Gamma Correction

Hi
Please take a look at these screenshots :

1- Model with no NormalMap and Gamma Correction is off : It looks OK

2- Model with NormalMap and Gamma Correction is off : Why it is like this ?

3- Model with NormalMap and Gamma Correction is on : Looks OK.

Is there something wrong with NormalMap?
When I enable GammaCorrection It fix the look of this model but cause my other models in the scene looks so bright so can I fix this problem without enabling Gamma Correction ?

Did you generate tangents for your model?

Usually that’s the issue in these cases since a normal map is basically nonsense for models without tangents.

1 Like

Paul your idea really hit the bull’s-eye . thank you!

this did the trick : TangentBinormalGenerator.generate(mySpatial);

Glad it worked. The odds were in my favor since 99% of the time, that’s the issue where normal maps are involved. :slight_smile:

You should always have gamma correction on.
I’m tempted to set it as a default for 3.1 and remove the checkbox in the setting dialog.
This way if you want to remove it you’ll have to do it by code and to knwo what you’re doing exactly.

2 Likes

…but then you screw up every game that hasn’t planned their textures for it, yes?

Well you’ll always be able to go :

settings.setGammaCorrection(false);

Not textures. Material colors, like:

mat.setColor("Diffuse", /* whatever */)

I thought when gamma was on then JME treated textures differently.

Really? So no need to edit texture gamma in image editors ?
Then can we set it directly in blender material diffuse color ?
If yes , then what is the preferable color number to set ?

Right. It will perform a gamma → linear conversion for textures and then a linear → gamma conversion when writing to the framebuffer. Those two operations cancel each other out.
Unfortunately this does not happen for colors which are either in gamma space when gamma correction is disabled, or in linear space when it is enabled.

1 Like

Makes sense. I sort of remembered that after posting but then thought that the ‘official answer’ would be appropriate for this thread given the context of the conversation so far.

Result: most of my games are fine. Mythruna will be a bitch to convert because of all of the hand tweaking of specific runtime colors… but I may be able to write a utility to smooth that transition someday.