docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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.

    Additional resources

    • Element Layout UV node
    • Element Texture Size node
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)