Class CustomPassUtils
A set of custom pass utility function to help you build your effects
Inheritance
CustomPassUtils
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
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
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
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
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
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
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
Returns
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
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
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
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