Fresnel Effect Node | Shader Graph | 6.9.2
docs.unity3d.com
    Show / Hide Table of Contents

    Fresnel Effect Node

    Description

    Fresnel Effect is the effect of differing reflectance on a surface depending on viewing angle, where as you approach the grazing angle more light is reflected. The Fresnel Effect node approximates this by calculating the angle between the surface normal and the view direction. The wider this angle is, the greater the return value will be. This effect is often used to achieve rim lighting, common in many art styles.

    Ports

    Name Direction Type Description
    Normal Input Vector 3 Normal direction. By default bound to World Space Normal
    View Dir Input Vector 3 View direction. By default bound to World Space View Direction
    Power Input Vector 1 Exponent of the power calculation
    Out Output Vector 1 Output value

    Generated Code Example

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

    void Unity_FresnelEffect_float(float3 Normal, float3 ViewDir, float Power, out float Out)
    {
        Out = pow((1.0 - saturate(dot(normalize(Normal), normalize(ViewDir)))), Power);
    }
    
    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