Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpecularGlossiness materials no longer reflect the environment #18463

Closed
3 of 13 tasks
elalish opened this issue Jan 23, 2020 · 6 comments · Fixed by #18474
Closed
3 of 13 tasks

SpecularGlossiness materials no longer reflect the environment #18463

elalish opened this issue Jan 23, 2020 · 6 comments · Fixed by #18474

Comments

@elalish
Copy link
Contributor

elalish commented Jan 23, 2020

Description of the problem

Something happened between r110 and dev, where glTF with SpecularGlossiness aren't playing well with PMREM anymore (other lights work).

To repro, put this model in Don's viewer and turn off the ambient and direct lights and you'll see this:
image

Three.js version
  • Dev
  • r112
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)
@elalish
Copy link
Contributor Author

elalish commented Jan 23, 2020

Ping @donmccurdy @Mugen87

@WestLangley
Copy link
Collaborator

@elalish Does the three.js example work for you?

@donmccurdy
Copy link
Collaborator

Loading the model in my viewer...

https://gltf-viewer.donmccurdy.com/#model=https://rawcdn.githack.com/KhronosGroup/glTF-Sample-Models/130fe585dd2133fee6dc79d22ecddd3e73ea7af0/2.0/SpecGlossVsMetalRough/glTF-Binary/SpecGlossVsMetalRough.glb

... I've confirmed that copying scene.environment to material.envMap fixes the issue. Run this in the JS console to see the fix:

var envMap = content.parent.environment;
content.traverse((o) => {
  if (o.isMesh) {
    o.material.envMap = envMap;
    o.material.needsUpdate = true;
  }
});

So #18465 really does look like the right solution, but I'm not sure why it doesn't seem to be working.

@mrdoob
Copy link
Owner

mrdoob commented Jan 24, 2020

I'll take a look tomorrow.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 24, 2020

Just for the record: The reason why Scene.environment does not work for the specular/glossiness material is explained here: #18265 (comment)

@elalish
Copy link
Contributor Author

elalish commented Jan 24, 2020

@WestLangley indeed, that model works, since the problem is restricted to scene.environment. Thanks for bringing that test to my attention though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants