This project is a simple OpenGL path tracer developed in Java 8 using the library LWJGL, based on the Ray tracing with OpenGL guide by Kai Burjack and on smallPT by Kevin Beason.
You'll need hardware supporting GLSL >= 4.30 (on Linux you can check with glxinfo | grep OpenGL
) and JDK >= 8 to run the compiled jar.
This project uses Maven to manage its dependencies, LWJGL and JOML, that will be automatically downloaded by Maven, when building the jar, in the .m2
folder under your user's home directory.
After the build you can remove the downloaded dependencies folders .m2/repository/org/lwjgl
and .m2/repository/org/joml
, or remove the .m2
folder entirely if you do not use Maven yourself.
- Clone the repo:
$ git clone https://github.com/marcodiri/lwjgl-opengl-pathtracer.git
- Build the jar with Maven (I suggest using the provided wrapper mvnw):
# Navigate inside the root project directory
$ cd lwjgl-opengl-pathtracer
# Unix
$ chmod +x mvnw
$ ./mvnw clean package
# Windows
$ .\mvnw clean package
You'll find the compiled jar in the target folder.
Load as existing Maven project in Intellij IDEA or Eclipse with M2E plugin and build/run from there.
Build the jar following the steps in the Building section.
To launch the application, run the generated lwjgl-opengl-pathtracer-*.jar in the target folder:
$ java -jar target/lwjgl-opengl-pathtracer-1.0-SNAPSHOT.jar
Rendered scene after some seconds after starting the program: