Add vk_ray_trace_indirect_scissor sample
This commit is contained in:
parent
27d8a79ce3
commit
a6690f149a
30 changed files with 4498 additions and 6 deletions
BIN
docs/Images/indirect_scissor/bounding.png
Normal file
BIN
docs/Images/indirect_scissor/bounding.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
BIN
docs/Images/indirect_scissor/bounding2.png
Normal file
BIN
docs/Images/indirect_scissor/bounding2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 981 KiB |
BIN
docs/Images/indirect_scissor/intro.png
Normal file
BIN
docs/Images/indirect_scissor/intro.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
BIN
docs/Images/indirect_scissor/rgb.png
Normal file
BIN
docs/Images/indirect_scissor/rgb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 265 KiB |
BIN
docs/Images/indirect_scissor/shadows.png
Normal file
BIN
docs/Images/indirect_scissor/shadows.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 MiB |
|
|
@ -35,16 +35,17 @@ See also [build_all](https://github.com/nvpro-samples/build_all) from nvpro-samp
|
|||
## Latest Vulkan SDK
|
||||
|
||||
This repository tries to always be up to date with the latest Vulkan SDK, therefore we suggest to download and install it.
|
||||
Version 1.2.162.0 and up has ray tracing extensions support.
|
||||
|
||||
**Vulkan SDK**: https://vulkan.lunarg.com/sdk/home
|
||||
|
||||
|
||||
## Beta Installation
|
||||
## Driver
|
||||
|
||||
KHR ray tracing is still in Beta, therefore you will need the latest
|
||||
Vulkan driver.
|
||||
NVIDIA driver 160.0 and up support Vulkan ray tracing.
|
||||
|
||||
**Latest driver**: https://developer.nvidia.com/vulkan-driver
|
||||
* Standard driver: https://www.nvidia.com/Download/index.aspx
|
||||
* Vulkan beta driver: https://developer.nvidia.com/vulkan-driver
|
||||
|
||||
|
||||
## CMake
|
||||
|
|
|
|||
1505
docs/vkrt_tuto_indirect_scissor.md.htm
Normal file
1505
docs/vkrt_tuto_indirect_scissor.md.htm
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1697,11 +1697,17 @@ the usage flag to include that stage. This was done in section Additions to the
|
|||
|
||||
## updateUniformBuffer
|
||||
|
||||
The computation of the matrix inverses is done in `updateUniformBuffer`, after setting the `ubo.proj` matrix:
|
||||
The computation of the matrix inverses is done in `updateUniformBuffer`, after setting the `hostUBO.proj` matrix:
|
||||
|
||||
```` C
|
||||
// #VKRay
|
||||
ubo.projInverse = nvmath::invert(ubo.proj);
|
||||
hostUBO.projInverse = nvmath::invert(hostUBO.proj);
|
||||
````
|
||||
|
||||
We also have to indicate that the UBO will be used in the raytracing shaders.
|
||||
```` C
|
||||
auto uboUsageStages = vk::PipelineStageFlagBits::eVertexShader
|
||||
| vk::PipelineStageFlagBits::eRayTracingShaderKHR;
|
||||
````
|
||||
|
||||
## Ray generation (raytrace.rgen)
|
||||
|
|
@ -2164,6 +2170,20 @@ At the end of the method, we destroy the shader module for the shadow miss shade
|
|||
The spec does not guarantee a recursion check at runtime. If you exceed either
|
||||
the recursion depth you reported in the raytrace pipeline create info, or the
|
||||
physical device recursion limit, undefined behaviour results.
|
||||
|
||||
The KHR raytracing spec lowers the minimum guaranteed recursion limit from
|
||||
31 (in the original NV spec) to the much more modest limit of 1 (i.e. no
|
||||
recursion at all). Since we now need a recursion limit of 2, we should check
|
||||
that the device supports the needed level of recursion:
|
||||
|
||||
```` C
|
||||
// Spec only guarantees 1 level of "recursion". Check for that sad possibility here.
|
||||
if (m_rtProperties.maxRayRecursionDepth <= 1) {
|
||||
throw std::runtime_error("Device fails to support ray recursion (m_rtProperties.maxRayRecursionDepth <= 1)");
|
||||
}
|
||||
````
|
||||
|
||||
Recall that `m_rtProperties` was filled in in `HelloVulkan::initRayTracing`.
|
||||
|
||||
## `traceRaysKHR`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue