Normal Mapping for Precomputed Radiance Transfer PeterPike Sloan

  • Slides: 34
Download presentation
Normal Mapping for Precomputed Radiance Transfer Peter-Pike Sloan Microsoft

Normal Mapping for Precomputed Radiance Transfer Peter-Pike Sloan Microsoft

Inspiration • [Mc. Taggart 04] Half-Life 2 “Radiosity Normal Mapping”

Inspiration • [Mc. Taggart 04] Half-Life 2 “Radiosity Normal Mapping”

Related Work • [Willmott 99] Vector irradiance formulation of radiosity (for accelerating computation) •

Related Work • [Willmott 99] Vector irradiance formulation of radiosity (for accelerating computation) • [Tabellion 04] Lighting model similar to above (dominant light direction) • [Good 2005] “Spherical Harmonic Light Maps”

Goal • Develop lightweight techniques to decouple normal variation (ala HL 2) – From

Goal • Develop lightweight techniques to decouple normal variation (ala HL 2) – From parameterized models of lighting (PRT) – For rigid objects • Non goals – Modeling “local GI” of the bumps [Sig 05] – Masking effects – Glossy materials

PRT

PRT

PRT

PRT

PRT

PRT

Bi-Scale Radiance Transfer

Bi-Scale Radiance Transfer

Bi-Scale Radiance Transfer • l : vector = source radiance spherical function • Mp

Bi-Scale Radiance Transfer • l : vector = source radiance spherical function • Mp : 25 x 25 transfer matrix at point p (source → transferred incident) • q(xp) : ID map (2 D → 2 D, maps RTT patch over surface) • b(x, v) : RTT (4 D → 25 D, tabulated over small spatial patch) applies macro-scale transferred radiance to meso-scale RTT

Bi-Scale Radiance Transfer • l : vector = source radiance spherical function • Mp

Bi-Scale Radiance Transfer • l : vector = source radiance spherical function • Mp : 25 x 25 transfer matrix at point p (source → transferred incident) • q(xp) : ID map (2 D → 2 D, maps RTT patch over surface) • b(x, v) : RTT (4 D → 25 D, tabulated over small spatial patch) applies macro-scale transferred radiance to meso-scale RTT

Bi-Scale Radiance Transfer • l : vector = source radiance spherical function • Mp

Bi-Scale Radiance Transfer • l : vector = source radiance spherical function • Mp : 25 x 25 transfer matrix at point p (source → transferred incident) • q(xp) : ID map (2 D → 2 D, maps RTT patch over surface) • b(x, v) : RTT (4 D → 25 D, tabulated over small spatial patch) applies macro-scale transferred radiance to meso-scale RTT

Limitations • Expensive – Stores 64 “response vectors” that are 9 -36 D (x

Limitations • Expensive – Stores 64 “response vectors” that are 9 -36 D (x 3 for spectral) • Parallax mapping cheaper way of getting masking – Local radiance is too much data (9 – 36 x 3) for low res textures/per-vertex • Add constraints – Just model normal variation – Diffuse only

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Distant Lighting Environment

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Distant Lighting Environment

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Distant Radiance to Transferred Incident

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Distant Radiance to Transferred Incident Radiance In local frame

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Diagonal Convolution Matrix Clamped cosine

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Diagonal Convolution Matrix Clamped cosine kernel

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Irradiance Environment Map

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Irradiance Environment Map

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Irradiance Environment Map

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Irradiance Environment Map

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Evaluate SH basis with normal

Diffuse + Normal Maps • Quadratic SH [Ramamoorthi 2001] Evaluate SH basis with normal

Concerns • Lot of data at low res – 9 x. O 2 matrices

Concerns • Lot of data at low res – 9 x. O 2 matrices (x 3 with color bleeding) – Can compress using CPCA [Sig 03] • Too much data passed from low res to high res – Irradiance emap (27 numbers, 7 interpolators) • Alternatives – Project into analytic basis – Separable approximation

Analytic Basis Project into new basis (fewer rows)

Analytic Basis Project into new basis (fewer rows)

Shifted Associated Legendre Polynomials [Gautron 2005]

Shifted Associated Legendre Polynomials [Gautron 2005]

Half-Life 2 Basis

Half-Life 2 Basis

Comparison PRT Gold Standard HL 2 SAL

Comparison PRT Gold Standard HL 2 SAL

Comparison PRT Gold Standard HL 2 SAL

Comparison PRT Gold Standard HL 2 SAL

Normal Mapping for PRT • Use same ideas as BRDF factorization [Kautz and Mc.

Normal Mapping for PRT • Use same ideas as BRDF factorization [Kautz and Mc. Cool 1999] Bi-linear basis functions over hemisphere (4 non-zero) Matrix, rows “normal directions” columns quadratic SH light Aij equals evaluating convolved light basis function “j” in normal direction “i”

Normal Mapping for PRT

Normal Mapping for PRT

Normal Mapping for PRT • Compute SVD of A Nx 9 matrix (each column

Normal Mapping for PRT • Compute SVD of A Nx 9 matrix (each column is a “normal basis” texture) 9 x 9 diagonal matrix (singular values) 9 x 9 matrix

Normal Mapping for PRT • Old equation • New equation

Normal Mapping for PRT • Old equation • New equation

Normal Mapping for PRT • Use first M singular values • Mx. O 2

Normal Mapping for PRT • Use first M singular values • Mx. O 2 matrix • M channel “normal direction” texture

Pixel Shader Standard. SVDPS( VS_OUT In, out float 3 rgb : COLOR ) {

Pixel Shader Standard. SVDPS( VS_OUT In, out float 3 rgb : COLOR ) { float 2 Normal = tex 2 D(Normal. Sampler, In. Tex. Coord); float 2 v. Tex = Normal*0. 5 + float 2(0. 5, 0. 5); float 4 v. U = tex 2 D(USampler, v. Tex); rgb. r = dot(In. c. R, v. U); rgb. g = dot(In. c. G, v. U); rgb. b = dot(In. c. B, v. U); rgb *= tex 2 D(Albedo. Sampler, In. Tex. Coord); }

Comparison

Comparison

Demo

Demo

Conclusions • Lightweight form of normal mapping for PRT – Inspired by Half-Life 2

Conclusions • Lightweight form of normal mapping for PRT – Inspired by Half-Life 2 – For static objects, diffuse only • HL 2 basis and separable basis seem to be best • Experiment with CPCA more [Sig 03] • Integrate with other techniques – Parallax mapping for masking – Ambient Occlusion for local effects

Acknowledgments • Gary Mc. Taggart for HL 2 images • Shanon Drone for Models

Acknowledgments • Gary Mc. Taggart for HL 2 images • Shanon Drone for Models • Paul Debevec for Light Probes