Summary
In this chapter, we discussed the fundamentals of programming shaders with Unity’s new URP.
We studied the evolutions of ShaderLab and low-level hardware shader logic syntax between the built-in render pipeline and our new setup, and in particular, we zoomed into some common macro translations that are worth mentioning. We also got an overview of the frequently used tags to help the Unity engine handle cross-platform shaders that contain multiple SubShader
and/or Pass
tags.
Finally, we applied the theory to a simple example and implemented an unlit URP shader with two properties: a base color and a main texture. We also took this opportunity to look at the material inspector and how, with the new SRPs, it now provides us with some interesting extra options that are material-specific.
This concludes our first look at how to program HLSL-based shaders for the Unity URP – we now have a good idea of how these scripts are structured and how this structure...