Efficient Irradiance Normal Mapping

30
Efficient Irradiance Normal Mapping Ralf Habel, Michael Wimmer Institute of Computer Graphics and Algorithms Vienna University of Technology

description

Efficient Irradiance Normal Mapping. Ralf Habel, Michael Wimmer. Institute of Computer Graphics and Algorithms Vienna University of Technology. Motivation. Combining Light Mapping and Normal Mapping Also know as: Radiosity Normal Mapping Directional Light Mapping - PowerPoint PPT Presentation

Transcript of Efficient Irradiance Normal Mapping

Page 1: Efficient Irradiance Normal Mapping

Efficient Irradiance Normal Mapping

Ralf Habel, Michael Wimmer

Institute of Computer Graphics and Algorithms

Vienna University of Technology

Page 2: Efficient Irradiance Normal Mapping

Ralf Habel 2

Motivation

Combining Light Mapping and Normal MappingAlso know as:

Radiosity Normal Mapping

Directional Light Mapping

Spherical Harmonics Light Mapping

Popular in GamesHalf-Life 2, Halo 3 …

Cheap and good looking:Normal maps can be reused

Per vertex/per texel light map pipeline

Fast and trivial evaluation

Page 3: Efficient Irradiance Normal Mapping

Ralf Habel 3

Motivation

Light mapped

Page 4: Efficient Irradiance Normal Mapping

Ralf Habel 4

Motivation

Irradiance normal mapped

Page 5: Efficient Irradiance Normal Mapping

Ralf Habel 5

Motivation

Irradiance normal mapped no albedo

Page 6: Efficient Irradiance Normal Mapping

Ralf Habel 6

Introduction

Goal: Represent irradiance on all surfaces for all possible directions (S x Ω)

Allows illumination to be stored sparsely similar to light mapping

Local variation is transported by normal maps

Representation:

Environment maps (piecewise linear)

Basis function sets (Spherical Harmonics)

Evaluation: Look up/calculate irradiance value in normal direction

Page 7: Efficient Irradiance Normal Mapping

Ralf Habel 7

Irradiance Environment Maps

Ramamoorthi et al. 2001: Spherical Harmonics up to the quadratic band (RGB: 27 coefficients) is enough for an accurate representation (avg. error < 3%).

9 RGB textures containing SH coefficients

Irradiance over all directions is a low frequency signal

Can we do better?Only hemispherical signal (Ω+) needed on opaque surfaces

Other basis functions than Spherical Harmonics?

Page 8: Efficient Irradiance Normal Mapping

Ralf Habel 8

Hemispherical bases

Set of functions defined over the hemisphere (Ω+)

Desired attributes for irradiance:No discontinuities for smooth interpolation

Orthonormality: simplifies projections and other calculations (just like in Euclidian space)

Band structure for LOD/increasing accuracy (like Spherical Harmonics)

Not important:Locality

High-frequency behavior

Page 9: Efficient Irradiance Normal Mapping

Ralf Habel 9

Half-Life 2 Basis

Consists of 3 orthonormal cosine lobes (linear SRBFs)

Orthonormal over Ω+

Equivalent toDirectional occlusion (one general cosine lobe)

Linear Spherical Harmonics band normed on Ω+

All require 3 coefficients and arelinear

No quadratic terms

Page 10: Efficient Irradiance Normal Mapping

Ralf Habel 10

Hemispherical bases

General orthonormal hemispherical bases:Hemispherical Harmonics [Gautron et al. 04]

Makhotkin Basis [Makhotkin 96] All basis functions are 0 or constant on border

of Ω+ due to generation through shifting Non-polynomial

Zernike Basis [Koenderink 96] Different band structure:

1,2,3..instead of 1,3,5.. Non-polynomial

Page 11: Efficient Irradiance Normal Mapping

Ralf Habel 11

Creating Directional Irradiance

We need irradiance on all surface points in all Ω+ directions:

Convolution with diffuse kernel far too expensive in Cartesian coordinates

Tens of millions of convolutions

Instead: Spherical Harmonics as an intermediate basis [Ramamoorthi 01, Basri and Jacobs 00]

Page 12: Efficient Irradiance Normal Mapping

Ralf Habel 12

Creating Directional Irradiance

Create radiance estimate in precomputationFrom photon mapping, path tracing, shadow mapping…

In tangent space (for tangent space normal maps)

Expand radiance into Spherical Harmonics by integrating against SH basis functions:

Page 13: Efficient Irradiance Normal Mapping

Ralf Habel 13

Creating Directional Irradiance

Perform diffuse convolution directly in SH to getUsing Funk-Hecke Theorem, diffuse convolution is carried out by scaling SH coefficients in each band l with al :

a0 = 1, a1 = 2/3, a2 = ¼, a3 = 0, a4 = -1/24

There is never a cubic contribution in an SH irradiance signal

All l >=4 are very small This is why SH up to the quadratic band is so

efficient for irradiance!

Page 14: Efficient Irradiance Normal Mapping

Ralf Habel 14

H-Basis

We would like something similar to SH on Ω+

Polynomial As fast as SH to evaluate

Same interpolation behavior

Orthonormal on Ω+

Targeted for irradiance representation

Take a close look at SH functions and polynomial Hilbert space to derive basis functions

Page 15: Efficient Irradiance Normal Mapping

Ralf Habel 15

H-Basis

SH functions that are symmetric to the z-axis are orthogonal on the hemisphere as well:

Y00,Y1

-1,Y11,Y2

-2,Y22

Renormed to Ω+

Page 16: Efficient Irradiance Normal Mapping

Ralf Habel 16

H-Basis

SH functions that are symmetric to the z-axis are orthogonal on the hemisphere as well:

Y00,Y1

-1,Y11,Y2

-2,Y22

Renormed to Ω+

Page 17: Efficient Irradiance Normal Mapping

Ralf Habel 17

H-Basis

Apply shifting to Y10 (cos θ = 2 cos θ -1)

Similar to Hemispherical Harmonics/ Makhotkin basis

Page 18: Efficient Irradiance Normal Mapping

Ralf Habel 18

H-Basis

Results in Ω+ orthonormal polynomial basis with 1 constant, 3 linear and 2 quadratic basis functions

There is a mathematical rigorous derivation!

Page 19: Efficient Irradiance Normal Mapping

Ralf Habel 19

H-Basis

Band structure allows to use only the constant+linear functions (H4) or all six (H6) similar to SH

Page 20: Efficient Irradiance Normal Mapping

Ralf Habel 20

SH to H-Basis

Directional irradiance signals are calculated in SH

Project SH coefficient vector into H-Basis with matrix multiplication:

Sparse due to closeness to SH

Both bases are polynomialNo loss due to change in used function space

Page 21: Efficient Irradiance Normal Mapping

Ralf Habel 21

Bases Comparison

Visual/perceptual comparison of all basesReplace H-Basis with any other

In “very bad case” lighting situation All basis functions are contributing

SH comparison is least-square hemispherically projected [Sloan 03]

Makes optimal use of SH on Ω+

Shown with increasing number of coefficientsOnly few are shown

See paper for all of them

Page 22: Efficient Irradiance Normal Mapping

Ralf Habel 22

Bases Comparison: 3 Coefficients

Ground truth

Half-Life 2 (not how the game evaluates)

Zernike 2 bands

Page 23: Efficient Irradiance Normal Mapping

Ralf Habel 23

Bases Comparison: 4 Coefficients

Ground truth

H4

SH 2 bands (Ω+ projected)Makhotkin 2 bands(Artefacts at border)

Page 24: Efficient Irradiance Normal Mapping

Ralf Habel 24

Bases Comparison: 6/9 Coefficients

Ground truth

H6

(6 coefficients)SH 3 bands(9 coefficients)

Page 25: Efficient Irradiance Normal Mapping

Ralf Habel 25

Bases Comparison

Integrated Mean Square Error

averaged over 10 000 random irradiance signals

6 coefficients is enough for a numerically accurate representation

What about difference between H4 and H6?

Page 26: Efficient Irradiance Normal Mapping

Ralf Habel 26

H-Basis Comparison

H4 - 4 coefficients

Page 27: Efficient Irradiance Normal Mapping

Ralf Habel 27

H-Basis Comparison

H6 - 6 coefficients

Page 28: Efficient Irradiance Normal Mapping

Ralf Habel 28

Conclusion

H-Basis is very efficient and very simple solution for hemispherical irradiance signals

4 coeffs. for perceptually accurate representationProbably sufficient for almost all practical cases

6 coeffs. for numerically accurate representationSome lighting situations may benefit from 6 coeffs.

Orthonormality :Shader LOD (functions are delocalized)

Easy expansion of other low frequency signals

Page 29: Efficient Irradiance Normal Mapping

Ralf Habel 29

Future Work

There is a general mathematical description and derivation similar to Spherical Harmonics

H-Basis is a special caseEfficient generating procedures

Clarify correlations to SH

Other hemispherical signalsVisibility?

BRDFs?

Page 30: Efficient Irradiance Normal Mapping

Ralf Habel 30

Thanks foryour attention