Raytracer
Class | Instructor | Date | Language | Ta'ed | Code |
---|---|---|---|---|---|
CS 3451 Intro To Graphics | Greg Turk | Spring 2012 (Expanded substantially as Personal Project) | Java/Processing | No | Code N/A |
CS 7490 Advanced Image Synthesis | Greg Turk | Spring 2016 | Java/Processing | No | Github Repo |
My ray tracer implementation also started as an assignment in a class I took, the undergraduate Computer Graphics course at Tech, and included the usual functionality from a Whitted-style ray tracer, such as shadow rays, reflection, spheres, triangle polygons, and point lights. I figured out and implemented many functions beyond the scope of the assigment, including :
Refraction (based on Fresnel Equations)
Cylinders
Generalized Guadric Surfaces (defined by 10 coefficients)
Quads and Meshes of Triangles or Quads
Texture Mapping on the outside and inside of surfaces/meshes.
Using Inverted Transformation Matrices to direct rays for each object (so a file with OpenGL style transformations mapping objects in space can be easily rendered)
Anti-Aliasing
In Spring Semester 2016 I took Greg Turk's Advanced Image Synthesis class, and expanded my ray tracer to include the following :
Distribution Ray Tracing
Area Lights
Depth of Field effects
Motion Blur
Fisheye Lens
Orthographic Projection
Spotlights (shadows are soft at edges)
Iterative Refinement (render only some evenly-spaced fraction of pixels as large tiles, and then iteratively get finer resolution until every pixel is displayed)
Acceleration via Bounding Volume Hierarchies
Perlin-noise and Worley-noise based Textures
Photon Mapping
I first became aware of ray tracers in the late 80's, when I was a student "the first time", and I've always been fascinated by them, so given the opportunity to actually implement one, I was very motivated, and still love working on it. High on my list of ideal jobs would be working in some capacity with ray tracers.
BVH Acceleration structure
By using a Bounding Volume Hierarchy on the following images, along with instancing of the single bunny mesh, I was able to render thousands of complex high-poly count meshes in less than a minute. The Sierpinski tetrahedron of bunnies has 9 layers, giving over 20,000 instances of the 69k poly bunny (many of which are vanishingly small).
Perlin and Worley Noise based textured bunnies
Worley Cellular Noise based textured spheres.
These spheres show the effects of varying different parameters of the Worley noise algorithm. These parameters are noise scale (describing the size of the blobs), distance function used to determine neighborhood (currently either Manhattan (L1) or Euclidean (L2)), Region of Interest function (how distance values are accumulated within neighborhood, currently either the sum, the alternating sum, or the inverse alternating sum of the values, the exponentials of the values or the logs of the values), the number of points in the neighborhood, the average # of random points in each cell and the distance threshold used by the 'mortar' (the grey color - everything below this threshold is gray). A lot of variety is possibly by just varying these values a little bit, as is shown below. I imagine a cool animation could be generated, comparable to Reaction-Diffusion, by varying these parameters incrementally over time as frames are generated.
Photon Mapping with Caustic and "Diffuse" Photons.
This was the last project for cs7490, and originally we were to implement the final gather step along with the caustic and diffuse photon casting, but this requirement was removed from the assignment due to time concerns. I implemented it on my own.