looeee
March 9, 2020, 5:16am
1
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?
looeee
March 9, 2020, 7:16am
3
Sorry, I didn’t see your post before I made mine.
Have you tested this with LDR maps or cubemaps?
makc3d
March 9, 2020, 7:29am
4
just LDR. I think if this is unintended then it was broken for months without anyone noticing.
1 Like
looeee
March 9, 2020, 8:33am
5
OK, well I have only tested with HDR so it’s probably all of them.
1 Like
looeee
March 9, 2020, 10:15am
7
Thanks. So the answer for anyone else coming here is that you cannot use equirectangular textures as environment maps with MeshStandardMaterial.
3 Likes
looeee
March 9, 2020, 10:24am
8
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
2 Likes
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
1 Like
makc3d
March 9, 2020, 11:31am
10
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
1 Like