Computer Graphics - Distribution Ray Tracing - Philipp Slusallek - - PowerPoint PPT Presentation

β–Ά
computer graphics
SMART_READER_LITE
LIVE PREVIEW

Computer Graphics - Distribution Ray Tracing - Philipp Slusallek - - PowerPoint PPT Presentation

Computer Graphics - Distribution Ray Tracing - Philipp Slusallek Overview Other Optical Effects Not yet included in Whitted-style ray tracing Stochastic Sampling Distribution Ray-Tracing Problems Anti-aliasing Depth of


slide-1
SLIDE 1

Philipp Slusallek

Computer Graphics

  • Distribution Ray Tracing -
slide-2
SLIDE 2

Overview

  • Other Optical Effects

– Not yet included in Whitted-style ray tracing

  • Stochastic Sampling
  • Distribution Ray-Tracing
slide-3
SLIDE 3

Problems

  • Anti-aliasing
  • Depth of field
  • Motion blur
  • BRDF
  • Area Lights
slide-4
SLIDE 4

Anti-aliasing

  • Anti-aliasing
  • Depth of field
  • Motion blur
  • BRDF
  • Area Lights

𝐽 β‰ˆ ΰΆ±

A

𝑀 𝑝 + 𝑒𝑒 𝑒𝐡

slide-5
SLIDE 5

Depth of field

  • Anti-aliasing
  • Depth of field
  • Motion blur
  • BRDF
  • Area Lights

𝐽 β‰ˆ ΰΆ±

A

𝑀 𝑝 + 𝑒𝑒 𝑒𝐡

slide-6
SLIDE 6

Motion blur

  • Anti-aliasing
  • Depth of field
  • Motion blur
  • BRDF
  • Area Lights

𝑀 β‰ˆ ΰΆ±

[𝑒𝑝,𝑒1]

π‘€π‘ˆ 𝑝 + 𝑒𝑒 π‘’π‘ˆ

slide-7
SLIDE 7

BRDF

  • Anti-aliasing
  • Depth of field
  • Motion blur
  • BRDF
  • Area Lights

𝑀𝑝 = 𝑀𝑓 + ΰΆ±

Ξ©+

𝑔

𝑠𝑀𝑗 cos πœ„π‘— π‘’πœ•π‘—

πœ•π‘ πœ•π‘— πœ„π‘—

slide-8
SLIDE 8

Area Lights

  • Anti-aliasing
  • Depth of field
  • Motion blur
  • BRDF
  • Area Lights

𝐹𝑗 = ΰΆ±

𝐡

π‘Š 𝑦, 𝑧 cosπœ„π΅ 𝑦 βˆ’ 𝑧 2 𝑒𝐡 𝑦 𝑧

slide-9
SLIDE 9

Integration by MC-Sampling

  • Anti-aliasing
  • Depth of field
  • Motion blur
  • BRDF
  • Area Lights

βž” Monte-Carlo Integration

𝑆 = ΰΆ±

𝐸

𝑔 𝑦 𝑒𝑦 𝑆 β‰ˆ 𝐸 π‘œ ෍

𝑗=1 π‘œ

𝑔 𝑦𝑗 𝑦𝑗 = uniform 𝐸

slide-10
SLIDE 10

STOCHASTIC SAMPLING

(VERY SHORT INTRO)

slide-11
SLIDE 11

Random Number

  • Random Number

– Uniformly distributed – ΞΎ in [0, 1)

  • Pseudo-Random Number

– Linear congruential – Mersenne-Twister – … – Speed / evenness trade-off

slide-12
SLIDE 12

Parallelogram Sampling

  • Parametric Form

– π‘ž 𝑣, 𝑀 = π‘ž0 + 𝑣 π‘ž1 βˆ’ π‘ž0 + 𝑀 π‘ž2 βˆ’ π‘ž0 = 1 βˆ’ 𝑣 βˆ’ 𝑀 π‘ž0 + π‘£π‘ž1 + 𝑀 π‘ž2

  • Random Sampling

– π‘ž 𝜊1, 𝜊2

p2 p1 p0 u v p

slide-13
SLIDE 13

Triangle Sampling

  • Parametric Form

– π‘ž 𝑣, 𝑀 = 1 βˆ’ 𝑣 βˆ’ 𝑀 π‘ž0 + π‘£π‘ž1 + 𝑀 π‘ž2

  • Random Sampling

– if 𝜊1 + 𝜊2 < 1 : π‘ž 𝜊1, 𝜊2 – if 𝜊1 + 𝜊2 > 1 : π‘ž 1 βˆ’ 𝜊1, 1 βˆ’ 𝜊2

p2 p1 p0 u v p

slide-14
SLIDE 14

Disc Sampling

  • Parametric Form

– p(u, v) = Polar2Cartesian(R v, 2 Ο€ u) // disc radius R

  • NaΓ―ve Sampling (wrong!)

– π‘ž 𝜊1, 𝜊2

slide-15
SLIDE 15

Disc Sampling

  • Parametric Form

– p(u, v) = Polar2Cartesian(R v, 2 Ο€ u) // disc radius R

  • Random Sampling

– π‘ž 𝜊1, 𝜊2 – Results in uniform sampling

  • For other cases,

see Phil Dutre’s Global Illumination Compendium at

http://people.cs.kuleuven.be/~philip.dutre/GI/TotalCompendium.pdf

slide-16
SLIDE 16

DISTRIBUTION RAY-TRACING

slide-17
SLIDE 17

Distribution Ray Tracing

  • Apply random sampling for many aspects in RT

– Pixel

  • Anti-aliasing

– Lens

  • Depth of field

– Time

  • Motion blur

– BRDF

  • Glossy reflections & refractions

– Area Lights

  • Soft shadows

– Base on paper:

  • R. Cook et al.,

Distributed Ray Tracing, Siggraph’84

slide-18
SLIDE 18

Anti-Aliasing

  • Artifacts

– Jagged edges – Aliased patterns

slide-19
SLIDE 19

Anti-Aliasing

  • Approach

– Average samples over pixel area – Akin to sensor cells of measuring device collecting photons

  • Random offset of pixel raster coords from center

– prc[coord] = pid[coord] + 0.5 + (ΞΎ – 0.5)

slide-20
SLIDE 20

Anti-Aliasing

  • Basic Method

– Plain average – Box filter f(x, y) = 1 – 𝑀 =

σ𝑗=1

π‘œ

𝑀(πœŠπ‘—1,πœŠπ‘—2) π‘œ

  • Filtering

– Weighted average – Filter f(x, y) – 𝑀 =

σ𝑗=1

π‘œ

𝑔(πœŠπ‘—1,πœŠπ‘—2)𝑀(πœŠπ‘—1,πœŠπ‘—2) σ𝑗=1

π‘œ

𝑔(πœŠπ‘—1,πœŠπ‘—2)

slide-21
SLIDE 21

Depth of Field

  • Real Camera

– Complex lenses that focus one distance onto the image

  • Finite aperture size

– Blurred features except for focal plane

slide-22
SLIDE 22

Depth of Field

  • Thin Lens

– Focus light rays from point on object onto image plane

  • Sharp features at focal plane
  • Blurred features before/beyond focal plane

– Depth of field: depth range with acceptably small circle of confusion

  • Smaller than one pixel
slide-23
SLIDE 23

Depth of Field

  • Compute ray through lens center

– Compute focus point Pf on focal plane, determined by Pb and Pc

  • Compute new ray origin

– Sample coordinates (x, y) of aperture diameter (= f / N) – Compute Pl: ray.origin += Pc + x * camera.right + y * camera.up – Might include modeling the shape of the aperture

  • Compute new ray direction

– Compute ray.direction = Pf - Pl β†’ vector from Pl to Pf – Normalize

Lens Image plane Focal plane

Pb Pl Pf Pc

slide-24
SLIDE 24

Depth of Field

Cook et al. Siggraphβ€˜84

slide-25
SLIDE 25

Depth of Field

  • Zero Aperture
slide-26
SLIDE 26

Depth of Field

  • Small Aperture
slide-27
SLIDE 27

Depth of Field

  • Large Aperture
slide-28
SLIDE 28

Depth of Field

  • Very Large Aperture
slide-29
SLIDE 29

Motion Blur

  • Real Camera

– Finite exposure time – Shutter opening at t0 – Shutter closing at t1

  • bject 𝑒

𝑒0 𝑒1 𝑒0 + 𝑒1 βˆ’ 𝑒0 𝜊

slide-30
SLIDE 30

Motion Blur

  • Real Camera

– Finite exposure time – Shutter opening at t0 – Shutter closing at t1

  • Approach

– Sample time t in [t0, t1): t = t0 + ΞΎ (t1 - t0) – Assign time t to new camera ray/path – Models with moving camera and/or moving objects in the scene

  • Time-dependent transformations
  • Transform objects or inverse-transform ray to proper positions at t

– Assume instantaneous opening and closing

  • Can be generalized by modeling shape of aperture over time
  • Gotchas

– Acceleration structures built over dynamic objects

slide-31
SLIDE 31

Motion Blur

Cook et al. Siggraphβ€˜84

slide-32
SLIDE 32

Reflections/Refractions

  • Dielectric Materials

– πœƒπ‘— – refractive index

𝑑 𝑀

– Light: fastest path – Snell’s law: – if

sin πœ„1 sin πœ„2 = πœƒ2 πœƒ1 sin πœ„2 = πœƒ1 πœƒ2 sin πœ„1 > 1 ... then total inner reflection

slide-33
SLIDE 33

Reflections/Refractions

  • Which ray to trace?

– Both: may be exponential

slide-34
SLIDE 34

Reflections/Refractions

  • Which ray to trace?

– Pick one at random:

  • 𝜊 < 0.5 – reflection
  • 𝜊 β‰₯ 0.5 – refraction

– Compensate for the energy-loss

  • 𝑀𝑝 = 2 β‹… 𝑀𝑗 β‹… 𝑔

𝑠

slide-35
SLIDE 35

Fuzzy Reflections/Refractions

  • Real Materials

– Never perfectly smooth surfaces

  • Empirical Approach

– Compute orthonormal frame around reflected/refracted direction – Sample coordinates (x, y) on disc: ray.direction += x * a + y * b

  • Or better use cosn sampling (β†’ GI Compendium)
slide-36
SLIDE 36

Fuzzy Reflections/Refractions

  • Gotchas

– Perturbed ray may may go inside – Check sign of dot product with N – Ignore rays on wrong side

  • Inter-Reflections/Refractions

– Recursively repeat process

  • At surfaces with corresponding materials
slide-37
SLIDE 37

Fuzzy Reflections/Refractions

Cook et al. Siggraphβ€˜84

slide-38
SLIDE 38

Soft Shadows

  • Real Light Sources

– Finite area

ω𝑗 ω𝑝

slide-39
SLIDE 39

Soft Shadows

  • Approach

– Random sample point on surface of light source – Scale intensity by area and cosine

ω𝑝 ω𝑗

slide-40
SLIDE 40

Soft Shadows

  • Small vs. Large Area Light
slide-41
SLIDE 41

Combined Effects

  • High-Dimensional Sampling Space

– number of anti-aliasing samples – x number of lens samples – x number of time samples – x number of material samples – x number of light samples βž” Exponential growth:

  • Increasing number of higher-order rays

with decreasing effect on final pixels β†’ bad2

  • Solution: Path-Based Approach

– Avoid exponential growth in ray tree – Pick a single sample at each step: β†’ Create a sample path – Average results over several paths per pixel β†’ path tracing (RIS)

  • Theoretical underpinning: Monte-Carlo Integration