docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Vrs

    Encapsulates variable shading rate support (VRS) and texture conversion to shading rate image

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

    Methods

    ColorMaskTextureToShadingRateImage(RenderGraph, RTHandle, RTHandle, bool)

    Converts a color mask texture to a shading rate image.

    Declaration
    public static TextureHandle ColorMaskTextureToShadingRateImage(RenderGraph renderGraph, RTHandle sriRtHandle, RTHandle colorMaskRtHandle, bool yFlip)
    Parameters
    Type Name Description
    RenderGraph renderGraph

    Render graph to record conversion commands

    RTHandle sriRtHandle

    Shading rate images to convert to.

    RTHandle colorMaskRtHandle

    Texture to convert from.

    bool yFlip

    True if shading rate image should be generated flipped.

    Returns
    Type Description
    TextureHandle

    Shading rate image texture handle created.

    Remarks

    sriRtHandle and colorMaskRtHandle are imported with renderGraph before doing the conversion.

    ColorMaskTextureToShadingRateImage(RenderGraph, TextureHandle, TextureHandle, TextureDimension, bool)

    Converts a color mask texture to a shading rate image.

    Declaration
    public static TextureHandle ColorMaskTextureToShadingRateImage(RenderGraph renderGraph, TextureHandle sriTextureHandle, TextureHandle colorMaskHandle, TextureDimension colorMaskDimension, bool yFlip)
    Parameters
    Type Name Description
    RenderGraph renderGraph

    Render graph to record conversion commands

    TextureHandle sriTextureHandle

    Shading rate images to convert to.

    TextureHandle colorMaskHandle

    Texture to convert from.

    TextureDimension colorMaskDimension

    Texture's dimension.

    bool yFlip

    True if shading rate image should be generated flipped.

    Returns
    Type Description
    TextureHandle

    Shading rate image texture handle created.

    Remarks

    sriRtHandle and colorMaskHandle are expected to be imported by renderGraph prior to this call.

    ColorMaskTextureToShadingRateImageDispatch(CommandBuffer, RTHandle, Texture, bool)

    Converts a color mask texture to a shading rate image. Use this function to perform the conversion without the RenderGraph.

    Declaration
    public static void ColorMaskTextureToShadingRateImageDispatch(CommandBuffer cmd, RTHandle sriDestination, Texture colorMaskSource, bool yFlip = true)
    Parameters
    Type Name Description
    CommandBuffer cmd

    CommandBuffer used for the compute dispatch.

    RTHandle sriDestination

    Shading rate images to convert to.

    Texture colorMaskSource

    Texture to convert from.

    bool yFlip

    True if shading rate image should be generated flipped.

    DisposeResources()

    Cleanup resources.

    Declaration
    public static void DisposeResources()

    InitializeResources()

    Preprocess resources found in VrsRenderPipelineRuntimeResources for use at runtime.

    Declaration
    public static void InitializeResources()

    IsColorMaskTextureConversionSupported()

    Check if conversion of color texture to shading rate image is supported. Convenience to abstract all capabilities checks.

    Declaration
    public static bool IsColorMaskTextureConversionSupported()
    Returns
    Type Description
    bool

    Returns true if conversion of color texture to shading rate image is supported, false otherwise.

    IsInitialized()

    Checks if VRS resources are initialized. Initialization may fail due to platform restrictions.

    Declaration
    public static bool IsInitialized()
    Returns
    Type Description
    bool

    Returns true if the Vrs resources are initialized.

    ShadingRateImageToColorMaskTexture(RenderGraph, in TextureHandle, in TextureHandle)

    Converts a shading rate image to a color texture for visualization.

    Declaration
    public static void ShadingRateImageToColorMaskTexture(RenderGraph renderGraph, in TextureHandle sriTextureHandle, in TextureHandle colorMaskHandle)
    Parameters
    Type Name Description
    RenderGraph renderGraph

    Render graph to record conversion commands

    TextureHandle sriTextureHandle

    Texture to convert from.

    TextureHandle colorMaskHandle

    Output of conversion.

    ShadingRateImageToColorMaskTextureBlit(CommandBuffer, RTHandle, RTHandle)

    Converts a shading rate image to a color mask texture. Use this function to perform the conversion without the RenderGraph.

    Declaration
    public static void ShadingRateImageToColorMaskTextureBlit(CommandBuffer cmd, RTHandle sriSource, RTHandle colorMaskDestination)
    Parameters
    Type Name Description
    CommandBuffer cmd

    CommandBuffer used for the compute dispatch.

    RTHandle sriSource

    Shading rate images to convert from.

    RTHandle colorMaskDestination

    Texture to convert to.

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