diff --git a/examples/raytracinggltf/raytracinggltf.cpp b/examples/raytracinggltf/raytracinggltf.cpp index 2edd9be69..a1a9d257e 100644 --- a/examples/raytracinggltf/raytracinggltf.cpp +++ b/examples/raytracinggltf/raytracinggltf.cpp @@ -1,5 +1,5 @@ /* - * Vulkan Example - Rendering a glTF model using hardware accelerated ray tracing example /for proper transparency, this sample does frame accumulation) + * Vulkan Example - Rendering a glTF model using hardware accelerated ray tracing example (for proper transparency, this sample does frame accumulation) * * Copyright (C) 2023 by Sascha Willems - www.saschawillems.de * @@ -705,6 +705,10 @@ class VulkanExample : public VulkanRaytracingSample { uniformData.projInverse = glm::inverse(camera.matrices.perspective); uniformData.viewInverse = glm::inverse(camera.matrices.view); + // This value is used to accumulate multiple frames into the finale picture + // It's required as ray tracing needs to do multiple passes for transparency + // In this sample we use noise offset by this frame index to shoot rays for transparency into different directions + // Once enough frames with random ray directions have been accumulated, it looks like proper transparency uniformData.frame++; memcpy(ubo.mapped, &uniformData, sizeof(uniformData)); }