Skip to content

Instantly share code, notes, and snippets.

@Trass3r
Last active February 10, 2021 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Trass3r/8429ba646308854a528919a7f1b3bf4b to your computer and use it in GitHub Desktop.
Save Trass3r/8429ba646308854a528919a7f1b3bf4b to your computer and use it in GitHub Desktop.
#version 460
#extension GL_KHR_shader_subgroup_vote: require
layout (location = 0) in float lightDistanceSqared;
layout (location = 0) out vec4 fragColor;
void main()
{
const int radius = 5;
#if 0
if (lightDistanceSqared <= radius*radius)
#else
if (subgroupAny(lightDistanceSqared <= radius*radius))
#endif
{
fragColor = vec4(0.1.xxx, 1.0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment