Ray Tracing I - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Ray Tracing I

Description:

If an eye ray intersects an object: Cast shadow rays to each light source. ... Cast reflection ray, search for object intersection. ... too glossy or ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 14
Provided by: drewke9
Category:
Tags: ray | tracing

less

Transcript and Presenter's Notes

Title: Ray Tracing I


1
Ray Tracing I
2
Reflection and Transmission
Light Source
S5
R1
R3
S6
Eye
S3
Eye Ray
S1
R2
T1
S2
S4
Light Source
3
Recursive Ray Tracing
  • If an eye ray intersects an object
  • Cast shadow rays to each light source.
  • diffuse illumination
  • shadows
  • Cast reflection ray, search for object
    intersection.
  • ambient illumination
  • Cast transmission ray, search for object
    intersection.
  • Transparency
  • For each new reflection and transmission ray,
    repeat.
  • Until no intersection
  • Until N intersections (recursion depth) (3 ? N ?
    7)

4
Reflection Vector
-I
?N
I, Incident Ray
R, Reflected Ray
N
?
?
  • Assume that I N R 1, I, R, and
    N are coplanar
  • We know (-I)N RN (unit vectors with same
    angle)
  • (-I)R ?N, where ? is the length of (-I)R

5
Reflection Vector Calculation
  • (-I)R ?N
  • (-IR)N ?NN ?
  • (-IN)(NR) ?
  • (-IN)(-IN) ?
  • 2(-IN) ?
  • -I R ?N 2(-IN)N
  • R 2(-IN)N I

-I
?N
I
R
N
?
?
6
Transmission
  • Let ?i be the index of refraction of medium i
    with respect to a vacuum.
  • Let ?t be the index of refraction of medium t
    with respect to a vacuum.
  • Snells law states
  • We also know that
  • T ?I ?N
  • (All vectors are of unit length!)

Medium i
N
I
Ai
At
I
-N
T
Medium t
7
Transmission Vector
8
Transmission Vector (cont.)
1
  • We now have two equations and two unknowns!
  • Some algebra and a look at the geometry gives us

9
Index of Refraction
  • Medium Index of Refraction
  • Water 1.33
  • Ethyl Alcohol 1.36
  • Carbon Bisulfide 1.63
  • Air 1.0003
  • Methylene Iodide 1.74
  • Fused Quartz 1.46
  • Glass, Crown 1.52
  • Glass, Dense Flint 1.66
  • Sodium Chloride 1.53
  • Note These are approximations. The index of
    refraction actually differs with each wavelength
    of light.

10
Total Internal Reflection
  • Total Internal Reflection occurs when the angle
    of the incident ray with the surface is too
    shallow.
  • Traveling from dense to less-dense medium
  • Becomes a reflection ray
  • Critical angle occurs when At 90, after which
    the radical in ? calculation is negative

11
Antialiased Ray Tracing
  • Adaptive Supersampling (Weighted sub-pixel
    averaging)
  • Cast rays through pixel corners (not centers)
  • Take average of corner values
  • If one corner differs significantly from average,
  • Subdivide, adding 5 corners
  • Repeat for each sub-area, averaging to obtain
    area value

Value for pixel BCEF
12
Ray Tracing Example
  • Created by Anto Matkovic

13
Problems With Ray Tracing
  • Ray/object intersection calculations become
    expensive with complex objects and more objects.
  • Light from other objects (other than pure
    reflection) is not modeled.
  • Still use the constant ambient light component.
  • Shadows often appear too sharp
  • Surfaces appear too glossy or smooth
  • Images take a long time to render, must
    recalculate for each new view
  • Have to tweak illumination model constants to get
    desired effect
Write a Comment
User Comments (0)
About PowerShow.com