瀏覽代碼

GLTFLoader: Add comment about ShaderMaterial cloning.

Don McCurdy 7 年之前
父節點
當前提交
f51e2289a5
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      examples/js/loaders/GLTFLoader.js

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

@@ -655,6 +655,18 @@ THREE.GLTFLoader = ( function () {
 
 			},
 
+			/**
+			 * Clones a GLTFSpecularGlossinessMaterial instance. The ShaderMaterial.copy() method can
+			 * copy only properties it knows about or inherits, and misses many properties that would
+			 * normally be defined by MeshStandardMaterial.
+			 *
+			 * This method allows GLTFSpecularGlossinessMaterials to be cloned in the process of
+			 * loading a glTF model, but cloning later (e.g. by the user) would require these changes
+			 * AND also updating `.onBeforeRender` on the parent mesh.
+			 *
+			 * @param  {THREE.ShaderMaterial} source
+			 * @return {THREE.ShaderMaterial}
+			 */
 			cloneMaterial: function ( source ) {
 
 				var target = source.clone();