What is PBR?
Physically-Based Rendering (PBR) is an approach to rendering that models how light interacts with surfaces based on real-world physics. PBR materials:- Respond realistically to different lighting conditions
- Are portable across different engines and tools
- Produce consistent results with measurable parameters
- Conserve energy (don’t reflect more light than received)
Standard Lit Shading Model
The lit model is based on a microfacet BRDF (Bidirectional Reflectance Distribution Function) that models surfaces as collections of tiny mirrors.Dielectrics vs. Conductors
All materials fall into two categories: Dielectrics (Non-metals):- Have chromatic diffuse reflection
- Have achromatic specular reflection (white/gray)
- Examples: plastic, wood, stone, fabric
- Have no diffuse reflection
- Have chromatic specular reflection (colored)
- Examples: iron, gold, copper, aluminum
metallic property controls this:
Energy Conservation
Filament’s shading models ensure energy conservation:metallic increases:
- Diffuse contribution decreases
- Specular contribution increases
- Total energy remains conserved
The BRDF Components
The lit model combines several components: Diffuse Term:- Uses Lambertian diffuse with Disney diffuse for improved edge behavior
- Controlled by
baseColor(for dielectrics) - Modulated by
(1 - metallic)
- Uses GGX (Trowbridge-Reitz) microfacet distribution
- Controlled by
roughness - Fresnel term uses Schlick approximation
Roughness and Specular Highlights
Roughness controls how micro-facets are oriented: Smooth surfaces (roughness = 0):- Micro-facets aligned with surface
- Sharp, mirror-like reflections
- Small, bright specular highlights
- Randomly oriented micro-facets
- Blurred, diffuse reflections
- Large, dim specular highlights
Perceptual Roughness
Filament uses perceptual roughness, which is more intuitive:Fresnel Effect
The Fresnel effect describes how reflectance changes with viewing angle:- At grazing angles (near 90°), all surfaces become highly reflective
- At normal incidence (0°), reflectance depends on material
F0 (Fresnel at Normal Incidence)
F0 is the reflectance at 0° viewing angle: For dielectrics:- Water: 0.02 (2%)
- Plastic: 0.04 (4%)
- Glass: 0.04-0.05 (4-5%)
- Diamond: 0.17 (17%)
Clear Coat Layer
The clear coat model adds a second specular lobe for multi-layer materials:- Is always isotropic (not anisotropic)
- Is always dielectric (IOR = 1.5)
- Has independent roughness
- Can have its own normal map
Clear Coat IOR Change
When adding a clear coat, Filament accounts for the index of refraction change, which modifies the base layer’s appearance:Anisotropic Reflections
Anisotropic materials have directional micro-facets, like brushed metal:- GGX distribution with anisotropic extension
- Separate roughness along tangent and bitangent
- Direction map to control highlight orientation
Sheen Model
Sheen adds a soft lobe on top of the base layer, useful for fabrics:- Uses Charlie sheen distribution (Estevez 2017)
- Sits below clear coat if present
- Energy-conserving with base layer
Subsurface Scattering Model
The subsurface model approximates light scattering beneath the surface:Approximation Method
Filament uses a fast approximation:- Wrap lighting: Light wraps around to back side
- Thickness-based attenuation: Uses
thicknessparameter - Color scattering: Modulated by
subsurfaceColor
Cloth Shading Model
The cloth model is optimized for fibrous materials:Key Differences from Lit Model
- Softer specular lobe - Better matches fabric appearance
- Forward/backward scattering - For velvet-like materials
- Two-tone specular - Via
sheenColor - No metallic - Fabrics are always dielectric
Ashikhmin-Shirley BRDF
Cloth uses a modified Ashikhmin-Shirley model:- Softer highlights than GGX
- Better edge scattering
- Optimized for cloth appearance
Image-Based Lighting (IBL)
Filament uses pre-filtered environment maps for efficient IBL:Split-Sum Approximation
- Stored in cubemap with mip levels
- Each mip represents different roughness
- Generated offline with
cmgentool
- 2D lookup table (NdotV, roughness)
- Pre-computed Fresnel integral
- Shared across all materials
Diffuse IBL
Diffuse IBL uses spherical harmonics:- 1 band (1 SH coefficient) - Fastest
- 2 bands (4 SH coefficients) - Good
- 3 bands (9 SH coefficients) - Best (default)
Advanced Lighting Features
Specular Ambient Occlusion
AO for specular/reflections, derived from roughness:- Fast approximation
- Based on horizon occlusion
- More accurate
- Requires bent normal map
- Higher cost
Multi-bounce Ambient Occlusion
Accounts for multiple light bounces in occluded areas:- Reduces over-darkening
- Adds color to AO (based on
baseColor) - More realistic occlusion
Refraction
Filament supports screen-space and cubemap refraction:Solid Refraction
Thin Refraction
Dispersion
Chromatic aberration for refractions:Specular Anti-Aliasing
Reduces specular aliasing on glossy materials:- Analyzes normal map variance
- Increases roughness where needed
- Preserves highlight shape at distance
Custom Surface Shading
For advanced users, implement custom lighting:Performance Considerations
Material Complexity Costs
| Feature | Relative Cost |
|---|---|
| Base lit model | 1x |
| + Normal mapping | 1.1x |
| + Clear coat | 2x |
| + Anisotropy | 1.2x |
| + Subsurface | 1.3x |
| + Refraction (screen-space) | 2-3x |
Optimization Tips
-
Don’t set unused properties
-
Use appropriate shading models
- Cloth model for fabrics (not lit + sheen)
- Unlit for UI elements
- Subsurface only when needed
-
Limit variants
-
Optimize textures
- Pack roughness/metallic/AO into single texture
- Use appropriate precision (medium for mobile)
Validation and Debugging
Common Issues
Too dark:- Check ambient occlusion is in [0,1]
- Verify IBL is set on scene
- Ensure colors are in linear space
- For metals, specular = baseColor
- For non-metals, check reflectance value
- Verify metallic is 0 or 1 (not in-between)
- Check baseColor is in [0,1]
- Verify emissive is reasonable (< 10,000 nits)
- Don’t add to baseColor AND emissive
Further Reading
- Real Shading in Unreal Engine 4 - Foundational PBR paper
- Physically Based Rendering in Filament - Complete technical documentation
- Material models reference
- Material properties reference