yes, this is andy

← Back to all posts

Physically Based Rendering Materials

#rendering #pbr #materials

Physically Based Rendering Materials

PBR revolutionized game graphics by providing a framework for creating consistent, realistic materials under any lighting condition.

What is PBR?

Physically Based Rendering uses material properties based on real-world physics. Instead of arbitrary values, we use:

Why PBR Matters

Before PBR, artists had to tweak materials for every lighting scenario. With PBR:

  1. Materials look correct in all lighting
  2. Values have physical meaning
  3. Asset reuse across projects
  4. Predictable results

[!note] PBR doesn’t automatically make things look good - it just makes them look correct.

The Metallic Workflow

Most engines use the metallic workflow:

vec3 F0 = vec3(0.04);
F0 = mix(F0, albedo, metallic);

// Fresnel-Schlick approximation
vec3 F = F0 + (1.0 - F0) * pow(1.0 - cosTheta, 5.0);

// Cook-Torrance BRDF
float NDF = DistributionGGX(N, H, roughness);
float G = GeometrySmith(N, V, L, roughness);
vec3 numerator = NDF * G * F;
float denominator = 4.0 * max(dot(N, V), 0.0) * max(dot(N, L), 0.0);
vec3 specular = numerator / max(denominator, 0.001);

Common Mistakes

Things I see developers get wrong:

Texture Authoring

Good PBR textures require attention:

Use Substance Designer or Painter for best results.

Performance

PBR is more expensive than simple Blinn-Phong, but worth it:

Optimize by using texture atlases and LOD for distant objects.