google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
6.85k stars 810 forks source link

AR model reflects environment-image #1445

Closed paperli closed 2 years ago

paperli commented 4 years ago

Description

I set both the environment-image and skybox-image in the model-viewer, and view the model in AR with a Pixel 3. The model reflects the environment-image in WebXR’s AR viewer. It makes no sense because the AR model is supposed to reflect the real-world environment instead of a pre-set env map.

Is there an attribute to prevent environment-image reflection in AR, or a fix to remove environment-image from the reflection in WenXR?

It’s worth noting that there is no problem either in iOS’s quick look viewer or when set only the skybox-image(no environment-image.)

Live Demo

With skybox-image and environment-image: https://glitch.com/~chipped-daffy-anaconda with skybox-image only: https://glitch.com/~exultant-reinvented-meeting

Version

Browser Affected

OS

elalish commented 4 years ago

Correct, and it does this because the WebXR API does not yet expose estimated environment lighting, though it's coming soon. If you select ar-modes="scene-viewer quick-look", those both use estimated lighting, though we've actually gotten even more complaints about that. It's all ML, and sadly nothing is perfect.

paperli commented 4 years ago

Thanks for the reply. We did change the at-modes settings to work around the problem. I am still curious about why skybox-image doesn’t affect the reflection but environment-image dose.

elalish commented 4 years ago

environment-image is what affects lighting and therefore reflections. It should default to skybox-image if only that is specified. Are you seeing different behavior than that?

paperli commented 4 years ago

Edit: it was false alarm Yes, if I assign only the skybox-image property without environment-image, the model doesn’t reflect the skybox-image. When you compare below images, you can see the env-map is reflected in the first model, which make it darker(the blue leather part). But the second one is much brighter. The only difference is with or without environment-image.

elalish commented 4 years ago

Can you remix the Glitch from our issue template to demonstrate? Also, if you can use colored or sunrise environments just to make them more obvious, that would be helpful. Many other things can contribute to overall brightness.

paperli commented 4 years ago

Sorry, I tried again and found that I fired a false alarm. In both with/without environment-image situations, the WebXR's AR mode shows similar behavior. The model reflects either environment-image or skybox-image. I don't exactly know why I saw the different results in the previous test. Edit: turns out that in the previous test, the AR mode fell back to Scene Viewer. That’s why I saw the result.

However, I share the two set-ups in Glitch:

elalish commented 2 years ago

And we now have the xr-environment attribute to enable lighting estimation in WebXR mode.