docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Access Custom Render Texture shader properties

    If you want to create shaders, in Shader Graph, for use with Custom Render Textures, you need to understand how to access specific texture coordinates and other shader properties.

    Accessing the texture coordinates

    Shader Graph provides access to local and global texture coordinates via the UV Node:

    • Channel 0 (localTexcoord): Provides the local texture coordinates.
    • Channel 1 (globalTexcoord): Provides the global texture coordinates.

    To access these channels, add a UV node to your Shader Graph and select the appropriate channel.

    Access the cubemap view direction

    For shaders that interact with Cubemaps, use the View Direction node to retrieve the direction for the Cubemap sampling . Make sure that the space is set to World Space to get the correct direction vector.

    Access the Update Zone Index

    You can access the update zone index via the UV Node as well.

    • Channel 2 (PrimitiveID): Provides the Primitive ID. The primitive ID corresponds to the index of the update zone being rendered.

    Additional resources

    • Custom Render Textures
    • Custom Render Texture Nodes
    • UV node
    • View Direction 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)