-
Notifications
You must be signed in to change notification settings - Fork 65
Developer Manual (PathTracer)
PathTrace is (as the name suggests) a simple path tracer that can render pictures with global illumination effects. The first part of the assignment will focus on providing an efficient implementation of ray-scene geometry queries. In the second half of the assignment you will add the ability to simulate how light bounces around the scene, which will allow your renderer to synthesize much higher-quality images. Much like in MeshEdit, input scenes are defined in COLLADA files, so you can create your own scenes for your scenes to render using free software like Blender.)
Unlike MeshEdit, the code that you will work with for PathTracer is organized in several different source files. Some of the particularly important ones are outlined below. Methods that we expect you to implement are marked with "TODO (PathTracer)", which you may search for.
File(s) | Purpose | Need to modify? |
---|---|---|
pathtracer.cpp |
This is the main workhorse class. Inside the ray tracer class everything begins with the method Pathtracer::raytrace_pixel() in pathtracer.cpp. This method computes the value of the specified pixel in the output image. | Yes |
camera.cpp |
You will need to modify Camera::generate_ray() in Part 1 of the assignment to generate the camera rays that are sent out into the scene. | Yes |
static_scene/triangle.cpp , static_scene/sphere.cpp
|
Scene objects (e.g., triangles and spheres) are instances of the Primitive interface defined in static_scene/Primitive.h. You will need to implement the Primitive::intersect() method for both triangles and spheres. | Yes |
static_scene/light.h |
Describes lights in the scene. The initial starter code has working implementations of directional lights and constant hemispherical lights. | No |
spectrum.h |
Light energy is represented by instances of the Spectrum class. While it's tempting, we encourage you to avoid thinking of spectrums as colors -- think of them as a measurement of energy over many wavelengths. Although our current implementation only represents spectrums by red, green, and blue components (much like the RGB representations of color you've used previously in this class), this abstraction makes it possible to consider other implementations of spectrum in the future. Spectrums can be converted into colors using the Spectrum::toColor() method. This file is in the CMU462 reference library. | No |
bvh.cpp |
A major portion of the first half of the assignment concerns implementing a bounding volume hierarchy (BVH) that accelerates ray-scene intersection queries. The implementation of the BVH will be located in bvh.cpp/.h. Note that a BVH is also an instance of the Primitive interface (A BVH is a scene primitive that itself contains other primitives.) | Yes |
Implementing the functionality of PathTracer is split in to 7 tasks; the sidebar on the right contains links to a page for each.
- Task 1: Camera Rays
- Task 2: Intersecting Primitives
- Task 3: BVH
- Task 4: Shadow Rays
- Task 5: Path Tracing
- Task 6: Materials
- Task 7: Environment Light
Notes:
- Task 1: Spline Interpolation
- Task 2: Skeleton Kinematics
- Task 3: Linear Blend Skinning
- Task 4: Physical Simulation
Notes: