Skip to content

Commit

Permalink
Code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaWillems committed Nov 28, 2023
1 parent b77417e commit a467d94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/raytracinggltf/raytracinggltf.cpp
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -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));
}
Expand Down

0 comments on commit a467d94

Please sign in to comment.