What are best practices for customizing the URP (or HDRP)?

So far we find it best to make a duplicate copy of the appropriate URP package locally. From there we can make a copy of ForwardRenderer and make customizations within the Setup function (among other places). First issue we run into is that several things that the ForwardRenderer uses are private, so we have to modify files in the URP package to expose those (for example, SceneViewDepthCopyPass is internal so we change that to public - along with dozens of other changes like that). This works, but it feels a bit clunky and we have to redo it every time we upgrade our Unity/URP package combo.

Basically, the functionality we’re trying to add goes beyond a Renderer Feature, but doesn’t require us to start our ForwardRenderer from scratch either. Do you have any suggestions for making that process smoother? Something like a CustomizedForwardRenderer template would create a good starting point to allow developers some advanced modifications but without overcomplicating the process.

1 Like

Right now, as you mention, the only way to achieve deep customization is to heavily edit the source code to make passes public, and in general expose more of the internal systems.
This can lead to painful maintenance issues every time you need to upgrade a package or integrate changes from the main branch, so definitely not ideal.

As part of the RenderGraph work we are planning a big API overhaul, which aims to make our internal passes modular and accessible publicly to users for reuse in their own custom passes or renderers, make the relevant internal resources available more easily and in general without requiring to edit the actual package locally

You can check my answer in this thread for more info, and stay tuned for more info once we approach release

3 Likes