Class CustomPassUtils | High Definition RP | 9.0.0-preview.71
docs.unity3d.com
    Show / Hide Table of Contents

    Class CustomPassUtils

    A set of custom pass utility function to help you build your effects

    Inheritance
    Object
    CustomPassUtils
    Namespace: UnityEngine.Rendering.HighDefinition
    Syntax
    public static class CustomPassUtils

    Fields

    fullScreenScaleBias

    Fullscreen scale and bias values, it is the default for functions that have scale and bias overloads.

    Declaration
    public static Vector4 fullScreenScaleBias
    Field Value
    Type Description
    Vector4

    x: scaleX, y: scaleY, z: biasX, w: biasY

    Methods

    Copy(CustomPassContext, RTHandle, RTHandle, Int32, Int32)

    Declaration
    public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sourceMip = 0, int destMip = 0)
    Parameters
    Type Name Description
    CustomPassContext ctx
    RTHandle source
    RTHandle destination
    Int32 sourceMip
    Int32 destMip

    Copy(CustomPassContext, RTHandle, RTHandle, Vector4, Vector4, Int32, Int32)

    Declaration
    public static void Copy(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sourceMip = 0, int destMip = 0)
    Parameters
    Type Name Description
    CustomPassContext ctx
    RTHandle source
    RTHandle destination
    Vector4 sourceScaleBias
    Vector4 destScaleBias
    Int32 sourceMip
    Int32 destMip

    DownSample(CustomPassContext, RTHandle, RTHandle, Int32, Int32)

    Convert the source buffer to an half resolution buffer and output it to the destination buffer.

    Declaration
    public static void DownSample(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sourceMip = 0, int destMip = 0)
    Parameters
    Type Name Description
    CustomPassContext ctx

    Custom Pass Context

    RTHandle source
    RTHandle destination
    Int32 sourceMip
    Int32 destMip

    DownSample(CustomPassContext, RTHandle, RTHandle, Vector4, Vector4, Int32, Int32)

    Declaration
    public static void DownSample(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sourceMip = 0, int destMip = 0)
    Parameters
    Type Name Description
    CustomPassContext ctx
    RTHandle source
    RTHandle destination
    Vector4 sourceScaleBias

    Scale and bias to apply when sampling the source buffer

    Vector4 destScaleBias

    Scale and bias to apply when writing into the destination buffer. It's scale is relative to the destination buffer, so if you want an half res downsampling into a fullres buffer you need to specify a scale of 0.5;0,5. If your buffer is already half res Then 1;1 scale works.

    Int32 sourceMip
    Int32 destMip

    DrawRenderers(CustomPassContext, LayerMask, CustomPass.RenderQueueType, Material, Int32)

    Simpler version of ScriptableRenderContext.DrawRenderers to draw HDRP materials.

    Declaration
    public static void DrawRenderers(in CustomPassContext ctx, LayerMask layerMask, CustomPass.RenderQueueType renderQueueFilter = CustomPass.RenderQueueType.All, Material overrideMaterial = null, int overideMaterialIndex = 0)
    Parameters
    Type Name Description
    CustomPassContext ctx
    LayerMask layerMask
    CustomPass.RenderQueueType renderQueueFilter
    Material overrideMaterial
    Int32 overideMaterialIndex

    GaussianBlur(CustomPassContext, RTHandle, RTHandle, RTHandle, Int32, Single, Int32, Int32, Boolean)

    Declaration
    public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, int sampleCount = 9, float radius = 5F, int sourceMip = 0, int destMip = 0, bool downSample = true)
    Parameters
    Type Name Description
    CustomPassContext ctx
    RTHandle source
    RTHandle destination
    RTHandle tempTarget
    Int32 sampleCount
    Single radius
    Int32 sourceMip
    Int32 destMip
    Boolean downSample

    GaussianBlur(CustomPassContext, RTHandle, RTHandle, RTHandle, Vector4, Vector4, Int32, Single, Int32, Int32, Boolean)

    Declaration
    public static void GaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, RTHandle tempTarget, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 9, float radius = 5F, int sourceMip = 0, int destMip = 0, bool downSample = true)
    Parameters
    Type Name Description
    CustomPassContext ctx
    RTHandle source
    RTHandle destination
    RTHandle tempTarget
    Vector4 sourceScaleBias
    Vector4 destScaleBias
    Int32 sampleCount
    Single radius
    Int32 sourceMip
    Int32 destMip
    Boolean downSample

    GetRenderQueueRangeFromRenderQueueType(CustomPass.RenderQueueType)

    Convert a Custom Pass render queue type to a RenderQueueRange that can be used in DrawRenderers

    Declaration
    public static RenderQueueRange GetRenderQueueRangeFromRenderQueueType(CustomPass.RenderQueueType type)
    Parameters
    Type Name Description
    CustomPass.RenderQueueType type

    The type of render queue

    Returns
    Type Description
    RenderQueueRange

    The converted render queue range

    HorizontalGaussianBlur(CustomPassContext, RTHandle, RTHandle, Int32, Single, Int32, Int32)

    Declaration
    public static void HorizontalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, float radius = 5F, int sourceMip = 0, int destMip = 0)
    Parameters
    Type Name Description
    CustomPassContext ctx
    RTHandle source
    RTHandle destination
    Int32 sampleCount
    Single radius
    Int32 sourceMip
    Int32 destMip

    HorizontalGaussianBlur(CustomPassContext, RTHandle, RTHandle, Vector4, Vector4, Int32, Single, Int32, Int32)

    Declaration
    public static void HorizontalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, float radius = 5F, int sourceMip = 0, int destMip = 0)
    Parameters
    Type Name Description
    CustomPassContext ctx
    RTHandle source
    RTHandle destination
    Vector4 sourceScaleBias
    Vector4 destScaleBias
    Int32 sampleCount
    Single radius
    Int32 sourceMip
    Int32 destMip

    VerticalGaussianBlur(CustomPassContext, RTHandle, RTHandle, Int32, Single, Int32, Int32)

    Declaration
    public static void VerticalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, int sampleCount = 8, float radius = 5F, int sourceMip = 0, int destMip = 0)
    Parameters
    Type Name Description
    CustomPassContext ctx
    RTHandle source
    RTHandle destination
    Int32 sampleCount
    Single radius
    Int32 sourceMip
    Int32 destMip

    VerticalGaussianBlur(CustomPassContext, RTHandle, RTHandle, Vector4, Vector4, Int32, Single, Int32, Int32)

    Declaration
    public static void VerticalGaussianBlur(in CustomPassContext ctx, RTHandle source, RTHandle destination, Vector4 sourceScaleBias, Vector4 destScaleBias, int sampleCount = 8, float radius = 5F, int sourceMip = 0, int destMip = 0)
    Parameters
    Type Name Description
    CustomPassContext ctx
    RTHandle source
    RTHandle destination
    Vector4 sourceScaleBias
    Vector4 destScaleBias
    Int32 sampleCount
    Single radius
    Int32 sourceMip
    Int32 destMip
    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