• Stars
    star
    613
  • Rank 73,175 (Top 2 %)
  • Language
    C++
  • License
    BSD 3-Clause "New...
  • Created about 6 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Getting Started with RTX Ray Tracing

Getting Started with RTX Ray Tracing

This directory contains Chris Wyman's shader tutorials from the GDC 2019 and SIGGRAPH 2018 courses "Introduction to DirectX Raytracing". Visit the SIGGRAPH course webpage to get more details, more descriptive code walkthroughs, some prebuilt tutorial binaries, course presentations, and other information about the course.

Please read this document carefully before trying to build our tutorials. Given DirectX Raytracing is new, building code that relies on it can easily break in surprising ways if you do not have the latest requirements. We have tried to specify all requirements and caveats, to avoid pain in getting started, and we will update this tutorial code as requirements change. Please contact us or log an issue if you run into unexpected troubles not covered below.

Also note: None of the tutorial examples are intended to demonstrate best practices for highly optimized performance. These samples are optimized to provide an easy starting point, clarity, and general code readability (rather than performance).

Source code for our tutorials and shaders is licensed under a BSD license. Models, textures, and other resources have their own licenses (see 'Acknowledgments' below).

Software/Hardware Requirements:

  1. This code.
    • If you clone this repository using a command window, please use the standard Windows CMD window, not a Linux shell, which can alter the CR/LF in project files and make them fail with errors such as "c1xx : fatal error C1083: Cannot open source file: '..\SharedUtils\FullscreenLaunch.cpp': No such file or directory" and similar when building the code.
  2. Windows 10 RS5.
    • If you run "winver.exe" you should see Version 1809 (OS Build 17763) or later.
    • See older versions of this repository for unsupported code that runs on RS4 (v1803).
  3. Microsoft Visual Studio 2017.
  4. Windows 10 SDK 10.0.17763.0 (aka Windows 10 SDK, version 1809).
    • Download SDK
    • Note: Later SDK versions probably work, but you need to change each Visual Studio project to look for the SDK you download, rather than 10.0.17763.0.
  5. A graphics card supporting DirectX Raytracing.
  6. An NVIDIA driver that natively supports DirectX Raytracing.
    • Includes most public drivers version 400 or later.
    • We recommend updating to recent drivers to provide highest performance and stability when ray tracing.
  7. Make sure you get Falcor from (https://github.com/NVIDIAGameWorks/Falcor) and checkout the commit tagged v3.1 (commit 5a12f298c15b82297447906afafdcf5a2f58f99e).
    • The repo should be setup with a submodule to do this automatically.
    • This version of Falcor should reside in the Falcor/ subdirectory of the GettingStartedWithRTXRayTracing repository.
    • If compiling gives a bunch of undefined references and cast conversion errors, you have the wrong version of Falcor.
    • We plan to update these tutorials once more for Falcor 4.0, perhaps including as part of the distribution.
  8. Make sure to build a "ReleaseD3D12" (or "DebugD3D12") version of the samples.

Getting started:

Satisfying the requirements above, you're ready to get started.

You should be able to install the tutorials directory almost anywhere. However, we have run into problems with the build scripts if the install directory contains spaces. For now, we suggest avoiding that.

Before compiling, you need to include Falcor and download Falcor dependencies. Falcor itself is downloaded by the link on the Github page for these Getting Started program, which currently leads to this Falcor 3.1 repo. If not done automatically, download and put these files in the Falcor/ directory.

Next, run update_dependencies.bat in the Falcor/ directory. It should download a bunch of packages and put them in Falcor/Framework/Externals/ and Falcor/Media/. The Visual Studio solution will call this script for you via a pre-build step, but it sometimes gives confusing error messages when starting a parallel build. This is not a problem if you run the script manually.

Now open the Visual Studio solution GettingStartedWithRTXRayTracing.sln. We suggest you initially choose the "ReleaseD3D12" configuration to begin, as programs will start up and run faster. Then "Build | Build Solution" to build all the tutorial programs. In the Solution Explorer you right-click and choose "Set as StartUp Project" to run that tutorial.

Most tutorials load a default scene (the "modern living room" from Benedikt Bitterli's page). We also include one other simple scene in directory Falcor/Media/Arcade/. Additional, more complex scenes can be downloaded from the Open Research Content Archive:

Troubleshooting:

Visual Studio gives "Error MSB3073" when building. This is an issue with the pre-build step, and we've seen it in the following cases:

  • The installation directory name (or parent directories) contains a space.
  • You ran a parallel build; our pre-build script gets called for each tutorial and fails on all except the first. This is usually a one-time error and rebuilding solves the problem.
  • There are installation problems with the dependencies. Remove the "Falcor/Media/" directory and all subdirectories in the Falcor/Framework/Externals/ directory (you can do this with delete_dependencies.bat) and rerun update_dependencies.bat in the Falcor/ directory.

Visual Studio gives "c1xx : fatal error C1083: Cannot open source file: '..\SharedUtils\FullscreenLaunch.cpp': No such file or directory" or similar when building. As noted in step 0, cloning the repository with Git under certain shells such as Ubuntu can cause problems with end of line characters and so alter project files. Use the Windows CMD command prompt, or if all else fails, download the zip.

Tutorial Information:

Note the UI has a number of slightly-hidden features. Hover your mouse over the "(?)" next to "Keyboard Shortcuts" at the top of the menu on the left to see some useful key shortcuts. "Global Controls" can be viewed by clicking on the small arrow to the left of this text.

The mouse orbits and WASD moves the camera through the scene, along with Q and E for down and up. Camera movement can be made slower by holding down "Ctrl" and faster by holding down "Shift."

Each tutorial demonstrates how to implement some basic rendering algorithm. Much of the focus of each is the set of shaders in the Shaders directory. You are encouraged to modify these shaders and the rest of the code as you wish. One nice feature of the Falcor framework is that you can modify and reload the shaders without restarting the program. While focused on the program, press F5 and then change the view or toggle some feature that causes a refresh. The new shaders should then take effect.

Additional Resources for DirectX Raytracing:

Chris has a code walkthrough for his shader tutorials. You can download most of the prebuilt binaries (please read the readme to avoid issues; also, does not include the Sphereflake demo).

Other useful resources:


Acknowledgments:

The desert HDR environment map (MonValley Dirtroad) is provided from the sIBL Archive under a Creative Commons license CC BY-NC-SA 3.0 US.

The included "pink_room" scene is named 'The Modern Living Room' by Wig42 on Benedikt Bitterli's webpage. It has been modified to match the Falcor material system. This scene was released under a CC-BY license. It may be copied, modified and used commercially without permission, as long as: Appropriate credit is given to the original author The original scene file may be obtained here.

The moon texture came from here under CC BY 4.0 license.

The earth texture is public domain from here.

The normal map texture is licensed CC0 from here.

More Repositories

1

kaolin

A PyTorch Library for Accelerating 3D Deep Learning Research
Python
4,452
star
2

PhysX

NVIDIA PhysX SDK
C++
2,893
star
3

Falcor

Real-Time Rendering Framework
C++
2,615
star
4

PhysX-3.4

NVIDIA PhysX SDK 3.4
C++
2,307
star
5

kaolin-wisp

NVIDIA Kaolin Wisp is a PyTorch library powered by NVIDIA Kaolin Core to work with neural fields (including NeRFs, NGLOD, instant-ngp and VQAD).
Python
1,450
star
6

rtx-remix

Combined repo for the RTX-Remix runtime
1,369
star
7

DxrTutorials

C++
834
star
8

RTXGI-DDGI

RTX Global Illumination (RTXGI)
C++
689
star
9

RTX-Path-Tracing

Real-time path tracing library and sample
C++
624
star
10

FleX

C++
579
star
11

nvrhi

C++
525
star
12

RayTracingDenoiser

NVIDIA Ray Tracing Denoiser
HLSL
512
star
13

FaceWorks

A middleware library and sample application for high-quality skin and eye rendering
C++
450
star
14

NVIDIAImageScaling

NVIDIA Image Scaling SDK
C
426
star
15

Streamline

Streamline Integration Framework
C
400
star
16

RTXDI

C++
356
star
17

Blast

A modular destruction SDK designed for performance and flexibility, replacing APEX destruction
C++
331
star
18

dxvk-remix

C++
307
star
19

NvCloth

C
296
star
20

KickstartRT

KickstartRT SDK
C++
185
star
21

Flow

Flow is a sparse grid-based fluid simulation library for real-time applications.
C
168
star
22

donut

C++
164
star
23

HBAOPlus

HBAO+
C++
160
star
24

bridge-remix

This is the NVIDIA RTX Remix Runtime Bridge repository
C++
146
star
25

Displacement-MicroMap-Toolkit

C++
130
star
26

SpatiotemporalBlueNoiseSDK

C
127
star
27

UnityPhysXPlugin

Experimental Unity package to enable access to NVIDIA PhysX SDK 4 from within Unity.
C#
122
star
28

NRI

C++
90
star
29

RTXMU

C++
89
star
30

ShaderMake

Shader Compilation Tool
C++
78
star
31

donut_examples

C++
72
star
32

NRDSample

C++
69
star
33

GeForceNOW-SDK

This is the home of the SDK for GeForce NOW
C
65
star
34

KickstartRT_demo

Repo for KickstartRT demo application
C++
50
star
35

Opacity-MicroMap-SDK

Opacity Micro-Map SDK Source Repository
C++
36
star
36

MathLib

C++
28
star
37

Displacement-MicroMap-SDK

C++
19
star
38

Streamline_Sample

C++
17
star
39

nas-sample

C++
16
star
40

ComfyUI-RTX-Remix

ComfyUI RTX Remix
Python
14
star
41

Opacity-MicroMap-Samples

Samples repository for the Opacity MicroMap SDK
C++
11
star
42

Displacement-MicroMap-BaryFile

C++
11
star
43

NRIFramework

C
8
star
44

NRISamples

C++
7
star
45

rtxdi-runtime

HLSL
2
star