Light color in PBR in linear or gamma space?

Today I found out that the albedo color in PBR materials needs to be converted to linear color space to appear correctly, otherwise they will be washed out.

What about the lights though? The color specified when you create them, will it be converted internally to linear (like with textures) or should that be done manually as well (like the albedo color)?

adding @sebavan

Simple colors you pass to the PBR pipeline like the light color, the material emissive/albedo/… colors should be provided in linear space.

Only the texture colors (albedo texture for eg, but not normal or roughness textures, as those are not color textures) are automatically converted from sRGB to linear space in the shaders (as you can hardly do it yourself).

3 Likes

Thank you for clearing it up for me.

Is this documented anywhere obvious? The reason I’m asking is that intuitively one would expect to get the same result by setting the albedo color to (127, 127, 127) as when using a single pixel albedo texture with the same pixel value.

I’m not saying that the Babylon way is wrong in any way, just counter intuitive and perhaps will bite other users as well. Especially if they are moving from Three.js which does not require values in linear color space.

1 Like