docs.unity3d.com
    Show / Hide Table of Contents

    Normal Reconstruct Z Node

    Description

    Derives the correct Z value for generated normal maps using a given X and Y value from input In.

    Ports

    Name Direction Type Description
    In Input Vector 2 Normal X and Y value
    Out Output Vector 3 Output value

    Generated Code Example

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

    void Unity_NormalReconstructZ_float(float2 In, out float3 Out)
    {
        float reconstructZ = sqrt(1.0 - saturate(dot(In.xy, In.xy)));
        float3 normalVector = float3(In.x, In.y, reconstructZ);
        Out = normalize(normalVector);
    }
    
    Back to top
    Terms of use
    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