moving frostbite to physically based rendering

91
Moving to PBR Sébastien Lagarde & Charles de Rousiers

Upload: dice

Post on 20-Aug-2015

145.925 views

Category:

Software


4 download

TRANSCRIPT

Page 1: Moving Frostbite to Physically Based Rendering

Moving to PBRSébastien Lagarde & Charles de Rousiers

Page 2: Moving Frostbite to Physically Based Rendering

Acknowledgments

• Contributions from *many* people

• This talk and the course notes are about:1. Summarizing all of the steps to move an engine to

PBR2. Using the state of the art in our base

implementation3. Small improvements in quality

Page 3: Moving Frostbite to Physically Based Rendering

Disclaimer

• This presentation is about: A high level overview Steps to move to PBR

• Courses notes come with full details and code …

Page 4: Moving Frostbite to Physically Based Rendering

What is the scope of PBR?

Page 5: Moving Frostbite to Physically Based Rendering

What is the scope of PBR?

Light

Page 6: Moving Frostbite to Physically Based Rendering

What is the scope of PBR?

Light

Environment

Page 7: Moving Frostbite to Physically Based Rendering

What is the scope of PBR?

Light Camera

Environment

Page 8: Moving Frostbite to Physically Based Rendering

What is the scope of PBR?

Light

Camera

Environment

1 Materials

2 Lighting

3 Camera

Page 9: Moving Frostbite to Physically Based Rendering

What is the scope of PBR?

CameraLight

Environment

1 Materials

2 Lighting

3 Camera

Page 10: Moving Frostbite to Physically Based Rendering

What is the scope of PBR?

Light

Environment

Camera

1 Materials

2 Lighting

3 Camera

Page 11: Moving Frostbite to Physically Based Rendering

Reference framework

• Need good reference Export to offline path-tracer In-engine reference

Page 12: Moving Frostbite to Physically Based Rendering

Materials

Page 13: Moving Frostbite to Physically Based Rendering

Material – Standard Model

• Standard material 80% of appearance types Model• Specular: Microfacet model with GGX NDF• Diffuse: Disney’s model

• Other material types Subsurface material Single layer coated material

Die

lectr

icC

on

du

cto

r

Page 14: Moving Frostbite to Physically Based Rendering

Material – Specular

4 (n.v)

F(v, h, f0)G(v, l, h )D(h, ɑ)

(n.l)Fs(v, l) =

Schlick GGX

Height-Correlated Smith[Heitz14]

Page 15: Moving Frostbite to Physically Based Rendering

Material – Specular

Standard (uncorrelated) Smith G Term

Die

lectr

icM

eta

l

Page 16: Moving Frostbite to Physically Based Rendering

Material – Specular

Height-correlated Smith G Term

Die

lectr

icM

eta

l

Page 17: Moving Frostbite to Physically Based Rendering

Material - Specular

Height-correlated Smith G Term

Correlated Standard

Page 18: Moving Frostbite to Physically Based Rendering

Material – Diffuse

• Disney Diffuse [Burley12] Coupled roughness between diffuse and specular Retro-reflection

Page 19: Moving Frostbite to Physically Based Rendering

Material – Diffuse

Lambertian Diffuse

RoughSmooth

Page 20: Moving Frostbite to Physically Based Rendering

Material – Diffuse

Disney Diffuse

RoughSmooth

Page 21: Moving Frostbite to Physically Based Rendering

Material - Diffuse

Disney’s Diffuse

Disney LambertDisney Lambert

Smooth Roughness

Page 22: Moving Frostbite to Physically Based Rendering

Material – Diffuse

Original Disney Diffuse Renormalized Disney Diffuse Diffuse + Specular

Page 23: Moving Frostbite to Physically Based Rendering

Material – Diffuse

Disney Diffuse

Page 24: Moving Frostbite to Physically Based Rendering

Material – Diffuse

Renormalized Disney Diffuse

Page 25: Moving Frostbite to Physically Based Rendering

Material – Parameterization

Normal

BaseColor

Smoothness

Metallic

Reflectance

Normal

BaseColor

Reflectance

Smoothness

Metallic

Page 26: Moving Frostbite to Physically Based Rendering

Material – Parameterization

(1 –Smoothness)

(1 –Smoothness)2

(1 –Smoothness)3

(1 –Smoothness)4

Burley12

Smoothness

Page 27: Moving Frostbite to Physically Based Rendering

Material – Parameterization

Fresnel0

Reflectance

0

255

ConductorsDielectrics

CommonMicro occlusion Gem stones

0

1

128

Page 28: Moving Frostbite to Physically Based Rendering

Material – Parameterization

Page 29: Moving Frostbite to Physically Based Rendering

LIGHTING

Page 30: Moving Frostbite to Physically Based Rendering

Lighting

Page 31: Moving Frostbite to Physically Based Rendering

Lighting

Page 32: Moving Frostbite to Physically Based Rendering

Lighting

Page 33: Moving Frostbite to Physically Based Rendering

Lighting

Page 34: Moving Frostbite to Physically Based Rendering

Lighting

• Lighting coherence All BRDFs must be integrated properly with all light

types All lights need to manage both direct and indirect

lighting All lighting is composed properly (SSR/local IBL/…) All lights have the correct ratio between each other

Page 35: Moving Frostbite to Physically Based Rendering

Lighting – Units & Frame of Reference

Light Power

Page 36: Moving Frostbite to Physically Based Rendering

Lighting – Units & Frame of Reference

Light Power

15 lm 1 200 lm 2 600 lm 64 000 lux

Page 37: Moving Frostbite to Physically Based Rendering

Lighting – Units & Frame of Reference

Luminous powerLumens Lux

Illuminance Luminous intensityCandela

LuminanceCandela/m2

Photometric Unit System

Page 38: Moving Frostbite to Physically Based Rendering

Lighting – Units & Frame of Reference

Luminous power (lm), Luminance (cd/m2), or EV

Area

Luminous power (lm)Punctual

Photometric

Emissive

Sun

Luminous intensity (cd)

Luminance (cd/m2) or EV

Illuminance (lux)

Page 39: Moving Frostbite to Physically Based Rendering

Lighting – Analytical Lights

• Parameterization

1,000 k 10,000 k

Page 40: Moving Frostbite to Physically Based Rendering

Lighting – Units & Frame of Reference

Page 41: Moving Frostbite to Physically Based Rendering

Lighting – Analytical Lights

Page 42: Moving Frostbite to Physically Based Rendering

Lighting – Analytical Lights

Point Sphere

LineTube

SpotDisk

FrustumRectangle

Punctual Area

Page 43: Moving Frostbite to Physically Based Rendering

Lighting – Analytical Lights

• Punctual lights Unit: Lum. power (lm) or Lum. intensity (cd) Use smooth attenuation [Karis13]

Inverse squareKaris13

Distance

Falloff

AttenuationRadius

Page 44: Moving Frostbite to Physically Based Rendering

Lighting – Analytical Lights

• Photometric lights Unit: luminous intensity (cd) Applied to point and spot lights

Simple / IsotropicProfile

IES photometricProfile

Artists

Measured

Page 45: Moving Frostbite to Physically Based Rendering

Lighting – Analytical Lights

• Area lights Unit: Luminous power (lm), Luminance (cd/m2 or

EV) Separate diffuse and specular evaluation

Page 46: Moving Frostbite to Physically Based Rendering

Lighting – Analytical Lights

• Area lights

Without horizon handling With horizon handling

Large area light Horizon handling

Page 47: Moving Frostbite to Physically Based Rendering

Lighting – Analytical Lights

• Diffuse area lights 3 integration techniques:• Analytic

Form factors (radiosity) / view factors (heat transfer)

• MRPSolid angles x Most Representative Point lighting [Drobot14]

• Structured sampling of light shapeSolid angles x average cos

Page 48: Moving Frostbite to Physically Based Rendering

Lighting – Analytical lights

• Area lights: Diffuse term

Sphere

Tube

Disk

Rectangle

View factor

Mix of sphere and rectangle

View factor

Structured sampling

Page 49: Moving Frostbite to Physically Based Rendering

Lighting – Analytical Lights

• Specular area lights No satisfying method Shortest distance to reflection

ray with energy conservation [Karis13]

Page 50: Moving Frostbite to Physically Based Rendering

Lighting – Analytical Lights

• Sun light Units: Illuminance (lux) Facing disk with non-null solid angle

Page 51: Moving Frostbite to Physically Based Rendering

Lighting – Analytical Lights

• Emissive surfaces Units: Luminance (cd/m2 or EV) ”Visible part” of a light Does not emit light

Page 52: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

• Types of IBLs Distant light probe Local light probes Screen-space reflections Planar reflections

Page 53: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

• Types of IBLs Distant light probe Local light probes Screen-space reflections Planar reflections

Focus

Page 54: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

• Units: Luminance (cd/m2 or EV) • Source for the distant light probe

HDRI Procedural sky

Page 55: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

• Light probe lighting: Integral[Env. lighting x BRDF]

• Pre-integration by separating:• Integral of Lighting x NDF, for V = N• Integral of BRDF, for all V & roughness values

Specular[Karis13]

& Diffuse

Page 56: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

• Light probe lighting: Integral[Env. lighting x BRDF]

• Pre-integration by separating:• Integral of Lighting x NDF, for V = N• Integral of BRDF, for all V & roughness values

Specular[Karis13]

& Diffuse

LDDFG

Page 57: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

• Light probe lighting: pre-integration

Isotropic approximation Reference

Error due to LD pre-integration with V = N

Page 58: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

• Light probe lighting: pre-integration LD needs to be computed each time the lighting changes Needs to be fast (real-time capture / refresh) Deals with HDR source

• Integration method for LD Importance sampling Multiple importance sampling Filtered importance sampling

Page 59: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

• Light probe lighting: pre-integration LD needs to be computed each time the lighting changes Needs to be fast (real-time capture / refresh) Deals with HDR source

• Integration method for LD Importance sampling Multiple importance sampling Filtered importance samplingFaster convergence

Page 60: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

• Light probe: pre-integration

Filtered importance sampling

Importance sampling

Page 61: Moving Frostbite to Physically Based Rendering

Lighting – Image-based lights

• Light probe: pre-integration

Pre-Filtered importance sampling

Importance samplingFiltered ISSimple IS

Page 62: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based LightsLight probe• Runtime evaluation

N

Page 63: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based LightsLight probe• Runtime evaluation

N

Page 64: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based LightsLight probe• Runtime evaluation

N

Page 65: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based LightsLight probe• Runtime evaluation

N

Page 66: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

Mirror Direction

Die

lectr

icM

eta

l

Page 67: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

Dominant Direction

Die

lectr

icM

eta

l

Page 68: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

Main Direction

DominantReferenceMirrorReference

Page 69: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

• Local light probes Acquire surrounding geometry Approximate local parallax: box & sphere proxy

[Lagarde12]

Page 70: Moving Frostbite to Physically Based Rendering
Page 71: Moving Frostbite to Physically Based Rendering
Page 72: Moving Frostbite to Physically Based Rendering
Page 73: Moving Frostbite to Physically Based Rendering

RGB

Dielectric

Conductor

Sky is handled by distant light probe

Page 74: Moving Frostbite to Physically Based Rendering

ConductorDielectric

Page 75: Moving Frostbite to Physically Based Rendering

Lighting – Image-Based Lights

• Distant & local light probes composition Lots of local light probes across level Local light probes can overlap each other Distant light probe contains sky information

RGB Alpha

Page 76: Moving Frostbite to Physically Based Rendering

Probe

Lighting – Image-Based Lights

• Distance-based roughness

Probe

Page 77: Moving Frostbite to Physically Based Rendering

Probe

Lighting – Image-Based Lights

• Distance-based roughness

Probe

Page 78: Moving Frostbite to Physically Based Rendering

Probe

Lighting – Image-Based Lights

• Distance-based roughness

Probe

Page 79: Moving Frostbite to Physically Based Rendering

Probe

Lighting – Image-Based Lights

• Distance-based roughness

Probe

Page 80: Moving Frostbite to Physically Based Rendering

Probe

Lighting – Image-Based Lights

• Distance-based roughness

Probe

Page 81: Moving Frostbite to Physically Based Rendering

CAMERA

Page 82: Moving Frostbite to Physically Based Rendering

Camera – Physically Based Camera

• Transforming scene luminance to pixel value

Page 83: Moving Frostbite to Physically Based Rendering

Camera – Settings

Sensor (Sensitivity)

Aperture

Lens

Shutter Speed f/1.41/125s

ISO 100

f/2.81/125s

ISO 100

f/5.61/125s

ISO 100

f-Stop 1/s

ISO

Page 84: Moving Frostbite to Physically Based Rendering

Camera – Exposure Scene luminance

Sensor illumiance

CCD ADC FilmStock

Sensor exposure

Quantized value

Pixel value

Normalizedvalue

lux

lux.scd/m2

Page 85: Moving Frostbite to Physically Based Rendering

Camera – Exposure

Incident Luminance

Cam

era

ran

ge 1

0 Camera range

Pix

el valu

e

1

0

1. Film stock / tone map 2. Style (LUT / grading)3. sRGB / Rec709

1

Exposure computationbased on HSBS sensitivity

Page 86: Moving Frostbite to Physically Based Rendering

Camera – Exposure

• Sunny 16 rule as validation Sky 20,000 lux Sun 100,000 lux

f/16 1/125s ISO 100

Page 87: Moving Frostbite to Physically Based Rendering

TRANSITION TO PBR

Page 88: Moving Frostbite to Physically Based Rendering

Transition – Steps

1. Standard material + viewer first + educating key artists

2. PBR / non-PBR in parallel, with automatic conversion

3. Evangelize PBR to game teams + validation tools

Fresnel0 Diffuse Albedo Illuminance

Page 89: Moving Frostbite to Physically Based Rendering

Acknowledgements

• EA Frostbite - Alex Fry, Christian Bense, Noah Klabunde, Henrik Fernlund, the rendering team

• EA DICE - Yasin Uludag, Arne Schober

• Lucasfilm: Lutz Latta, Cliff Ramshaw, Rodney Huff, Rogers Cordes

• Graphics community: Michał Drobot, Benjamin Rouveyrol, Eric Heitz, Juan Cañada, Ondra Karlík, Tomasz Stachowiak, Brian Karis

• Stephen Hill & Stephen McAuley

Page 90: Moving Frostbite to Physically Based Rendering

QUESTIONS?

Sébastien [email protected]: @seblagarde

Charles de [email protected]: @kiwaiii

Page 91: Moving Frostbite to Physically Based Rendering

References

• [Burley12] Brent Burley, “Physically Based Shading at Disney”, SIGGRAPH’12, PBR Course

• [Karis13] Brian Karis, “Real Shading in Unreal Engine 4”, SIGRRAPH’13, PBR Course

• [Drobot14] Michal Drobot, ”Physically Based Area Lights”, GPU Pro 5

• [Heitz14] Eric Heitz, ”Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs”, JCGT, 2014

• [Lagarde12] Sébastien Lagarde, “Local Image-based Lighting With Parallax-Corrected Cubemaps”, SIGGRAPH’12