The MoreAdvancedVehicles project (using JME 3.3.2-stable) issues a warning while loading the tank asset:
Jan 24, 2021 4:53:23 PM com.jme3.material.Material checkTextureParamColorSpace
WARNING: The texture Models/Tank/Tank_Occ_Rough_Metal.png has linear color space, but the material parameter LightMap specifies no color space requirement, this may lead to unexpected behavior.
Check if the image was not set to another material parameter with a linear color space, or that you did not set the ColorSpace to Linear using texture.getImage.setColorSpace().
Does anyone know a way to avoid this warning, short of configuring Material.logger?
An identical warning occurs in the TestPbrLighting app of jme3-examples, which is simpler and thus easier to debug.
I do not, but I would love to know the answer as I get that warning regularly as well. At one point I had investigated it and found that the texture was flagged as linear from the material, but for some reason I still get the warning.
That was just the code I was using for getting the textures from the material when I was looking into the warning several months ago. The code does not have anything to do with loading the textures or the color space, as by the time I extract the textures from the material the texture is already loaded and the warning has already occurred. It was just a convenient because it already pulled the textures from the material. I’m simply showing that the texture object I checked was pulled from the material.
Ok, but without showing the check, etc… It lacks all of the meaningful parts to me. I would have already believed you if you said you looked at the textures in the material.
I think TestPbrLighting is probably a more useful direction since it’s a simple self-contained test that exhibits the issue.
Without knowing more details or context, the answer is: “setup the material better” or “setup the texture better”.
It’s caused by exactly what the error says. Textures can be “linear space” or “srgb” space. A particular material parameter will generally expect one or the other. Since “most” textures are coloring (diffuse maps, albedo maps, etc.) they should be in “srgb”. If they are not specified that way and the material parameter does not specify that it specifically wants “linear space” then JME gives a warning.
Generally, it means the material parameter is defined without a LINEAR_SPACE marker or that the texture should be srgb and isn’t.
Side note: linear color space textures store information as colors too, but the values of these colors are used for something else, e.g. the normal map stores encoded normal vectors, etc.
You don’t want these values to be messed up by srgb.