4.2.0 materials are to bright if SSAO is used

With version 4.2.0 materials are two bright if SSAO is used.
See here: https://www.babylonjs-playground.com/#CNT50Z#1

colors are only correct if i do one of the following:

  • disable SSAO or
  • set forceGeometryBuffer in the SSAO constructor to true or
  • do not use toneMapping/ImageProcessing for the materials

pinging @CraigFeldspar

With the new Prepass optimisation for SSAO2 introduced in 4.2 a gamma transform is automatically performed and your tonemapping also performs a gamma transform.
So basically there’s 1 gamma transform too much.

Therefore I added a parameter in the prepass to force disable that transform :

Here is a PG that fixes your issue, setting the boolean to true. Will only work when the PR is merged and deployed :
https://playground.babylonjs.com/#CNT50Z#4

1 Like