Closed FuXiii closed 1 year ago
See the ray tracing specification.
The definition about gl_InstanceCustomIndexEXT can be found at line 728 and gl_InstanceID at line 745
Thanks! (๑•̀ㅂ•́)و✧
as gl_InstanceId
specifies the index of the instance that intersects the current ray, which is in this case the same value as i
.
What is the i
? (=′∇`=)
Is the i
means the instances index in shader? such like:
layout(set = 1, binding = eObjDescs, scalar) buffer objDesc_ {ObjDesc i[];} objDesc;
I believe i
here is intended to be ObjInstance::objIndex
(i.e. the index of the object in the scene); instanceCustomIndex
is set to this in the code block below the text. I'll add an edit to make this clearer. Thanks!
In NVIDIA Vulkan Ray Tracing Tutorial section 5.2 Top-Level Acceleration Structure
I could not found the definition about
gl_InstanceId
andgl_InstanceCustomIndex
. I only can find some describe about gl_InstanceID and gl_InstanceIndex in Vulkan Specification