Nonlinear Prefiltering for Surface Shading Presenter: Chun-Po - - PowerPoint PPT Presentation

nonlinear prefiltering for surface shading
SMART_READER_LITE
LIVE PREVIEW

Nonlinear Prefiltering for Surface Shading Presenter: Chun-Po - - PowerPoint PPT Presentation

Nonlinear Prefiltering for Surface Shading Presenter: Chun-Po Wang, Pramook Khungurn MOTIVATION Motivation Real world objects have surface details . Representing Surface Details Detailed meshes Henrik van Jensen. Digital Face


slide-1
SLIDE 1

Nonlinear Prefiltering for Surface Shading

Presenter: Chun-Po Wang, Pramook Khungurn

slide-2
SLIDE 2

MOTIVATION

slide-3
SLIDE 3

Motivation

  • Real world objects have surface details.
slide-4
SLIDE 4

Representing Surface Details

  • Detailed meshes

Henrik van Jensen. “Digital Face Cloning.” SIGGRAPH 2003 Sketch

slide-5
SLIDE 5

Representing Surface Details

  • Volume data

Samuli Laine, Tero Karras. “Efficient Sparse Voxel Octree.” I3D, 2010

slide-6
SLIDE 6

Representing Surface Details

  • The traditional approach

– Coarse meshes – Texture maps

  • Why not the last two approaches?

– Huge memory requirement – Not available 10 years ago

slide-7
SLIDE 7

Coarse Meshes + Texture Maps

http://radoff.com/blog/2008/08/22/anatomy-of-an-mmorpg/

slide-8
SLIDE 8

Types of Texture Maps

  • Color maps
  • Normal maps
  • Horizon maps
  • Shadow maps
slide-9
SLIDE 9

Color Maps

http://www.siggraph.org/education/materials/HyperGraph/mapping/r_wolfe/

slide-10
SLIDE 10

Normal Maps

+

=

slide-11
SLIDE 11

Horizon Maps

  • Used to deal with self occlusion.
  • Each texel stores a function Θ(𝜚).
  • Θ(𝜚) = elevation angle beyond which the

vision is not occluded by the object itself

slide-12
SLIDE 12

Horizon Maps

Nelson L. Max. “Horizon mapping: shadows for bump-mapped surfaces.” The Visual Computer, 1988

slide-13
SLIDE 13

Shadow Maps

  • Texels store the distance to the visible surface

from light source.

Foley et al. “Computer Graphics Principles and Practice”

slide-14
SLIDE 14

ALIASING

slide-15
SLIDE 15

Problem: Aliasing

  • Occur when a pixel covers many fine details.
  • So much info in a pixel, but display just a little.
slide-16
SLIDE 16

Problem: Aliasing

http://forums.create.msdn.com/forums/p/63434/388892.aspx

slide-17
SLIDE 17

Problem: Aliasing

Ma et al. “Level-of-Detail Representation of Bidirection Texture Functions for Real-Time Rendering.” I3D, 2005

slide-18
SLIDE 18

Removing Aliasing

  • Two solutions

– Supersampling – Prefiltering

  • Supersampling

– Throw in more samples in a pixel. – More samples = more info covered. – Always works. – But SLOW…

slide-19
SLIDE 19

Prefiltering

  • Come up with low-detail versions of the map.

– “Filter” the map.

  • Use the right low-detail version

according to how many texels are covered.

slide-20
SLIDE 20

Prefiltering Example: Color Map

  • MIP-mapping

– Decimate the original color map by factor of 2. – Do so until getting a 1x1 image. – Use smaller image when pixel cover more texels.

http://www.gamedev.net/page/resources/_/technical/directx-and-xna/mip-mapping-in-direct3d-r1233

slide-21
SLIDE 21

Prefiltering Example: MIP-map

slide-22
SLIDE 22

PREFILTERING FRAMEWORK

slide-23
SLIDE 23

Prefiltering Framework

  • Setting

∆𝜕

slide-24
SLIDE 24

Prefiltering Framework

  • Measurement Equation

𝐽 = 𝑥 𝜕 𝑀 𝑝, 𝜕 𝑒𝜏(𝜕)

∆𝜕

– 𝐽 = pixel color – Weight function 𝑥(𝜕)

  • Assign weight to each direction in the pixel.
  • Integrates to 1 over the pixel.

𝑥 𝜕 𝑒𝜏 𝜕

∆𝜕

= 1

slide-25
SLIDE 25

Prefiltering Framework

  • Transform to integral over surface
slide-26
SLIDE 26

Prefiltering Framework

  • Transform to integral over surface

– Weight function 𝑥 (𝑦) over points. – Expression for color: 𝐽 = 𝑥 𝑦 𝑀 𝑦, 𝑤 𝑒𝐵(𝑦)

𝐵

– Weight function integrates to 1 over the pixel: 𝑥 𝑦 𝑒𝐵(𝑦)

𝐵

= 1

slide-27
SLIDE 27

Bidirectional Texture Function

  • 𝜐𝐵(𝑚, 𝑤) function

– 𝑚 = direction where light come from – 𝑤 = view direction – 𝐵 = pixel footprint

“fraction of light from 𝑚 that gets reflected to 𝑤 from pixel footprint 𝐵”

slide-28
SLIDE 28

Bidirectional Texture Function

  • Usage:

𝐽 = 𝜐𝐵 𝑤, 𝑚

Ω

𝐹 𝑚 𝑒𝜏(𝑚)

𝐹 𝑚 = environment light from direction 𝑚

slide-29
SLIDE 29

PREFILTERING APPROACHES

slide-30
SLIDE 30

Brute Force

  • Precompute 𝜐𝐵(𝑚, 𝑤)

– Different footprint sizes 𝐵 – Different light direction 𝑚, and view direction 𝑤. – Around every point on the surface.

  • Huge space requirement.
  • Lots of literature on this topic.

– Most on compression

slide-31
SLIDE 31

Independent Prefiltering

  • BTF approach assumes everything is coupled.
  • We can prefilter each map independently.

– Color map – Normal map (BRDF map)

  • That is, we assume

𝜐𝐵 𝑚, 𝑤 ≈ 𝑙𝐵 × 𝜍𝐵(𝑚, 𝑤)

– 𝑙𝐵 is the prefiltered color over 𝐵 – 𝜍𝐵(𝑚, 𝑤) is the prefiltered BRDF over 𝐵

slide-32
SLIDE 32

Independent Prefiltering

𝑙𝐵 = 𝑥 𝑦 𝑙𝑦𝑒𝐵(𝑦)

𝐵

𝜍𝐵 𝑚, 𝑤 = 𝑥 𝑦 𝜍𝑦(𝑤, 𝑚) 𝑜𝑦𝑚 𝑒𝐵(𝑦)

𝐵

where 𝑜𝑦𝑚 = max (0, 𝑜𝑦 ∙ 𝑚)

slide-33
SLIDE 33

Linear Prefiltering

  • Filtering color map is “linear.”
  • Color in low-detail maps

= weighted average of color in high-detail map

1/4 1/4 1/4 1/4

slide-34
SLIDE 34

NORMAL MAP PREFILTERING

slide-35
SLIDE 35
  • The BRDF is determined by the normal.

– Lambertian: 𝜍𝑦 𝑚, 𝑤 = max 0, 𝑜𝑦 ∙ 𝑚 = 𝑜𝑦𝑚 – Blinn-Phong: 𝜍𝑦 𝑚, 𝑤 =

𝑜𝑦ℎ 𝛽 𝑜𝑦𝑚 where h = 𝑚+𝑤 𝑚+𝑤

  • In general, BRDF is a nonlinear function of 𝑜𝑦

BRDF

slide-36
SLIDE 36

BRDF Filtering: Filter the Normal Map

Want: Can we filter the normal instead? BRDF is a nonlinear function of normal

slide-37
SLIDE 37

Correct Image Linear Filtering

BRDF Map Filtering is NOT Linear

slide-38
SLIDE 38

The normals at two points

  • n the surface

Combined “normal distribution” Averaged normal

slide-39
SLIDE 39

Normal Distribution Funtion

Does not depend on the surface property Normal Distribution Function (NDF) h: half vector of l and v Canceled in the equation Let’s make assumptions on BRDF:

slide-40
SLIDE 40

Normal Map Filtering

Want: Where Want to find a parameterization of fx so it’s linear

slide-41
SLIDE 41

R1 R3 R2 R4 G1 G3 G2 G4 B1 B3 B2 B4 α1 α3 α2 α4 β1 β3 β2 β4 ϒ1 ϒ3 ϒ2 ϒ4 αA βA ϒA … RA GA BA MIP-map filtering Normal distribution parameters map Color map

slide-42
SLIDE 42

Direct Method: 3D Gaussian

  • [Olano and North, 1997]

h μ μ fA(h) A A

slide-43
SLIDE 43

Direct Method: 3D Gaussian

9 linear parameters First moment M1 Second moment M2 M1a, M2a wa wb

+

M1b, M2b

=

M1= waM1a +wbM1b M2= waM2a +wbM2b

slide-44
SLIDE 44

Convolution Method

Underlying BRDF Surface normal distribution (NDF)

slide-45
SLIDE 45

Convolution Method: Spherical Harmonics

  • [Han et al., 2007] (Sec. 6)

Spherical Harmonics Coefficients

  • Multiplication instead of convolution
  • plm can be linearly filtered (e.g., MIP-map)

Underlying BRDF Surface NDF Images: http://www.maths.nottingham.ac.uk/personal/pcm/sphere/sphere.html

slide-46
SLIDE 46

[Han et al., 2007]

slide-47
SLIDE 47

Limitations

  • Is the problem solved?

– Answer: No – Maps are assumed to be uncorrelated – Parallax effect

Correlated normal and color Color filtered separately Ground truth

slide-48
SLIDE 48

Conclusion

  • Correctly filtered surface maps are visually

important

– Normal, horizon, and shadow maps are non-linear

  • Still far from solving the problem
slide-49
SLIDE 49

Thank you