KiRaRay is a simple interactive ray-tracing renderer using optix.
Working in progress (?) project
This toy renderer is purposed for learning and only with limited features.
- GPU path tracing (megakernel/wavefront).
- GPU volumetric rendering (wavefront).
- Spectral or tristimulus (RGB) rendering.
- Post processing passes (e.g. denoising).
- Basic support for scene animation (glTF).
Windows (MSVC) |
---|
- Nvidia RTX GPU (Turing or higher).
- OptiX 7.3+ and CUDA 11.4+.
- Vulkan SDK 1.3+.
This project is developed with on Windows (MSVC). It cannot compile on Linux.
KiRaRay now uses Vulkan for better interoperability with CUDA, and extensibility to rasterization-based render passes. If Vulkan is not desired, check the legacy-GL branch that instead depends on OpenGL.
KiRaRay uses thirdparty dependencies as submodules so fetch them recursively when cloning:
git clone --recursive https://github.com/cuteday/KiRaRay.git
This project uses cmake to build, Make sure cuda is installed and added to PATH, and OptiX_INSTALL_DIR
environment variable points to the OptiX installation directory.
Specify the json configuration file as command line argument to start the renderer, as the example below. Check the example configurations for some test scenes, including volumetric rendering and animated scenes.
build/src/kiraray.exe common/configs/example_cbox.json
The two necessary entries in the configuration are
model
(specifying the relative path to the scene file) andpasses
(describing the render pipeline). Once compiled, directly runkiraray
without specifying configuration (this example configuration will be used) to get a feel for this toy renderer.
Camera controlling. Dragging LeftMouse
for orbiting, dragging Scroll
or Shift+LeftMouse
for panning. Scroll
for zooming in/out.
Python binding. Several simple interfaces are exposed to python scripting via pybind11, see scripts for details.
Currently, the renderer runs extremely slow on Debug build for unknown reasons. Please switch to Release build for normal performance.
It is possible to write your own render pass, see the examples here. Check bindless render pass (rasterization) or the post-processing passes for more working examples.
Kiraray provided limited support for importing scenes like OBJ, glTF2 using Assimp. Animations in glTF2 models could be correctly imported, but skeleton animation is not yet supported. pbrt-parser is used to import pbrt-v3 scenes (get some here, modify the file url to download the pbrt-v3 format models).
Although the main purpose of this project is to let me (a beginner) learn c++ and optix, I really wish to add more features and make it a fully-functional renderer with support for both ray-tracing and rasterization based techniques, combined via vulkan-cuda interopration. However, it may be a long process and I don't know if I will continue to do it. Since in reality i am so lazy, trying to sleep as more as possible (*/ω\*).
- The great optix tutorial for beginners: optix7course.
- Some of the code are adapted from pbrt and donut.
- KiRaRay has a tiny math wrapper built upon eigen.
- ImGui is used to build simple user interfaces for this project.