Three.js: Ambient light brightes metal materials with high roughness

Created on 14 Aug 2019  路  9Comments  路  Source: mrdoob/three.js

In the current dev version materials with a metalness of 1 get brighter through the ambient light. The rougher they are the stronger the efffect is.

Testscene

Sphere left side: metalness: 1, roughness: 0,
Sphere right side: metalness: 1, roughness: 1
AmbientLight Intensity: 2

Expected (r107)

Spheres r107
The ambient light intensity does not change the brightness of metal materials
jsfiddle master

Actual (dev)

Spheres dev
The ambient light intensity changes the brightness of the smooth metal a bit and the brightness of the rough metal a lot.
jsfiddle dev

Three.js version
  • [x] Dev
  • [ ] r107
Browser
  • [x] All of them
OS
  • [x] Windows
Bug

Most helpful comment

@WestLangley probably it is related with the clearcoat normal PR, these changes add others behavior related to the lights_physical_pars_fragment. I create a test to ensure if preserve-energy is the bug causing, bellow. I will have to look at this more calmly to find out the origin.

https://jsfiddle.net/zdyf196n/
https://github.com/sunag/three.js/tree/dev-bug-test1

All 9 comments

I expect this is the cause...

https://github.com/mrdoob/three.js/issues/17102#issuecomment-518053612

/ping @jsantell
/ping @sunag

@WestLangley probably it is related with the clearcoat normal PR, these changes add others behavior related to the lights_physical_pars_fragment. I create a test to ensure if preserve-energy is the bug causing, bellow. I will have to look at this more calmly to find out the origin.

https://jsfiddle.net/zdyf196n/
https://github.com/sunag/three.js/tree/dev-bug-test1

@mrdoob Little Reminder: I suppose this issue should be fixed before R108 is released next week, right?

@WestLangley I am questioning myself if this is a bug... Because for me the result is right today and wrong in the r107.

r107 for example, AmbientLight.intensity make no difference, but should do.
r108 its add AmbientLight.intensity = 2 if you descreasing the intensity the ambience( white irradiance light ) also decrease, which is natural.

r107 for example, AmbientLight.intensity make no difference, but should do.
r108 its add AmbientLight.intensity = 2 if you descreasing the intensity the ambience( white irradiance light ) also decrease, which is natural.

That sounds correct to me... 馃

This is definitely a bug.

The _diffuse reflectance_ of a pure metallic material is zero. Metals only reflect specularly, so the pure metal in our model should not respond to the AmbientLight.

This bug was introduced in r.101 to Standard/Physical materials when using PMREM.

In r.108dev, the bug was extended to include Standard/Physical materials in non-PMREM use cases. This is what is demonstrated here.

@WestLangley I think that for the pure metallic effect it is not should be roughness=0?

I test in other engine and the it looks the same of r108.

pbr.metallic = 1.0;
pbr.roughness = 1.0;

Widthout HemiLight
https://www.babylonjs-playground.com/#FEEK7G#59

With HemiLight
https://www.babylonjs-playground.com/#FEEK7G#58

Other example is NodeMaterial sub-slot, there is no analytic irradiance light only IBL, if your define radiance=0, roughness=1, and metalness=1 it generates irradiance from IBL.
if it is set to roughness=0 its not generates irradiance because it is a pure metal.

https://raw.githack.com/sunag/three.js/dev-r8/examples/webgl_materials_nodes.html?e=sub-slot

@sunag

  1. You are confusing diffuse reflectance and specular energy conservation. Metals do not reflect diffusely. The increased brightness you see in the babylon playground is specular energy.
  2. Babylon has a different hemisphere-light model than three.js does -- babylon's has a specular hot-spot; three.js' does not.
  3. three.js ambient light has no specular component, either.

@WestLangley Yes, I see. Ok, you must be right same. Thank you for your answer.

Was this page helpful?
0 / 5 - 0 ratings