|
|
@@ -548,7 +548,7 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.uvNode = nodeObject( uvNode );
|
|
|
- textureNode.referenceNode = this.getSelf();
|
|
|
+ textureNode.referenceNode = this.getBase();
|
|
|
|
|
|
return nodeObject( textureNode );
|
|
|
|
|
|
@@ -576,7 +576,7 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.biasNode = nodeObject( amountNode ).mul( maxMipLevel( textureNode ) );
|
|
|
- textureNode.referenceNode = this.getSelf();
|
|
|
+ textureNode.referenceNode = this.getBase();
|
|
|
|
|
|
const map = textureNode.value;
|
|
|
|
|
|
@@ -602,7 +602,7 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.levelNode = nodeObject( levelNode );
|
|
|
- textureNode.referenceNode = this.getSelf();
|
|
|
+ textureNode.referenceNode = this.getBase();
|
|
|
|
|
|
return nodeObject( textureNode );
|
|
|
|
|
|
@@ -630,12 +630,22 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.biasNode = nodeObject( biasNode );
|
|
|
- textureNode.referenceNode = this.getSelf();
|
|
|
+ textureNode.referenceNode = this.getBase();
|
|
|
|
|
|
return nodeObject( textureNode );
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Returns the base texture of this node.
|
|
|
+ * @return {TextureNode} The base texture node.
|
|
|
+ */
|
|
|
+ getBase() {
|
|
|
+
|
|
|
+ return this.referenceNode ? this.referenceNode.getBase() : this.getSelf();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Samples the texture by executing a compare operation.
|
|
|
*
|
|
|
@@ -646,7 +656,7 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.compareNode = nodeObject( compareNode );
|
|
|
- textureNode.referenceNode = this.getSelf();
|
|
|
+ textureNode.referenceNode = this.getBase();
|
|
|
|
|
|
return nodeObject( textureNode );
|
|
|
|
|
|
@@ -663,7 +673,7 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.gradNode = [ nodeObject( gradNodeX ), nodeObject( gradNodeY ) ];
|
|
|
- textureNode.referenceNode = this.getSelf();
|
|
|
+ textureNode.referenceNode = this.getBase();
|
|
|
|
|
|
return nodeObject( textureNode );
|
|
|
|
|
|
@@ -679,7 +689,7 @@ class TextureNode extends UniformNode {
|
|
|
|
|
|
const textureNode = this.clone();
|
|
|
textureNode.depthNode = nodeObject( depthNode );
|
|
|
- textureNode.referenceNode = this.getSelf();
|
|
|
+ textureNode.referenceNode = this.getBase();
|
|
|
|
|
|
return nodeObject( textureNode );
|
|
|
|
|
|
@@ -779,7 +789,7 @@ export const texture = ( value = EmptyTexture, uvNode = null, levelNode = null,
|
|
|
if ( value && value.isTextureNode === true ) {
|
|
|
|
|
|
textureNode = nodeObject( value.clone() );
|
|
|
- textureNode.referenceNode = value.getSelf(); // Ensure the reference is set to the original node
|
|
|
+ textureNode.referenceNode = value.getBase(); // Ensure the reference is set to the original node
|
|
|
|
|
|
if ( uvNode !== null ) textureNode.uvNode = nodeObject( uvNode );
|
|
|
if ( levelNode !== null ) textureNode.levelNode = nodeObject( levelNode );
|