Beruflich Dokumente
Kultur Dokumente
Lecture 10:
Ray Tracing and Constructive Solid Geometry
Secondary rays
travel towards each
light source
I = k a I a + si I i k d (n l i ) + k s ( v l i ' ) t
Viewing
plane
Graphics Lecture 1: Slide 3
Secondary
Rays
Primary Ray
Viewer
Viewer
primary ray
C
transmission ray
reflection ray
reflection ray
reflection ray
Background
Intensity
reflection ray
transmission ray
Background
Background
Intensity
Intensity
I = k a I a + si I i k d (n l i ) + k s ( v l i ' ) t + k r I r + kt I t
i
Reflections
Reflections
n
primary ray
secondary ray
in
out
v ' = v ( 2v n)n
Reflections
Reflection
+ 2 vn +
1 = vv =
Solving both equation yields:
mirror
smooth or polished surfaces
v ' = v ( 2v n)n
Graphics Lecture 1: Slide 13
Reflections
Translucent Objects
n
primary ray
secondary ray
Reflected rays
are distributed in
a specular cone
k1 sin(1 ) = k 2 sin(2 )
v
1
Medium 1
(eg air)
2 v
Refraction
Refraction
k1 ( v n) = k 2 ( v 'n)
The direction of the refracted ray is
2
k
k
v ' = 1 (n v) 2 + 2 1 n v n + v
k2
k1
k
(n v ) 2 > 1 2
k1
Refraction
Perfect refraction implies that the ray is only refracted in one
direction.
Perfect refraction is a good approximation for
Refraction
n
v
clear glass
water
Secondary rays
are refracted in a
specular cone
Sphere
Difference
Difference
Difference
CSG trees
CSG operations are not commutative:
CSG trees
CSG operations are not unique:
Cube B
Plane
Spheres:
Sphere A with center ps = (0, 0, 8) and radius r = 5
Sphere B with center ps = (0, 0, 9) and radius r = 3
Sphere C with center ps = (0, -3, 8) and radius r = 2
A+B+C
AB
(B A) C
A + (B C)
B
Z
Viewplane
Graphics Lecture 1: Slide 39
( 1 , 2 , K , n )
Each list of line segments will either contain
an odd number of intersection points (the viewpoint is
inside the solid object)
an even number of intersection points (the viewpoint is
outside the solid object)
an empty list of intersection points
Graphics Lecture 1: Slide 42
Union
Scale
Intersection
Translation
Box
Rotation
Cylinder
Sphere
Graphics Lecture 1: Slide 47