Title: More on Raytracing
1More on Raytracing
2Holidays Lectures, Labs, etc
- Easter break next week.
- I will be away from Friday 7th to Sunday 23rd
April (inclusive). - No lectures or tutorial during the first week
after the break. - There WILL be a lab during that week.
3Laboratory exercises
- This week parametric equations and
intersections. Read up lectures and attend
tutorial today. - Next (logical) week Colour and Lighting. Read
relevant chapters.
4Ray Casting recapitulation
? pixels in screen do Shoot ray p from the
eye through the pixel. Find closest
ray-object intersection. Get colour at
intersection?
5Ray Casting recapitulation
? pixels in screen do Shoot ray p from the
eye through the pixel. Find closest
ray-object intersection. Get colour at
intersection?
6Ray Casting recapitulation
? pixels in screen do Shoot ray p from the
eye through the pixel. Find closest
ray-object intersection. Get colour at
intersection ? Illumination model
7Types 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.
8Ambient light
- Ambient light comes from all directions and is
reflected in all directions. - The intensity and colour depend only the
properties of the surface colour and
reflectivity.
9Ambient light
- I Iaka
- where
- Ia is the intensity of the ambient light,
- and
- ka is the ambient constant of the surface (0-1).
10Perfect reflection
N
L
The angle between the incoming ray and the
surface normal is maintained for the outgoing ray.
11Diffuse reflection
- An ideal diffuse (Lambertian) reflector (e.g.
chalk) is the simplest to model. - Incoming light is scattered equally in all
directions, so brightness does not depend on the
viewing direction.
12Diffuse reflection
- Reflected brightness depends on the direction and
brightness of illumination (cos of light/normal
angle).
13Diffuse reflection
14Diffuse reflection
15Lambertian illumination
- Use Lamberts law, which says the intensity of
the reflected energy (light) depends upon the
angle between the incoming light and the surface
normal. - The intensity is view independent!
16Lambertian illumination
- I ILkd N.L
- where
- IL is the intensity of the light source,
- and
- kd is the diffuse constant of the surface (0-1).
17Illumination equation
- The colour of a pixel is determined by a
combination of ambient (background) illumination
and Lambertian reflection. - Thus I Iaka ILkd N.L
18Specular reflection
- Shiny surfaces reflect light coherently in a
narrow beam around the true reflected ray. - If your eye is in that cone, the surface looks
brighter (a highlight).
19Specular reflection
- Specular reflection isnt perfect so the
highlight is a blob with bright-ness reducing
gradually away from the center.
20Specular reflection
N
L
The width of the reflective cone depends upon the
smoothness of the surface.
21Specular reflection
- We can model this behavior using the Phong
illumination model - I kP cosn?
- where ? is the angle between the ray and the
direction of true reflection to the eye.
22Specular reflection
N
L
R
?
V
23Diffuse and specular reflection
N
L
R
V
I Ilkd(cos? kP cosn?) I Ilkd(L.N) kP
(R.V)n)
24Full illumination model
I Iaka ?j ILj(kd(L.N) kP(R.V )n)
25(No Transcript)
26(No Transcript)
27(No Transcript)
28(No Transcript)
29(No Transcript)
30(No Transcript)
31(No Transcript)
32(No Transcript)
33(No Transcript)
34(No Transcript)
35(No Transcript)
36(No Transcript)
37(No Transcript)
38(No Transcript)
39(No Transcript)
40(No Transcript)
41(No Transcript)
42(No Transcript)
43Phong Model Demos
- http//www.cs.auckland.ac.nz/richard/research-topi
cs/PhongApplet/PhongDemoApplet.html - http//www.eml.hiroshima-u.ac.jp/member/jrs/
nis/javaexampl/phong/phong.html - http//www.siggraph.org/education/materials/
HyperGraph/illumin/javaprog/shadesame.html - http//www.eye.ch/mduerig/phong/Phong.html
44Next Lecture
Refraction and Shadows