CMSC 435/634: Introduction to Computer Graphics

Assignment 6
Enhanced Realism
Due December 14, 2010

The Assignment

For this assignment, you will add procedural texturing to the ray tracer you implemented in projects 2 and 5. You will be given different materials in class on November 30, and your goal will be to make your ray traced objects look as much like these materials as possible. This means you must create two different procedural textures. One texture should match the marble and the other texture one of the other three objects.

You should also create a scene that shows off your textures and submit it as part of the project. Your scene does not need to be very complex, since the focus of this assignment is on texturing and not composition. Feel free to use balls.nff or your object models from project 4.

Your textures should incorporate the following elements at a miniumum:

A portion of the grading for this project will be subjective, with points awarded for realism. You should try to match the appearances of the materials as closely as possible.

Re-Using Assignment 5 Code

You are expected to complete assignment 6 by modifying your code for assignment 5. If you did not complete assignment 5, or if you think you will be unable to modify your code, you can request a working implementation from the TA.

Keep in mind that you will not be allowed to turn in assignment 5 late after requesting code from the TA.

Special Note on Late Submissions

No free late is available for this project, so that grading may be completed in time to give semester grades.

Input File Format

As with the previous projects, the input file will use a subset of the NFF file format. However, you will need to modify the format to add support for selecting a texture.

You are free to modify the input format in any way you see fit, but you should document your changes in your readme file. An example of how you might specify a texture is given below:

t
Procedural texture.  Description:
    "t" N [scale]

Format:
    t %d [%g]

    The parameter N specifies which procedural texture should be used.  Valid
    choices are 0 to 3.  The optional scale parameter influences the calculation
    of texture coordinates (default is 1.0).

    Like the fill color, the texture is applied to the objects following it until
    a new texture is assigned.

Implementation Tips

You should begin by identifying what properties the materials have that most strongly influence their appearance. Some things to think about:

To actually implement your procedural texture, you should first add code to calculate texture coordinates whenever you intersect an object. Choose some arbitrary point on your object to be the texture origin, and find coordinates relative to that. Then use the texture coordinates to alter some or all of the variables used in your lighting calculations (color, specularity, normal direction, etc).

Extra Credit (some mandatory for those taking 634)

What To Turn In

Submit your assignment as 'Proj6'. Include your source code and makefile, as well as your sample scene in NFF format. Please do not submit PPM files, as they can be very large. If you must submit images, convert them to a compressed format such as .jpeg. The 'convert' program is available on the GL servers, so for example you can do:

    convert image.ppm image.jpg

Also include a readme file with a description of what hardware / software environment you used to develop your project, and a description of any help you received or outside resources you used. (If you received no help beyond the text and course staff, state as much.) Your readme should also include any instructions necessary for using your program, and a description of any extensions you added to the NFF format.

Working At Home

If possible, don't. We test things out on the university computers and may or may not be able to help you if things don't work right for you at home. If you do work at home, your final submitted version must be able to run on the gl machines and must be electronically submitted there.