I am trying to something very simple in concept: I have a scriptable renderer feature that I want to draw the objects in my scene using the same shaders but a different shader pass. The camera image will be stored into a temporary render texture and applied to another image effect shader using SetGlobalTexture.
I cannot find any examples online that explain how to draw the scene using a different shader pass?? I can override materials but this will not solve my problem because I must avoid creating a second material for all of my objects!!! I do not want one material applied to all my objects.
Please help. Greatly appreciated.
Mike
Hi, do you mean:
The current URP only considers 3 (lighting) pass tags, which are
“UniversalForward”
“UniversalForwardOnly”
“SRPDefaultUnlit”
Assume there’s another pass tagged “UniversalCustom” and you want URP to render any object with this tag to a temporary RT?
I just want a custom render pass to render my scene with different shader passes, so I can color them all as single-color unlit shapes, similar to a cryptomatte if you are familiar with the compositing term. I want to save the camera view of this custom render pass into a temporary render texture
I think you can try ScriptableRenderContext.DrawRenderers().
From Documentation:
public void DrawRenderers(Rendering.CullingResults cullingResults, ref Rendering.DrawingSettings drawingSettings, ref Rendering.FilteringSettings filteringSettings);
If you are looking for a minimum example, there’s a custom render pass sample for LWRP. (need to change the name space to URP)
This doesnt solve the problem of creating new material though. I want to render my objects to have completely different shading in the custom render pass, WITHOUT overriding material to a different material. Because then I have to make two materials for everything. I just want to have two different shader passes that look different, and draw objects with the second shader pass in the custom render pass
Hi, you don’t need to override any material, just provide the shader (used by the material) pass tag(s) you would like to render to the temporary RT.

Ok, this is definitely what I was looking for. Could you show the full code? for the custom render pass that draws the scene using the shader pass with the custom shadertagID and how the shader tag ID is defined in the shader pass?
It’s on Elringus’s github. Before using it, you will need to change the LWRP’s name space to URP:
Change LWRP name space:
using UnityEngine.Rendering.LWRP;
To URP’s:
using UnityEngine.Rendering.Universal;
It’s defined in line 15.
// Corresponds to `Tags { "LightMode" = "YourShaderTag" }` in your custom shaders.
private static readonly ShaderTagId shaderTag = new ShaderTagId("YourShaderTag");
You can change the renderPassEvent to control when to enqueue the custom shader pass.
public MyCustomPass ()
{
// Enqueues custom rendering pass after rendering URP transparent.
renderPassEvent = RenderPassEvent.AfterRenderingTransparents;
}
The example sets the the objects sorting to transparent, and you can change it to opaque if needed.
var drawingSettings = CreateDrawingSettings(shaderTag, ref renderingData, SortingCriteria.CommonTransparent);