浏览代码

Examples: Clean up. (#24118)

Michael Herzog 3 年之前
父节点
当前提交
86f51a6a91
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      examples/jsm/loaders/LWOLoader.js
  2. 0 0
      examples/models/json/lightmap/lightmap.json

+ 4 - 2
examples/jsm/loaders/LWOLoader.js

@@ -350,6 +350,8 @@ class MaterialParser {
 
 		const materialType = this.getMaterialType( connections.attributes );
 
+		if ( materialType !== MeshPhongMaterial ) delete params.refractionRatio; // PBR materials do not support "refractionRatio"
+
 		return new materialType( params );
 
 	}
@@ -591,8 +593,6 @@ class MaterialParser {
 
 		if ( attributes[ 'Bump Height' ] ) params.bumpScale = attributes[ 'Bump Height' ].value * 0.1;
 
-		if ( attributes[ 'Refraction Index' ] ) params.refractionRatio = 0.98 / attributes[ 'Refraction Index' ].value;
-
 		this.parsePhysicalAttributes( params, attributes, maps );
 		this.parseStandardAttributes( params, attributes, maps );
 		this.parsePhongAttributes( params, attributes, maps );
@@ -643,6 +643,8 @@ class MaterialParser {
 
 	parsePhongAttributes( params, attributes, maps ) {
 
+		if ( attributes[ 'Refraction Index' ] ) params.refractionRatio = 0.98 / attributes[ 'Refraction Index' ].value;
+
 		if ( attributes.Diffuse ) params.color.multiplyScalar( attributes.Diffuse.value );
 
 		if ( attributes.Reflection ) {

文件差异内容过多而无法显示
+ 0 - 0
examples/models/json/lightmap/lightmap.json


部分文件因为文件数量过多而无法显示