SLIDE 1 Image Based Lighting
francesco.banterle@isti.cnr.it
SLIDE 2 Image Based Lighting: why?
- Image Based Lighting (IBL):
- To (re)light synthetic objects with real-world
lighting
SLIDE 3 Image Based Lighting: why?
- IBL is very important:
- advertisement: cars, forniture, etc.
- visual effects: CGI, live motion, etc.
- augmented reality
- cultural heritage
SLIDE 4 IBL: Capturing Lighting
- The input of IBL is real-world lighting
- HDR imaging is the key
- A HDR photograph captures a limited portion of
light coming from the point of capture
SLIDE 5
IBL: Capturing Lighting
SLIDE 6 IBL: Capturing Lighting
- Solution:
- To capture HDR panoramic image 360x180
- These images are typically called either
environment map or lightprobe
SLIDE 7
IBL: Capturing Lighting
SLIDE 8 IBL: Capturing Lighting
- How capturing spherical (360x180) images?
- Single shot panorama cameras:
- SpheronVR: 50Mpix and 24 f-stops
- iSTAR 360: 50Mpix and 27 f-stops
- Roundshot: 160Mpix
- These cameras may be expensive…
SLIDE 9 IBL: Capturing Lighting
- to capture a mirror sphere (e.g. xmas ball)
- to capture a panoramic image from multiple directions and
exposure times. This requires post-processing; e.g. image stitching:
- PTGui:
- http://www.ptgui.com
- Hugin (open source):
- http://hugin.sourceforge.net/download/
SLIDE 10
IBL: Capturing Lighting
SLIDE 11
IBL: Capturing Lighting
SLIDE 12 IBL: Capturing Lighting
0.289
SLIDE 13 IBL: Capturing Lighting
0.289
SLIDE 14 IBL: Capturing Lighting
0.289
SLIDE 15 IBL: Capturing Lighting
0.289 0.537
SLIDE 16 IBL: Capturing Lighting
x
θ
φ
x y z
SLIDE 17 IBL: Longitude Latitude Mapping
D = 2 4 sin θ cos φ cos θ sin θ sin φ 3 5 θ = π ✓
1 2
j height
2
◆ φ =
π2i width
θ
φ
SLIDE 18 IBL: Longitude Latitude Mapping
- Advantages:
- easy mapping to understand/implement
- Disadvantages:
- not equal-area —>pixels cover different areas on the
sphere
- squeezed at the poles —> to take this into account
SLIDE 19 IBL: angular mapping
D = cos φ sin θ sin φ sin θ − cos θ φ = arctan(1 − 2y, 2x − 1) θ = π p (2x − 1)2 + (2y − 1)2
SLIDE 20 IBL: angular mapping
- Advantages:
- avoiding undersampling at edges
- Disadvantages:
- not equal-area —>pixels cover different areas on the
sphere
SLIDE 21 IBL: cube mapping
D = 1 p 1 + (2x − 1)2 + (2y − 1)2 2 4 2x − 1 2y − 1 1 3 5
x ∈ 1 3, 2 3
1 2, 3 4
x y
SLIDE 22 IBL: cube mapping
D = 1 p 1 + (2x − 1)2 + (2y − 1)2 2 4 2x − 1 2y − 1 1 3 5
x ∈ 1 3, 2 3
1 2, 3 4
x y
SLIDE 23 IBL: cube mapping
- Advantages:
- hardware support on the GPU
- Disadvantages:
- not equal-area (pixels are bigger at edges) —>pixels
cover different areas on the sphere
SLIDE 24
… and now?
SLIDE 25 Rendering
~ !i ~ n ~ !o x
SLIDE 26 Rendering
Lo(x, ~ !o) = Le(x, ~ !o) + Z
Ω+ Li(x, ~
!i)fr(x, ~ !i, ~ !o)|~ n · ~ !i|d~ !i
SLIDE 27
Rendering
SLIDE 28 Rendering
Lo(x, ~ !o) = Le(x, ~ !o) + Z
Ω+ Li(~
!i)fr(x, ~ !i, ~ !o)|~ n · ~ !i|d~ !i
SLIDE 29 Rendering
Lo(x, ~ !o) = Le(x, ~ !o) + Z
Ω+ Li(~
!i)fr(x, ~ !i, ~ !o)|~ n · ~ !i|d~ !i
SLIDE 30 Rendering
- How to solve this integral?
- Creating light sources from the environment map
- Sampling the environment map
SLIDE 31 Light sources generation
- Direction light sources are extracted from the
environment map.
- Properties: direction, and HDR color
- The integral is converted into:
- Number of light sources is a parameter: more lights
more time. Few lights —> bias (integral not converged)
Lo(x, ~ !o) = Le(x, ~ !o) +
N
X
j=1
Lj
ifr(~
!j
i , ~
!o)|~ n · ~ !j
i |
SLIDE 32 Light sources generation: uniform sampling
Subdivide the panorama in regular regions
SLIDE 33 Light source generation: uniform sampling
Extracted light sources
SLIDE 34 Light sources generation: median-cut sampling
Subdivide the panorama in regions of equal luminance
SLIDE 35 Light sources generation: median-cut sampling
Subdivide the panorama in regions of equal luminance
SLIDE 36 Light sources generation: median-cut sampling
Subdivide the panorama in regions of equal luminance
SLIDE 37 Light sources generation: median-cut sampling
Subdivide the panorama in regions of equal luminance
SLIDE 38 Light sources generation: median-cut sampling
Subdivide the panorama in regions of equal luminance
SLIDE 39 Light sources generation: median-cut sampling
Subdivide the panorama in regions of equal luminance
SLIDE 40 Light sources generation: median-cut sampling
Subdivide the panorama in regions of equal luminance
SLIDE 41 Light sources generation: median-cut sampling
Subdivide the panorama in regions of equal luminance
SLIDE 42 Light source generation: median-cut sampling
Extracted light sources
SLIDE 43 Light source generation: median-cut sampling
Extracted light sources
SLIDE 44
Light source generation: median-cut sampling
SLIDE 45
Light source generation: median-cut sampling
SLIDE 46 Sampling the Environment Map
- Solving:
- with monte-carlo methods; generating samples
according to a probability distribution:
Lo(x, ~ !o) = Le(x, ~ !o) + 1 N
N
X
j=1
Li(~ !xj
i )fr(~
!xj
i , ~
!o)|~ n · ~ !xj
i |
p(xj) Lo(x, ~ !o) = Le(x, ~ !o) + Z
Ω+ Li(~
!i)fr(x, ~ !i, ~ !o)|~ n · ~ !i|d~ !i
SLIDE 47
Sampling the Environment Map
SLIDE 48
Sampling the Environment Map
SLIDE 49 how to insert virtual
SLIDE 50
Differential Rendering
SLIDE 51
Differential Rendering
SLIDE 52
Differential Rendering
SLIDE 53
Differential Rendering
SLIDE 54 Differential Rendering
Images are courtesy of Karsch
SLIDE 55 Differential Rendering
/
Synthetic Objects + Support Geometry Support Geometry Only
SLIDE 56 Differential Rendering
Shadows to insert into the photograph (table)
SLIDE 57
Differential Rendering
x
SLIDE 58
Differential Rendering
SLIDE 59 Differential Rendering
x
) (
+
SLIDE 60
Differential Rendering
SLIDE 61
there is more…
SLIDE 62
nobody expects… the Spanish Inquisition
SLIDE 63 Spatial IBL
- A single environment can capture only distant light
sources
- Nearby light sources are not modeled as local light
but as distant ones
- To increase realism there is the need to model them
properly
SLIDE 64
Spatial IBL
SLIDE 65
Spatial IBL
SLIDE 66
Spatial IBL
SLIDE 67
Spatial IBL
SLIDE 68
Spatial IBL
SLIDE 69
Questions?