#include <raytracer.h>
Inherited by PathTracer, and WhittedTracer.
Inheritance diagram for Raytracer:
Public Member Functions | |
Raytracer (Scene *scene, Image *img) | |
Creates a raytracer. | |
virtual | ~Raytracer () |
Destroys the raytracer and all the objects it contains. | |
void | computeImage () |
Raytraces the scene by calling tracePixel for every pixel in the output image. | |
Protected Member Functions | |
virtual Color | trace (int x, int y) |
Compute the color of the pixel at (x,y) by raytracing. | |
Ray | getShadowRay (const Intersection &is, PointLight *light) const |
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 | getTransmittedRay (const Intersection &is) const |
Helper function that computes the transmission 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. |
When the function trace() is called, the image is raytraced by calling tracePixel for each pixel in the output image. tracePixel should be overridden in the sub-class to apply the desired raytracing algorithm (Whitted, pathtracing).