Commit baf3203913f04f7e98f148deb05d3f21a28803cd

Thomas de Grivel 2024-02-23T17:24:41

max lights in gl_camera

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/libc3/window/sdl2/gl_camera.c b/libc3/window/sdl2/gl_camera.c
index cffaa2f..d37cbbd 100644
--- a/libc3/window/sdl2/gl_camera.c
+++ b/libc3/window/sdl2/gl_camera.c
@@ -100,7 +100,7 @@ static const char * g_gl_camera_fragment_shader_src =
   "    oColor = uMaterial.Color;\n"
   "  vec4 sum = vec4(0);\n"
   "  vec3 n = normalize(ioNormal);\n"
-  "  for (int i = 0; i < 3; i++) {\n"
+  "  for (int i = 0; i < uLightCount; i++) {\n"
   "    sum += microfacetModel(i, ioPos, n, oColor);\n"
   "  }\n"
   "  sum = pow(sum, vec4(1.0 / 2.2));\n"