2 #extension GL_EXT_ray_tracing : enable
3 #extension GL_NV_shader_invocation_reorder : enable
4 #extension GL_NV_ray_tracing_motion_blur : enable
5 layout(location = 1) rayPayloadEXT vec4 payload;
6 layout(location = 2) rayPayloadEXT pBlock { vec2 val1; vec2 val2; };
7 layout(location = 2) hitObjectAttributeNV vec2 attr;
8 layout(location = 3) hitObjectAttributeNV hBlock { float attrval;};
9 layout(binding = 0) uniform accelerationStructureEXT as;
10 layout(binding = 1) buffer block {
16 hitObjectNV hObjHit, hObjMiss, hObjNop;
19 hitObjectTraceRayNV(hObj, as, 1U, 1U, 1U, 1U, 1U, vec3(0.5), 0.5, vec3(1), 1.0, 1);
20 hitObjectTraceRayMotionNV(hObj, as, 1U, 1U, 1U, 1U, 1U, vec3(0.5), 0.5, vec3(1), 1.0, 10.0, 2);
21 hitObjectRecordHitNV(hObj, as, 1, 1, 1, 2U, 2U, 2U, vec3(1), 1.0f, vec3(2), 2.0f, 2);
22 hitObjectRecordHitMotionNV(hObj, as, 1, 1, 1, 2U, 2U, 2U, vec3(1), 1.0f, vec3(2), 2.0f, 4.0f, 2);
23 hitObjectRecordHitWithIndexNV(hObjHit, as, 1, 1, 1, 2U, 2U, vec3(1), 1.0f, vec3(2), 2.0f, 3);
24 hitObjectRecordHitWithIndexMotionNV(hObjHit, as, 1, 1, 1, 2U, 2U, vec3(1), 1.0f, vec3(2), 2.0f, 4.0f, 3);
25 hitObjectRecordEmptyNV(hObjNop);
26 hitObjectRecordMissNV(hObjMiss, 1U, vec3(0.5), 2.0, vec3(1.5), 5.0);
27 hitObjectRecordMissMotionNV(hObjMiss, 1U, vec3(0.5), 2.0, vec3(1.5), 5.0, 8.0f);
28 hitObjectExecuteShaderNV(hObjHit, 2);
29 if (hitObjectIsHitNV(hObj)) {
31 } else if (hitObjectIsMissNV(hObj)) {
33 } else if (hitObjectIsEmptyNV(hObj)) {
38 float tmin = hitObjectGetRayTMinNV(hObjHit);
39 float tmax = hitObjectGetRayTMaxNV(hObjHit);
40 vec3 orig = hitObjectGetWorldRayOriginNV(hObjHit);
41 vec3 dir = hitObjectGetWorldRayDirectionNV(hObjHit);
42 vec3 oorig = hitObjectGetObjectRayOriginNV(hObjHit);
43 vec3 odir = hitObjectGetObjectRayDirectionNV(hObjHit);
44 mat4x3 otw = hitObjectGetObjectToWorldNV(hObjHit);
45 mat4x3 wto = hitObjectGetWorldToObjectNV(hObjHit);
46 int cid = hitObjectGetInstanceCustomIndexNV(hObjMiss);
47 int iid = hitObjectGetInstanceIdNV(hObjNop);
48 int pid = hitObjectGetPrimitiveIndexNV(hObj);
49 int gid = hitObjectGetGeometryIndexNV(hObj);
50 uint hkind = hitObjectGetHitKindNV(hObj);
51 hitObjectGetAttributesNV(hObj, 2);
52 uvec2 handle = hitObjectGetShaderRecordBufferHandleNV(hObj);
53 uint rid = hitObjectGetShaderBindingTableRecordIndexNV(hObj);