You can then use this value during thresholding instead of the dot product. Instead of calculating the dot product, you calculate how lit a surface is. To fix this, you need to use a different method. Also, objects can not cast shadows on cel shaded objects. The limitation with this method is that other lights cannot affect cel shaded objects. If the dot product is lower than -0.8, assign a light color. For example, you can assign a darker color if the dot product is higher than -0.8. 1 means they are facing the same direction.īy thresholding the dot product, you can create multiple bands. 0 means they are perpendicular to each other. By calculating the dot product between the normal and light direction, you will get a value between -1 and 1.Ī value of -1 means the surface and light are facing opposite directions.
The most common method is to compare the surface direction (known as the normal) and the light direction. In the next section, you will learn how you can implement cel shading. You will see this a lot in anime-styled games such as Guilty Gear Xrd and Dragon Ball FighterZ.
This helps an image look like it was drawn or inked. Notice that the character’s shading does not utilize bands of color.Įven though outlines are not cel shading, it is common to combine them together. Although this game has a stylized look, it is not cel shaded. One for shadows, one for midtones and one for highlights.Ī common misconception is that if something has outlines, it is cel shaded. Note that only the character has cel shading while the background does not. What is Cel Shading?Ĭel shading is when you render something using multiple bands of color rather than a continuous gradient.īelow is an example of cel shading in The Legend of Zelda: Breath of the Wild. Before you start, you should know what cel shading is.
This is the character you will be cel shading. Navigate to the project folder and open CelShader.uproject.
Note: This tutorial is part of a 4-part tutorial series on shaders in Unreal Engine:ĭownload the starter project and unzip it.