Getting Started with RTX Ray Tracing
Switch branches/tags
Nothing to show
Clone or download
Eric Haines
Latest commit 9d13784 Oct 12, 2018
Permalink
Failed to load latest commit information.
01-OpenWindow Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
02-SimpleRasterShader Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
03-RasterGBuffer Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
04-RayTracedGBuffer Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
05-AmbientOcclusion Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
06-TemporalAccumulation Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
07-SimpleAntialiasing Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
08-ThinLensCamera Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
09-LambertianPlusShadows Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
10-LightProbeEnvironmentMap Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
11-OneShadowRayPerPixel Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
12-DiffuseGlobalIllumination Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
13-SimpleToneMapping Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
14-GGXGlobalIllumination Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
CommonPasses Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
DXR-RayTracingInOneWeekend Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
DXR-Sphereflake comment cleanup, and show normalized version better Oct 12, 2018
Falcor Fix linked directory deletion batch file. Oct 9, 2018
SharedUtils Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
.gitignore Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
GettingStartedWithRTXRayTracing.sln Remove unnecessary x86 config, and improve build instructions. Oct 2, 2018
LICENSE.MD Initial commit. Debug version of Falcor.lib left off. Oct 2, 2018
README.MD Fix version number. Oct 9, 2018
sphereflake_zoom.jpg Add an image Oct 2, 2018

README.MD

Getting Started with RTX Ray Tracing

This directory contains Chris Wyman's shader tutorials from the SIGGRAPH 2018 Course "Introduction to DirectX Raytracing" along with an additional "sphereflake" demo. Visit the course webpage to get more details, more descriptive code walkthroughs, some prebuilt tutorial binaries, course presentations, and other information about the course.

Sphereflake zoom

Please read this document carefully before trying to build our tutorials. Given DirectX Raytracing is not fully finalized and stabilized, building code that relies on it is still somewhat complex and can fail in surprising ways. 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. Windows 10 RS4.
    • If you run "winver.exe" you will need the older Version 1803 (OS Build 17134).
    • The tutorials do not yet run on versions of Win 10 RS5, e.g., the current version 1809. We hope to update soon.
    • Later releases will run on Win 10 RS5, once I have time to rebuild and test them there.
  2. For now, Windows needs to be in "Developer Mode."
    • Go to "PC Settings" -> "Updates & Security" -> "For developers".
    • Toggle to "Developer Mode"
  3. Microsoft Visual Studio 2017.
  4. Windows 10 SDK 10.0.16299.91.
    • Download SDK
    • Note: Later SDK versions probably work, but you would need to change each Visual Studio project to look for the SDK you download, rather than 10.0.16299.91. (Do this under Project -> Properties -> Config Properties -> General -> Window SDK Version)
  5. A graphics card supporting DirectX Raytracing.
    • Currently, limited to newer NVIDIA cards, e.g., Titan V and Turing-class cards.
    • Eventually, the tutorials should work via the software fallback. They don't yet. I expect after moving to Windows 10 RS5, the software fallback will be easier to link to simultaneously with vendor-supported DXR drivers.
  6. An NVIDIA driver that natively supports DirectX Raytracing.
    • Includes public drivers after version 396, though we recommend version 400 or later.
    • When we can build and test on the software fallback layer, we will provide some guidance on required drivers for other hardware.
  7. The Release versions will compile and link with the files in this distribution. To link the Debug versions:

Getting started:

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

You should be able to unzip 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 download the other Falcor dependencies. We suggest you do this by running 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.

Open the Visual Studio solution GettingStartedWithRTXRayTracing.sln. We suggest you initially choose the "Release" 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.

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.

For the two standalone demos, "Ray Tracing In One Weekend" and "Sphereflake," you may wish to modify the code named after the demos, in the Passes directory of each. For example, SphereflakeDemoPass.h lets you change how many spheres are generated (we start at 7 for mSizeFactor, but 8 can work on many systems) and whether the spheres are shiny or diffuse.

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.