Fixing typos and adding more details

This commit is contained in:
mklefrancois 2020-04-06 11:03:18 +02:00
parent 90bebea66b
commit 21fc655237
5 changed files with 12 additions and 4 deletions

View file

@ -91,7 +91,7 @@ Replacing if/else by callable shaders. The code to execute the lighting is done
## [Ray Query](vkrt_tuto_rayquery.md.htm)
Inkoking ray interestion queries directly from the fragment shader to cast shadow rays.
Invoking ray intersection queries directly from the fragment shader to cast shadow rays.
* Ray tracing directly from the fragment shader

View file

@ -202,7 +202,7 @@ Finally, here is the Vulkan Device Memory view from Nsight Graphics:
We can also modify the code to use the [Vulkan Memory Allocator](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator) from AMD.
Download [vk_mem_alloc.h](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/blob/master/src/vk_mem_alloc.h) from GitHub and add this to the `current` folder.
Download [vk_mem_alloc.h](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/blob/master/src/vk_mem_alloc.h) from GitHub and add this to the `shared_sources` folder.
There is already a variation of the allocator for VMA, which is located under [nvpro-samples](https://github.com/nvpro-samples/shared_sources/tree/master/nvvkpp). This allocator has the same simple interface as the `AllocatorDedicated` class in `allocator_dedicated_vkpp.hpp`, but will use VMA for memory management.
@ -249,8 +249,7 @@ In `setup()`
VmaAllocatorCreateInfo allocatorInfo = {};
allocatorInfo.physicalDevice = physicalDevice;
allocatorInfo.device = device;
allocatorInfo.flags |=
VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT | VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT;
allocatorInfo.flags = VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT;
vmaCreateAllocator(&allocatorInfo, &m_vmaAllocator);
m_alloc.init(device, m_vmaAllocator);
~~~~

View file

@ -186,6 +186,10 @@ At the begining of `HelloVulkan::raytrace`, call
The application will now antialias the image when ray tracing is enabled.
Adding `resetFrame()` in `HelloVulkan::onResize()` will also take care of clearing the buffer while resizing the window.
## Resetting Frame on UI Change
The frame number should also be reset when any parts of the scene change, such as the light direction or the background color. In `renderUI()` in `main.cpp`, check for UI changes and reset the frame number when they happen:

View file

@ -185,6 +185,10 @@ void main()
}
~~~~
!!! Note
Adding a new shader requires to rerun CMake to added to the project compilation system.
## `main.cpp`
In `main`, after we set which hit group an instance will use, we can add the data we want to set through the shader record.

View file

@ -1601,6 +1601,7 @@ tracing descriptor set. Add the binding of the material buffer and the array of
```` C
layout(binding = 1, set = 1, scalar) buffer MatColorBufferObject { WaveFrontMaterial m[]; } materials[];
layout(binding = 3, set = 1) uniform sampler2D textureSamplers[];
layout(binding = 4, set = 1) buffer MatIndexColorBuffer { int i[]; } matIndex[];
````
The declaration of the material is the same as that used for the rasterizer and is defined in