Git Product home page Git Product logo

kickstartrt's Introduction

Kickstart RT

  1. What's Kickstart RT
  2. How it works
  3. Getting Started
  4. License
  5. Release Notes

1. What's Kickstart RT

This SDK aims to achieve higher quality reflection and GI rendering than traditional screen space techniques, using hardware ray-tracing functionality without having to set up shaders and shader resources for ray-tracing.
When implementing ray-tracing into an existing game engine, one of the biggest problems is preparing the shaders for reflection and GI rays. All of the countless shaders that exist in a game scene must be listed and configured. We also need to make sure that the various shader resources (ConstantBuffer, Texture, etc.) can be accessed correctly from those shaders for each material. This can be a very complex task.
Instead of setting up all the shaders, this SDK takes the lighting information from a rendered G-Buffer and stores it in a world space cache. Therefore, the application does not need to modify any shaders for ray-tracing. Internally, the SDK creates reflection and GI information by sampling the lighting information using ray-tracing. This is the biggest difference from screen space based techniques as lighting information for off-screen objects will also be sampled if it is stored in the SDK.

Is this a complete replacement for ray-traced reflection or GI?

No, it is not.
First, Kickstart RT takes the lighting information from the G-Buffer and stores it in world space, but the SDK doesn't take into account what components it consists of (Diffuse, Specular, Fresnel etc...). It also does not take into account the material of the surfaces. Any surface of material that the ray hits will be evaluated as a full Lambertian, so the lighting information from the G-Buffer will be treated as radiance. This is a major compromise but it frees the application from having to manage the materials for ray-tracing. Additionally, each pixel in screen space (i.e.the starting point for ray-tracing) can be evaluated as a material by passing texture parameters such as specular and roughness. However, if there is a sudden change in the lighting environment or object movement in the scene, the lighting information stored in the SDK may become stale and wont represent the current lighting conditions very well. In order to update the changed lighting, multiple G-Buffers containing the new lighting information must be continuously provided to the SDK for several frames. Thus there is also increased latency there which is another compromise.

2. How it works

For detailed information of Kickstart RT, please refer to the separate documents includes in the docs. Here's a rough idea of how it works

  1. The application passes the vertex and index buffers of the geometry in the scene to the SDK so that it builds the BVH of the scene internally. The SDK also receives information such as updates on geometry shapes, instance position, newly placed or removed instances etc...
    Slide1

  2. The application passes the G-buffer containing the lighting along with depth and normal information to the SDK. The SDK stores the information of the G-buffer in the lighting cache in world space. It also receives the projection matrix and view matrix information along with the G-Buffer which are needed to reconstruct world space position.
    Slide2

  3. SDK performs raytracing internally and passes Reflection and GI results to the application. The SDK performs raytracing based on the camera position specified by the application. It renders reflections and GI using information from the lighting cache (built in world space), and returns the result to the application as a texture.
    Slide3

3. Getting Started

Kickstart RT is designed from the ground up to provide a simple interface to common implementations of ray tracing techniques used in modern games. It provides API support in Direct3D11/12 & Vulkan. It can be compiled to Windows or Linux platforms including ARM instruction sets.
Kickstart RT is designed to be a dynamically linked runtime library that is linked to your application at build time. We provide full source code to all parts of the library so that you may build it yourself. In addition to browsing the sample code, we encourage you to check out the formal documentation listed here.

Requirements

The requirements to use Kickstart RT when built from source.

Windows
  • Cmake 3.22+
    Tested with : 3.22.0
  • Visual Studio 2019+
    Tested with : Microsoft Visual Studio Professional 2022 (64-bit) Version 17.0.1
  • Vulkan SDK
    Should be worked with 1.2 or higher. Tested with : 1.3.204.0 and 1.2.189.
  • Windows10 SDK
    Any recent one should be fine. Tested with : 10.0.20348.0.
  • PIX EventMarker runtime
    If you want to enable perf marker in SDK’s render passes. Tested with : 1.0.220124001.
Linux
  • Cmake 3.22+
  • Vulkan SDK
    Should work with 1.2 or higher. Tested with 1.2.189.
  • gcc/g++ 9.3 or above

GPU Requirements

The SDK checks for the following feature support at initialization time. It doesn’t mean that the SDK guarantees to support all GPUs that fulfills the following features.

  • D3D11

    • D3D11.4
      Needs to support ID3D11Device5 to handle fence objects.
  • D3D12 and 11 D3D11 uses D3D12 as a backend of the rendering, so the requirement is basically the same.

    • D3D12_RESOURCE_BINDING_TIER_3
    • D3D12_RAYTRACING_TIER_1_0 or greater. Need 1.1 for Inline Raytracing.
  • Vulkan
    Instance Extensions

    • VK_EXT_debug_utils

    Physical Device features

    • VK_EXT_buffer_device_address
    • VK_KHR_acceleration_structure
    • VK_KHR_ray_tracing_pipeline

    Device Extensions

    • VK_KHR_ray_tracing_pipeline
    • VK_KHR_ray_query If enabling inline ray tracing.

Build Steps

Kickstart is built using CMake, so the build instructions are pretty standard.

Windows build instructions
  1. Clone the repository
    git clone --recursive https://github.com/NVIDIAGameWorks/KickstartRT
  2. Set up dependent libraries
    • Windows SDK
      You can download and install from here.
    • Vulkan SDK
      You can download and install from here. The installer will set VULKAN_SDK environment variable by default, and the CMake file refers it to find out the location of the SDK. So, please be sure to set the value properly.
    • PIX WinPixEventRuntime
      If you want to enable PIX in the SDK's render passes, you need to install PIX runtime which can download from here. There are two options to enable PIX in the SDK.
      • Set PIX_EVENT_RUNTIME_SDK environment variable with the path to the lib before configuring CMake.
      • Set KickstartRT_PIX_EVENT_RUNTIME_SDK_PATH in the CMake's configuration with the path to the lib.
  3. CMake confiture and generate projects.
    You can use CMake GUI to configure project files. You can set the destination folder anywhere. However, build directory just under the repository is preferred since it is already noted in .gitignore.
  4. Build
    Open the Visual Studio solution which should be generated under build directory and build ALL_BUILD and INSTALL.
    After INSTALL, built files will be assembled into build/package directory. You can then copy this package into your game engine for integration.
Linux build instructions
  1. Clone the repository recursively
    git clone --recursive https://github.com/NVIDIAGameWorks/KickstartRT

  2. Download and install the Vulkan SDK here. If built from sources, remember to run the setup_env.sh script to set up the required environment variables.

  3. Ensure gcc 9.3 is installed. This has been tested with gcc 9.3 and is required for the C++17 functionality. If you have an older version of gcc installed, please update otherwise you will get compilation issues with #include <filesystem>

    sudo apt install gcc-9 g++-9

  4. Windows resource files have been emulated with some CMake magic which has restrictions when adding new shaders. The shader rc file is dynamically creating at build time, rather than build generation time, so a pre-populated resource file is included in the project which will get over-written on the first build. If a new shader is added and the project has not been built yet, then the pre-populated rc file will need updating or Kickstart RT will fail to find the new shader.

4. License

This project is under the MIT License, see the LICENSE.txt file for details. Also, you may need to check licenses for dependent components.

5. Release Notes

Version-0.9.0

  • Initial vresion.

Version-1.0.0

  • Changed RegisterGeometry to accept multiple vertex/index pairs for inputs.
    • Changed GeometryInput struct.
    • Added struct GeometryComponet as a sub struct of GeometryInput.
  • Added DirectLightTransfer task
    • Added enum RenderTask::Task::Type::DirectLightTransfer.
    • Added struct DirectLightTransferTask.
    • Added bool GeometryInput::allowLightTransferTarget.
  • Added parameters to optimize raytracing workload.
    • Added DirectLightingInjectionTask::injectionResolutionStride to optimize light injection tasks.
    • Added TraceTaskCommon::maxRayLength to optimize ray tracing tasks.
  • Added functionality to control BVH's participants of each render tasks.
    • Added enum BVHTask::InstanceInclusionMask
  • Changed to allocate single descriptor heap for all render tasks.
  • Updated NRD to v3.9.2.

kickstartrt's People

Contributors

github-actions[bot] avatar tiont avatar tksgmsy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kickstartrt's Issues

Vulkan validation error in BVHBuildTask

Hello,
I have this validation error multiple times (one per BLAS or TLAS I think) when I execute BVHBuildTask.
I tried to set this buffer usage flag to all my buffers so I don't think it's coming from my implementation or I forgot to set up a feature?

EDIT: I created a minimal main to reproduce.

Vulkan SDK: 1.3.224.1
KickstartRT: v1.0.0 (VULKAN)

VUID-vkCmdBuildAccelerationStructuresKHR-geometry-03673(ERROR / SPEC): msgNum: -1971459747 - Validation Error: [ VUID-vkCmdBuildAccelerationStructuresKHR-geometry-03673 ] Object 0: handle = 0x205e9ab1730, type = VK_OBJECT_TYPE_DEVICE; Object 1: handle = 0x2d0f10000000124, name = KS:SharedBufferForVertexTemp, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0x8a7de95d | vkCmdBuildAccelerationStructuresKHR(): The buffer associated with pInfos[0].pGeometries[0].geometry.triangles.vertexData was not created with VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR. The Vulkan spec states: The buffers from which the buffer device addresses for all of the geometry.triangles.vertexData, geometry.triangles.indexData, geometry.triangles.transformData, geometry.aabbs.data, and geometry.instances.data members of all pInfos[i].pGeometries and pInfos[i].ppGeometries are queried must have been created with the VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR usage flag (https://vulkan.lunarg.com/doc/view/1.3.224.1/windows/1.3-extensions/vkspec.html#VUID-vkCmdBuildAccelerationStructuresKHR-geometry-03673)
Objects: 2
[0] 0x205e9ab1730, type: 3, name: NULL
[1] 0x2d0f10000000124, type: 9, name: KS:SharedBufferForVertexTemp

Performance improvements

This issue represents a few new features that will help users get better performance from the Kickstart RT SDK.

Specifically it includes:

  1. Support for global ray shortening
  2. Support for multi-resolution light injection

Improved QoL support for meshes

This issue represents a few quality of life improvements around meshes that we have planned for the 1.0 release.

Specifically it includes

  1. Allow unregister instances from TLAS to temporally hide and exempt from TLAS with keeping the instance with its direct lighting cache.
  2. Support multiple geometries per instance
  3. Improve tile-cache continuity during LOD switching

Please let us know any comments on these features!

Minor typo in git command

Under Build Steps, for both Windows and Linux, it has in the git command "–recursive" when it should have two dashes: "-–recursive".

License to RayTracingDenoiser

It's great that this is MIT licensed, but the RayTracingDenoiser dependency is still under standard GameWorks License.

Can we get RayTracingDenoiser MIT licensed?

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.