Created
October 27, 2023 01:11
-
-
Save sjhalayka/855d4a56b48c01b623a8549785116b24 to your computer and use it in GitHub Desktop.
Clear line of sight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
layout(location = 2) rayPayloadEXT bool shadowed; | |
bool is_clear_line_of_sight(vec3 pos_start, const vec3 pos_end) | |
{ | |
shadowed = true; // Make sure to set this to the default before tracing the ray! | |
traceRayEXT(topLevelAS, gl_RayFlagsTerminateOnFirstHitEXT | gl_RayFlagsOpaqueEXT | gl_RayFlagsSkipClosestHitShaderEXT, 0xFF, 0, 0, 1, pos_start, 0.001, pos_end, 10000.0, 2); | |
return !shadowed; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment