• Home
  • Contact
  • Projects
  • Personal
  • More
    • Home
    • Contact
    • Projects
    • Personal
  • Home
  • Contact
  • Projects
  • Personal

Curtis Buckoll.

Curtis Buckoll.Curtis Buckoll.Curtis Buckoll.

Ray Tracing Renderer

This project implements a basic ray tracing renderer to draw static images containing interesting lighting, interreflection, and shadow properties.


Source: https://github.com/CurtisBuckoll/RayTracingRenderer


Project Overview 


A scene is first loaded from file, specified by a scene configuration file which loads models from .obj's and determines their transformations into world space where the viewpoint is fixed at the origin looking down the z axis. With the scene ready, we are able to render it. 


A direction vector is determined for each pixel in the window, stretching from the origin to the plane at z = 1 from x, y both in the range [-1,1] which depends on the pixel position in the image. We then cast a ray in the direction of this vector, and examine what in the scene (if anything) we have collided with. If a collision is found with a face of a model in the scene, we then do two things. First, we shoot another ray from the collision position to each light position, and perform the lighting calculation only if the path is unobstructed. Otherwise we are in a shadow and we let the light contribution be zero. Second, we calculate a reflection vector and repeat the same process recursively, with any additional collisions contributing to the pixel value with decreasing weight as a function of distance traveled by the reflected ray.


Following is an example of a rendered image, where the maximum recursion depth is 2.


Copyright © 2018 Curtis Buckoll - All Rights Reserved.

  • Home
  • Contact
  • Projects
  • Personal

Powered by GoDaddy