From 52a4c00ffe067781715dc8707cd7add23b62fadd Mon Sep 17 00:00:00 2001 From: Alberto Torres Date: Fri, 13 Sep 2024 02:31:47 +0200 Subject: [PATCH] Fix shadows not compiling without `myouDebugShadows`. --- src/shadows/simple_shadow.nim | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/shadows/simple_shadow.nim b/src/shadows/simple_shadow.nim index 8dd4b8f..2b2372d 100644 --- a/src/shadows/simple_shadow.nim +++ b/src/shadows/simple_shadow.nim @@ -126,8 +126,6 @@ proc renderShadow*(self: SimpleShadowManager, scene: Scene, min_z: float32 = 0) = # Find the projection matrix that fits all bounding points and sphere # TODO: option to rotate proj to favor vertical lines? - when not defined(release): - debug_mesh.clear_vertices() let rotm = self.light.world_matrix.to_mat3_rotation let rotmi = rotm.inverse var pmin = vec3(Inf) @@ -182,9 +180,6 @@ proc renderShadowWithCamera*(self: SimpleShadowManager, camera: Camera) = # it assumes that all world matrices are already up to date # TODO: accept a cameradata instead? - - when not defined(release): - debug_mesh.clear_vertices() template depth_to_screen(d: float32, proj: Mat4): float32 = # TODO: make more efficient and put in Camera @@ -220,6 +215,8 @@ proc renderShadowWithCamera*(self: SimpleShadowManager, camera: Camera) = self.renderShadow(camera.scene, points, min_z=zrange*4) method renderShadow*(self: SimpleShadowManager, camera: Camera): bool {.locks:"unknown".} = + when defined(myouDebugShadows): + debug_mesh.clear_vertices() if self.use_camera: self.renderShadowWithCamera( camera = camera)