Project 3: TraceAssigned: Monday, 9 November 1998
Due: Monday, 23 November 1998
Artifact: Wednesday, 25 November 1998
RayTraceis a program that constructs recursively ray-traced images of fairly simple scenes.
Getting StartedTo install the starting point source code, copy all the files from here. In the scenes subdirectory, you'll find some example scene files (all the files with the .out extension).
Example SolutionBefore you begin coding, you should run the example executable. It has all of the requirements implemented.
Front endYou'll find some example scene files to use in the
scenessubdirectory (the files with the .out extension.) You should use these scenes to test that you've got the basics working.
Creating Your Own ScenesIt's also possible to create your own scenes by converting a VRML model into a .out file. At present, the program that convertes VRML to out files only lives on the old instructional SGI machines (which have all been removed from the lab). So to convert your file, you'll have to log in to blue, one of the SGIs, remotely. You should all have accounts on this machine.
To convert from VRML to OUT:
Note: The raytracer pretends that all spheres are perfect spheres even if you have scaled or rotated them. You might want to take this into consideration when designing your scene.
- Transfer your .wrl file from your NT directory to your home directory on blue using FTP or by mounting your blue directory using "Map Network Drive" on NT and dragging-and-dropping.
- Use the following script:A .out file will be generated in whichever directory filename.wrl happens to be in.
blue% /cse/courses/cse457/bin/vrml2out filename.wrl
- Copy the .out file back into NT land using the reverse of the procedure from step 1.
Note: We are in the process of creating an easier method for converting VRML files to .out files. Watch your email for an announcement.
Required ExtensionsEach individual must implement recursive ray tracing as described in class. This entails making the following extensions to the starting point program. (The starting point for the extensions is in the file Raytrace.c)
Your Raytracer should trace rays to a recursive depth of 5.
Extension H&B Foley, et al. Phong specular-reflection model 14.2 16.1 and 16.2.5 Contribution from multiple light sources:
and light attenuation
- Directional lights
- Point lights
14.1, 14.2 16.1 (particularly in 16.1.5 and 16.1.6) Shadows 14.6 16.12 and 16.4 Reflection 14.2 16.12 Refraction 14.2 16.12
GradingThis assignment will be worth a total of 10 points. The required extenions will be graded as follows:
Phong specular-reflection model: 3 points Directional Lights: 1 point Point Lights: 1 point Shadows: 2 points Reflection: 1 points Refraction: 1 points Artifact: 1 point Total: 10 points
Bells and WhistlesIn some cases, the material in the Angel and Foley, et al books goes into more depth on a particular subject than Hearn & Baker. If you're planning on implementing any of these bells and whistles, you are encouraged to read the relevant sections in those books as well.
Add support for materials with arbitrary index of refraction.
Implement an adaptive termination criterion for tracing rays, based on ray contribution.
Implement spot lights.
Add a menu option that lets you specify a background image to replace the environment's ambient color during the rendering.
Implement antialiasing by adaptive sampling, as described in H&B, p. 538 and Foley, et al., 15.10.4.
Implement bump mapping (see H&B, p. 558, Angel, 10.4; Foley, et al., 16.3.3).
Add texture mapping support to the program. An additional for adding a menu option for reflection (environment) mapping (see H&B, p. 554, Angel, 10.3; Foley, et al., 16.12.1 and 16.6).
Implement solid textures or some other form of procedural texture mapping, as described in H&B, p. 556, Foley, et al., 20.1.2 and 20.8.3.
Extend the ray-tracer to create Single Image Random Dot Stereograms (SIRDS). Click here for a brief explanation of how to view them, and click here to read a paper on how to make them. This page may also have some helpful information.
for first, for each additional
Implement distributed ray tracing to produce one or more or the following effects: depth of field, soft shadows, motion blur, glossy reflection or antialiasing (see H&B, p. 540, Foley, et al., 16.12.4).
Implement ray-intersection optimization using either hierarchical bounding volumes or spatial subdivision (see H&B, p. 535, Foley, et al., 15.10.2).
Implement a more realistic shading model. Credit will vary depending on the sophistication of the model. A simple model factors in the Fresnel term to compute the amount of light reflected and transmitted at a perfect dielectric (e.g., glass). A more complex model incorporates the notion of a microfacet distribution to broaden the specular highlight. Accounting for the color dependence in the Fresnel term permits a more metalic appearance. Even better, include anisotropic reflections for a plane with parallel grains or a sphere with grains that follow the lines of latitude or longitude. Sources: Foley et al, Section 16.7; Glassner, Chapter 4, Section 4; Ward's SIGGRAPH '92 paper; Schlick's Eurographics Rendering Workshop '93 paper.
There are innumerable ways to extend a ray tracer. Think about all the visual phenomena in the real world. The look and shape of cloth. The texture of hair. The look of frost on a window. Dappled sunlight seen through the leaves of a tree. Fire. Rain. The look of things underwater. Prisms. Do you have an idea of how to simulate this phenomenon? Better yet, how can you fake it but get something that looks just as good? You are encouraged to dream up other features you'd like to add to the base ray tracer. Obviously, any such extensions will receive variable extra credit depending on merit. Feel free to discuss ideas with the course staff before proceeding!