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

Spec says hitAttributeEXT should have two components, not three #4

Closed Novum closed 4 years ago

Novum commented 4 years ago

https://github.com/nvpro-samples/vk_raytracing_tutorial_KHR/blob/21fc6552372d40927b29904eabb25061874668ba/ray_tracing_manyhits/shaders/raytrace.rchit#L9

https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GLSL_EXT_ray_tracing.txt#L348

For the case of triangle geometry with no custom intersection shaders, any-hit and closest-hit shaders can access barycentric weights of the point of intersection of ray with triangle by declaring a hitAttributeEXT variable of two 32-bit floating point elements

mklefrancois commented 4 years ago

That's right, using vec3 is working as long as only the x, y component are used. I will change this to vec2. Thanks