HDR Environment map doesn't work unless I convert it to a PMREM

MeshStandardMaterial doesn’t work with a HDR equirectangular environment map unless I convert it to a PMREM.

Not sure if this ever worked, but I feel like I would have noticed before if it was not possible.

Here’s a pen that demonstrates what I mean:

This fails:

const envMap = await loadEnvironment();
scene.environment = envMap;

This works:

const envMap = await loadEnvironment();
const envMapPMREM = createPMREM(pmremGenerator, envMap);
scene.environment = envMapPMREM;

Is it required to use PMREM with MeshStandardMaterial now? I know it’s required for correct results, but I’m sure it used to at least work previously.
Or perhaps I need to change some settings on the loaded texture?

lol @ timing

:sweat_smile:

Sorry, I didn’t see your post before I made mine.

Have you tested this with LDR maps or cubemaps?

just LDR. I think if this is unintended then it was broken for months without anyone noticing.

OK, well I have only tested with HDR so it’s probably all of them.

see Envmap + no lights = dark scene

Thanks. So the answer for anyone else coming here is that you cannot use equirectangular textures as environment maps with MeshStandardMaterial.

The terrible thing about this is that I’m actually the person who added the note to docs saying that equirectangular maps are not supported :unamused:

Don’t worry about it. Details like that can easily be overlooked. After all, it was easy to clarify the situation because of the docs :wink:

And from your commit message it was after WestLangley commented on Aug 14, 2018, so 1.5 years now, not “months”. Now how many projects I have shipped during that time not noticing it was not working because the lights were on :thinking: