CSCI 420: Computer Graphics
Hao Li
http://cs420.hao-li.com
Fall 2018
7.2 Ray Tracing
1
7.2 Ray Tracing Hao Li http://cs420.hao-li.com 1 Motivation: - - PowerPoint PPT Presentation
Fall 2018 CSCI 420: Computer Graphics 7.2 Ray Tracing Hao Li http://cs420.hao-li.com 1 Motivation: Reflections 2 Motivation: Depth of Field 3 Local Illumination Object illuminations are independent No light scattering between objects
CSCI 420: Computer Graphics
http://cs420.hao-li.com
Fall 2018
1
2
3
4
5
6
7
contribute to image!
practical
8
pixel in image plane
9
10
11
12
image plane center
(COP) field of view angle (fov) ray
x y z x y z side view frontal view h w aspect ratio = w / h
13
image plane COP field of view angle (fov)
x y z side view side view
image plane
x y z
f = 1
y = 0 z = 0
y = tan(fov/2) z = −1
y = − tan(fov/2) z = −1
14
h w x y z frontal view a = aspect ratio = w / h
x = −a tan(fov/2) y = tan(fov/2) z = −1 x = −a tan(fov/2) y = − tan(fov/2) z = −1
x = a tan(fov/2) y = tan(fov/2) z = −1
x = a tan(fov/2) y = − tan(fov/2) z = −1
x = 0 y = 0 z = −1
Steps (3) and (4) require recursion.
15
hits surface point
surface point to each light
contribution from that light
improved diffuse reflection
16
light source
scene
scene
image plane ray n shadow ray (blocked) light source camera
can reach to the light, apply a standard Phong model
17
light source
scene
image plane ray n shadow ray (unblocked) light source camera v l
18
19
20
21
www.yafaray.org
22
relative to speed of light in vacuum
23
but blur the background image
(called distributed ray tracing)
24
25
www.povray.org
26
model for that light, and add the result to pixel color
below threshold
27
28
29
www.yafaray.org
30
www.povray.org
31
www.yafaray.org
32
www.povray.org
33
http://cs420.hao-li.com
34