Here's your free sample!

1.1.3. Forward Rendering

This post is also available in…

Forward is the default Rendering Path and supports all typical features of a material including Normal Maps, individual pixel illumination, shadows, and more. This rendering path has two different code written passes that you can use in your shader, the first, base pass and the second additional pass

In the base pass you can define ForwardBase Light Mode and in the additional pass, you can define ForwardAdd Light Mode for additional lighting calculations. Both are characteristic functions of a shader with lighting calculations. The base pass can process directional light Per-Pixel and will prioritise the brightest light if there are multiple directional lights in the scene. In addition, the base pass can process Light Probes, global illumination, and ambient illumination (sky light). 

As its name says, the additional pass can process additional lights (Point Light, Spotlight, Area Light) or also shadows that affect the object. What does this mean? If there are two lights in the scene, your object will be influenced by only one of them, However, if you have defined an additional pass for this configuration, then it will be influenced by both. 

A point to consider is that each illuminated pass will generate an independent Draw Call. What does this mean? By definition a Draw Call is a call graphic that is made in the GPU every time an element is drawn on the screen of the computer. These calls are processes that require a large amount of computation, so they need to be kept to the minimum possible, even more so if you are working on projects for mobile devices. 

To understand this concept, suppose there are four spheres and one directional light in your scene. Each sphere, by its nature, generates a call to the GPU, this means that each of them will generate an independent Draw Call by default.

Likewise, the directional light influences all the spheres that are found in the scene, therefore, it will generate an additional Draw Call for each one.

This is mainly because a second pass has been included in the shader to calculate the shadow projection, therefore, four spheres, plus one-directional light will generate eight graphic calls in total.

(Fig. 1.1.3a. In the image above, you can see the increase in Draw Calls when there are light sources. The calculation includes the ambient color and the light source as the object)

Having determined the base pass, if another pass is added in the shader, then another Draw Call for each object will be added, and consequently, the graphic load will increase respectively.

Follow us to stay informed about all the latest news, updates, and more.

Join the group to share your experiences with other developers.

Subscribe to our channel and keep learning game dev!

Jettelly Team

We are a team of indie developers with more than 9 years of experience in video games. As an independent studio, we have developed Nom Noms in which we published with Hyperbeard in 2019. We are currently developing The Unity Shader Bible.

Follow us on our social networks.