What’s New in NVIDIA VKRay

NVIDIA VKRay is a set of three extensions that bring ray tracing functionality to the Vulkan open, royalty-free standard for GPU acceleration. VK_NV_ray_tracing is the stable registered extension for adding ray tracing effects to Vulkan raster applications. The SPV_NV_ray_tracing extension provides the API to write SPIR-V shaders that are compatible with functions in VK_NV_ray_tracing. Developers can write RayGeneration, ClosestHit, AnyHit, Miss and Intersection shaders to create effects such as physically based reflections, natural area light shadows and even global illumination. Applications that use GLSL as their shading language can use GL_NV_ray_tracing extension.

[If you are attending GDC 2019, you can see Vulkan ray tracing it in action at the NVIDIA booth]

Stable API

NVIDIA Introduced Vulkan ray tracing with the experimental VK_NVX_raytracing extension. The updated VK_NV_ray_tracing extension is the final stable version of the NVX experimental extension which is now deprecated. Application developers can confidently build Vulkan applications that take advantage of ray tracing knowing that NVIDIA drivers will support the new extension.

New Callable Shaders

Callable shaders provide applications with the means to reuse shading code across many different objects. This reduces duplication of code, which increases productivity while also allowing for more effective use of GPU shader execution resources.

Applications are now able to dynamically call arbitrary shaders via the shader binding table without going through the ray tracing infrastructure. There are new arguments in vkCmdTraceRaysNV to pass in SBT offsets for callable shaders, similar to the other shader stages.

Callable shaders can be invoked from a ray generation, closest hit or miss shader, as well as from another callable shader.

API Improvements

The new stable extension includes API updates for cleaner code and flexible memory management. Specifically the hit group is now a structure instead of an arbitrary integer. When querying memory requirements for an acceleration build you can now ask for the AS storage requirements or the scratch buffer requirements. You can also independently query the scratch buffer requirements for an update operation. There are also a small handful of cosmetic/naming changes, please refer to the documentation for additional details.

Tutorials

To get started with VKRay please visit https://developer.nvidia.com/rtx/raytracing/vkray

VKRay sample code: https://developer.nvidia.com/vkray-sample-code