Unity HDRP Materials and Shaders

PBR fundamentals through the full Lit shader, specialized shaders, and optimization

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:

ShaderMain use
LitStandard realistic surfaces (wood, metal, stone, plastic)
Lit TessellationSurfaces with geometric deformation
Layered LitComplex multi-layer materials
FabricTextiles, velvet
HairHair and fur
EyeRealistic eyes
DecalProjections onto existing surfaces
UnlitSurfaces 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.
Careful - if a material shows up pink/magenta, it's using a shader incompatible with HDRP. Fix it by manually assigning HDRP/Lit, or by running the HDRP Wizard (Window → Rendering → HDRP Wizard) to convert materials.

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:

SampleContent
Material SamplesMetals (steel, copper, gold), brick, glass, ice, plastics
Fabric SamplesFabric, carpet, wool with realistic rendering
Environment SamplesDay/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:

ChannelPropertyValue 0Value 1
RMetallicNon-metallicMetallic
GAmbient OcclusionShadowedExposed
BDetail MaskNo detailDetail visible
ASmoothnessRoughSmooth

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.

Good to know - Unity defaults to the OpenGL normal-map format. If your Normal Map comes from a DirectX-convention tool (some Substance exports), enable "Flip Green Channel" in the import settings.

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.

Careful - for SSS to actually work, you need to add a Subsurface Scattering override to a Volume (Global or Local) in your scene. Without it, SSS materials won't render correctly.

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.

Careful - tessellation is GPU-expensive. Limit it to objects near the camera and use fade-distance settings to disable the effect on distant objects.

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

PropertyLitFabric
AnisotropyOptionalNative and optimized
Light scatteringStandardAdapted for fibers
SSSGenericCalibrated for textiles
Thread MapNot availableDedicated 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.

Good to know - the Arnold shader in Unity HDRP is a real-time-adapted implementation; it doesn't require installing Arnold as an external render engine.

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

ShaderPerformanceVersatilityRealismUse case
LitExcellentVery highVery goodGeneral use
Lit TessellationMediumHighExcellentSurfaces with relief
Layered LitMediumMediumVery goodMulti-material
FabricGoodSpecializedExcellentTextiles
ArnoldLowHighExceptionalCinematics
AxFLowSpecializedMetrologicalIndustry
UnlitExcellentLimitedN/AUI, 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.

FormatUseQualitySize
BC7Albedo, Mask MapExcellent~4:1
BC5Normal MapsExcellent~4:1
BC4Height, single channelGood~4:1
BC1Simple texturesMedium~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

ProblemCauseFix
Pink/magenta materialIncompatible shaderAssign HDRP/Lit manually, or HDRP Wizard → Convert All Built-in Materials
Incorrect Normal MapWrong import config or DirectX vs. OpenGL formatConfirm Texture Type = Normal Map; enable Flip Green Channel if needed
SSS not workingMissing Subsurface Scattering overrideAdd the override to a Volume in the scene
Transparency artifactsIncorrect render orderAdjust Sorting Priority; enable Depth Write if appropriate

6.8 Material Resources

ResourceTypeFree?
Poly HavenPBR textures, HDRI, modelsYes
ambientCGPBR textures, SBSAR, HDRIYes
Quixel MegascansPhotoreal scansVia Bridge
Substance 3D CommunitySBSAR materialsMixed
Unity Asset StoreEverythingMixed

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).

Good to know - the two most important maps to have are the Albedo and a grayscale Height Map. The others can often be derived or approximated.

Part 2 Summary

ChapterSkills covered
Ch. 4 - FundamentalsShader/Material/Texture, PBR workflow, available shaders
Ch. 5 - Lit ShaderBase properties, texture maps, advanced Material Types
Ch. 6 - SpecializedTessellation, 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.