Created
January 10, 2023 14:34
-
-
Save jdolan/26b523e21e80ea5cea3594d0e93b84b7 to your computer and use it in GitHub Desktop.
Point shadows geometry shader using cubemap array texture
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
void main() { | |
light_t light = lights[light_index]; | |
vec4 translate = vec4(-light.model.xyz, 0.0); | |
for (int i = 0; i < 6; i++) { | |
gl_Layer = light_index * 6 + i; | |
for (int j = 0; j < 3; j++) { | |
position = light_view_cube[i] * (gl_in[j].gl_Position + translate); | |
gl_Position = light_projection_cube * position; | |
EmitVertex(); | |
} | |
EndPrimitive(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment