Hello, thank you for taking the time to listen to people's questions! I recently started looking into SRP's but one of the things that made me hesitant to upgrade from BRP is that I'm not a big fan of authoring shaders via shader graphs and from what I've seen, "surface shaders" aren't a thing in URP/HDRP any more and authoring SRP shaders through code requires a lot of code duplication and is currently not a very nice workflow.
Even just making a simple Physically Based shader that has an interesting animated noise pattern for its albedo colour and works in both Forward and Deferred rendering paths requires you to implement a lot of passes with a lot of includes.
The simplest implementation of this sort of thing that I've seen is in the UniversalShaderExamples repository by Unity's own Felipe Lira, but from what I can see it only supports Forward Rendering, and if it were to support Deferred Rendering too I believe the shader would be much more complex because the Forward and Deferred shaders require different kinds of Varyings structs, for example. I've had a go at trying to set up a "surface shader workflow" myself, but it required modifying the URP package and it doesn't support all features. It's telling to me that the best way of authoring SRP shader code is basically an attempt to re-implement the "surface shader" approach from BRP, maybe we just need that back.
My question for the team is two-tiered:
- What tips do you have in the short term to improve the shader authoring workflow through code?
- Does Unity have any plans in the long-term to improve this workflow? If so, when can we expect to see such improvements (broadly speaking, like in a future version of Unity 6? Unity 7? Beyond?)
Sand box project containing example shaders and assets compatible with Unity Universal Render Pipeline. - phi-lira/UniversalShaderExamples