Skip to content

Instantly share code, notes, and snippets.

@jdolan
Created January 10, 2023 14:34
Show Gist options
  • Save jdolan/26b523e21e80ea5cea3594d0e93b84b7 to your computer and use it in GitHub Desktop.
Save jdolan/26b523e21e80ea5cea3594d0e93b84b7 to your computer and use it in GitHub Desktop.
Point shadows geometry shader using cubemap array texture
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