Files
2026-11-01 23:39:55 +02:00

3.7 KiB
Raw Permalink Blame History

uid
uid
sample-element-texture-node

Sample Element Texture node

[!include]

The Sample Element Texture node samples a texture at specific UV coordinates. You can use this node to get multiple samples of the texture assigned to the element, for example to create complex visual effects or manipulate the texture.

Sampling multiple times with this node is more efficient than using several separate nodes for individual samples. This is because each node introduces overhead by traversing internal branches to select the correct texture slot. By combining multiple samples into a single node, you reduce this overhead and improve performance. Use the Sample Count setting to control how many samples the node takes.

Limitations

[!includenodes-sample-fragment-lod]

Ports

The node has a pair of UV input and Color output ports for each sample. The number of pairs matches the Sample Count setting, and the ports are numbered from 0 to Sample Count − 1. By default, the node has four samples (UV 0 to UV 3 and Color 0 to Color 3).

Name Direction Type Description
UV n Input Vector2 The UV coordinates for sample n.
Sampler Input Sampler State The Sampler State to use when sampling. If you leave this port unconnected, the node uses the element texture's own sampler.
LOD Input Float The mip level to sample. This port only appears when Mip Sampling Mode is LOD.
Color n Output Color The color sampled at UV n.

Additional node settings

The Sample Element Texture [!includenodes-additional-settings]

Name Description
Sample Count The number of samples the node takes, between 1 and 32. The node displays one UV input port and one Color output port per sample.
Mip Sampling Mode Controls how the node selects the texture mip level. The options are:
  • Standard: The GPU calculates the mip level from screen-space derivatives. You can only use this mode in the Fragment Context.
  • LOD: You specify the mip level explicitly through the LOD input port. Use this mode to sample the texture in the Vertex Context.

Additional resources