|
@@ -25,10 +25,34 @@ class TextureNode extends UniformNode {
|
|
|
this.updateMatrix = false;
|
|
|
this.updateType = NodeUpdateType.NONE;
|
|
|
|
|
|
+ this.referenceNode = null;
|
|
|
+
|
|
|
+ this._value = value;
|
|
|
+
|
|
|
this.setUpdateMatrix( uvNode === null );
|
|
|
|
|
|
}
|
|
|
|
|
|
+ set value( value ) {
|
|
|
+
|
|
|
+ if ( this.referenceNode ) {
|
|
|
+
|
|
|
+ this.referenceNode.value = value;
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this._value = value;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ get value() {
|
|
|
+
|
|
|
+ return this.referenceNode ? this.referenceNode.value : this._value;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
getUniformHash( /*builder*/ ) {
|
|
|
|
|
|
return this.value.uuid;
|
|
@@ -258,6 +282,7 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.uvNode = uvNode;
|
|
|
+ textureNode.referenceNode = this;
|
|
|
|
|
|
return nodeObject( textureNode );
|
|
|
|
|
@@ -267,6 +292,7 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.levelNode = levelNode.mul( maxMipLevel( textureNode ) );
|
|
|
+ textureNode.referenceNode = this;
|
|
|
|
|
|
return nodeObject( textureNode );
|
|
|
|
|
@@ -276,6 +302,7 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.levelNode = levelNode;
|
|
|
+ textureNode.referenceNode = this;
|
|
|
|
|
|
return textureNode;
|
|
|
|
|
@@ -291,6 +318,7 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.compareNode = nodeObject( compareNode );
|
|
|
+ textureNode.referenceNode = this;
|
|
|
|
|
|
return nodeObject( textureNode );
|
|
|
|
|
@@ -300,6 +328,7 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.depthNode = nodeObject( depthNode );
|
|
|
+ textureNode.referenceNode = this;
|
|
|
|
|
|
return nodeObject( textureNode );
|
|
|
|