浏览代码

[gltf] Use flat shading if normals are not included.

Don McCurdy 8 年之前
父节点
当前提交
6e7f14cccb
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      examples/js/loaders/GLTF2Loader.js

+ 6 - 0
examples/js/loaders/GLTF2Loader.js

@@ -2196,6 +2196,12 @@ THREE.GLTF2Loader = ( function () {
 
 						}
 
+						if ( geometry.attributes.normal === undefined ) {
+
+							material.shading = THREE.FlatShading;
+
+						}
+
 						meshNode = new THREE.Mesh( geometry, material );
 						meshNode.castShadow = true;