docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ShaderUtils

    Various utility functions for shaders in URP.

    Inheritance
    object
    ShaderUtils
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Rendering.Universal
    Assembly: Unity.RenderPipelines.Universal.Runtime.dll
    Syntax
    public static class ShaderUtils

    Methods

    GetEnumFromPath(string)

    Retrieves a URP Shader Path ID from a path given.

    Declaration
    public static ShaderPathID GetEnumFromPath(string path)
    Parameters
    Type Name Description
    string path

    The path to the shader.

    Returns
    Type Description
    ShaderPathID

    The URP Shader Path ID.

    GetShaderGUID(ShaderPathID)

    Returns a GUID for a URP shader from Shader Path ID.

    Declaration
    public static string GetShaderGUID(ShaderPathID id)
    Parameters
    Type Name Description
    ShaderPathID id

    ID of shader path.

    Returns
    Type Description
    string

    GUID for the shader.

    GetShaderPath(ShaderPathID)

    Retrieves a shader path for the given URP Shader Path ID.

    Declaration
    public static string GetShaderPath(ShaderPathID id)
    Parameters
    Type Name Description
    ShaderPathID id

    The URP Shader Path ID.

    Returns
    Type Description
    string

    The path to the URP shader.

    IsLWShader(Shader)

    Checks if a given shader is a URP shader or not.

    Declaration
    public static bool IsLWShader(Shader shader)
    Parameters
    Type Name Description
    Shader shader

    The shader.

    Returns
    Type Description
    bool

    True or false if it's a URP shader or not.

    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)