Skip to content

KiRaRay is a simple interactive ray-tracing renderer using OptiX7/8.

License

Notifications You must be signed in to change notification settings

GraphicsEnthusiast/KiRaRay

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KiRaRay

KiRaRay is a simple interactive ray-tracing renderer using optix.

Features

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.
  • Other distributed effects like DoF and motion blur.
  • Post processing passes (e.g. denoising).
  • Single/multi-level scene graph with animation support.
  • Interactive editing scene components with simple UI.

Build and run

Windows (MSVC) Build

Requirements

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.

Cloning the repository

KiRaRay uses thirdparty dependencies as submodules so fetch them recursively when cloning:

git clone --recursive https://github.com/cuteday/KiRaRay.git

Building

This project uses cmake to build, make sure CUDA is installed and added to PATH. Several optional variables are available for building configuration.

Variable Default Description
OptiX_INSTALL_DIR auto-detect When auto-detection failed to find the correct OptiX path, this variable needs to be manually specified to point to the OptiX installation.
KRR_RENDER_SPECTRAL ON Whether to build spectral render. If turned OFF, the RGB renderer is build.
KRR_PYTHON_PATH auto-detect Manually specify this to enable Python binding for a specific version of Python.

Running

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, showcasing core features like volumetric rendering, animated scenes and motion blur.

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) and passes (describing the render pipeline). Once compiled, directly run kiraray without specifying configuration (this example configuration will be used) to get a feel for this toy renderer.

Usage

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, including a OptiX denoiser wrapper for denoising NumPy or PyTorch tensors, see scripts for details.

Galleries

Additional Information

Writing new render passes.

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.

Scene loading

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).

Epilogue

Be happy today!

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 (*/ω\*).

Credits

About

KiRaRay is a simple interactive ray-tracing renderer using OptiX7/8.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 99.8%
  • Other 0.2%