Importance Sampling Microfacet-Based BSDFs using the Distribution of - - PowerPoint PPT Presentation

importance sampling microfacet based bsdfs using the
SMART_READER_LITE
LIVE PREVIEW

Importance Sampling Microfacet-Based BSDFs using the Distribution of - - PowerPoint PPT Presentation

Importance Sampling Microfacet-Based BSDFs using the Distribution of Visible Normals Eric Heitz 1 & Eugene dEon 2 1 INRIA ; CNRS ; Univ. Grenoble Alpes 2 The Jig Lab Introduction Dielectric material (e.g. water, plastic) 1 Introduction


slide-1
SLIDE 1

Importance Sampling Microfacet-Based BSDFs using the Distribution of Visible Normals

Eric Heitz1 & Eugene d’Eon2

1INRIA ; CNRS ; Univ. Grenoble Alpes 2The Jig Lab

slide-2
SLIDE 2

Introduction Dielectric material (e.g. water, plastic)

1

slide-3
SLIDE 3

Introduction Rough dielectric material

2

slide-4
SLIDE 4

Introduction Conductor material (e.g. metal)

3

slide-5
SLIDE 5

Introduction Rough conductor material

4

slide-6
SLIDE 6

Introduction Microfacet theory:

statistical model of the rough interface and its interaction with light.

microfacet normals

5

slide-7
SLIDE 7

Introduction State of the art in microfacet theory

Walter et al., Microfacet Models for Refraction through Rough Surfaces, EGSR 2007

Physical model → the equations.

BRDF

fr(ωi,ωo)= F(ωi,ωhr )G2(ωi,ωo,ωhr )D(ωhr )

4|ωi·ωg||ωo·ωg|

BTDF

ft(ωi,ωo)=

|ωi·ωht ||ωo·ωht | |ωi·ωg||ωo·ωg| n2

0 (1−F(ωi,ωht ))G2(ωi,ωo,ωht )D(ωht )

(ni(ωi·ωht )+no(ωo·ωht ))

2

Importance sampling → how to solve the equations.

Where does the light path continue? Choose a direction at random.

6

slide-8
SLIDE 8

Introduction Available in Mitsuba (Physically Based Renderer)

Mitsuba’s documentation

7

slide-9
SLIDE 9

Introduction Rendering with Mitsuba (path tracing+MIS)

32 spp 128 spp A dielectric glass plate (n = 1.5) with anisotropic Beckmann roughness (αx = 0.05, αy = 0.4).

8

slide-10
SLIDE 10

Introduction Rendering with Mitsuba (path tracing+MIS)

512 spp 4096 spp A dielectric glass plate (n = 1.5) with anisotropic Beckmann roughness (αx = 0.05, αy = 0.4).

9

slide-11
SLIDE 11

Introduction What if we had perfect BSDF importance sampling?

Precomputed data (inverse CDF)

10

slide-12
SLIDE 12

Introduction What if we had perfect BSDF importance sampling?

Perfect importance sampling Previous with precomputed data (512 spp) (512 spp)

This is NOT what we propose to do.

But this shows that there is clearly room for improvement.

11

slide-13
SLIDE 13

Introduction OK, so why not just use perfect BSDF importance sampling?

Precomputed data (inverse CDF) Precomputed data (inverse CDF) Precomputed data (inverse CDF)

12

slide-14
SLIDE 14

Introduction Per-BSDF precomputed data?

OK for “toy-scenes” with a low number of BSDFs.

  • nly 1 BSDF in this scene

Not affordable for complex scenes with a huge number of

different BSDFs.

13

slide-15
SLIDE 15

Introduction Example: Textured Assets

Parametric BRDF models (roughness parameters αx,αy) Per-texel parameters GigaBytes of textures

Varying isotropic GGX Roughness map (α)

∞ number

  • f BSDFs

in this scene Courtesy of Christian Bense

14

slide-16
SLIDE 16

Introduction Example: Textured Assets

Parametric BRDF models (roughness parameters αx,αy) Per-texel parameters GigaBytes of textures

Varying anisotropic Beckmann Roughness map (αx,αy)

∞2 number

  • f BSDFs

in this scene Courtesy of WETA Digital

14

slide-17
SLIDE 17

Introduction We propose

A better BSDF importance sampling scheme with lower variance, not perfect, but that can be used in production rendering.

Fulfilled requirements

Parametric BSDF models used in production (typically Beckmann

and GGX)

Varying anisotropic roughness parameters αx,αy No assumption on the kind of integrator (bidir, MLT, etc.) Plug & Play (trivial update of an existing implementation of the

previous method)

15

slide-18
SLIDE 18

Introduction Our approach

We investigate the physical “meaning” of the BSDF model and use it to our advantage.

fr(ωi,ωo) = F(ωi,ωhr)G2(ωi,ωo,ωhr)D(ωhr) 4|ωi ·ωg||ωo ·ωg| ft(ωi,ωo) = |ωi ·ωht||ωo ·ωht| |ωi ·ωg||ωo ·ωg| n2

0 (1−F(ωi,ωht))G2(ωi,ωo,ωht)D(ωht)

  • ni(ωi ·ωht)+no(ωo ·ωht)

2

Looks complicated. But the model behind the equations is actually very simple and intuitive.

16

slide-19
SLIDE 19

The Problem with the Previous Method

17

slide-20
SLIDE 20

The Problem with the Previous Method

How to sample outgoing directions?

18

slide-21
SLIDE 21

The Problem with the Previous Method

Available information: the distribution of normals.

18

slide-22
SLIDE 22

The Problem with the Previous Method

Use it to generate a random normal sample.

18

slide-23
SLIDE 23

The Problem with the Previous Method

Apply a transport operator on the normal (“reflect” or ”transmit”).

18

slide-24
SLIDE 24

The Problem with the Previous Method

Importance sampling is based on the distribution of normals.

19

slide-25
SLIDE 25

The Problem with the Previous Method

But in the physical model, the incident ray can only intersect normals that are visible.

19

slide-26
SLIDE 26

The Problem with the Previous Method

In the physical model, the transport operators are applied only on visible normals.

19

slide-27
SLIDE 27

The Problem with the Previous Method

This difference is what makes importance sampling inefficient.

20

slide-28
SLIDE 28

The Problem with the Previous Method

Samples are generated with the distribution of normals, but are weighted by the distribution of visible normals.

20

slide-29
SLIDE 29

The Problem with the Previous Method

Samples are generated with the distribution of normals, but are weighted by the distribution of visible normals.

20

slide-30
SLIDE 30

The Problem with the Previous Method

Samples are generated with the distribution of normals, but are weighted by the distribution of visible normals.

20

slide-31
SLIDE 31

The Problem with the Previous Method

Samples are generated with the distribution of normals, but are weighted by the distribution of visible normals.

20

slide-32
SLIDE 32

The Problem with the Previous Method

Samples are generated with the distribution of normals, but are weighted by the distribution of visible normals.

20

slide-33
SLIDE 33

The Problem with the Previous Method

Samples are generated with the distribution of normals, but are weighted by the distribution of visible normals.

20

slide-34
SLIDE 34

The Problem with the Previous Method Problem 1: sampling space wasting.

21

slide-35
SLIDE 35

The Problem with the Previous Method

Samples are generated with the distribution of normals, but are weighted by the distribution of visible normals.

22

slide-36
SLIDE 36

The Problem with the Previous Method

Samples are generated with the distribution of normals, but are weighted by the distribution of visible normals.

22

slide-37
SLIDE 37

The Problem with the Previous Method Problem 2: high sampling weights.

firefly artifacts →

23

slide-38
SLIDE 38

Our Method: Main Idea

24

slide-39
SLIDE 39

Our Method: Main Idea Importance sampling with the distribution of normals distribution of visible normals.

25

slide-40
SLIDE 40

Our Method: Main Idea

Our importance sampling method does exactly what is represented in this picture.

26

slide-41
SLIDE 41

Our Method: Main Idea

Only one component of the model is missing: most of the rays leave the surface...

27

slide-42
SLIDE 42

Our Method: Main Idea

...but other are occluded (microsurface shadowing).

27

slide-43
SLIDE 43

Our Method: Main Idea

Previous weights Our weights masking*shadowing*projected area shadowing

[0,∞[ [0,1] 28

slide-44
SLIDE 44

Our Method: Main Idea

Previous 512 spp (88.9s) Our 408 spp (87.1s) A dielectric glass plate (n = 1.5) with anisotropic Beckmann roughness (αx = 0.05, αy = 0.4). same rendering time

29

slide-45
SLIDE 45

Our Method: Main Idea

Previous 256 spp (194.5s) Our 192 spp (198.9s) A rough dielectric with isotropic GGX roughness (α = 0.05). same rendering time

30

slide-46
SLIDE 46

Our Method: Main Idea

Previous 32 spp (2.9s) Our 28 spp (2.8s) A rough conductor with isotropic GGX roughness (α = 0.10). same rendering time

31

slide-47
SLIDE 47

Our Method: Main Idea

Previous 8192 spp (31.1min) Our 1024 spp (5.2m) A rough conductor with isotropic GGX roughness (α = 0.15). 8× less samples per pixel 6× less rendering time

32

slide-48
SLIDE 48

Our Method: in Practice

33

slide-49
SLIDE 49

Our Method: in Practice The distribution of visible normals

Dωi(ωm) = G1(ωi,ωm) cosθi 〈ωi,ωm〉D(ωm,αx,αy)

D(ωm,αx,αy) distribution of normals (αx,αy) roughness parameters G1(ωi,ωm) masking function 〈ωi,ωm〉 cosine projection factor

Sampling this PDF is not simple! 34

slide-50
SLIDE 50

Our Method: in Practice

microfacet normals ⇔ microsurface slope

35

slide-51
SLIDE 51

Our Method: in Practice

scaling the roughness ⇔ stretching the microsurface

35

slide-52
SLIDE 52

Our Method: in Practice

The distribution of visible normals is stretch-invariant.

36

slide-53
SLIDE 53

Our Method: in Practice

If a sampling scheme is available for let’s say αx = 1 and αy = 1... ...it can be used for any other αx and αy.

37

slide-54
SLIDE 54

Our Method: in Practice

Example: we want to sample Dωi for α = 1

2.

38

slide-55
SLIDE 55

Our Method: in Practice

First, we stretch into a configuration where α = 1.

38

slide-56
SLIDE 56

Our Method: in Practice

Now, since α = 1 we know how to sample Dωi.

38

slide-57
SLIDE 57

Our Method: in Practice

Finally, we go back to the initial configuration.

38

slide-58
SLIDE 58

Our Method: in Practice

Implementing the sampling scheme for α = 1

39

slide-59
SLIDE 59

Our Method: in Practice

Spherical coordinates

ωm ⇔ (θm,φm)

The PDF of θm depends on θi and φm The PDF of φm depends on θi and θm 2D PDFs difficult

40

slide-60
SLIDE 60

Our Method: in Practice

Spherical coordinates

ωm ⇔ (θm,φm)

The PDF of θm depends on θi and φm The PDF of φm depends on θi and θm 2D PDFs difficult Slope coordinates

ωm ⇔ (x ˜

m,y ˜ m)

The PDF of x ˜

m depends on θi

The PDF of y ˜

m depends on x ˜ m

1D PDFs simple

40

slide-61
SLIDE 61

Our Method: in Practice

  • 1. Main idea: sample the distribution of visible normals.
  • 2. In practice: sampling Dωi(ωm,αx,αy) is not simple

2.1 Stretch invariance: solve only for αx = 1 and αy = 1. 2.2 Slope space: sample only two 1D PDFs.

Now it’s simple

  • 3. Implementation (C++ code in our supplemental material)

3.1 Beckmann and GGX distributions: analytic sampling. 3.2 Other distributions: generic sampling with precomputed data.

  • 4. Validation: passes χ2 test in Mitsuba.

41

slide-62
SLIDE 62

Our Method: in Practice

  • 1. Main idea: sample the distribution of visible normals.
  • 2. In practice: sampling Dωi(ωm,αx,αy) is not simple

2.1 Stretch invariance: solve only for αx = 1 and αy = 1. 2.2 Slope space: sample only two 1D PDFs.

Now it’s simple

  • 3. Implementation (C++ code in our supplemental material)

3.1 Beckmann and GGX distributions: analytic sampling. 3.2 Other distributions: generic sampling with precomputed data.

  • 4. Validation: passes χ2 test in Mitsuba.

41

slide-63
SLIDE 63

Our Method: in Practice

  • 1. Main idea: sample the distribution of visible normals.
  • 2. In practice: sampling Dωi(ωm,αx,αy) is not simple

2.1 Stretch invariance: solve only for αx = 1 and αy = 1. 2.2 Slope space: sample only two 1D PDFs.

Now it’s simple

  • 3. Implementation (C++ code in our supplemental material)

3.1 Beckmann and GGX distributions: analytic sampling. 3.2 Other distributions: generic sampling with precomputed data.

  • 4. Validation: passes χ2 test in Mitsuba.

41

slide-64
SLIDE 64

Our Method: in Practice

  • 1. Main idea: sample the distribution of visible normals.
  • 2. In practice: sampling Dωi(ωm,αx,αy) is not simple

2.1 Stretch invariance: solve only for αx = 1 and αy = 1. 2.2 Slope space: sample only two 1D PDFs.

Now it’s simple

  • 3. Implementation (C++ code in our supplemental material)

3.1 Beckmann and GGX distributions: analytic sampling. 3.2 Other distributions: generic sampling with precomputed data.

  • 4. Validation: passes χ2 test in Mitsuba.

41

slide-65
SLIDE 65

Conclusion

42

slide-66
SLIDE 66

Conclusion Contribution

Efficient BSDF Importance sampling Easy to implement Analytic for Beckmann and GGX distributions

Lessons Learned

Physical models have often a “meaning” Spend time working out the intuitions behind the math

43

slide-67
SLIDE 67

Conclusion Contribution

Efficient BSDF Importance sampling Easy to implement Analytic for Beckmann and GGX distributions

Lessons Learned

Physical models have often a “meaning” Spend time working out the intuitions behind the math

43

slide-68
SLIDE 68

Questions?

44

slide-69
SLIDE 69

A Few Words on Microfacet Theory

45

slide-70
SLIDE 70

A Few Words on Microfacet Theory

The distribution of visible normals

Dωi(ωm) = G1(ωi,ωm) cosθi 〈ωi,ωm〉D(ωm,αx,αy)

D(ωm,αx,αy) distribution of normals G1(ωi,ωm) masking function

Is it actualy a PDF? I.e.

G1(ωi,ωm) cosθi 〈ωi,ωm〉D(ωm,αx,αy)dωm

?

= 1 46

slide-71
SLIDE 71

A Few Words on Microfacet Theory

The distribution of visible normals

Dωi(ωm) = G1(ωi,ωm) cosθi 〈ωi,ωm〉D(ωm,αx,αy)

D(ωm,αx,αy) distribution of normals G1(ωi,ωm) masking function

Is it actualy a PDF? I.e.

G1(ωi,ωm) cosθi 〈ωi,ωm〉D(ωm,αx,αy)dωm

?

= 1 46

slide-72
SLIDE 72

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature Smith Cook & Torrance V-cavities Implicit Kelemen Schlick-Smith

47

slide-73
SLIDE 73

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature Smith Cook & Torrance V-cavities Implicit Kelemen Schlick-Smith “approximate” “unrealistic” “accurate”

47

slide-74
SLIDE 74

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature Smith Cook & Torrance V-cavities Implicit Kelemen Schlick-Smith “approximate” “unrealistic” “accurate” Does it work?

G1(ωi,ωm) cosθi 〈ωi,ωm〉D(ωm,αx,αy)dωm

?

= 1 47

slide-75
SLIDE 75

A Few Words on Microfacet Theory What does it mean for a masking function to be “correct” or “exact”?

48

slide-76
SLIDE 76

A Few Words on Microfacet Theory

The masking function is “correct” or “exact”.

The distribution of visible normals is a PDF, i.e.

G1(ωi,ωm) cosθi 〈ωi,ωm〉D(ωm,αx,αy)dωm = 1 49

slide-77
SLIDE 77

A Few Words on Microfacet Theory

The distribution of visible normals is NOT a PDF, i.e.

G1(ωi,ωm) cosθi 〈ωi,ωm〉D(ωm,αx,αy)dωm = 1 ⇔

The masking function is NOT “correct” or “exact” and should NOT be called “physically based”.

50

slide-78
SLIDE 78

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature Name

Dωi is a PDF?

“physically based”? Smith Cook & Torrance V-cavities Implicit Kelemen Schlick-Smith

51

slide-79
SLIDE 79

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature Name

Dωi is a PDF?

“physically based”? Smith ✓ ✓ Cook & Torrance V-cavities Implicit Kelemen Schlick-Smith

51

slide-80
SLIDE 80

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature Name

Dωi is a PDF?

“physically based”? Smith ✓ ✓ Cook & Torrance V-cavities ✓ ✓ Implicit Kelemen Schlick-Smith

51

slide-81
SLIDE 81

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature Name

Dωi is a PDF?

“physically based”? Smith ✓ ✓ Cook & Torrance V-cavities ✓ ✓ Implicit ✗ ✗ Kelemen ✗ ✗ Schlick-Smith ✗ ✗

51

slide-82
SLIDE 82

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature Name

Dωi is a PDF?

“physically based”? Smith ✓ ✓ Cook & Torrance V-cavities ✓ ✓ Implicit ✗ ✗ Kelemen ✗ ✗ Schlick-Smith ✗ ✗ More details in “Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs”, Eric Heitz, JCGT 2014, to appear.

51