How to use GLTF Loader in three.js? Texture and material displaying as black

我是研究僧i 提交于 2019-12-11 11:55:30

问题


I'm having issues loading a gltf. The model is able to load successfully but all the textures and materials (already embedded in the .gltf) are completely black. When I view it in the gltfviewer, all the textures and materials show up correctly. I'm new to three.js so if anyone can walk me through using the GLTF loader, I would greatly appreciate it!!


回答1:


This issue is essentially the same as How to use AmbientLight in combination with MeshStandardMaterial? — your model has a 100% metallic material, and pure metals do not reflect diffuse (ambient and hemisphere) lights.

Ideally, always add an environment map to PBR models. Another solution is to add non-diffuse/direct lights, such as PointLight or DirectionalLight instances. If you are able to edit the model, reducing its metalness would also work.

For more details, see https://github.com/mrdoob/three.js/issues/9228.



来源:https://stackoverflow.com/questions/53344348/how-to-use-gltf-loader-in-three-js-texture-and-material-displaying-as-black

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!