Introduction to Real-Time Ray Tracing with Vulkan

Originally published at: Introduction to Real-Time Ray Tracing with Vulkan | NVIDIA Technical Blog

NVIDIA’s new Turing GPU unleashed real-time ray-tracing in a consumer GPU for the first time. Since then, much virtual ink has been spilled discussing ray tracing in DirectX 12. However, many developers want to embrace a more open approach using Vulkan, the low-level API supported by the Khronos Group. Vulkan enables developers to target many…

Hey Nuno, I have a question (or rather a suggestion) about building the acceleration structure. I've been trying to find more information about this but I think the documentation skips it. As far as I know there is no way of defining the instancing structure so it should be defined in the API but it is nowhere to be found on the documentation. I'm talking about the transform for each bottom level acceleration structure. In the NVIDIA Vulkan examples they use the given struct:

struct VkGeometryInstance
{
float transform[12];
uint32_t instanceId : 24;
uint32_t mask : 8;
uint32_t instanceOffset : 24;
uint32_t flags : 8;
uint64_t accelerationStructureHandle;
};

I found out the hard way that if you do not use this exact struct building the top level acceleration struct will kill the device handle. If this is correct, you might want to mention it in the documentation on vkCmdBuildAccelerationStructureNVX or even in this blog. If not, what do you think is going on with my program ? (Or am I not looking at the wrong or outdated documentation ?)

Hi. Do you have a simple example intersection with one triangle?