docs.unity.cn
    Show / Hide Table of Contents

    Method refract

    refract(float2, float2, Single)

    Returns the refraction vector given the incident vector i, the normal vector n and the refraction index.

    Declaration
    public static float2 refract(float2 i, float2 n, float indexOfRefraction)
    Parameters
    Type Name Description
    float2 i

    Incident vector.

    float2 n

    Normal vector.

    Single indexOfRefraction

    Index of refraction.

    Returns
    Type Description
    float2

    Refraction vector.

    refract(float3, float3, Single)

    Returns the refraction vector given the incident vector i, the normal vector n and the refraction index.

    Declaration
    public static float3 refract(float3 i, float3 n, float indexOfRefraction)
    Parameters
    Type Name Description
    float3 i

    Incident vector.

    float3 n

    Normal vector.

    Single indexOfRefraction

    Index of refraction.

    Returns
    Type Description
    float3

    Refraction vector.

    refract(float4, float4, Single)

    Returns the refraction vector given the incident vector i, the normal vector n and the refraction index.

    Declaration
    public static float4 refract(float4 i, float4 n, float indexOfRefraction)
    Parameters
    Type Name Description
    float4 i

    Incident vector.

    float4 n

    Normal vector.

    Single indexOfRefraction

    Index of refraction.

    Returns
    Type Description
    float4

    Refraction vector.

    refract(double2, double2, Double)

    Returns the refraction vector given the incident vector i, the normal vector n and the refraction index.

    Declaration
    public static double2 refract(double2 i, double2 n, double indexOfRefraction)
    Parameters
    Type Name Description
    double2 i

    Incident vector.

    double2 n

    Normal vector.

    Double indexOfRefraction

    Index of refraction.

    Returns
    Type Description
    double2

    Refraction vector.

    refract(double3, double3, Double)

    Returns the refraction vector given the incident vector i, the normal vector n and the refraction index.

    Declaration
    public static double3 refract(double3 i, double3 n, double indexOfRefraction)
    Parameters
    Type Name Description
    double3 i

    Incident vector.

    double3 n

    Normal vector.

    Double indexOfRefraction

    Index of refraction.

    Returns
    Type Description
    double3

    Refraction vector.

    refract(double4, double4, Double)

    Returns the refraction vector given the incident vector i, the normal vector n and the refraction index.

    Declaration
    public static double4 refract(double4 i, double4 n, double indexOfRefraction)
    Parameters
    Type Name Description
    double4 i

    Incident vector.

    double4 n

    Normal vector.

    Double indexOfRefraction

    Index of refraction.

    Returns
    Type Description
    double4

    Refraction vector.

    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