Foreword: I do not have that much experience with rendering, this is my first time exploring the topic.
So I created a Scriptable render feature using this tutorial.
I got graphics working perfectly fine, except when the new renderer feature is enabled, it just displays a black screen. I don’t really know exactly what I’m doing so I don’t really know what’s going wrong.
A few screen shots and some code:
My ScriptableRendererFeature -
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class BlitMaterial : ScriptableRendererFeature
{
class CustomRenderPass : ScriptableRenderPass
{
public RenderTargetIdentifier source;
public Material toApply;
RenderTargetHandle temp;
public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor)
{
temp.Init("_temp");
}
public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
{
CommandBuffer cb = CommandBufferPool.Get();
cb.GetTemporaryRT(temp.id, renderingData.cameraData.cameraTargetDescriptor);
Blit(cb, source, temp.Identifier(), toApply);
Blit(cb, temp.Identifier(), source);
context.ExecuteCommandBuffer(cb);
cb.Release();
}
}
public Material ApplicableMaterial;
CustomRenderPass m_ScriptablePass;
public override void Create()
{
m_ScriptablePass = new CustomRenderPass();
m_ScriptablePass.renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing;
}
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
{
m_ScriptablePass.toApply = ApplicableMaterial;
m_ScriptablePass.source = renderer.cameraColorTarget;
renderer.EnqueuePass(m_ScriptablePass);
}
}
The 2D Lit shader graph I’m using for my material -
The two frame debugger draws for each Blit -

In this one, you can see the camera color texture has some white text inside of it

In this one, the _MainTex property is completely black. ???
Blit in the documentation says it copies to the material’s _MainTex, but here it looks like it isn’t doing much of anything. I’m just more confused than anything.
Thanks in advance.
