docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PolySpatialShaderGlobals

    Provides static functions to set global shader properties and transfer the updated values to the renderer via PolySpatial.

    Inheritance
    object
    PolySpatialShaderGlobals
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.PolySpatial
    Assembly: Unity.PolySpatial.dll
    Syntax
    public static class PolySpatialShaderGlobals

    Methods

    SetColor(string, Color)

    Sets the value of a color shader global and adds it to the list of globals to transfer via PolySpatial.

    Declaration
    public static void SetColor(string name, Color value)
    Parameters
    Type Name Description
    string name

    The name of the shader global to set.

    Color value

    The new value for the shader global.

    SetFloat(string, float)

    Sets the value of a float shader global and adds it to the list of globals to transfer via PolySpatial.

    Declaration
    public static void SetFloat(string name, float value)
    Parameters
    Type Name Description
    string name

    The name of the shader global to set.

    float value

    The new value for the shader global.

    SetInteger(string, int)

    Sets the value of an integer shader global and adds it to the list of globals to transfer via PolySpatial.

    Declaration
    public static void SetInteger(string name, int value)
    Parameters
    Type Name Description
    string name

    The name of the shader global to set.

    int value

    The new value for the shader global.

    SetMatrix(string, Matrix4x4)

    Sets the value of a matrix shader global and adds it to the list of globals to transfer via PolySpatial.

    Declaration
    public static void SetMatrix(string name, Matrix4x4 value)
    Parameters
    Type Name Description
    string name

    The name of the shader global to set.

    Matrix4x4 value

    The new value for the shader global.

    SetTexture(string, Texture)

    Sets the value of a texture shader global and adds it to the list of globals to transfer via PolySpatial.

    Declaration
    public static void SetTexture(string name, Texture value)
    Parameters
    Type Name Description
    string name

    The name of the shader global to set.

    Texture value

    The new value for the shader global.

    SetVector(string, Vector4)

    Sets the value of a vector shader global and adds it to the list of globals to transfer via PolySpatial.

    Declaration
    public static void SetVector(string name, Vector4 value)
    Parameters
    Type Name Description
    string name

    The name of the shader global to set.

    Vector4 value

    The new value for the shader global.

    TryAdd(string, PropertyType)

    Attempts to add a property to the list of shader globals to transfer via PolySpatial.

    Declaration
    public static bool TryAdd(string name, PolySpatialShaderGlobals.PropertyType type)
    Parameters
    Type Name Description
    string name

    The name of the shader global to add.

    PolySpatialShaderGlobals.PropertyType type

    The type of the shader global.

    Returns
    Type Description
    bool

    True if added or already present with the same type, false if already present with a different type (in which case an error will be logged).

    In This Article
    Back to top
    Copyright © 2024 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)