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


Неке датотеке нису приказане због велике количине промена