This project consists of a raytracer implementation in Java. It renders .obj files and spheres with either a Lambert or Blinn-Phong shaders. The program includes reflection (recursive), refraction, multiple lights, shadows (optional) and also affine transformations of the objects such as three-axis rotation, scaling and translation.
Java version (JRE or JDK): jre1.8.0_241
Execution environment: JavaSE-1.8
Download the folder RayTracer15_MarianaAvalos
and store it in your computer. This is all the source code.
Import the folder to Eclipse IDE.
Run RayTracing.java
.
On the files
folder you can add .OBJ files to render.
On the class SampleScene.java
you can change the objects that are rendered in the scene.
The pdf file RayTracingReport_MarianaAvalos.pdf
explains the theory I used for the rendering algorithm.
The program outputs three different scenes.
The first scene focuses mainly on the rendering of refraction. This is the output of the first scene:
The second scene focuses on reflection, potentially recursive when you have two reflective objects in front of each other. The output of the second scene is the following:
The third scene focuses on rendering reflection and refraction combined in one material. For this, I coded a loop for 360 frames and created a video that shows how translation, rotation and scaling is also implemented as one of the features. Download the output video here. However, a sample frame from that video is stored in this repo and its gif version is the following:
This is one of my favorite projects and I am very honored that it was chosen for display at SIGGRAPH 2019 Student Work Exhibit, celebrated in Los Angeles, California.