Explorar o código

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

Don McCurdy %!s(int64=8) %!d(string=hai) anos
pai
achega
6e7f14cccb
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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;