Code Monkey home page Code Monkey logo

kiraray's Introduction

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

kiraray's People

Contributors

cuteday avatar hineven avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.