From ffdaf36ebcb06eb9025bfeaffa716c1338bbeee8 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Sat, 29 Jul 2023 17:17:31 +0200 Subject: [PATCH] libgarbage: fix depth when using LIMIT_DEPTH_TO_MESH with SCENE_SCALE --- Assets/raymarched/lib/libgarbage.cginc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/raymarched/lib/libgarbage.cginc b/Assets/raymarched/lib/libgarbage.cginc index 8e4b87d..22167e1 100644 --- a/Assets/raymarched/lib/libgarbage.cginc +++ b/Assets/raymarched/lib/libgarbage.cginc @@ -211,7 +211,7 @@ FragOut frag (V2F i) { depth_point = i.hit_pos; #ifdef LIMIT_DEPTH_TO_MESH - if (length(i.cam_pos - first_hit) > length(i.cam_pos - i.hit_pos)) + if (length(i.cam_pos - first_hit * SCENE_SCALE) > length(i.cam_pos - i.hit_pos)) depth_point = i.hit_pos; #endif