【Unity】Unity Materials and Shaders Basics: Adding Color and Texture to Objects

Created: 2025-12-07

Essential knowledge for giving 3D models realistic surfaces—Materials and Shaders. Learn their relationship, how to use Unity's standard shaders (Lit/Unlit), and PBR (Physically Based Rendering) basics.

Overview

A 3D model (mesh) is merely "shape" data. Materials and Shaders define what color the object is and what kind of surface (metal, plastic, cloth, etc.) it has.

These two concepts are closely related and often confused, but their roles are distinctly different:

  • Shader: A program (algorithm) that calculates how to draw (render) the object. Contains formulas for how light reflects, how shadows are calculated, how textures are applied, etc.
  • Material: An asset for actually applying a shader to an object. A material selects a specific shader and sets concrete values for the properties that shader exposes (color, textures, smoothness, etc.).

Think of it this way: a shader is a "recipe (formula)," and a material is "the dish made by applying specific ingredients (colors and textures) to that recipe." The same recipe (shader) with different ingredients (properties) creates completely different dishes (appearances).

This article explains how to create materials and use Unity's powerful Standard Shader to give objects various surface qualities.

Creating and Applying Materials

  1. Create: Right-click in the Project window and select Create > Material. A new material asset (.mat file) is created.
  2. Apply: Drag and drop the created material asset onto a 3D object in Scene view or Hierarchy. The material is set in the object's Mesh Renderer component's Materials array.

Selecting a Shader

Select a material asset to see a Shader dropdown menu at the top of the Inspector. This is where you select the "recipe" for this material. Unity includes many built-in shaders, but the most fundamental and powerful is the Standard Shader.

Standard Shader: Lit vs Unlit

In Unity's standard render pipeline (Built-in Render Pipeline), the Standard shader is default. With URP (Universal Render Pipeline) or HDRP (High Definition Render Pipeline), the base shaders are named Lit (with lighting) and Unlit (without lighting). They serve essentially the same roles:

  • Lit (with lighting): Fully affected by scene lights. Receives shading from light direction, enabling realistic surface appearance. Most objects in 3D games use Lit shaders. This is the basis of PBR (Physically Based Rendering).
  • Unlit (without lighting): Completely ignores scene lights. Objects display set colors/textures at constant brightness. Used for UI elements, special effects, or debug visualization.

Basic PBR (Physically Based Rendering) Properties

Lit shaders (Standard Shader) support PBR, which simulates light reflection based on physical laws. By specifying characteristics that real-world materials possess, artists can create materials that look realistic under various lighting conditions. Key properties:

  • Albedo: Defines the object's base color. Typically assigned a color texture (an image depicting the object's patterns and colors).

  • Metallic: Sets how "metallic" the surface appears, from 0 to 1. 0 is non-metal (plastic, wood, cloth, etc.), 1 is metal (iron, gold, copper, etc.). Typically set to exactly 0 or 1—intermediate values are rarely used.

  • Smoothness / Roughness: Defines how smooth or rough the surface is. Smoothness near 1 (Roughness near 0) means mirror-smooth surfaces that clearly reflect light. Near 0 (Roughness near 1) means rough surfaces that scatter light. This value is crucial for expressing plastic sheen, wet surfaces, frosted glass, etc. Note: Unity's standard shader uses Smoothness; Unreal Engine and many other tools use Roughness (1 - Smoothness). The concept is identical.

  • Normal Map: A special texture that creates the illusion of surface bumps and details without increasing mesh polygon count. Used for brick wall grooves, fabric weaves, armor patterns on characters—dramatically enhancing visual richness.

  • Emission: Makes the object appear to emit light. Doesn't illuminate other objects like actual lights, but used for neon signs, magical items, monitor screens, etc. Combined with post-processing Bloom effects, creates beautiful glow effects.

Summary

Materials and shaders are essential elements for bringing 3D objects to life.

  • Shaders are "formulas"; materials are "configured with specific values."
  • Lit shaders respond to light sources for realistic surfaces. Unlit shaders ignore light sources.
  • PBR fundamentals: Define surface quality with three main properties—Albedo (color), Metallic (metalness), Smoothness (smoothness).
  • Add detail with Normal Maps, express self-illumination with Emission.

By adjusting these properties and combining various textures, you can create nearly infinite visual variations from the same 3D model. Good materials dramatically enhance the believability of your game world.