diff options
author | eug-vs <eugene@eug-vs.xyz> | 2024-05-18 21:30:33 +0200 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2024-05-18 21:30:33 +0200 |
commit | aa04af2eb5b5e93e4f33e6878ef4af83ac472c04 (patch) | |
tree | 316dfad559ec27d716d82766734c865f885e9bb3 | |
parent | abf95a0423c26e12b91d9bb67a333abb822fa2e6 (diff) | |
download | pistol-aa04af2eb5b5e93e4f33e6878ef4af83ac472c04.tar.gz |
feat: descrease marching threshold
-rw-r--r-- | src/renderer.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<Vector> { - 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 { |