Skip to content

rinuya/Moire

Repository files navigation

Moiré

example

Image of a glass bunny

How it works

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

How to build

Makefile (Linux)

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.

Windows

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

Linux

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.

CUDA

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

Todo list

Some features are still on the todo list and will be implemented soon:

  • Transforms
  • More complex sampling
  • Bounding Volume Hierarchy

Dev workflow

cmake -B build --preset=Release && cd build/ && cmake --build . && ./moire-raytracer

cd .. && rm -rf build/

About

A CUDA based offline raytracer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors