CSE 681 Refraction - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

CSE 681 Refraction

Description:

Snell's Law. Willebrord Snell (Dutch Physicist) determined how ... Snell's Law. The angle at which the light bends is described by the following relationship: ... – PowerPoint PPT presentation

Number of Views:107
Avg rating:3.0/5.0
Slides: 21
Provided by: naeems
Category:
Tags: cse | refraction | snell

less

Transcript and Presenter's Notes

Title: CSE 681 Refraction


1
CSE 681Refraction
2
Transparency
3
Refraction
  • Transparency depends upon the refractive
    properties of the material
  • Light bends through some materials

4
Snells Law
  • Willebrord Snell (Dutch Physicist) determined
    how light refracts through a medium in 1621

5
Snells Law
  • The angle at which the light bends is described
    by the following relationship

qi Incident angle qt Refractive angle hr
Refractive index of the medium light is
entering hi Refractive index of the medium
light is leaving
6
Refraction (Ray Tracing)
  • Since we are following rays from the eye to the
    light, we refract using the view vector
  • Cast a secondary ray (refractive ray)
  • Incorporate the color from this ray into our
    shading

7
Refraction
  • How do we compute the refraction vector T?

8
Geometric Construction
  • Assume all given vectors are unit vectors
  • Define vector M that is to N

9
Geometric Construction
  • Project T onto M
  • Project T onto -N

10
Geometric Construction
  • Algebra

11
Raytracing AlgorithmShadows, Reflection, and
Refraction
  • Color shade( ray, recursionDepth )
  • Initialize pixel color to background
  • Intersect all objects
  • If an intersection is found
  • Initialize to ambient shading
  • For each light
  • Shoot shadow ray
  • If not in shadow add diffuse and
    specular
  • If ( recursionDepth lt MAXRECURSION)
  • If (object is shiny)
  • Trace reflection ray
  • If (object is transparent)
  • Trace transmittive ray
  • Return color

12
Raytracing PseudocodeShadows, Reflection, and
Refraction
Keep track of the depth of the ray tree
  • Color shade( ray, recursionDepth )
  • c background color
  • intersectFlag FALSE
  • for each object
  • intersectFlag intersect ( ray, p )
  • if intersectFlag is TRUE
  • c ambient
  • for each light source
  • shadowFlag intersectShadowRay ( p )
  • if shadowFlag is FALSE
  • compute reflective ray R (or H)
  • c diffuse
  • c specular components
  • if ( recursionDepth lt MAXRECURSION)
  • if (object is shiny)
  • compute reflection of the ray, R1

First illuminate the point
Dont spawn reflection ray past the pre-chosen
tree depth
R1 reflects the view vector Add the returned
color with a shininess factor
T depends upon the index of refraction Add the
returned color with a transmittance factor
13
Wavelength
  • Refraction (and reflection) is wavelength-dependen
    t
  • Remember Newtons experiment
  • Where rainbows come from
  • So, compute separately for each component (i.e.,
    r, g, b)

14
The Ray Tree Recursion!
T3
Eye
R2
N2
T1
R3
R1
N3
L1
L2
L3
N1
L1
T1
R1
L3
L2
Ni surface normal Ri reflected ray Li shadow
ray Ti transmitted (refracted) ray
Eye
T3
R2
R3
15
Infinite Recursion
  • Stopping criteria
  • Recursion depth
  • Stop after some bounces
  • Ray contribution
  • Stop if transparency/transmitted attenuation
    becomes too small
  • Usually do both

16
Recursion for Reflection
1 recursion
0 recursion
2 recursions
17
Simulate Physics?
  • Wait, in physics, dont the photons go from the
    light to the eye not the other way
  • What we do is backward ray tracing

18
Forward Ray Tracing
  • Start from the light source
  • Low probability to reach the eye
  • What can we do about it?

19
Forward Ray Tracing
  • Always send a ray to the eye
  • Still not efficient

20
Simulate Physics?
  • Shadows of transparent objects
  • Assume it is opaque
  • Just multiply by transparency color but no
    refraction
  • Ray Tracing is full of dirty tricks
Write a Comment
User Comments (0)
About PowerShow.com