Required Features for Ray Tracer Milestone 2


Ray Tracer Milesone 2

Due: Feb 20, 2024

In this second Milestone, you will implement faster handling of ray-object collision detection, and incorporate textures into your ray tracer. You will also implement some optional additional features of your choice.

There is no new starter code for this Milestone. Use the code you wrote in Milestone I as a starting point. You will not be re-penalized for broken Milestone I features when Milestone II is graded.

Fixing Bugs From Milestone I

You may correct errors in your Milestone I solution for 50% of points back on any Milestone I scenes that you previously failed. Do not submit a separate executable—we will simply rerun the Milestone I test scenes using your Milestone II code. Milestone I probably will not be graded in time for the Milestone II submission, but feel free to reach out to the TA for feedback on whether your Milestone 1 scenes are acceptable.

Required Features Do Not Sum To 100 Points

You can only earn 80% credit by completing the required features. To get full credit for this milestone, you must either implement additional optional features from the bells and chimes list, do well on the performance contest, submit a creative scene, or some combination of the three.

Required Features

(60 pts) Acceleration Structure

Implement your choice of a kD tree, bounding volume hierarchy (BVH), or octree to accelerate ray-object intersection.

Make sure that your acceleration module is able to handle the entire current set of geometric primitives – that is, triangles, spheres, squares, boxes, and cones.

(10 pts) Texture mapping

Implement texture mapping. To do this you will need to write code which looks up the texture color in the texture bitmap given the texture (u,v) coordinates during shading. Use a bilinear filter (bilinear interpolation) to compute the color “in between” texture pixels. The scenes provided in Public Scenes Part 2 contain texture-mapped examples.

More advance filter kernels, such as a sinc filter, are eligible for extra credit.

(10 pts) Cube mapping

Implement cube mapping (skybox) as a user-selectable option. When using the cube map, rays that “go to infinity” look up their color in the cube map rather than using the default black color. Use this feature to render the transparent dragon4.ray with cube mapping.

A set of cube mapping textures can be loaded through the GUI, or the command line option -c. Note in either case you only need to specify one texture file (any of the six works), and all the remaining files will be matched and loaded automatically. For testing purpose, this function can be disabled in GUI mode, by unchecking the Smart Load checkbox.

Please note that the labeling convention for the cube map textures are the opposite of what you may expect; i.e. the +z texture is the one to display when looking from the positive z direction.

The required resources can be downloaded at the overview page.

Extra Credit

(up to 15 points) Performance Contest

During grading, the submission whose ray tracing code is the fastest will receive 15 points extra credit, and other high-efficiency submissions will receive partial extra credit. To measure rendering speed, a secret scene not included in the starter code (containing at least a few thousand triangles) will be traced using your code. The test will be performed using one ray per pixel (no anti-aliasing) and at least 5 levels of secondary ray recursion. The command line used for testing rendering speed looks like:

ray -r 5 [in.ray] [out.png]

Note: We may change the number of recursions, or add other standard arguments/options when testing our secret scenes.

Only ray tracers that correctly render the secret scene will be eligible for performance extra credit. You are welcome to use multiple threads when tracing rays. You are also welcome to precompute scene-specific acceleration structures when your program starts, and make other time-memory tradeoffs, but your precomputation time and memory use should be reasonable and will be included in the timing of your ray tracer. Don’t try to customize your ray tracer for the test scenes; we will use only the secret scene when running the performance contest.

If you have any questions about what constitutes a fair acceleration technique, ask us. Compiling with optimization enabled is allowed (-O3 is already enabled, though). Coding your inner loops in machine language is not allowed. Using multiple computers or the cloud is not allowed. In general, don’t go overboard tuning aspects of your system that aren’t related to tracing rays.

(up to 10 pts) Creative Scene

You may also include ray tracing scenes of your own; obviously, your ray tracer should be capable of rendering these scenes. Complex and creative scenes will receive more extra credit. Please carefully describe any scenes you want considered for extra credit in your README file.

Bells and Whistles

Many opportunities for additional credit are available for this project.

Important Any additional features you attempt must obey the following two cardinal rules:

  1. Your code must obey the spec and the spec from Milestone 1. In other words, you can add new features, but should not modify the way that existing features function. You will be deducted points if your extra features causes your program to violate the spec!

  2. Include a brief explanation of any scenes/features you would like considered for credit in your README file. This explanation must include instructions for turning on/toggling the extra features. Undocument or poorly-documented features risk receiving no credit.

  3. Some of the following items presuppose a working implementation of the basic, required project features. You may not receive full credit for a bell or whistle if a dependent required feature is buggy or missing.

Approved 🔔 (10 pts each) and 🎐 (5 pts each)

References

General

Space Subdivision

Hierarchical Bounding Volume

Tips