Babylon.js: PBRMaterial washed out for basic albedo color material

Created on 25 Mar 2020  路  3Comments  路  Source: BabylonJS/Babylon.js

Hey Folks!

We've been seeing some washed out materials lately in the following scenario:

  • Create a basic geometry like a box
  • Create a PBRMaterial
  • Set albedoColor to a value such as '#A4262C' (this is a burgundy shade)
  • Flag material as unlit, assign it to the geometry

The result is a faded look compared to the expected (in pg as a StandardMaterial) - it seems like the PBR is in linear mode rather than SRGB.

Repro on this playground:
https://www.babylonjs-playground.com/#2BGTDG#3

rendering engine

Most helpful comment

Not a recent change, just a recent feature. Using this sort of shading to tint things dynamically. Didn't realize we should be using the .toLinearSpace helper. Thanks!

All 3 comments

Yup this is expected for the PBR material. All the scalar input for color are expected to be in linear space (similar to gltf data).

You can use the color utils toGammaSpace or toLinearSpace to convert from one space to the other.

Did you experience a recent change on this ? as it should have always been the case ?

Adding the PG using the utils:

https://www.babylonjs-playground.com/#2BGTDG#4

I am closing for now as it is not a bug, but feel free to reopen if something changes as I would like to track it down.

Not a recent change, just a recent feature. Using this sort of shading to tint things dynamically. Didn't realize we should be using the .toLinearSpace helper. Thanks!

Was this page helpful?
0 / 5 - 0 ratings