Computer Graphics (Spring 2008) Computer Graphics (Spring 2008)
COMS 4160, Lectures 17, 18: Nuts and bolts of Ray Tracing Ravi Ramamoorthi
http://www.cs.columbia.edu/~cs4160
Acknowledgements: Thomas Funkhouser and Greg Humphreys
Ray Casting Outline in Code Outline in Code Image Raytrace (Camera - - PDF document
To Do To Do Computer Graphics (Spring 2008) Computer Graphics (Spring 2008) Start early on raytracer assignment (assn 4) COMS 4160, Lectures 17, 18: Nuts and bolts of Ray Tracing Ravi Ramamoorthi http://www.cs.columbia.edu/~cs4160
Acknowledgements: Thomas Funkhouser and Greg Humphreys
Eye Up vector Center
From 4160 lecture 4 on deriving gluLookAt
Eye Up vector Center
αu βv
1 2
1 2
1 2 1 1
2 2 1 1 1
2 2 1 1 1
1
A B C
( ) ( ) ( ) ( ) C A B A n C A B A − × − = − × −
A B C
( ) ( ) ( ) ( ) C A B A n C A B A − × − = − × −
1 1
1
A B C P α β γ
0, 0, 1 P A B C α β γ α β γ α β γ = + + ≥ ≥ ≥ + + =
A B C P α β γ
0, 0, 1 P A B C α β γ α β γ α β γ = + + ≥ ≥ ≥ + + = ( ) ( ) P A B A C A β γ − = − + − 1 , 0 1 1 β γ β γ ≤ ≤ ≤ ≤ + ≤
2
* * L L const lin d quad d = + +
1
n s a e i d i s i i i
=
Color = Visible ? Illumination Model : 0 ;
Color += reflectivity * Color of reflected ray
1
n s a e i d i s s i i R T T i
=
Adaptive sampling, depth control
Beam tracing, cone tracing, pencil tracing etc.
Optimized Ray-Object Intersections Fewer Intersections
If no intersection bounding box, needn’t check objects