Download presentation
Presentation is loading. Please wait.
1
CSCE 441: Computer Graphics Ray Tracing
Jinxiang Chai
2
Ray Tracing Provides rendering method with
Refraction/Transparent surfaces Reflective surfaces Shadows Image taken from
3
Any difference for rendering three pixels?
Ray Tracing Provides rendering method with Refraction/Transparent surfaces Reflective surfaces Shadows Any difference for rendering three pixels? Image taken from
4
Local Illumination vs. Ray Tracing
5
Ray Tracing Results Click here
6
Overview Ray Tracing Algorithm Shadows, Reflection, Refraction
Surface Intersection Infinite planes, spheres, polygons Optimizations Readings: HB 10-11
7
Essential Information for Ray Tracing
Eye point Screen position/orientation Objects Material properties Reflection/Refraction coefficients Index of refraction Light sources
8
Ray Tracing Assumption
The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources)
9
Ray Tracing Assumption
The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources)
10
Ray Tracing Assumption
The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources) - reflection ray (light reflected by an object)
11
Ray Tracing Assumption
The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources) - reflection ray (light reflected by an object) - transparent ray (light passing through an object)
12
Ray Tracing Assumption
The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources) - reflection ray (light reflected by an object) - transparent ray (light passing through an object)
13
Ray Tracing Assumption
The illumination of a point is determined by - illumination/shadow ray (direct lighting from light sources) - reflection ray (light reflected by an object) - transparent ray (light passing through an object)
14
Illumination / Shadow Rays
A ray is cast from an object’s surface towards a light. If the light is not occluded, then the light contributes to the object’s surface color. If the light is occluded, then the light does not contribute to the object’s surface color. If ray hits a semi-transparent object, scale the contribution of that light and continue to look for intersections Occluder Pixels
15
Reflected Rays A ray is cast from the surface of an object based on its material properties. The contribution results in the specular reflection.
16
Transparency/transmission/refracted Rays
Some objects are transparent or translucent. The transmitted light also contributes to the surface color, called specular transmission. The ray can be refracted based on the object’s composition.
17
Recursive Ray Tracing 3 L1 L2 4 1 2
18
Recursive Ray Tracing 3 L1 L2 4 1 2
19
Recursive Ray Tracing 3 L1 L2 4 1 2
20
Recursive Ray Tracing 3 L1 L2 4 1 2
21
Recursive Ray Tracing 3 L1 L2 4 1 2
22
Recursive Ray Tracing 3 L1 L2 4 1 2
23
Recursive Ray Tracing 3 L1 L2 4 1 2
24
Recursive Ray Tracing 3 L1 L2 4 1 2
25
Recursive Ray Tracing 3 L1 L2 4 1 2
26
What are real light paths?
Recursive Ray Tracing 3 L1 L2 4 1 2 What are real light paths?
27
Recursive Ray Tracing and Light path
3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!
28
Recursive Ray Tracing and Light path
3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!
29
Recursive Ray Tracing and Light path
3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!
30
Recursive Ray Tracing and Light path
3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!
31
Recursive Ray Tracing and Light path
3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!
32
Recursive Ray Tracing and Light path
3 L1 L2 4 1 2 Ray tracing paths just reverses real light paths!
33
Ray Tree Eye Shadow of Obj 4 Object 1 L2 Reflection Transmission L1 L1
34
Recursive Ray Tracing For each pixel
Intersect ray from eye through pixel with all objects in scene Find closest (positive) intersection to eye Compute lighting at intersection point Recur for reflected and refracted rays (if necessary)
35
Recursive Ray Tracing
36
Termination Criterion
1. The ray intersects no surfaces 2. The ray intersects a light source that is not a reflecting surface 3. The tree has been generated to its maximum allowable depth.
37
Three Issues Ray-object intersection - hidden surface removal
Reflection direction - mirror direction Refraction direction - Snell’s law
38
Ray-object Intersection
screen eye Similar to ray casting!
39
Ray-object Intersection
screen eye Similar to ray casting! But how to determine the intersection point between a ray and an object such as sphere or triangle?
40
Ray Casting Implementation - Parameterize each ray as
- Each object Ok returns tk>0 such that first intersection with ok occurs at r(tk) - Q: given the set {tk}, what is the first intersection point?
41
Ray-Sphere Intersection
42
Ray-Triangle Intersection
First, intersection ray with plane Then, check if point is in triangle
43
Ray-Plane Intersection
44
Ray-Triangle Intersection
Check if point is inside triangle algebraically For each side of triangle
45
Reflection Mirror-like/Shiny objects Surface
46
Refraction Bending of light caused by different speeds of light in different medium Each (semi-)transparent object has an index of refraction ni Use Snell’s law to find refracted vector Image taken from
47
Snell’s Law Surface
48
How to compute Transmission Ray?
Surface n2
49
Snell’s Law Surface
50
Snell’s Law Surface
51
Snell’s Law Surface
52
Snell’s Law Surface
53
Snell’s Law Surface
54
Snell’s Law Surface
55
Snell’s Law Surface
56
Snell’s Law Surface
57
Snell’s Law Surface
58
Snell’s Law Surface
59
Snell’s Law Surface
60
Recursive Ray Tracing Recur for reflective/transparent objects
61
Recursive Ray Tracing Recur for reflective/transparent objects
62
Optimizations Lots of rays to cast!
Ray-Surface intersections are expensive Associate with each object Bounding box in 3-space If ray doesn’t intersect box, then ray doesn’t intersect object
63
Parallel Processing Ray tracing is a trivially parallel algorithm!
Cast rays in parallel Cast reflection, refraction, shadow rays in parallel Calculate ray/surface intersections independently in parallel
64
Ray Tracing Results: Special Effects
Copyright Newline Cinema
65
Ray Tracing Results: Video Games
These images are from a prototype computer game running in realtime on the ray tracer. It consists of more than 40 million polygons and all optical effects are fully simulated at rendering time. All trees are fully models and no LOD is being used.
66
Ray Tracing Results: Massive Models
Ray tracing has been the first and (to our knowledge) only technology to interactively render the entire Boeing 777 data set. It consists of 350 million polygons and takes up to 30 GB of data on disk. Every detail is models including tiny screws, cables, pipes, values, and many more. With ray tracing this model can be rendered interactively even on a dual-processor PC with 2-3 fps at video resolution. The right image contains plants with a total of roughly 1.5 billion polygons. All leafs use alpha-mapped textures leading to an extremely high depth complexity. Still the scene can be rendered with interactive performance on a decent PC cluster. Even smooth lighting from the sky dome can be integrated. An good approximation is then shown during interaction but the image converges to a high quality solution with a few seconds.
67
Pros and Cons of Ray Tracing
Advantages of ray tracing All the advantages of the local illumination model Also handles shadows, reflection, and refraction Disadvantages of ray tracing Computational expense No diffuse inter-reflection between surfaces (i.e., color bleeding) Not physically accurate Other techniques exist to handle these shortcomings, at even greater expense!
68
Ray Tracing References
Peter Shirley, “Realistic Ray Tracing”, ISBN Andrew Glassner, “An Introduction to Ray Tracing”, ISBN Steve Pettifer ( Anselmo Lastra ( Paul Rademacher ( Mark Harris ( Kenny Hoff ( POV-Ray (
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.