PBR Material not black when HDR environment texture level is set to 0 and all lights are turned off

Hello guys,

First of all, the scene setup I have is:
1- A sphere.
2- A HDR environment texture (pre-filtered on load as below):

let hdrTexture = new HDRCubeTexture("/texture//Studio_HDRI_003.hdr", scene, 512, false, false, false, true);
scene.environmentTexture = hdrTexture;

3- No lights at all.

Now, when I apply a PBR material with albedo color (red) and metallic factor 1.0 and set the HDR environment texture level to zero, I get the expected result as below:

But, when I apply a PBR material with the same albedo color (red) and metallic factor 0.5 and set the HDR environment texture level to zero again, I get the result as below:

Does someone know, or can someone explain where does the sphere get the light from when environment texture level is set to zero?

I would really appreciate your answer.

Thank you.

Regards,
Gerald

this is completely expected as in this case you still have the diffuse part of the environment working through the harmonics. to fully dim the environment you want to rely on scene.environmentIntensity which use to dim fully the env and not just the texture part.

Thank you very much for your response.

I did try setting the scene.environmentIntensity and that works as you explained. But, is there a way to control the reflectivity separately from the environment light?

@sebavan Thank you again for your response, but I am still not clear.

I will try to be as clear as possible so that you understand what I am looking for in BabylonJS.

The setup example is from Unity:

1- The scene contains one camera (Clear Flags: Solid Color, Background color: 1, 1, 1, 0), so the camera has a transparent background. I have the same setup in Babylon as well.

2- The scene contains two spheres, one having material with metallic factor set to 1 and another having a material with metallic factor set to 0.4(non-metallic).

3- I have set the Lighting settings in Unity as in the picture below:
Lighting Settings Unity

  • As you can see the ambient color is set to (1, 1, 1).
  • Cubemap is the same as the prefiltered HDR texture in Babylon.
  • Intensity Multiplier is set to 1.

The scene looks as below(Intensity Multiplier = 1, Ambient Color = (1, 1, 1):

4- If I set the Intensity Multiplier to 0 and Ambient Color to (1, 1, 1), the result would be as below:

5- If I set the Ambient Color to 0 and Ambient Color to (0, 0, 0), I would get the following result:

This is the control I want to have in BabylonJS as well.

Is this possible?

What is the Intensity Multiplier in BabylonJS and what is the Ambient Color in BabylonJS?

I would be really grateful if you or someone else would have the right answer.

Thank you in advance. :slight_smile:

@sebavan Please let me know if what I asked in the post above is possible in Babylon.
Thank you again. :slight_smile:

Intensity Multiplier is the scene.environmentIntensity

AmbientColor is equivalent (in some ways) to material.reflectionColor

@sebavan Thank you for your response.
I need to test the material.reflectionColor and see if that’s the equivalent of ambient color in Unity Lighting settings.

Another thing which I realized from testing is that the Intensity Multiplier in Unity is actually the equivalent of scene.environmentTexture.level and not the equivalent of scene.environmentIntensity.

As soon as I have tested the material.reflectionColor I will let you know.

Thanks :slight_smile:

Here a quick show of reflectionColor effect https://playground.babylonjs.com/#8AMWS5#2

@Vinc3r Thanks. :wink:

I think material.reflectionColor is actually the same with the Environment Lighting ->Ambient Color in Unity.