Microsoft Introduces DirectX Raytracing Bringing Photorealistic, Movie-Quality 3D To Games

Microsoft says that 3D gaming today is a lie. While the techniques game designers use can make games on your screen look like they're 3D, the rasterization process used ultimately only operates in two dimensions with 3D primitives mapped onto it via transformation matrices.

ray tracing

Things are changing with the introduction today of a DirectX 12 technique that aims to bridge the gap between rasterization techniques used today and the full 3D effects of tomorrow. The new feature that will do this is called DirectX Raytracing (DXR). DXR allows current techniques like screen-space reflections (SSR) to "naturally and efficiently" fill gaps left by rasterization.

Microsoft says that DXR adds four new concepts to the DirectX 12 API:

  1. The acceleration structure is an object that represents a full 3D environment in a format optimal for traversal by the GPU. Represented as a two-level hierarchy, the structure affords both optimized ray traversal by the GPU, as well as efficient modification by the application for dynamic objects.
  2. A new command list method, DispatchRays, which is the starting point for tracing rays into the scene. This is how the game actually submits DXR workloads to the GPU.
  3. A set of new High-Level Shader Language (HLSL) shader types including ray-generation, closest-hit, any-hit, and miss shaders. These specify what the DXR workload actually does computationally. When DispatchRays is called, the ray-generation shader runs. Using the new TraceRay intrinsic function in HLSL, the ray generation shader causes rays to be traced into the scene. Depending on where the ray goes in the scene, one of several hit or miss shaders may be invoked at the point of intersection. This allows a game to assign each object its own set of shaders and textures, resulting in a unique material.
  4. The raytracing pipeline state, a companion in spirit to today’s Graphics and Compute pipeline state objects, encapsulates the ray tracing shaders and other state relevant to ray tracing workloads.

Microsoft says that no new GPU engine is required for DXR; all DXR workloads can be run on either of DX12's existing engines. Microsoft wrote, "The primary reason for this is that, fundamentally, DXR is a compute-like workload. It does not require complex state such as output merger blend modes or input assembler vertex layouts. A secondary reason, however, is that representing DXR as a compute-like workload is aligned to what we see as the future of graphics, namely that hardware will be increasingly general-purpose, and eventually most fixed-function units will be replaced by HLSL code."

DXR can be broken down into two basic steps with the first being building the acceleration structures that operate on a two-level hierarchy. The second step is using DXR to create the ray tracing pipeline state. Microsoft notes that PIX for Windows will support DirectX Raytracing API from day one. Microsoft wrote, "PIX on Windows supports capturing and analyzing frames built using DXR to help developers understand how DXR interacts with the hardware. Developers can inspect API calls, view pipeline resources that contribute to the raytracing work, see contents of state objects, and visualize acceleration structures. This provides the information developers need to build great experiences using DXR."

pix windows

The big questions for gamers is what exactly will this mean for games moving forward? DXR will at first be tasked with supplementing current rendering techniques such as screen space reflections to fill in data from geometry that has either been occluded or is off-screen (which should lead to an increase in image quality). But as techniques improve, developers get more confident and hardware becomes more powerful, Microsoft expects that DXR will be used for true global illumination and may completely replace rasterization as the standard algorithm for 3D scene rendering.

The screenshot at the top of the story is from SEED, Electronic Arts and gives a glimpse at what scenes in future games might look like. Microsoft also says that it has been working with hardware vendors and developers for nearly a year to design and tune the API. Thanks to that work, Microsoft notes that a "significant number" of studios and engines are planning to integrate DXR support into games. Among those are EA's Frostbite, EA's Seed, Epic Games' Unreal Engine, Futuremark 3DMark, and Unity Engine. Microsoft partner NVIDIA has already announced its efforts to push towards a ray tracing future with NVIDIA RTX.