Blit in URP
To blit from one texture to another in a custom render pass in the Universal Render Pipeline (URP), use the Blitter API from the Core Scriptable Render Pipeline (SRP).
The shader you use with the Blitter
API must be a hand-coded shader. Shader Graph shaders aren't compatible with the Blitter
API.
Note: The recommended best practice is not to use the CommandBuffer.Blit
or Graphics.Blit
APIs with URP, or APIs that use them internally such as RenderingUtils.Blit
. These APIs might break XR rendering, and aren't compatible with native render passes. You can still use CommandBuffer.Blit
and Graphics.Blit
with the Built-In Render Pipeline.
For example, add the following:
{
Blitter.BlitCameraTexture(commandBuffer, sourceTexture, destinationTexture, materialToUse, passNumber);
}
For a full example, refer to Example of a complete Scriptable Renderer Feature.
Additional resources
- The blit examples in the URP Package Samples
- Custom render pass workflow
- Using textures