Writing Your First URP Shader
Thanks to the first two chapters, we are now familiar with both the old way of writing shaders using the built-in render pipeline and the idea that we could improve our workflow by switching to the new Universal Render Pipeline (URP). However, we still don’t know exactly what this implies for our shader scripts, and how to actually create our effects with this new setup.
Although Unity now puts the node-based shader editing in the foreground with its Shader Graph, it is still interesting to know what goes on behind the scenes and to have an idea of how to write shader code for this new render pipeline via code. This will give you more knowledge of the overall shading pipeline and help you decipher some obscure documentation or a discreet thread on a great but rare shader effect, and be useful if your shaders require some custom functions – for which you will need to write your own scripts.
So, throughout this chapter, we will learn...