Browse Source

TSL: Add `.load()` function to `texture()` (#31510)

sunag 5 tháng trước cách đây
mục cha
commit
297579cde5
1 tập tin đã thay đổi với 12 bổ sung0 xóa
  1. 12 0
      src/nodes/accessors/TextureNode.js

+ 12 - 0
src/nodes/accessors/TextureNode.js

@@ -554,6 +554,18 @@ class TextureNode extends UniformNode {
 
 	}
 
+	/**
+	 * TSL function for creating a texture node that fetches/loads texels without interpolation.
+	 *
+	 * @param {Node<uvec2>} uvNode - The uv node.
+	 * @returns {TextureNode} A texture node representing the texture load.
+	 */
+	load( uvNode ) {
+
+		return this.sample( uvNode ).setSampler( false );
+
+	}
+
 	/**
 	 * Samples a blurred version of the texture by defining an internal bias.
 	 *

粤ICP备19079148号