Archived
1
Fork 0
A ray-tracer built as my final project for ICS4U
This repository has been archived on 2020-01-03. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2020-01-02 20:01:51 -05:00
.settings Added java project 2019-12-26 13:58:05 -05:00
.vscode Moved all vector math over to libvec 2019-12-28 14:53:00 -05:00
examples Added scene selection 2019-12-27 16:59:36 -05:00
gradle/wrapper Added java project 2019-12-26 13:58:05 -05:00
src Add "RT" mode 2020-01-02 19:26:19 -05:00
.classpath Added java project 2019-12-26 13:58:05 -05:00
.gitignore Update .gitignore 2019-12-26 15:05:45 -05:00
.project Added java project 2019-12-26 13:58:05 -05:00
build.gradle Moved all vector math over to libvec 2019-12-28 14:53:00 -05:00
gradlew Added java project 2019-12-26 13:58:05 -05:00
gradlew.bat Added java project 2019-12-26 13:58:05 -05:00
LICENSE Initial commit 2019-12-26 13:53:40 -05:00
output.png Added camera positioning 2020-01-01 19:52:02 -05:00
README.md add main app info to README 2020-01-02 20:01:51 -05:00
scene.json 16k rendering 2019-12-27 15:07:31 -05:00
settings.gradle Added java project 2019-12-26 13:58:05 -05:00

Rayzor

👁️ My ICS4U ISP, a ray-tracing experiment.

What is this?

Last year, as part of the final project of ICS3U, I made a very simple raycaster, as it was something I had newly learned about. This year, I'm stepping into the next dimension with a full 3D raytracer, built from scratch (and a little vector math library to go with it). This project was inspired by @bheisler's "Raytracing in Rust" project, and was developed with help from Scratchapixel and an assignment from Joel Ross' CS 315 course at the University of Puget Sound.

Examples

Here are a few examples of scenes rendered by this software:

Enclosed room
An enclosed room with 3 light sources, and 3 balls



Enclosed room with close wall
Same scene, with a closer wall, and a single white light

Render times

This software does CPU rendering (I have yet to learn anything about GPU rendering). Running on an Intel i3-8130U running at 2.20GHz, Im getting the following render times for the first example scene:

Resolution Max reflections Time
800x600 10 3 seconds
800x600 1000 15 seconds
1920x1080 100 20 seconds
3840x2160 100 32 seconds
15360x8640 1000000 7 minutes 28 seconds

As you can see, not the world's best render times, but pretty good for my first try, with absolutely no 3D graphics experience of any kind.

Using the main program

The main program can be run with:

./graldew :run

This will ray-trace a pre-defined scene (stored in src/main/java/ca/retrylife/ics4u/rayzor/scenes/Balls.java), and output the render to output.png

Using the "RT" viewer

This project has a second, experimental frontend that can be found at ca.retrylife.ics4u.rayzor.RTApp. It uses @salamander2's hsa2 graphics library to display a simple ray-traced "world". It runs at about 0.004 FPS on my computer, and movement is slow because of it.

Here are the keybindings for the program:

Key Action
W Move camera forward
S Move camera backward
A Move camera left
D Move camera right
Q Move camera down
E Move camera up