2020-03-20 22:23:27 +00:00
|
|
|
#version 460
|
|
|
|
#extension GL_NV_ray_tracing : enable
|
|
|
|
#extension GL_EXT_ray_query : enable
|
2020-03-26 22:51:18 +00:00
|
|
|
layout(binding = 0, set = 0) uniform accelerationStructureEXT acc0;
|
2020-03-20 22:23:27 +00:00
|
|
|
|
|
|
|
layout(shaderRecordNV) buffer block
|
|
|
|
{
|
|
|
|
vec3 dir;
|
|
|
|
vec3 origin;
|
|
|
|
};
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
rayQueryEXT localRayQuery;
|
|
|
|
uint rayFlags = gl_RayFlagsOpaqueEXT | gl_RayFlagsSkipClosestHitShaderEXT;
|
|
|
|
float tMin = 0.f;
|
|
|
|
float tMax = 1000.f;
|
2020-03-26 22:51:18 +00:00
|
|
|
rayQueryInitializeEXT(localRayQuery, acc0, rayFlags, 0xFF , origin, tMin, dir, tMax);
|
2020-03-20 22:23:27 +00:00
|
|
|
if (!rayQueryProceedEXT(localRayQuery))
|
|
|
|
{
|
|
|
|
rayQueryTerminateEXT(localRayQuery);
|
|
|
|
}
|
|
|
|
}
|