提交 434c71ed 编写于 作者: D Don McCurdy

GLTFLoader: Fix regression unecessarily choosing MeshPhysicalMaterial.

上级 d46af62e
......@@ -488,7 +488,12 @@ THREE.GLTFLoader = ( function () {
}
GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( /* materialIndex */ ) {
GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( materialIndex ) {
var parser = this.parser;
var materialDef = parser.json.materials[ materialIndex ];
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
return THREE.MeshPhysicalMaterial;
......@@ -564,7 +569,12 @@ THREE.GLTFLoader = ( function () {
}
GLTFMaterialsTransmissionExtension.prototype.getMaterialType = function ( /* materialIndex */ ) {
GLTFMaterialsTransmissionExtension.prototype.getMaterialType = function ( materialIndex ) {
var parser = this.parser;
var materialDef = parser.json.materials[ materialIndex ];
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
return THREE.MeshPhysicalMaterial;
......
......@@ -551,7 +551,12 @@ var GLTFLoader = ( function () {
}
GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( /* materialIndex */ ) {
GLTFMaterialsClearcoatExtension.prototype.getMaterialType = function ( materialIndex ) {
var parser = this.parser;
var materialDef = parser.json.materials[ materialIndex ];
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
return MeshPhysicalMaterial;
......@@ -627,7 +632,12 @@ var GLTFLoader = ( function () {
}
GLTFMaterialsTransmissionExtension.prototype.getMaterialType = function ( /* materialIndex */ ) {
GLTFMaterialsTransmissionExtension.prototype.getMaterialType = function ( materialIndex ) {
var parser = this.parser;
var materialDef = parser.json.materials[ materialIndex ];
if ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;
return MeshPhysicalMaterial;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册