diff --git a/pkg/ant.shadow_bounding/scene_bounding.lua b/pkg/ant.shadow_bounding/scene_bounding.lua index 7ff8fb9015..2c141690a3 100644 --- a/pkg/ant.shadow_bounding/scene_bounding.lua +++ b/pkg/ant.shadow_bounding/scene_bounding.lua @@ -95,7 +95,7 @@ local function build_scene_info(C, sb) end if math3d.aabb_isvalid(PSR) then - si.zn, si.zf = math.max(zn, F.n), math.min(zf, F.f) + si.zn, si.zf = mu.clamp(zn, F.n, F.f), mu.clamp(zf, F.n, F.f) else si.zn, si.zf = F.n, F.f PSR = math3d.minmax(math3d.frustum_points(C.camera.viewprojmat))