Commit 0f887ea114241e56c38f5b1f40f63511907eb548

Thomas de Grivel 2025-04-05T15:07:19

fix clip_z_near

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/window/sdl2/gl_camera.c b/window/sdl2/gl_camera.c
index 6cef7e8..742b866 100644
--- a/window/sdl2/gl_camera.c
+++ b/window/sdl2/gl_camera.c
@@ -56,6 +56,7 @@ static const char * g_gl_camera_fragment_shader_src =
   "    oColor = vec4(1.0f);\n"
   "  ambiantColor = oColor * vec4(uAmbiantLightColor, 1.0f);\n"
   "  oColor = ambiantColor;\n"
+  "  //oColor = vec4(vec3(gl_FragCoord.z), 1.0);\n"
   "}\n";
 
 /*
@@ -200,7 +201,7 @@ s_gl_camera * gl_camera_init (s_gl_camera *camera, uw w, uw h)
   assert(camera);
   gl_camera_set_aspect_ratio(camera, w, h);
   camera->clip_z_far = 10.0f;
-  camera->clip_z_near = 0.1f;
+  camera->clip_z_near = 1.0f;
   camera->fov_y = 90.0f;
   camera->position.x = 0.0f;
   camera->position.y = 0.0f;