PBRLighting.j3md: annotate LightMap as being a LINEAR texture#2139
PBRLighting.j3md: annotate LightMap as being a LINEAR texture#2139stephengold wants to merge 1 commit intomasterfrom
Conversation
|
This change eliminates some runtime diagnostics like this one: Nov 04, 2023 11:44:39 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(). |
|
Is the light map supposed to be linear? It is sampled as color, so i would say it should be sRGB, but i genuinely don't know what is the consensus for light maps. |
|
The only evidence I have one way or the other is that it's common to specify the same texture for both "LightMap" and "MetallicRoughnessMap" (with "LightMapAsAOMap" set to |
|
It seems that when LightMapAsAOMap is true the lightmap is used as ao map that is a grayscale linear texture that can be specified as -LINEAR. |
|
@riccardobl How inconvenient! |
|
We have so many possible combinations in our PBR shader at this point, but my understanding is that if the AO map is the R component of MetallicRoughnessMap, it should be used by setting AoPackedInMRMap. |
|
PBRLighting.j3md does seem needlessly complex. So if "AoPackedInMRMap" is true then the AO map is linear, but if "LightMapAsAOMap" is true then the AO map is sRGB? |
|
AO is always linear, but the lightmap is linear if it contains only AO or sRGB if it is a full lightmap |
This PR should eliminate the distracting/confusing warnings currently generated when the same texture is specified for both LightMap and another PBR map.