#include <pathtracer.h>
Inherits Raytracer.
Inheritance diagram for PathTracer:
Public Member Functions | |
PathTracer (Scene *scene, Image *img) | |
Creates a pathtracer. | |
virtual | ~PathTracer () |
Destructor. | |
void | computeImage () |
Raytraces the scene by calling tracePixel() for each pixel in the output image. | |
Protected Member Functions | |
Color | tracePixel (int x, int y) |
Computes the color of the pixel at (x,y) by sending a large number of rays through the pixel into the scene. | |
Color | trace (const Ray &ray) |
Computes the radiance returned by path tracing the ray. | |
Ray | getShadowRay (const Intersection &is, PointLight *light) const |
Helper function that sets up a shadow ray from an intersection point to a point light source. | |
Ray | getReflectedRay (const Intersection &is) const |
Helper function that computes the reflected view direction and sets up a ray with the correct parameters. | |
Ray | getRefractedRay (const Intersection &is) const |
Helper function that computes the refracted direction and sets up a ray with the correct parameters. | |
Protected Attributes | |
Scene * | mScene |
Ptr to the scene. | |
Image * | mImage |
Ptr to the output image. | |
Camera * | mCamera |
Ptr to the camera used for rendering. |
The tracePixel() function is called for each pixel in the image, and is responsible for computing the output color by tracing a number of paths (rays) through the scene.