You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project aims to build a real-time ray tracer in Java, accelerated on heterogeneous hardware using
TornadoVM.
The project uses JavaFX to obtain a canvas for a graphical context to draw on and to build an
interactive graphical user interface, while the entire rendering process consists of manual calculation of the colors of
the pixels through tracing rays, applying the Blinn-Phong shading model and sampling soft shadows.
The embarrassingly parallel property of ray tracing allows for concurrent computation of each individual pixel color,
achieving up to 930x performance increase on an Nvidia RTX2060 GPU against the default sequential Java execution on an
Intel i7-8550u CPU.
Install TornadoVM. The following example builds TornadoVM with OpenJDK 11 and OpenCL:
git clone https://github.com/beehive-lab/TornadoVM.git
cd TornadoVM
./scripts/tornadoVMInstaller.sh --jdk11 --opencl
source source.sh
cd ..
If you cannot build TornadoVM with the installer, try
the manual installation
.
Download the JavaFX SDK for your system from: JavaFX downloads. You will need
the path of the JavaFX SDK for Step 3.
Note that TornadoVM-Ray-Tracer has been tested with JavaFX version 18.
Set up the environment and store the variables in a file (e.g. sources.env):
cd TornadoVM-Ray-Tracer
vim sources.env
export TORNADO_RAY_TRACER_ROOT="${PWD}"export PATH="${PATH}:${TORNADO_RAY_TRACER_ROOT=}/bin"export JAVAFX_SDK=<path to JavaFX>/javafx-sdk-18/
export TORNADO_ROOT=<path to TornadoVM>export PATH="${PATH}:${TORNADO_ROOT}/bin/bin/"export TORNADO_SDK=${TORNADO_ROOT}/bin/sdk
export JAVA_HOME=${TORNADO_ROOT}/TornadoVM-OpenJDK11/jdk-11.0.13+8