Docsity

Enhancing Raytracer: Shadows, Reflections, Refractions, and Triangles in CG - Prof. Christ, Assignments of Computer Graphics

Toggle sidebar
bg1
Fall 2005
22C:151 Introduction to Computer Graphics
Assignment 10
Due: Friday November 18th at 11:59 pm
(Be aware that Professor Wyman will be unavailable from the afternoon of the 17th! Ask questions early.)
Goal: Extend your basic raytracer to handle shadows, reflections, refractions, and triangles.
Problem 1 (5 points): Extend your ray tracer to compute shadows on diffuse surfaces. In other words when a ray hits
a diffuse surface, check if the light is visible from the hitpoint before shading. If the light is visible, shade as normal.
If the point is shadowed, then either return black or some ambient term.
Problem 2 (5 points): Add a reflective material that behaves like a perfect mirror.
Problem 3 (10 points): Add a refractive material that transmits light.
Problem 4 (5 points): Add a triangle object type to your ray tracer.
Problem 5 (5 points): Read an OBJ file to your raytracer and render it using a diffuse material type. Remember OBJ
files consist of a number of triangles, the primitive you added to your ray tracer in problem 4.
Hint: Look at the ’glm.c’ file (and glmDraw() in particular) in order to figure out how the triangle data is
loaded into memory.
Hint: If you use large models, your ray tracer will run very, very, very slowly. Use a smaller model, like Al
Capone.
Hint: If you plan on doing this part late on the evening of Friday the 18th, your program may not finish executing
in order to submit your homework on time! You are responsible for such delays, so start early!
Extra Credit (5 points): Modify your ray tracer into a path tracer. Your need only worry about diffuse surfaces and
you can assume the only lightsource is a (non-black) constant color background.
NOTE: A “README” file is required in order to get full credit! Please tell us how to compile and run your program.
When we run the program with no parameters, it should create a PPM file which demonstrates all 5 problems from the
homework! (This means, you’ll need to have an example scene with shadows, reflections, refractions, and a mesh!)
NOTE: Example images and scene data to recreate them will be posted online.

Partial preview of the text

Download Enhancing Raytracer: Shadows, Reflections, Refractions, and Triangles in CG - Prof. Christ and more Assignments Computer Graphics in PDF only on Docsity!

Fall 2005

22C:151 Introduction to Computer Graphics

Assignment 10

Due: Friday November 18th at 11:59 pm (Be aware that Professor Wyman will be unavailable from the afternoon of the 17th! Ask questions early.)

Goal: Extend your basic raytracer to handle shadows, reflections, refractions, and triangles.

Problem 1 (5 points): Extend your ray tracer to compute shadows on diffuse surfaces. In other words when a ray hits a diffuse surface, check if the light is visible from the hitpoint before shading. If the light is visible, shade as normal. If the point is shadowed, then either return black or some ambient term.

Problem 2 (5 points): Add a reflective material that behaves like a perfect mirror.

Problem 3 (10 points): Add a refractive material that transmits light.

Problem 4 (5 points): Add a triangle object type to your ray tracer.

Problem 5 (5 points): Read an OBJ file to your raytracer and render it using a diffuse material type. Remember OBJ files consist of a number of triangles, the primitive you added to your ray tracer in problem 4.

Hint: Look at the ’glm.c’ file (and glmDraw() in particular) in order to figure out how the triangle data is loaded into memory.

Hint: If you use large models, your ray tracer will run very, very, very slowly. Use a smaller model, like Al Capone.

Hint: If you plan on doing this part late on the evening of Friday the 18th, your program may not finish executing in order to submit your homework on time! You are responsible for such delays, so start early!

Extra Credit (5 points): Modify your ray tracer into a path tracer. Your need only worry about diffuse surfaces and you can assume the only lightsource is a (non-black) constant color background.

NOTE: A “README” file is required in order to get full credit! Please tell us how to compile and run your program. When we run the program with no parameters, it should create a PPM file which demonstrates all 5 problems from the homework! (This means, you’ll need to have an example scene with shadows, reflections, refractions, and a mesh!)

NOTE: Example images and scene data to recreate them will be posted online.