importance sampling microfacet-based bsdfs using the ... · pdf fileintroduction...

82
Importance Sampling Microfacet-Based BSDFs using the Distribution of Visible Normals Eric Heitz 1 & Eugene d’Eon 2 1 INRIA ; CNRS ; Univ. Grenoble Alpes 2 The Jig Lab

Upload: dinhtuong

Post on 06-Mar-2018

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Importance Sampling Microfacet-Based BSDFsusing the Distribution of Visible Normals

Eric Heitz1 & Eugene d’Eon2

1INRIA ; CNRS ; Univ. Grenoble Alpes2The Jig Lab

Page 2: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

Dielectric material (e.g. water, plastic)

1

Page 3: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

Rough dielectric material

2

Page 4: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

Conductor material (e.g. metal)

3

Page 5: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

Rough conductor material

4

Page 6: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

Microfacet theory: statistical model of the rough interfaceand its interaction with light.

→ microfacet normals

5

Page 7: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

State of the art in microfacet theoryWalter et al., Microfacet Models for Refraction through RoughSurfaces, 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 |

n20 (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 doesthe light pathcontinue?

Choosea directionat random.

6

Page 8: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

Available in Mitsuba (Physically Based Renderer)

Mitsuba’s documentation

7

Page 9: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 10: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 11: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

What if we had perfect BSDF importancesampling?

Precomputed data(inverse CDF)

10

Page 12: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

What if we had perfect BSDF importancesampling?

Perfect importance samplingPrevious with precomputed data(512 spp) (512 spp)

B This is NOT what we propose to do.But this shows that there is clearly room for improvement. 11

Page 13: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

OK, so why not just use perfect BSDFimportance sampling?

Precomputed data(inverse CDF)

Precomputed data(inverse CDF)

Precomputed data(inverse CDF)

12

Page 14: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

Per-BSDF precomputed data?

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

only 1 BSDF in this scene

Ï Not affordable for complex scenes with a huge number ofdifferent BSDFs.

13

Page 15: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

Example: Textured AssetsÏ Parametric BRDF models (roughness parameters αx,αy)Ï Per-texel parametersÏ GigaBytes of textures

Varying isotropic GGX Roughness map (α)

∞ numberof BSDFs

in this scene

Courtesy of Christian Bense 14

Page 16: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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 numberof BSDFs

in this scene

Courtesy of WETA Digital 14

Page 17: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

We proposeA 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 Beckmannand 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 theprevious method)

15

Page 18: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Introduction

Our approachWe investigate the physical “meaning” of the BSDF model and useit 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 |

n20 (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 andintuitive.

16

Page 19: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

17

Page 20: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

How to sample outgoing directions?18

Page 21: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

Available information: the distribution of normals.18

Page 22: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

Use it to generate a random normal sample.18

Page 23: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

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

Page 24: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

Importance sampling is based on the distribution of normals.

19

Page 25: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

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

19

Page 26: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

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

19

Page 27: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

This difference is what makes importance sampling inefficient.

20

Page 28: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

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

20

Page 29: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

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

20

Page 30: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

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

20

Page 31: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

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

20

Page 32: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

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

20

Page 33: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

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

20

Page 34: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

Problem 1: sampling space wasting.

21

Page 35: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

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

22

Page 36: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

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

22

Page 37: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

The Problem with the Previous Method

Problem 2: high sampling weights.

firefly artifacts →23

Page 38: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: Main Idea

24

Page 39: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: Main Idea

Importance sampling with the

distribution of normals

distribution of visible normals.

25

Page 40: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: Main Idea

Our importance sampling method does exactlywhat is represented in this picture.

26

Page 41: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: Main Idea

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

27

Page 42: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: Main Idea

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

27

Page 43: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: Main Idea

Previous weights Our weightsmasking*shadowing*projected area shadowing

[0,∞[ [0,1]

28

Page 44: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 45: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: Main IdeaPrevious 256 spp (194.5s) Our 192 spp (198.9s)

A rough dielectric with isotropic GGX roughness (α= 0.05).

same rendering time30

Page 46: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: Main IdeaPrevious 32 spp (2.9s) Our 28 spp (2.8s)

A rough conductor with isotropic GGX roughness (α= 0.10).

same rendering time31

Page 47: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: Main IdeaPrevious 8192 spp (31.1min) Our 1024 spp (5.2m)

A rough conductor with isotropic GGX roughness (α= 0.15).

8× less samples per pixel6× less rendering time 32

Page 48: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: in Practice

33

Page 49: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

B Sampling this PDF is not simple!

34

Page 50: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: in Practice

microfacet normals ⇔ microsurface slope35

Page 51: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: in Practice

scaling the roughness ⇔ stretching the microsurface35

Page 52: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: in Practice

The distribution of visible normals is stretch-invariant.

36

Page 53: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: in Practice

If a sampling scheme is available forlet’s say αx = 1 and αy = 1...

...it can be used for any other αx and αy.

37

Page 54: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: in Practice

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

38

Page 55: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: in Practice

First, we stretch into a configuration where α= 1.38

Page 56: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: in Practice

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

Page 57: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: in Practice

Finally, we go back to the initial configuration.38

Page 58: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Our Method: in Practice

Implementing the sampling scheme for α= 1

39

Page 59: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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 PDFsdifficult /

40

Page 60: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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 PDFsdifficult /

Slope coordinatesωm ⇔ (xm,ym)

The PDF of xm depends on θi

The PDF of ym depends on xm

1D PDFssimple ,

40

Page 61: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 62: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 63: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 64: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 65: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Conclusion

42

Page 66: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 67: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 68: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

Questions?

44

Page 69: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

A Few Words on Microfacet Theory

45

Page 70: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 71: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 72: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature

SmithCook & Torrance V-cavitiesImplicitKelemenSchlick-Smith

47

Page 73: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature

SmithCook & Torrance V-cavitiesImplicitKelemenSchlick-Smith

“approxim

ate”

“unrea

listic”

“accurate”

47

Page 74: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature

SmithCook & Torrance V-cavitiesImplicitKelemenSchlick-Smith

“approxim

ate”

“unrea

listic”

“accurate”

Does it work?

∫Ω

G1(ωi,ωm)

cosθi⟨ωi,ωm⟩D(ωm,αx,αy)dωm

?= 1

47

Page 75: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

A Few Words on Microfacet Theory

What does it mean for a masking function

to be “correct” or “exact”?

48

Page 76: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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

Page 77: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

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 6= 1

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

50

Page 78: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature

Name Dωi is a PDF? “physically based”?SmithCook & Torrance V-cavitiesImplicitKelemenSchlick-Smith

51

Page 79: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature

Name Dωi is a PDF? “physically based”?Smith 3 3

Cook & Torrance V-cavitiesImplicitKelemenSchlick-Smith

51

Page 80: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature

Name Dωi is a PDF? “physically based”?Smith 3 3

Cook & Torrance V-cavities 3 3

ImplicitKelemenSchlick-Smith

51

Page 81: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature

Name Dωi is a PDF? “physically based”?Smith 3 3

Cook & Torrance V-cavities 3 3

Implicit 7 7

Kelemen 7 7

Schlick-Smith 7 7

51

Page 82: Importance Sampling Microfacet-Based BSDFs using the ... · PDF fileIntroduction Stateoftheartinmicrofacettheory Walter et al., Microfacet Models for Refraction through Rough Surfaces,EGSR2007

A Few Words on Microfacet Theory

Masking functions G1 in the CG literature

Name Dωi is a PDF? “physically based”?Smith 3 3

Cook & Torrance V-cavities 3 3

Implicit 7 7

Kelemen 7 7

Schlick-Smith 7 7

More details in “Understanding the Masking-Shadowing Function inMicrofacet-Based BRDFs”, Eric Heitz, JCGT 2014, to appear.

51