Scene too bright after adding hdr environment texture

I had a scene with lights working but after adding environment texture like this
var hdrTexture = new BABYLON.CubeTexture.CreateFromPrefilteredData( ‘assets/hdr/parking.env’, scene );
scene.environmentTexture = hdrTexture;
scene.createDefaultSkybox( hdrTexture );

Everything becomes too bright. This persists even if I disable all the lights in the scene. I tried messing with the different properties on the texture but couldnt resolve the issue. I used one of the example hdr files from babylonJS documentations. But the issue persists with different HDR files from HDRHaven.
The model is created in blender and imported as glb file.
Before after comparison.

Hard to help without a repro…

Can you try with:

scene.environmentTexture = BABYLON.CubeTexture.CreateFromPrefilteredData("textures/environment.env", scene);

to be sure it does not work neither with a standard env?

Still have the same issue. I will create a playground when I get home to showcase the issue.

Not really surprised. Environment textures are a PBR form of lighting. I suppose you could keep the regular lights to highlight certain areas, or for dynamic shadows, but comment them out & see what you get.

If that is still too bright for you. There is an environmentIntensity property, default 1, of PBRMaterials. You could loop through all the scene’s.materials, and lower it to suit you. If you are using the Blender .babylon exporter, there is a world custom property to set it for all materials, as well as an override property inside of material to have one different from the rest of the materials.

If using something else, do it yourself after everything has loaded, but I am positive it works. First, toss the lights unless & see what you get, though. Doing both does have a GPU fragment shader cost as well, but programs are usually CPU bound so probably only a minor impact.

2 Likes

Tnx it fixed my issue. Will start using babylon exporter to make stuff easier for future.

2 Likes