Professional Documents
Culture Documents
} Now
} Can deals with reflection, refraction for transparent objects, and
shadow effects.
Ray Tracing Algorithm
} Assumes that scene has been transformed to image space.
} The observer is assumed to be on the positive z-axis
} Parallel or perspective
} Raytracing
} 3D → Image
} Geometric reasoning about light rays
} For each sample in pixel image…
Examples
Ray Generation
} Ray equation
} Through eye at t = 0
} At pixel center at t = 1
R(t) = E + td
Intersection point calculation
} Ray-Scene Intersection
} Intersections with geometric primitives
} Sphere
} Triangle
} Groups of primitives (scene)
} Acceleration techniques
} Bounding volume hierarchies
} Spatial partitions
¨ Uniform grids
¨ Octrees
¨ BSP trees
Intersection point calculation (cont’)
} Ray-Sphere Intersection
Intersection point calculation (cont’)
} Ray-Sphere Intersection
Intersection point calculation (cont’)
} Ray-Sphere Intersection
} Need normal vector at intersection for lighting
calculations
Intersection point calculation (cont’)
} Ray-Triangle Intersection
} First, intersect ray with plane
} Then, check if point is inside triangle
Intersection point calculation (cont’)
} Ray-Triangle Intersection
} intersect ray with plane
Intersection point calculation (cont’)
} Ray-Triangle Intersection
} Check if point is inside triangle algebraically
0
0
Intersection point calculation (cont’)
} Other Ray-Primitive Intersections
} Cone, cylinder, ellipsoid:
} Similar to sphere
} Box
} Intersect 3 front-facing planes, return closest
} Convex polygon
} Same as triangle (check point-in-polygon algebraically)
} Concave polygon
} Same plane intersection
} More complex point-in-polygon test
Intersection point calculation (cont’)
} Expensive Cost
} Ray Tracing is an exhaustive process for a display of
512 x 512 pixels
} 512 x 512 = 266,144 rays must be traced, and their potential
intersections with the objects should been evaluated
V B
S
Refracted Ray
} Transparent materials bend light
} Snell’s Law
“Distributed” Raytracing
} Send multiple rays through each pixel
Area Light
Occluder
“Distributed” Raytracing
: Soft Shadows
} Distribute shadow rays over light surface
Soft Shadows
“Distributed” Raytracing
: Glossy Reflection
} multiple reflection rays
Justin Legakis
θ θ polished surface
“Distributed” Raytracing
: Glossy Translucency
} Jittering the rays about the actual transmission angle
N
produces a blurred effect
I
qI
T
Bound of jittered
reflection rays
“Distributed” Raytracing
: Motion Blur
} Distribute rays over time
} More when we talk about animation...
“Distributed” Raytracing
: Depth of Field
} Pinhole camera – everything in focus.
} Camera with lens – utilized depth of field
: Gauss-Seidel Method
How to compute Form Factors
How to compute Form Factors
Light Leaks
Radiosity vs. Ray Tracing
} Radiosity
} Simulates the diffuse propagation of light
starting at the light sources
} Independent of the viewing direction: pre-
computable for static scenes
} Ray tracing
} Follows all rays from the eye of the viewer
back to the light sources
} Good at simulating specular reflections
and transparency