Skip to content

Offline Raytracer made from scratch that renders OBJ files and spheres with Lambertian or Blinn-Phong shaders. Includes: reflection, refraction, lights, shadows and object transformations.

License

Notifications You must be signed in to change notification settings

the-other-mariana/raytracer

Repository files navigation

Raytracing Algorithm for Object Visualization

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.

Specifications

Java version (JRE or JDK): jre1.8.0_241
Execution environment: JavaSE-1.8

Usage

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.

Sample output

The program outputs three different scenes.
The first scene focuses mainly on the rendering of refraction. This is the output of the first scene:

alt text

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:

alt text

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:

alt text

Recognition

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.

alt text

About

Offline Raytracer made from scratch that renders OBJ files and spheres with Lambertian or Blinn-Phong shaders. Includes: reflection, refraction, lights, shadows and object transformations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages