Code comments
This commit is contained in:
parent
b77417e7c8
commit
a467d94159
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
* Copyright (C) 2023 by Sascha Willems - www.saschawillems.de
|
||||||
*
|
*
|
||||||
|
|
@ -705,6 +705,10 @@ public:
|
||||||
{
|
{
|
||||||
uniformData.projInverse = glm::inverse(camera.matrices.perspective);
|
uniformData.projInverse = glm::inverse(camera.matrices.perspective);
|
||||||
uniformData.viewInverse = glm::inverse(camera.matrices.view);
|
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++;
|
uniformData.frame++;
|
||||||
memcpy(ubo.mapped, &uniformData, sizeof(uniformData));
|
memcpy(ubo.mapped, &uniformData, sizeof(uniformData));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue