Browse Source

Set .vertexColors on material if present in attributes.

Don McCurdy 8 years ago
parent
commit
a9790116ef
1 changed files with 6 additions and 0 deletions
  1. 6 0
      examples/js/loaders/GLTF2Loader.js

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

@@ -1750,6 +1750,12 @@ THREE.GLTF2Loader = ( function () {
 
 
 						}
 						}
 
 
+						if ( geometry.attributes.color !== undefined ) {
+
+							material.vertexColors = THREE.VertexColors;
+
+						}
+
 						if ( primitive.indices !== undefined ) {
 						if ( primitive.indices !== undefined ) {
 
 
 							geometry.setIndex( dependencies.accessors[ primitive.indices ] );
 							geometry.setIndex( dependencies.accessors[ primitive.indices ] );