<?xml version="1.0" encoding="utf-8"?>

In 3D graphics, the material properties of a surface, the distance of an object from light, the angle of light, the viewpoint, and other conditions affect the shading. Simply put, shading is the process of computing color, the way it changes, and basically how we see the object in a 3D scene.

You may aim to create a photorealistic shading that users can't distinguish from the real world, or you may want to try a new artistic approach with grotesque coloring. Depending on your goal, you should use a certain shading technique.

In this lesson, we'll go through the most common methods of shading in 3D, and learn their differences, so you can have the necessary background to further explore the topic.

Exercise #1

Normals

Shading in 3D can't exist without normals. The thing is, the brightness of an object at one particular point depends on the angle between the normal — a perpendicular vector to the surface — at that point and the light line bouncing off the surface. The greater the angle, the darker the surface on this spot.[1] 

Exercise #2

Reverse normals

In design terms, reverse normals are normals that got reversed, flipped, or inverted and point in the opposite direction. For example, on average, a sphere's normals are pointing outward, making it look like a fuzzy monster or bacteria. When you have its normals reversed, they point inward. Why does it matter?

Flipped normals change the face orientation, showing its backside. As a result, the shading changes too, and light faces look dark, while dark faces turn into light.[2]

Exercise #3

Normals angle

Normals are incredibly helpful and allow 3D designers to experiment with shadows. Manipulating the normals angle — the one formed by a normal vector and the light trajectory bouncing off the surface — you can adjust the shading. The greater the angle between a normal and light direction, the harder the shades get, while a smaller angle results in the soft ones.[3] 

Exercise #4

Flat shading

Flat shading is the shading model with this blocky lo-fi look which bears nostalgic vibes of the early 90s' games. Every model in 3D is a combination of vertices that define the shape. Each vertex has its own normal that we use to determine the amount of 3D lighting to apply to that vertex. As a result, each polygon receives an equal amount of light with flat shading without mathematical correction that makes the object look sharp and flat.[4]

Exercise #5

Smooth shading

Smooth shading treats color transition between two adjacent polygons with a gentle approach. It results in softened rough edges that appear difficult to distinguish at all. Keep in mind that smooth shading is computationally costly, as it takes a more complicated approach to define colors for each point of the face. In contrast, flat shading applies the same color for every pixel in a face.

Exercise #6

Physical shading

As you may guess from its name, physical shading tends to imitate the flow of light from the real world. Naturally, the light behavior depends on the surface type and whether it contains metal atoms or not. This model's core principle is to render even flat or matte surfaces as concrete with a pinch of shimmer and light.[5] 

Exercise #7

Phong shading

Phong shading took its name after Bui Tuong Phong, the first to mention it in his dissertation at the University of Utah in 1973. Phong shading is an elegant way to render multi-surface shapes by calculating and distributing the light per each point of interest across the surface instead of per vertex. As a result, objects look smooth and more realistic, as the shading uses more complex computations based on the color and illumination of each pixel.[6]

Exercise #8

Lambert shading

Lambert shading helps create a smooth matte surface. This model distributes the light equally in all directions around the normal vector of a small flat area. Once the normal vector or light direction shifts, the light diffusion for the flat area changes too. The model took its name after Johann Heinrich Lambert, who introduced perfect diffusion in his 1760 book Photometria.[7]

Exercise #9

Cel shading

What differentiates cel shading from other models is its non-photorealistic cartoonish style. Instead of smooth gradients of shadows and highlights, the cel shading renders objects with chunks of colors, creating a rather flat comic-like look. The technique appeared in the 2000s and is often associated with the video game Jet Set Radio, which widely boosted its popularity.

Complete this lesson and move one step closer to your course certificate