Skip to content

chillpert/rayex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rayex

Rayex is a framework for cross-platform, cross-vendor, real-time path tracing in Vulkan. It runs on both Linux and Windows and is implemented using the new Khronos Vulkan ray tracing extension. Additionally, rayex uses SDL2 for windowing and glm as its math library. The framework also features native Dear ImGui support enabling the user to create graphical user interfaces without writing any API-related code.

Rayex is still in development, so documentation and examples might not always be up to date or complete.

Table of Contents

  1. Requirements
  2. Deploy
  3. Build
  4. Examples
  5. Documentation

Requirements

General:

  • Download compatible drivers for NVIDIA or AMD if not already installed
  • C++20 has to be enabled for the target (see CMakeLists.txt)
  • VulkanSDK (1.2.162.1 or higher)

Linux:

  • Install SDL2 with package manager

Windows:

Deploy

To integrate rayex in an existing C++ / CMake project, please follow the steps below. Alternatively, build rayex yourself.

  1. Download pre-built binaries for your system and place them inside your project (assuming myProject/external/rayex).

  2. Inside your project's CMakeLists.txt:

    1. Include "include/CMakeLists.txt"
    include(${PROJECT_SOURCE_DIR}/external/rayex/include/CMakeLists.txt)
    
    1. Include all rayex headers
    target_include_directories(example PRIVATE ${RAYEX_INCLUDE_DIRS})
    
    1. Inform CMake about the location of rayex and all third party libraries
    target_link_directories(example PRIVATE ${RAYEX_LINK_DIRS})
    
    1. Link your target against rayex and all third party libraries
    target_link_libraries(example ${RAYEX_LIBRARIES})
    

Build

Alternatively, build rayex yourself:

$ git clone https://github.com/chillpert/rayex --recursive
$ cd rayex 
$ mkdir build && cd build
$ cmake ..
$ make

Note: On Windows open the Visual Studio solution file (.sln) in the build directory and compile instead of $ make.

Examples

The following code snippet shows how to render a single mesh. For a proper example, take a look at the documentation and at the official examples-repository for rayex.

#include "Rayex.hpp"

int main( )
{
    // Initialize the renderer.
    rx::Rayex renderer;
    renderer.init( );
    
    // Load some geometry and submit it to rayex.
    auto cube   = rx::loadObj( "cube.obj" );
    renderer.scene( ).submitGeometry( cube );

    // Create an instance of the geometry from above and submit it for rendering.
    auto cubeInstance = rx::instance( cube );
    renderer.scene( ).submitGeometryInstance( cubeInstance );

    // The main loop.
    while ( renderer.isRunning( ) )
    {
        renderer.run( );
    }
}

Documentation

A documentation of all classes and functions can be found here.

Current State

Issues

  • Fix hardware evaluation (in VkCore)
  • Crashes again when GUI disabled
  • Do a complete C++ guidelines check
  • Test Windows build
  • Remove unncessary includes (especially in PCH)
  • Provide new binaries for all platforms
  • Enable all warnings for rayex and disable all warnings for third party
  • Test rayex deploy with only headers and libs again
  • Remove any paths set at compile time
  • Remove big examples and put it in separate repo (combined with )
  • Consider decreasing project size
  • Fix camera reset when moving mouse after loading a scene
  • SDL2main is unnecessary - remove it
  • Set up a tool chain that automatically converts any texture to a ktx format of any given model (using toktx, from PNG) - OR - remove ktx and try to use STB image only
  • figure out why everything needs be linked twice
  • fix validation errors on latest Vulkan SDK

Planned Features

  • Use rasterization for primary rays
  • Improve documentation (especially requirements for model loading)
  • Improved acceleration structure handling with optional performance tweaks
  • Implement stochastic level of detail
  • Multiple importance sampling
  • HDR skymaps and skyboxes as light sources
  • Denoising
  • Add area light sampling for next event estimation

About

A cross-platform, cross-vendor, Vulkan-based, path tracer.

Resources

License

Stars

Watchers

Forks

Packages

No packages published