Lesson 34 +10 XP

Materials & Shaders

Materials & Shaders

To make a 3D model look like wood, metal, or glass, you use Materials and Shaders.

The Relationship

  • A Shader is a mathematical script that runs on the GPU. It calculates how light interactively reflects off surfaces.
  • A Material is an instance of a Shader containing specific textures and parameters (color, glossiness).

Multiple Materials can use the same Shader but display different colors and textures.

Physically Based Rendering (PBR)

Modern Unity pipelines use PBR Shaders. These simulate light properties to achieve realistic results:

  • Albedo: The base color of the surface, with no lighting or shadow information.
  • Metallic: Determines if a surface is metal (reflective, takes color from surroundings) or non-metal.
  • Smoothness (or Roughness): Controls how sharp or blurry light reflections are.
  • Normal Map: A texture that adds fake surface detail (wrinkles, bumps) by altering how light bounces off the geometry, without adding extra polygons.
  • Emission: Makes the material look like it glows, emitting light color.

TL;DR

  • Shaders are GPU programs that calculate light; Materials are configurations of Shaders.
  • PBR Shaders achieve realism by mimicking physical light equations.
  • Albedo sets base color; Normal Maps add surface texture details.
  • Metallic and Smoothness settings control reflection sharpness and intensity.