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
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.