Creating a URP wireframe shader
To better understand the ins and outs of these geometry shaders, let’s take a very common use case – the creation of a runtime wireframe shader. Our goal in this section will be to make the geometry of our mesh apparent live, outside of edit mode. This type of effect can be very useful for debugging, sci-fi games, or even retro-futuristic visuals à la Tron:
Figure 13.5 – An example of a wireframe shader partially applied to a spaceship model
The shader will be unlit, and we will make the size of the strokes tweakable so that users can easily pick the thickness they want and modify the render to their liking. Therefore, let’s go through this shader step by step by first setting up our URP shader, then adding the geometry stage, and finally, fine-tuning a few details to get smoother visuals.
Preparing our URP wireframe shader
To begin, we’re going to create our shader as a new...