This commit is contained in:
Sascha Willems 2022-04-21 07:35:01 +02:00
commit e8596963b3
2 changed files with 7 additions and 3 deletions

View file

@ -25,10 +25,10 @@ void main()
outFragColor = vec4(diffuse, 1.0);
rayQueryEXT rayQuery;
rayQueryInitializeEXT(rayQuery, topLevelAS, gl_RayFlagsTerminateOnFirstHitEXT, 0xFF, inWorldPos, 0.01, L, 1000.0);
rayQueryInitializeEXT(rayQuery, topLevelAS, gl_RayFlagsTerminateOnFirstHitEXT | gl_RayFlagsSkipAABBEXT, 0xFF, inWorldPos, 0.01, L, 1000.0);
// Start the ray traversal, rayQueryProceedEXT returns false if the traversal is complete
while (rayQueryProceedEXT(rayQuery)) { }
// Traverse the acceleration structure and store information about the first intersection (if any)
rayQueryProceedEXT(rayQuery);
// If the intersection has hit a triangle, the fragment is shadowed
if (rayQueryGetIntersectionTypeEXT(rayQuery, true) == gl_RayQueryCommittedIntersectionTriangleEXT ) {