nvpro-samples / vk_raytracing_tutorial_KHR

Ray tracing examples and tutorials using VK_KHR_ray_tracing
Apache License 2.0
1.36k stars 143 forks source link

Fix your tutorial please #11

Closed Adi146 closed 3 years ago

Adi146 commented 3 years ago

There are so many errors in you starter tutorial which link to the nv raytracing extension and not to the khr extension. There are also steps missing which cause a lot of frustration (e.g. updating the descriptor sets when updating the camera struct or modifying the closetHit shader). Fortunately the ray_tracing__simple example works perfectly so you can just compare what's missing.

mklefrancois commented 3 years ago

Hi Adi146,

Are you making reference to: https://nvpro-samples.github.io/vk_raytracing_tutorial_KHR? It would be very helpful if you could you pin point to the links that are not KHR, and in which document you found them.

Regarding the modification of the camera structure and the descriptor set, is there something missing in section 5.1?

Can you please be more explicit regarding the missing step you have encounter when modifying the closetHit shader.

I hope the tutorial was somehow useful. There are many more sections, which are going deeper in some of the ray tracing functionalities.

Best regards, -mkl

Adi146 commented 3 years ago

Hi, yes I'm talking about that tutorial.

It seems like I skipped section 5.1 by mistake but it was a little bit confusing cause the application still works until you reach section 10 and some of the modification are not needed until you reach section 11 or 12 so maybe you could move section 5.1 further down. But that was my mistake so don't worry about it to much.

Another point which should be fixed is, that the shader which you download on [section 6.1] (https://nvpro-samples.github.io/vk_raytracing_tutorial_KHR/#raytracingpipeline/addingshaders]) still use #extension GL_NV_ray_tracing : require instead of #extension GL_EXT_ray_tracing : require and the glslangValidator therefore is called with --target-env vulkan1.1 instead of vulkan1.2

Overall it is a good tutorial and very helpful.

mklefrancois commented 3 years ago

Thanks for pointing out the ZIP archives. They will be corrected and replaced.

As for the version used by glslangValidator, it should be set to 1.2 In the CMakeLists.txt, there is SET(VULKAN_TARGET_ENV vulkan1.2) resulting to:

C:/VulkanSDK/1.2.148.1/bin/glslangValidator.exe --target-env vulkan1.2 -o shaders/raytrace.rgen.spv vk_raytracing_tutorial_KHR/ray_tracing__simple/shaders/raytrace.rgen

If you are encountering other issues, please feel free to bring them up.

mklefrancois commented 3 years ago

Done in https://github.com/nvpro-samples/vk_raytracing_tutorial_KHR/commit/f69dd1d592e0cc81e48d2d567ebfaba8561eb0a0 and https://github.com/nvpro-samples/vk_raytracing_tutorial_KHR/commit/0f27e7dc4aafaaa1cdf76a1a37699b0fcd1dfcad