docs.unity3d.com
    Show / Hide Table of Contents

    Texel Size Node

    Description

    Returns the Width and Height of the texel size of Texture 2D input. Uses the built in variable {texturename}_TexelSize to access special properties of a Texture 2D.

    Note: Do not use the default input to reference your Texture 2D. It makes your graph perform worse. Instead connect this node to a separate Texture 2D Asset Node and re-use this definition for sampling.

    Ports

    Name Direction Type Binding Description
    Texture Input Texture None Texture asset
    Width Output Float None Texel width
    Height Output Float None Texel height

    Generated Code Example

    The following example code represents one possible outcome of this node.

    float _TexelSize_Width = Texture_TexelSize.z;
    float _TexelSize_Height = Texture_TexelSize.w;
    
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023