Microsoft Introduces DirectX Raytracing
Written by Kay Ewbank   
Friday, 23 March 2018

Microsoft has announced a way of specifying the details of 3D scenes for rendering. DirectX Raytracing (DXR) is a new API that will be included in DirectX 12. Aimed at providing more realistic lighting and shadows, it will enable DirectX applications to use hardware-accelerated raytracing.

Currently, if you want to render a 3D image on screen, the technique used is almost certainly that of rasterization. This takes a 3D definition of an image and maps it to 2D using transformation matrices. The problem is that rasterization works out what colors should be seen at any point by taking the 2D representation of the 3D object, and at each point on the screen, working out what would be visible at that point, and applying a color and light effect. Problems arise when objects outside the field of view should cast a shadow, for example, or should be reflected in something shiny on the screen.

Microsoft says that techniques such as screen-space reflection (SSR) and global illumination (which attempt to overcome the problems described above) are pushing rasterization to its limits. Because DirectX Raytracing allows the traversal of a full 3D representation of the game world, it lets current rendering techniques such as SSR fill the gaps left by rasterization. Support for DXR has already been announced for Pix on Windows. Pix is a performance tuning and debugging tool for game developers.

Pix now supports DXR

A simplified view of the way that raytracing works is that rays of light are projected from all the light sources in the 3D scene. The light rays are bounced around the scene at the correct angles depending on their original source. When they encounter an object, that object is illuminated according to the way it would be in real life. Full raytracing is computationally too demanding to run on current hardware, but DirectX Raytracing replicates some parts of the idea. While full raytracing looks at how all objects affect each other, DXR concentrates on the problematic elements such as reflections and shadows. Developers will be able to define rays and the route they should take.

DirectX Raytracing (DXR) adds four concepts to the DirectX 12 API, starting with an acceleration structure. This is an object that represents a full 3D environment in a format designed for traversal by the GPU.  You than use a new method, DispatchRays, as the starting point for tracing rays into the scene.  This is how the game actually submits DXR workloads to the GPU.

The details of what the DXR workload should do are defined using a set of new HLSL shader types including ray-generation, closest-hit, any-hit, and miss shaders.  When DispatchRays is called, the ray-generation shader runs, and causes rays to be traced into the scene.  Depending on where the ray goes in the scene, hit or miss shaders may be invoked. A game can assign each object its own set of shaders and textures.

The final new addition is a raytracing pipeline state. Microsoft says this is a companion in spirit to today’s Graphics and Compute pipeline state objects, and is used to encapsulate the raytracing shaders and other state relevant to raytracing workloads.

In terms of hardware support, Microsoft says:

"Developers can use currently in-market hardware to get started on DirectX Raytracing.  There is also a fallback layer which will allow developers to start experimenting with DirectX Raytracing that does not require any specific hardware support." 

In practical terms, applications using DXR will work with Nvidia's Volta architecture, and if DXR catches on there will undoubtedly be support from most hardware manufacturers. 

directxicon

 

More Information

Experimental DXR SDK

Related Articles

PIX For Windows Introduced

DirectX Tool Kit For DirectX 12 - 3D For The Rest Of Us? 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Quantum Computers Really Are A One Trick Pony
17/03/2024

Google is offering $5 million if you can think up a use for a quantum computer. Wait, I thought quantum computers were the next big thing, a revolution! Surely we know what they can do?



Apache Lucene Adds Similarity Vector Searches
27/02/2024

Apache Lucene 9.10 has been released with support for similarity-based vector searches. Other improvements include block join compatible index sorting, and several improvements to ensure the software  [ ... ]


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Friday, 23 March 2018 )