How to create a custom renderer feature that handle both Forward and Deferred?

Hi,

While try to create a custom renderer feature, I decide to emulate HDRP and allow users to choose a render target.

Problem is, there is no nice API like GetNormalBuffer() from HDRP’s CustomPass.

Every time URP internal passes do work that need cmd.GetTemporaryRT, the information is past from UniversalRenderer into these ScriptableRenderPass. Most of these API are internal, for example the DeferredLights class.

My questions:

  • Is there no easy way for a user of ScriptableRenderPass to get normal buffer easily?
  • If I had to duplicate some code where should I start?

Thx, any help appreciated!

This might come too late but I recently modified the URP package to support a custom gbuffer format and, in attempting to match the original code as closely as possible, found that there was no way to get a hold of the RenderTargetIdentifiers of the gbuffers outside of the package as DeferredLights is an internal class. Of course, I could have missed something.

I passed DeferredLights to my custom passes from inside UniversalRenderer so I’m not sure how I would go about extending the access to any ScriptableRenderPass

Thx, I did see your thread, hope we can both get a nicer solution than hacking URP :slight_smile:

One way I find, for my specific usage, is to force a DepthNormal pre-pass on my custom rendered objects.

Since Coated material doesn’t fit into Deferred path gbuffer, URP will force a pre-pass with normal on those materials.

Which gbuffer will happily read and combine later.