google / model-viewer

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

Textures Not Rendering - Showing All Black #1321

Closed reubenkib closed 4 years ago

reubenkib commented 4 years ago

The model textures are not being rendered and are all black. Tested on Safari, Chrome (Max OSX). When I load the .glb file to other online viewers, the model seems to be showing as it should. I have loaded the model in the interactive example and tested out different lighting environments, with no luck, it's still all black.

I looked at previous posts with similar issues but still haven't found a solution.

The model was rendered in Substance Painter.

Screen Shot 2020-07-01 at 2 45 05 PM
elalish commented 4 years ago

@reubenkib Thank you, can you remix our Glitch as the new issue instructions recommend? That will help enormously with debug.

reubenkib commented 4 years ago

@reubenkib Thank you, can you remix our Glitch as the new issue instructions recommend? That will help enormously with debug.

I remixed it here: https://saber-intriguing-reminder.glitch.me/

Is this what you meant?

elalish commented 4 years ago

@reubenkib Yes exactly, thanks! I have a repro and it seems to be a problem in three.js which I can repro here: https://gltf-viewer.donmccurdy.com/. If you try the lighting tab, you'll see that only the directional light is having an effect, while the environment and ambient do nothing. We use only an environment light, so that explains the black render. What kind of material is in your file? It would be helpful if you could file a bug on Three.js, since that is also what the gltf-viewer uses.

I've seen problems like this sometimes when the AO channel is set to one instead of zero or vice-versa; you might want to check that.

elalish commented 4 years ago

@reubenkib Actually, I'm nearly certain the issue is that the AO channel is black. Three's behavior here is actually correct, since AO affects environmental (ambient) lights, but not directional lights. Having uniformly black AO is physically incorrect, as this implies the whole surface gets no ambient lighting (as though the whole model were somehow the bottom of a crease). If you didn't specify this intentionally, then it's probably a bug in whatever program exported the glTF.

reubenkib commented 4 years ago

@reubenkib Actually, I'm nearly certain the issue is that the AO channel is black. Three's behavior here is actually correct, since AO affects environmental (ambient) lights, but not directional lights. Having uniformly black AO is physically incorrect, as this implies the whole surface gets no ambient lighting (as though the whole model were somehow the bottom of a crease). If you didn't specify this intentionally, then it's probably a bug in whatever program exported the glTF.

Thank you for your response. I'll pass the message along to my 3d modeler and hopefully this fixes it! I will report back.

reubenkib commented 4 years ago

The issue was due to the rendering settings in Substance Painter and other programs. All fixed now per your suggestions. Thank you!