Element Texture UV node
Note
Use this node only in shaders with Material set to UI for UI Toolkit. Using it elsewhere can lead to unexpected behavior or errors. For information on how to create shaders for UI Toolkit, refer to UI Shader Graph.
Outputs the texture coordinates (UV) of the texture mapped onto a UI element.
This node might output different coordinates than the Element Layout UV node, which provides coordinates within the element's bounding rectangle. The coordinates are more likely to be different if you tile, offset, or transform the texture.
If the texture is part of an atlas, its UV coordinates only map to a specific region within the atlas. If you repeat UV coordinates or sample outside them, the data comes from other textures in the atlas. Use texture coordinates (UV) when you need precise control over how a texture appears on a UI element, and be mindful of atlas constraints.
The texture UV can also originate from a custom mesh when you call MeshGenerationContext.DrawMesh
. In such cases, the UV values might vary depending on the mesh data.
Ports
Name | Direction | Type | Description |
---|---|---|---|
Texture UV | Output | Vector2 | The UV coordinates for the texture. |