Browse Source

Add code to add vertex color attribute to gltf models

Steven Vergenz 8 năm trước cách đây
mục cha
commit
1e089aee21
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      examples/js/loaders/GLTFLoader.js

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

@@ -1202,6 +1202,12 @@ THREE.GLTFLoader = ( function () {
 									geometry.addAttribute( 'uv', bufferAttribute );
 									break;
 
+								case 'COLOR_0':
+								case 'COLOR0':
+								case 'COLOR':
+									geometry.addAttribute( 'color', bufferAttribute );
+									break;
+
 								case 'WEIGHT':
 									geometry.addAttribute( 'skinWeight', bufferAttribute );
 									break;