From aa04af2eb5b5e93e4f33e6878ef4af83ac472c04 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 18 May 2024 21:30:33 +0200 Subject: feat: descrease marching threshold --- src/renderer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/renderer.rs b/src/renderer.rs index 6db67e2..953607e 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -73,14 +73,14 @@ impl Renderer { direction: Vector, sdf: &dyn Fn(Vector) -> f32, ) -> Option { - let threshold = 0.1; + let threshold = 0.01; let ray = direction.normalize(); let mut point = origin; let mut dist = 0.0; let mut count = 0; - while dist < 8.0 && count < 10 { + while dist < 8.0 && count < 30 { count += 1; dist = sdf(point); if dist.abs() < threshold { -- cgit v1.2.3