EXR color space: it is too bright now especially with 152

I load an exr file such as this one: Abandoned Parking HDRI • Poly Haven that looks like

I use EXRLoader to make a texture, and then sets the color space of that texture to be SRGBColorSpace, then feed it to PMREMGenerator, and keep the colorSpace of resulting texture to be intact (SRGBLinear) as it looks like PMREMGenerator has a reason to produce a texture with SRGBLinear. I use the resulting texture to scene.background and scene.environment where the renderer is using the default values of outputColorSpace and ColorManagement.enabled. It still came out like this:

As you can see the color of the sky is saturated, compared to the view on the polyhaven site. What does it take to make it look like the polyhaven site, and more importantly not make MeshStandardMaterials also washed out? The relevant code is here: microverse/behaviors/campus/lights.js at 2550314797e333ae6c158e0d9c04ab80fab3239f · croquet/microverse · GitHub . The assetManager.load() there loads the EXR data by using EXRLoader.

I use EXRLoader to make a texture, and then sets the color space of that texture to be SRGBColorSpace, then feed it to PMREMGenerator, and keep the colorSpace of resulting texture to be intact (SRGBLinear) as it looks like PMREMGenerator has a reason to produce a texture with SRGBLinear…

An OpenEXR texture is very unlikely to be in the sRGB color space. Typically they are Linear-sRGB, which is also the default EXRLoader will choose. This applies to most HDR textures as well.

I think if you leave the defaults alone you should be OK here, or you can equivalently set THREE.LinearSRGBColorspace.

If the colors appear right but the scene is over-exposed or blown-out, you may want to enable tone mapping on your renderer. This is a good idea in general for lit scenes.

Using the default still gives me satulated result. I was browsing the PMREMGenerator.js code

and it appears to me (that FragColor.rgb is used as it is. That may be less ok now with the color model change in 152 or such, perhaps?

You can see correct use of EXR textures in these two examples:

https://threejs.org/examples/?q=exr#webgl_materials_envmaps_exr

Both the EXR source texture and the PMREM output texture are in Linear-sRGB — neither should be annotated with SRGBColorSpace.

Thanks for the info for the example. The example controls toneMappigExposure of the renderer (as you suggested) and probably that is how I need to go with. My app is a construction framework so there will be many different use cases. I think we have to get into the habit of setting exposure in case by case basis.

1 Like