nvpro-samples / vk_raytracing_tutorial_KHR

Ray tracing examples and tutorials using VK_KHR_ray_tracing
Apache License 2.0
1.34k stars 142 forks source link

Fix raytrace.rgen in ray_tracing__advance #44

Closed lukelmy closed 1 year ago

lukelmy commented 1 year ago

According to ray_tracing_jitter_cam, we should write directly to the image if the frame number is equal to 0 in "raytrace.rgen".

ray_tracing_jitter_cam_shaders_raytrace rgen

However, there is an equal sign in "raytrace.rgen" of ray_tracing__advance, which may cause corruption.

ray_tracing__advance_shaders_raytrace rgen
mklefrancois commented 1 year ago

Thanks for reporting the issue. It works because when pcRay.frame ==0, a will be equal to 1.0F and the image will store only prd.hitValue. But to avoid any confusion and the unnecessary imageLoad, the code will be changed.