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:
/afs/umbc.edu/users/r/h/rheingan/pub/435/Proj6/Noise.cpp / .h
This is based on Ken Perlin's
reference implementation.
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.
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.
No free late is available for this project, so that grading may be completed in time to give semester grades.
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.
|
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).
Implement at least one texture based on turbulence, i.e. multiple levels of noise at different scales.
Vary the normal vector in at least one of your textures. This can be used to give the shading effect of a bumpy surface.
Implement displacement mapping to actually generate displaced geometry based on a texture specification. Unlike bump mapping, displacement mapping will change the appearance of the silhouette.
Find your own interesting materials and create procedural textures to model them. You should submit a picture of each material for comparison along with your project (if you are unable to obtain a picture, contact the TA for options).
Note that checkerboards are not interesting. Any materials you choose should be at least as complex as those given out in class. It would be best to get your bonus materials approved in advance.
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.