Creating a Sprite Outline Shader
Now that we have some background information on how to build shaders, let's look at a real-world example of a shader we could potentially use. For this first project, we will be creating a shader for a 2D game by drawing an outline around a sprite shape. This is something that we can easily do in Shader Graph, which will also allow us to see a non-trivial example of Shader Graph being used.
Getting ready
Ensure that you have created a project using the LRP, as described in the Creating a URP-based Shader Graph project recipe. Afterward, complete the following steps:
- Create a new scene, if you haven't done so already, by going to File | New Scene.
- Since we are going to be creating a 2D example, go to the Hierarchy window and select the Main Camera object. From the Inspector window open the Camera component and change the Projection dropdown to the Orthographic option.