Image of a glass bunny
The program (main.cpp) reads in a scene file (.txt), creates the scene on the host (CPU) and then sends the necessary info to device (GPU). Once the scene is finished rendering, the pixel values of the final image are copied back to host and saved as output.ppm.
Execution via arg (or std::cin):
./moire-raytracer /full/path/to/scene.txt
For Linux, there's a Makefile running the commands for you. Use make run to build and run the raytracer. Check the Makefile for specifics.
Using VisualStudio2022, you can just use the configure-vs2022 preset in the editor, or run the following via the "x64 Native Tools Command Prompt for VS2022":
cmake -B build --preset=configure-vs2022
CMake, git, and a C/C++ compiler are required. A build generator such as make or ninja is also necessary. Furthermore, vcpkg is necessary.
In the root of the project, run:
cmake -B build --preset=Release
cd build/
cmake --build .
Alternatively, you can build with the Debug preset.
If you get an error like:
Make Error at /usr/share/... (message):
CMAKE_CUDA_ARCHITECTURES must be non-empty if set.
Then try the following and do a clean rebuild after:
export PATH=/usr/local/cuda/bin:$PATH
Some features are still on the todo list and will be implemented soon:
- Transforms
- More complex sampling
- Bounding Volume Hierarchy
cmake -B build --preset=Release && cd build/ && cmake --build . && ./moire-raytracer
cd .. && rm -rf build/
