Browse Source

fix prem roughness

sunag 5 years ago
parent
commit
9a2a09ac06

+ 1 - 1
examples/jsm/nodes/misc/TextureCubeNode.js

@@ -84,7 +84,7 @@ TextureCubeNode.prototype.generate = function ( builder, output ) {
 
 		if ( builder.context.bias ) {
 
-			builder.context.bias.setTexture( this );
+			builder.context.bias.setTexture( this.value );
 
 		}
 

+ 1 - 1
examples/jsm/nodes/misc/TextureCubeUVNode.js

@@ -171,7 +171,7 @@ TextureCubeUVNode.prototype.generate = function ( builder, output ) {
 
 		var textureCubeUV = builder.include( TextureCubeUVNode.Nodes.textureCubeUV );
 
-		var biasNode = this.bias || builder.context.bias;
+		var biasNode = this.bias || builder.context.roughness;
 
 		return builder.format( textureCubeUV + '( ' + this.uv.build( builder, 'v3' ) + ', ' +
 			biasNode.build( builder, 'f' ) + ', ' +

+ 3 - 1
examples/jsm/nodes/utils/MaxMIPLevelNode.js

@@ -26,7 +26,9 @@ Object.defineProperties( MaxMIPLevelNode.prototype, {
 
 			if ( this.maxMIPLevel === 0 ) {
 
-				var image = this.texture.value.image ? this.texture.value.image[ 0 ] : undefined;
+				var image = this.texture.value.image;
+
+				if ( Array.isArray( image ) ) image = image[ 0 ];
 
 				this.maxMIPLevel = image !== undefined ? Math.log( Math.max( image.width, image.height ) ) * Math.LOG2E : 0;