Jelajahi Sumber

more customized TextureCubeNode

sunag 6 tahun lalu
induk
melakukan
b8c1eeff31
1 mengubah file dengan 5 tambahan dan 3 penghapusan
  1. 5 3
      examples/jsm/nodes/misc/TextureCubeNode.js

+ 5 - 3
examples/jsm/nodes/misc/TextureCubeNode.js

@@ -11,17 +11,19 @@ import { NormalNode } from '../accessors/NormalNode.js';
 import { ColorSpaceNode } from '../utils/ColorSpaceNode.js';
 import { ColorSpaceNode } from '../utils/ColorSpaceNode.js';
 import { BlinnExponentToRoughnessNode } from '../bsdfs/BlinnExponentToRoughnessNode.js';
 import { BlinnExponentToRoughnessNode } from '../bsdfs/BlinnExponentToRoughnessNode.js';
 
 
-function TextureCubeNode( value, textureSize ) {
+function TextureCubeNode( value, textureSize, uv, bias ) {
 
 
 	TempNode.call( this, 'v4' );
 	TempNode.call( this, 'v4' );
 
 
 	this.value = value;
 	this.value = value;
 	this.textureSize = textureSize || new FloatNode( 1024 );
 	this.textureSize = textureSize || new FloatNode( 1024 );
+	this.uv = uv || new ReflectNode( ReflectNode.VECTOR );
+	this.bias = bias || new BlinnExponentToRoughnessNode();
 
 
 	this.radianceCache = { uv: new TextureCubeUVNode(
 	this.radianceCache = { uv: new TextureCubeUVNode(
-		new ReflectNode( ReflectNode.VECTOR ),
+		this.uv,
 		this.textureSize,
 		this.textureSize,
-		new BlinnExponentToRoughnessNode()
+		this.bias
 	) };
 	) };
 
 
 	this.irradianceCache = { uv: new TextureCubeUVNode(
 	this.irradianceCache = { uv: new TextureCubeUVNode(