Realistic Image Synthesis - BRDFs and Direct Lighting - Philipp - - PowerPoint PPT Presentation

realistic image synthesis
SMART_READER_LITE
LIVE PREVIEW

Realistic Image Synthesis - BRDFs and Direct Lighting - Philipp - - PowerPoint PPT Presentation

Realistic Image Synthesis - BRDFs and Direct Lighting - Philipp Slusallek Karol Myszkowski Gurprit Singh Realistic Image Synthesis SS18 BRDFs and Direct Lighting Importance Sampling Example Example: Generate Cosine weighted distribution


slide-1
SLIDE 1

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Realistic Image Synthesis

  • BRDFs and Direct Lighting -

Philipp Slusallek Karol Myszkowski Gurprit Singh

slide-2
SLIDE 2

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Importance Sampling Example

  • Example: Generate Cosine weighted distribution

– Generate ray according to cosine distribution with respect to normal – Need only average of the incident radiance

slide-3
SLIDE 3

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Multidimensional Inversion

  • Multidimensional Inversion Method (here 2D)

– Goal: density function 𝑞(𝑦, 𝑧) with 𝑦 ∈ 𝑏, 𝑐 , 𝑧 ∈ [𝑑, 𝑒] – Compute cumulative distribution function 𝑄 𝑦, 𝑧 = න

𝑑 𝑧

𝑏 𝑦

𝑞 𝑦′, 𝑧′ 𝑒𝑦′𝑒𝑧′ – Random variables along x are generated by integrating 𝑄 over entire y-range (marginal density) 𝜊1 = 𝑄 𝜊1

′, 𝑧 ቚ 𝑧=𝑒 = ෠

𝑄 𝜊1

⇒ 𝜊1

′ = ෠

𝑄−1(𝜊1) – Now, given 𝑦 = 𝜊′1 we have a one-dimensional problem but we still need to normalize 𝜊2 ~ 𝑄 𝑦, 𝜊2

′ ቚ 𝑦=𝜊1

′ = ෨

𝑄 𝜊2

⇒ 𝜊2

′ ~ ෨

𝑄−1 𝜊2 ⇒ 𝜊2

′ =

෨ 𝑄−1(𝜊2) ෨ 𝑄(𝑒)

slide-4
SLIDE 4

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

  • Multidim. Inversion: Hemisphere
  • Multidimensional probability function (𝑞 𝜕 = 𝑑𝑝𝑜𝑡𝑢 = 𝑑)

Ω+

p 𝜕 𝑒𝜕 = 1 ⇒ 𝑑 න

Ω+

𝑒𝜕 = 1 ⇒ 𝑑 = 1 2𝜌 𝑞 𝜕 = 1 2𝜌 ⇒ 𝑞 𝜄, 𝜒 = sin(𝜄) 2𝜌 with 𝑒𝜕 = 𝑡𝑗𝑜𝜄 𝑒𝜄d𝜒

  • Marginal density function (integrating out 𝝌)

𝑞 𝜄 = න

2𝜌 𝑡𝑗𝑜𝜄

2𝜌 𝑒𝜒 = 𝑡𝑗𝑜𝜄 ⇒ 𝜊1 = 𝑄 𝜄 = න

𝜄

𝑡𝑗𝑜𝜄′𝑒𝜄′ = 1 − 𝑑𝑝𝑡𝜄

  • Conditional density function

𝑞 𝜒 𝜄 = 𝑞(𝜄, 𝜒) 𝑞(𝜄) = 1 2𝜌 ⇒ 𝜊2 = 𝑄 𝜒 𝜄 = න

𝜒

1 2𝜌 𝑒𝜒′ = 𝜒 2𝜌

  • Inverting, with: if (1 − 𝑌) is uniform in [𝟏, 𝟐], so is 𝒀

𝜄 = 𝑑𝑝𝑡−1 1 − 𝜊1 = 𝑑𝑝𝑡−1𝜊1 𝜒 = 2𝜌𝜊2

slide-5
SLIDE 5

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Sampling a BRDF

  • Uniformly distributed on the hemisphere (~𝑒𝜕)
  • Cosine distributed on the hemisphere (~𝑑𝑝𝑡𝜄d𝜕)
  • Cosine-power distributed on the hemisphere (~𝑑𝑝𝑡𝑜𝜄𝑒𝜕)

2 2 2 1 2 2 1 2 1

) 1 ( ) 2 sin( ) 1 ( ) 2 cos( ) acos( 2          = − = − = = = z y x

2 2 1 2 1 2 1

) 1 ( ) 2 sin( ) 1 ( ) 2 cos( ) acos( 2          = − = − = = = z y x

1 1 2 2 1 2 1 1 1 2 1

) 1 ( ) 2 sin( ) 1 ( ) 2 cos( ) acos( 2

1 2 1 2

+ +

= − = − = = =

+ +

n n

z y x

n n

        

Also see Global Illumination Compentium by Philip Dutre (U. Leuven): http://www.cs.kuleuven.ac.be/~phil/GI/

slide-6
SLIDE 6

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Sampling a BRDF

  • Phong BRDF
  • Sampling the diffuse part

– Uniform on the hemisphere – Better: Cosine distributed

  • Sampling the glossy part

– Uniform on the hemisphere – Better: Cosine distributed – Cosine-power distributed

  • Cdigon integrates only over

positive hemisphere (see GI-Compendium)

         d L k d L k d L x f

n i s i d i

  • i

r

cos cos cos cos ) , , (

  

+ + +

  

 + =

 

= =

= =

N k k k d k N k k k d

L N k I L N k I

1 1 1 1

) ( cos ) ( 2     

k N k k k s k n N k k k s k k n N k k k s

L C N k I L N k I L N k I           cos ) ( cos ) ( cos cos ) ( 2

1 digon 2 1 2 1 2

  

= = =

=  =  =

θ' θ

slide-7
SLIDE 7

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Direct Lighting Computation

  • Need to compute the integral
  • See also

– Shirley et al.: MC-Techniques for Direct Lighting Calculations

  • Single light source, not too close (>1/5 of its radius)

– Small:

  • 1/𝑠2 has low variance, cos𝜄𝑦 has low variance

– Planar:

  • cos𝜄𝑧 has low variance too
  • Choose samples uniformly on light source geometry

– Sampling directions could have high variance

– For curved light sources

  • Take into account orientation/normal
slide-8
SLIDE 8

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Direct Lighting Computation

Sampling projected solid angle 4 eye rays per pixel 100 shadow rays Sampling light source area 4 eye rays per pixel 100 shadow rays

slide-9
SLIDE 9

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Direct Lighting Computation

Fixed sample location 4 eye rays per pixel 1 shadow ray each Random sample location 4 eye rays per pixel 1 shadow ray each

slide-10
SLIDE 10

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Direct Lighting Computation

Sample locations on 2D grid 4 eye rays per pixel 64 shadow ray Stratified random sample locations 4 eye rays per pixel 64 shadow ray

slide-11
SLIDE 11

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Direct Lighting Computation

Stratified random sample locations 4 eye rays per pixel 16 shadow ray Stratified random sample locations 64 eye rays per pixel 1 shadow ray

slide-12
SLIDE 12

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Direct Lighting Computation

  • Importance sampling of many light sources

– Ray tracing cost grows with number of lights

  • Approaches

– Equal probability (1/NL) – Fixed weights according to total power of light

  • Sample as discrete probability density function
  • Make sure that pdf is not zero if light could be visible

– Must use conservative approximation

– Stratification through spatial subdivision

  • Estimate the contribution of lights in each cell (e.g. octree)

– Dynamic and adaptive importance sampling

  • Compute a running average of irradiance at nearby points
  • Use the relative contribution as the importance function
  • Should use coherent sampling
  • Might need to estimate separately for primary and secondary rays



 =

i i i

p

slide-13
SLIDE 13

Realistic Image Synthesis SS18 – BRDFs and Direct Lighting

Direct Lighting Computation

  • Example: Sampling thousands of lights interactively

– At each pixel send random path into the scene & towards some light

  • Low overhead since we already trace many rays per pixel

– Gives a rough estimate of light contribution to the entire image

  • Take maximum contribution of each light at any pixel
  • Might want to average over several images (less variance)

– Use this estimate for importance sampling

  • Make sure every light is sampled eventually
  • Might ignore lights with very low probability (but introduces bias)

– Trace samples ONLY from the eye

  • Avoids touching the entire scene
  • Minimizes working set for very large scenes

– Published as [Wald et al., Interactive Global Illumination in Complex and Highly Occluded Environments, EGSR’03]