Refraction and Shadows - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Refraction and Shadows

Description:

Reflection rays bring light reflected from another surface. ... Snell's law states that n1 sin 1 = n2 sin2 We can use this to determine the ... – PowerPoint PPT presentation

Number of Views:87
Avg rating:3.0/5.0
Slides: 25
Provided by: MOL133
Category:

less

Transcript and Presenter's Notes

Title: Refraction and Shadows


1
Refraction and Shadows
2
Types of rays
  • Primary rays light directly to a pixel.
  • Shadow rays aka light-seeking rays.
  • Reflection rays bring light reflected from
    another surface.
  • Transmission rays bring light through an object.

3
Types of rays
  • Primary rays light directly to a pixel.
  • Shadow rays aka light-seeking rays.
  • Reflection rays bring light reflected from
    another surface.
  • Transmission rays bring light through an object.

4
Shadow rays
  • Shoot shadow ray (light-seeking ray) at each
    light.
  • If this ray 'sees' (intersects) a light, add the
    contribution from that light to the ambient,
    otherwise add 0.

5
Reflection Rays
  • If the object is reflective then we cast a
    reflection ray to determine what, if anything, is
    reflected there.
  • This ray starts at the intersection point and has
    a direction v 2N(N.v).
  • How did we get that?

6
Remember this?
Treat ray as a vector, hence we can represent it
by the vector p u vt where u is the
starting point, v is the direction and t is
how far we've travelled along the ray.
7
Perfect reflection
v
n
L
Note that v and n are unit vectors.
8
Reflection rays
n
v
n(n.v)
9
Reflection rays
n(n.v)
v
n(n.v)
10
Reflection rays
n(n.v)
v
n(n.v)
So we start a new ray u' v't, Where u' is the
intersection point, and v' v 2n(n.v).
11
Cancer
12
Transmission rays
n
L
?
13
Why does refraction occur?
  • Different velocities through different materials.
  • Ray bends towards normal when passing into an
    optically denser medium and away for the opposite
    case.
  • Do all wavelengths (colours) behave the same way?

14
Refractive index
  • Light travels at a speed c in a vacuum and at c/n
    in a medium of refractive index n.
  • Snell's law states that n1 sin?1 n2 sin2 We can
    use this to determine the direction of the
    refracted ray.

15
Refractive index
  • Common values of refractive index
  • air 1.00
  • water 1.33
  • glass 1.50
  • diamond 2.40

16
Refraction demos
  • http//www.physics.uoguelph.ca/applets/Intro_physi
    cs/refraction/LightRefract.html
  • http//oldsite.vislab.usyd.edu.au/photonics/fibres
    /fizzz/refraction/
  • http//www.olympusmicro.com/primer/lightandcolor/r
    efraction.html

17
Ray genealogy
  • Each primary ray spawns (at least) three other
    rays. (Why/what?)
  • Two of those, in turn, can spawn three more.
  • When do you stop?

18
When do you stop?
  • When ray leaves the scene.
  • When the contribution becomes 'too small'.
  • When we get tired i.e. when we get to a preset
    recursion limit.

19
Ray genealogy
20
Ray genealogy
21
Ray genealogy
22
Some numbers
  • Consider a 1024 x 1024 pixel image.
  • 1 primary ray and, on average, 6 secondary rays ?
    7M rays.
  • Assume 10 operations per intersection test, 2GHz
    machine, 5 cycles/ operation.

23
Some numbers
  • Comes to 0.175 seconds/object.
  • 100,000 objects ? 5 hours.

24
Next Lecture
Problems with Raytracing
Write a Comment
User Comments (0)
About PowerShow.com