Skip to content

Commit 297579c

Browse files
authored
TSL: Add .load() function to texture() (#31510)
1 parent a1d8dde commit 297579c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/nodes/accessors/TextureNode.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,18 @@ class TextureNode extends UniformNode {
554554

555555
}
556556

557+
/**
558+
* TSL function for creating a texture node that fetches/loads texels without interpolation.
559+
*
560+
* @param {Node<uvec2>} uvNode - The uv node.
561+
* @returns {TextureNode} A texture node representing the texture load.
562+
*/
563+
load( uvNode ) {
564+
565+
return this.sample( uvNode ).setSampler( false );
566+
567+
}
568+
557569
/**
558570
* Samples a blurred version of the texture by defining an internal bias.
559571
*

0 commit comments

Comments
 (0)