|
@@ -60,6 +60,14 @@ class StorageTextureNode extends TextureNode {
|
|
|
*/
|
|
*/
|
|
|
this.storeNode = storeNode;
|
|
this.storeNode = storeNode;
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * The mip level to write to for storage textures.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @type {number}
|
|
|
|
|
+ * @default 0
|
|
|
|
|
+ */
|
|
|
|
|
+ this.mipLevel = 0;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* This flag can be used for type testing.
|
|
* This flag can be used for type testing.
|
|
|
*
|
|
*
|
|
@@ -115,6 +123,19 @@ class StorageTextureNode extends TextureNode {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Sets the mip level to write to.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {number} level - The mip level.
|
|
|
|
|
+ * @return {StorageTextureNode} A reference to this node.
|
|
|
|
|
+ */
|
|
|
|
|
+ setMipLevel( level ) {
|
|
|
|
|
+
|
|
|
|
|
+ this.mipLevel = level;
|
|
|
|
|
+ return this;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Generates the code snippet of the storage node. If no `storeNode`
|
|
* Generates the code snippet of the storage node. If no `storeNode`
|
|
|
* is defined, the texture node is generated as normal texture.
|
|
* is defined, the texture node is generated as normal texture.
|
|
@@ -200,6 +221,7 @@ class StorageTextureNode extends TextureNode {
|
|
|
|
|
|
|
|
const newNode = super.clone();
|
|
const newNode = super.clone();
|
|
|
newNode.storeNode = this.storeNode;
|
|
newNode.storeNode = this.storeNode;
|
|
|
|
|
+ newNode.mipLevel = this.mipLevel;
|
|
|
return newNode;
|
|
return newNode;
|
|
|
|
|
|
|
|
}
|
|
}
|