Chapter 4: PBR Material Fundamentals
This is Part 2 of the Unity HDRP production guide, continuing from Part 1: Setup, Interface and Assets. This installment covers materials and shaders: PBR fundamentals, the full HDRP Lit shader, specialized shaders, and material optimization for production.
4.1 Core Concepts: Shader, Material, Texture
Before building materials, it's worth clearly separating three concepts that get confused often: shaders, materials and textures.
A shader is a small GPU program that defines how light interacts with a surface - reflectivity, transparency, light scattering. Shaders are written in HLSL and talk directly to the graphics card. HDRP's main surface shaders:
| Shader | Main use |
|---|---|
| Lit | Standard realistic surfaces (wood, metal, stone, plastic) |
| Lit Tessellation | Surfaces with geometric deformation |
| Layered Lit | Complex multi-layer materials |
| Fabric | Textiles, velvet |
| Hair | Hair and fur |
| Eye | Realistic eyes |
| Decal | Projections onto existing surfaces |
| Unlit | Surfaces unaffected by lighting |
A material is a Unity asset (.mat) that combines a shader with a configured set of properties - the concrete instance of a shader with specific values: colors, assigned textures, roughness levels. A texture is an image (usually 2D) applied to a material to enrich its appearance, simulating surface detail: color, relief, roughness, reflections. It can be a standard bitmap (.png, .tga, .tiff, .exr), a mathematically generated procedural texture, a 3D texture for volumetric effects, or a cubemap for environment reflections.
SHADER (GPU program)
└─ MATERIAL (configured instance)
├─ Scalar properties (Metallic: 0.8, Smoothness: 0.6)
└─ TEXTURES (assigned images)
├─ Base Map (color)
├─ Normal Map (relief)
└─ Mask Map (combined properties)
4.2 The PBR Workflow
Physically Based Rendering (PBR) simulates light's real physical behavior. Unlike older empirical methods, PBR gives consistent results under different lighting conditions, resting on a few physical principles:
- Energy conservation - a surface can't reflect more light than it receives; the more reflective (specular) a surface, the less diffuse it is.
- Microfacets - at microscopic scale, surfaces are made of tiny, randomly oriented facets; their distribution determines apparent roughness.
- Fresnel - a surface's reflectivity varies with viewing angle; at grazing angles, even non-metallic surfaces become highly reflective.
Two standard PBR workflows exist industry-wide: Metallic/Roughness (Metallic 0-1, Roughness 0-1 - used by Unity HDRP, Unreal Engine, Substance) and Specular/Glossiness (Specular RGB, Glossiness 0-1 - used by legacy Unity Standard and some other tools). Unity HDRP uses Metallic/Roughness, with Smoothness = 1 - Roughness. PBR's advantages: materials stay coherent under different lighting, parameters are intuitive and physically grounded, materials transfer cleanly between software (Substance, Blender, Maya), and results are predictable and reproducible.
4.3 Shader Graph
Shader Graph is Unity's built-in visual shader editor, letting you build custom shaders without writing code through a node-based interface: the Blackboard lists exposed properties (parameters adjustable in the material's Inspector), the Graph is the node workspace, the Master Node defines the shader's final outputs, and a Preview shows the result in real time. It's especially useful for animated visual effects (dissolve, distortion, holograms), procedural materials (noise, patterns), stylized non-photoreal looks, and fast look prototyping. For standard photoreal materials, the Lit shader is usually enough - Shader Graph earns its place when Lit's built-in features don't cover a specific need.
4.4 Available HDRP Shaders
When working in HDRP, stick to shaders in this category to avoid compatibility issues:
- HDRP/Lit - HDRP's central shader, versatile enough for the large majority of realistic materials: metal, wood, stone, plastic, glass, skin, vegetation.
- HDRP/Lit Tessellation - a Lit variant with dynamic tessellation, subdividing geometry in real time to add relief detail from a Height Map.
- HDRP/Layered Lit - stacks up to 4 material layers with mask-controlled blending; ideal for terrain or complex surfaces.
- HDRP/Fabric - optimized for textiles, simulating fiber-specific properties: natural anisotropy, specific scattering, adapted subsurface.
- HDRP/Hair - specialized for hair and fur, handling hair-strand anisotropy and light transmission through strands.
- HDRP/Eye - dedicated to realistic eyes, simulating corneal refraction, iris depth, and characteristic specular reflections.
- HDRP/Decal - projects textures onto existing surfaces without modifying their geometry - useful for localized detail (impacts, grime, signage).
- HDRP/Unlit - a shader with no lighting interaction; the displayed color is exactly the texture's. Used for UI, emissive screens, skyboxes.
4.5 Materials Bundled With Unity HDRP
Unity ships a library of ready-to-use materials, an excellent learning and quick-start resource, accessible via Window → Package Manager → High Definition RP → Samples:
| Sample | Content |
|---|---|
| Material Samples | Metals (steel, copper, gold), brick, glass, ice, plastics |
| Fabric Samples | Fabric, carpet, wool with realistic rendering |
| Environment Samples | Day/night cycles, auroras, procedural skies |
Recommended approach: download the samples via Package Manager, open the included demo scenes, examine the materials in the Inspector to understand their setup, then duplicate and adapt them for your own needs. This reverse-engineering approach is often more effective than configuring materials from scratch.
Chapter 5: The HDRP Lit Shader
5.1 Overview
The Lit shader is HDRP's "master shader," implementing a complete PBR lighting model capable of building nearly any realistic surface: a physically accurate lighting model, support for both metallic and dielectric materials, advanced reflection/refraction handling, ray-tracing and path-tracing compatibility, and a large set of optional advanced properties.
The Lit shader's Inspector is organized into collapsible sections:
Surface Options
├── Surface Type (Opaque / Transparent)
├── Rendering Pass
└── Alpha Clipping
Exposed Properties
├── Base Map / Color
├── Mask Map
├── Normal Map
├── Bent Normal Map
├── Height Map
├── Detail Map
└── Emission
Advanced Options (depends on Material Type)
├── Subsurface Scattering
├── Iridescence
├── Anisotropy
└── Coat
5.2 Surface Types
The first parameter to configure is Surface Type, defining the material's fundamental behavior. Opaque materials block light entirely - the default for most solid surfaces (wood, stone, metal, opaque plastic, concrete). Transparent materials let light pass through partially or fully (glass, water, translucent plastic, crystal), with extra parameters: Blend Mode (Alpha, Additive, Premultiply), Refraction (index of refraction for distortion), and Sorting Priority (render order for overlapping transparencies). Alpha Clipping uses the texture's alpha channel to create hard cutouts - pixels below a threshold become fully transparent, used for foliage, mesh fences, hair cards and vegetation, with a key Alpha Cutoff parameter (typically 0.5).
5.3 Base Properties and Textures
Base Map (Albedo) defines the surface's fundamental color - its intrinsic color with no lighting baked in. Avoid colors that are too dark or too light (pure black/white doesn't exist in reality), never bake shadows or highlights into the albedo, and use PNG or TGA with BC7 compression.
Mask Map (RGBA) is an optimized texture combining four properties in one file to save memory:
| Channel | Property | Value 0 | Value 1 |
|---|---|---|---|
| R | Metallic | Non-metallic | Metallic |
| G | Ambient Occlusion | Shadowed | Exposed |
| B | Detail Mask | No detail | Detail visible |
| A | Smoothness | Rough | Smooth |
Note that Unity uses Smoothness (the inverse of Roughness) - 1 means a perfectly smooth, reflective surface. Import config: Texture Type Default, sRGB off (linear data), BC7 compression.
Normal Map simulates relief detail without changing actual geometry, encoding surface normal direction in the RGB channels (R=X, G=Y, B=Z, usually near 1). Import config: Texture Type Normal Map, sRGB off, BC5 compression.
Height Map (Displacement) is a grayscale image defining a surface's actual relief - unlike the Normal Map's optical illusion, it can actually deform geometry via tessellation (black = recessed, gray = base level, white = raised). Related parameters: Parametrization (Min/Max or Amplitude), Min/Max (displacement range in world units), Offset. Import config: Default type, sRGB off, BC4 (single channel).
Emission Map defines light-emitting areas, unaffected by scene lighting by default (Emission Map texture, Emission Color in HDR, and a Global Illumination setting of Baked/Realtime/None for it to actually contribute to scene lighting). Used for neon, screens, lava, magic objects, LEDs.
Detail Map layers micro-detail on top of the main textures, particularly useful for large surfaces where base resolution would fall short - combining Albedo detail (R), Normal detail (GA) and Smoothness detail (B), each with its own intensity scale parameter.
5.4 Advanced Material Types
The Lit shader offers several Material Types unlocking extra properties for specialized rendering:
Subsurface Scattering (SSS) simulates light penetrating and scattering through translucent materials - light partially passes through the surface, scatters internally, then exits with a characteristic tint. Relevant materials: human skin, wax and candles, marble and alabaster, backlit leaves and vegetation, jade and translucent stone, food (fruit, meat). To configure: enable Subsurface Scattering as the Material Type, create a Diffusion Profile (Assets → Create → Rendering → Diffusion Profile) with Scattering Distance, Transmission and Texturing Mode, then assign it to the material, and set a Subsurface Mask (1 = full SSS, 0 = opaque) and optional Thickness Map on the material itself.
Anisotropy creates directional specular highlights that vary with surface orientation, simulating oriented micro-structures - brushed metal (anodized aluminum, stainless steel), hair and fur, vinyl records, fabric with visible weave, sanded wood. Parameters: Anisotropy (-1 to 1) and an optional Tangent Map for its direction.
Iridescence simulates view-angle-dependent color shifts, producing rainbow-like effects - insect wings (butterflies, flies), soap bubbles, oil films on water, CDs/DVDs, special metallic automotive paint, mother-of-pearl and shells. Parameters: Iridescence Mask and Iridescence Layer Thickness (which determines visible colors).
Clear Coat adds a transparent varnish layer on top of the base material, with its own specular reflections - lacquered automotive paint, varnished wood, glossy plastic, car bodywork, waxed parquet. Parameters: Coat Mask (varnish intensity per area) and Coat Smoothness.
Specular Color enables explicit control of specular color, useful for materials with non-standard colored highlights. Translucent is a simplified SSS without depth computation - faster but less precise, used for simple transparencies.
5.5 UV Coordinate Systems
UV coordinates define how textures map onto geometry. Unity supports up to 8 UV channels (UV0-UV7): UV0 for main textures (created in the modeling software), UV1 for lightmaps (auto-generated by Unity), UV2 for detail maps and secondary textures, UV3+ for special effects and custom masks.
Planar projection applies a texture as if projected from a 2D plane perpendicular to an axis (X, Y or Z) - simple and fast, but stretches on non-perpendicular surfaces; good for walls, floors, flat oriented surfaces. Triplanar projection projects along all three axes at once and blends the results based on surface normals - no stretching and works without UVs, at a higher GPU cost (3× the texture samples); good for terrain, rocks, procedural geometry, organic surfaces.
Chapter 6: Specialized Shaders and Optimization
6.1 Lit Tessellation
Lit Tessellation adds dynamic geometry subdivision driven by a Height Map, producing real relief rather than an optical illusion. It subdivides mesh triangles in real time, then displaces the new vertices per the Height Map, with the subdivision level able to vary by camera distance. Parameters: Tessellation Mode (None, Phong smoothing), Tessellation Factor (1-64), Start/End Fade Distance, Triangle Size. Recommended for paved/brick floors with strong relief, close-up mountainous terrain, detailed rock surfaces, and hero objects needing precise relief.
6.2 Layered Lit
Layered Lit stacks up to 4 material layers with precise mask-driven blending control - each layer has its own textures (Base, Mask, Normal), with a blend mask controlling visibility. Used for terrain with grass/dirt/rock transitions, walls with wear and degradation, surfaces with accumulation (snow, dust, moss), and complex composite materials.
6.3 Fabric Shader
| Property | Lit | Fabric |
|---|---|---|
| Anisotropy | Optional | Native and optimized |
| Light scattering | Standard | Adapted for fibers |
| SSS | Generic | Calibrated for textiles |
| Thread Map | Not available | Dedicated to threads |
Used for clothing and costumes, curtains and drapes, rugs and carpet, textile furniture (sofas, armchairs).
6.4 Specialized Shaders: Arnold and AxF
Arnold Standard Surface is Unity's implementation of the well-known Arnold shader used in offline Maya/3ds Max rendering - advanced photoreal rendering, sophisticated multi-scattering, high-precision subsurface scattering, ray/path tracing compatible. Best for projects where visual quality matters more than performance, offline-rendered cinematics, and complex materials needing extreme realism.
AxF (X-Rite Appearance Exchange Format) is an ultra-precise shader based on real BRDF measurements from physical material scans - metrological fidelity, professionally scanned material data, complete BRDFs capturing every light/material interaction. Best for industrial projects needing exact physical reproduction, high-end ArchViz, and automotive configuration with certified materials. Limitation: needs AxF files from professional scans.
6.5 Shader Comparison
| Shader | Performance | Versatility | Realism | Use case |
|---|---|---|---|---|
| Lit | Excellent | Very high | Very good | General use |
| Lit Tessellation | Medium | High | Excellent | Surfaces with relief |
| Layered Lit | Medium | Medium | Very good | Multi-material |
| Fabric | Good | Specialized | Excellent | Textiles |
| Arnold | Low | High | Exceptional | Cinematics |
| AxF | Low | Specialized | Metrological | Industry |
| Unlit | Excellent | Limited | N/A | UI, effects |
6.6 Material Optimization
Power-of-2 texture dimensions (256, 512, 1024, 2048, 4096) are optimal for the GPU - faster memory transfers, easier mipmapping, no extra filtering steps. Mipmapping generates reduced-size versions of each texture for distant objects, automatically if enabled on import - better quality on distant objects (no shimmering) and improved performance.
| Format | Use | Quality | Size |
|---|---|---|---|
| BC7 | Albedo, Mask Map | Excellent | ~4:1 |
| BC5 | Normal Maps | Excellent | ~4:1 |
| BC4 | Height, single channel | Good | ~4:1 |
| BC1 | Simple textures | Medium | ~8:1 |
GPU instancing renders multiple objects sharing the same material in a single draw call - enable "Enable GPU Instancing" in the material's settings. Recommended resolutions: 512×512 for distant/secondary props, 1024×1024 for medium/recurring elements, 2048×2048 for important props and characters, 4096×4096 for heroes, close-ups and terrain.
6.7 Common Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Pink/magenta material | Incompatible shader | Assign HDRP/Lit manually, or HDRP Wizard → Convert All Built-in Materials |
| Incorrect Normal Map | Wrong import config or DirectX vs. OpenGL format | Confirm Texture Type = Normal Map; enable Flip Green Channel if needed |
| SSS not working | Missing Subsurface Scattering override | Add the override to a Volume in the scene |
| Transparency artifacts | Incorrect render order | Adjust Sorting Priority; enable Depth Write if appropriate |
6.8 Material Resources
| Resource | Type | Free? |
|---|---|---|
| Poly Haven | PBR textures, HDRI, models | Yes |
| ambientCG | PBR textures, SBSAR, HDRI | Yes |
| Quixel Megascans | Photoreal scans | Via Bridge |
| Substance 3D Community | SBSAR materials | Mixed |
| Unity Asset Store | Everything | Mixed |
If you don't have every map you need, tools can generate them from a source image: ShaderMap (generates Normal, AO, Displacement from Albedo), Materialize (a similar free tool), Substance Designer (advanced procedural generation).
Part 2 Summary
| Chapter | Skills covered |
|---|---|
| Ch. 4 - Fundamentals | Shader/Material/Texture, PBR workflow, available shaders |
| Ch. 5 - Lit Shader | Base properties, texture maps, advanced Material Types |
| Ch. 6 - Specialized | Tessellation, Layered, Fabric, Arnold, AxF, optimization |
Key takeaways: the Lit shader covers 90% of realistic material needs; the Mask Map combines 4 properties into one texture to save memory; Material Types (SSS, Anisotropy, Iridescence) unlock advanced properties; optimization (power-of-2, compression, instancing) matters a lot in production; and Unity's bundled materials are an excellent learning base.
Part 3, next, covers cinematic lighting: light types and parameters, the physical camera and exposure, and HDRP's lighting modes and shadow system.