Raytracer

    • Reflections
    • Refractions
    • .obj mesh support and triangle intersection
    • Soft-Shadows
    • BVH-tree ray intersection optimization

I used a trick similar to what pathtracers do, where effects that require multisampling (anti-aliasing, soft shadows, depth of field, ray splitting into refraction+reflection), are sampled only once per frame but blended into the previous frames. This way, an image is quickly produced, with some grainy artifacts that disappear over time. This combined with multi-threading using a simple job system (1 job per horizontal line), makes the raytracer reasonably fast. And to allow real-time camera movement, some calculations, like reflections and refractions, are skipped while the camera is moving.

Result

Source:

GitHub

Download:

raytracer.zip

Platform:

Windows

Team:

Solo

Date:

January 2014