浏览代码

check for colors and enable vertex colors

Luis Fraguada 5 年之前
父节点
当前提交
32813e2afc
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      examples/jsm/loaders/3DMLoader.js

+ 6 - 0
examples/jsm/loaders/3DMLoader.js

@@ -382,6 +382,12 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 				var geometry = loader.parse( obj.geometry );
 
+				if ( geometry.attributes.hasOwnProperty( 'color' ) ) {
+
+					mat.vertexColors = true;
+
+				}
+
 				var mesh = new Mesh( geometry, mat );
 				mesh.castShadow = attributes.castsShadows;
 				mesh.receiveShadow = attributes.receivesShadows;