vk.com

Select your language

Implement HLSL Ray tracing to Vulkan

  DirectX Ray Tracing (DXR) allows you to visualize graphics using ray tracing instead of the traditional rasterization method. This API was created by NVIDIA and Microsoft back in 2018.

  A few months later, NVIDIA unveiled its Turing GPU architecture with its own hardware support to accelerate ray tracing workloads. Since then, the ray tracing ecosystem has been constantly evolving. Several AAA games using DXR have been announced and released, as well as industry standard visualization tools.

  Along with DXR, NVIDIA has delivered an extension for NVIDIA VKRay Vulkan suppliers with the same level of ray tracing functionality. Several Vulkan titles use NVIDIA VKRay, including Quake2 RTX, JX3 (MMO), and Wolfenstein: Youngblood.

  The cross-platform Vulkan API from the Khronos Group can reach a wide audience on a wide variety of platforms and devices. Many developers are migrating content from DirectX to Vulkan to take advantage of this wider market. However, to transfer the header, you need to transfer both API calls (in Vulkan) and shaders (in SPIR-V).

  While most third-party software vendors can handle 3D API calls with some reasonable effort, rewriting HLSL shaders in another shader language is a significant undertaking. Shader source code can evolve over the years. In some cases, shaders are also generated on the fly. Therefore, the cross-platform compiler that translates the source code of the HLSL shader to SPIR-V for Vulkan execution is very attractive to developers.

  One such tool is the server side of SPIR-V for Microsoft's open source DirectXCompiler (DXC). Over the past couple of years, this compiler has become a common, ready-to-use solution for delivering HLSL content to Vulkan. Khronos recently discussed more about using HLSL in Vulkan in a recent post, HLSL as the first-class Vulkan Shading Language.

  Now, combining the use of HLSL and ray tracing in Vulkan, NVIDIA has added ray tracing support to the SPIR-V DXC backend by configuring the SPV_NV_ray_tracing extension under the NVIDIA VKRay extension. It is expected that this work can also be used for the inter-production version of the Vulkan ray tracing extension, which is currently being discussed at Khronos.


You can learn more about this here.