Simple raytracer built in julia by Boldini M., Galafassi G. and Lonardoni S. during Calcolo Numerico per la Generazione di Immagini Fotorealistiche (AY 2024/25) @ UNIMI.
Clone this repository.
git clone https://github.com/stevelonny/jujutracer.gitThen activate the environment and instantiate the dependencies.
cd jujutracer
julia --project=.using Pkg
Pkg.activate(".")
Pkg.instantiate()Enjoy the code! Either use the REPL or use the scene definition language to define your scene and render it as per documentation.
The code can be used in two main ways:
- As a library in the REPL, as demonstrated in the
scriptsfolder. Examples of these scenes are shown inexamples. - Using the provided
interpreterto define scenes, like those in thescenesfolder. Usage example:julia -t auto interpreter.jl scenes/<file_name>
For more details on using the REPL or defining scenes, please refer to the official documentation.
The user must provide the input file in the correct PFM format, the a value and gamma correction value, and the output file, which must be of the .png or .jpg extension.
julia main.jl <pfm_file> <a> <gamma> <output_file>See issue #22
The code leverages multi-threading in a clean way simply by parallelizing each ray fired using the @threads keyword.
To leverage multi-thread, launch julia with the correct flag t and the number of threads to be assigned (or the auto keyword).
julia -t auto demo.jl <output_file> <width> <height> <cam_angle>
julia -t auto demoCSG.jl <output_file> <width> <height> <cam_angle>Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
This project is licensed under the MIT "Expat" License
