Differences in PBR Material Behavior Between Babylon 5 and 7

Hi everyone,

I recently updated BabylonJS from version 5.57.1 to 7.47.2 for my project to take advantage of new features. However, I noticed that the PBR Material behavior has changed significantly between these versions.

I am using the exact same model, identical environment map, and the same scene material image processing settings. The IBL intensity is also unchanged. Despite this, the metallic/roughness workflow produces different results.

To ensure the issue wasn’t related to my implementation, I also tested the materials in the BabylonJS Sandbox, and the behavior is exactly the same as in my project. This confirms that the difference is coming from the rendering engine itself rather than any custom settings in my scene.

The model I am using for testing is available here:
:link: Suzanne Hi-Poly GLB Model

The environment map I am using is:
:earth_africa: Studio With Gradients .env Map

Here are some comparisons between Babylon 5.57.1 and 7.47.2 at the same metallic/roughness values:

To cross-check, I also tested a metallic/roughness workflow in Unity with the same env to get another reference, and it seems to me more similar to the Babylon 5 reference (ex. with metallic 1, roughness 1):

Have there been notable changes in the PBR Material rendering between BabylonJS 5.57.1 and 7.6.0? If so, is there any documentation or explanation for these differences?

Thanks in advance for your help!

cc @PatrickRyan

Here’s some Sandbox links for the before vs after.

(P.S. Welcome to the forum! :slight_smile: )

@c.gianfrate, if I remember correctly between 5.5 and now, there was an update in the glTF spec because it was not handling energy conservation correctly, so we updated our implementation to correctly conserve energy. Basically, it means that under certain circumstances the energy reflected from the material surface was not equal to the amount of energy hitting it. I will try to track down the furnace test model we used to illustrate it, but the person who might know where the model lives is out of the office right now.

I don’t remember exactly when that update came into the engine, but I will say that the way we render now is more physically accurate. I don’t think there’s much in the way of documentation about the change because in essence it was a bug in the way we were rendering. However, @cx20 has a great resource for comparing the different renderers to see where there may be differences. If you look at the PBR models, you can see that we have all snapped to the correct energy conservation now. I hope this helps explain the difference.

3 Likes

In fact, it is this PR (available since 7.45.0) that modifies the way in which models with high roughness are rendered, to be better aligned with raytraced ground truths.

Model in 7.44.1: Babylon.js Sandbox - View glTF, glb, obj and babylon files

Model in 7.45.0: Babylon.js Sandbox - View glTF, glb, obj and babylon files

2 Likes

To go back to the previous version (less physically correct) in case you can not adapt your model, feel free to set DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE to false in BABYLON.PBRBRDFConfiguration

Here is how it improved for reference:

3 Likes

Should this be part of the breaking changes docs?

I did not put it there cause it is more a bug fix but I can understand the concerns. @RaananW any easy way to add back a breaking change in the list ?

Of course, just edit this file - Documentation/content/breaking-changes.md at master · BabylonJS/Documentation · GitHub

1 Like