From 03e5a88f9b7da79749370685e8f5afaf03a25b4a Mon Sep 17 00:00:00 2001 From: Sakarias Johansson Date: Mon, 16 Jan 2023 20:58:55 +0100 Subject: =?UTF-8?q?=F0=9F=8E=A8=20Add=20dialectric=20material?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- racer-tracer/src/render.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'racer-tracer/src/render.rs') diff --git a/racer-tracer/src/render.rs b/racer-tracer/src/render.rs index 9d029e3..c5013cf 100644 --- a/racer-tracer/src/render.rs +++ b/racer-tracer/src/render.rs @@ -50,6 +50,10 @@ pub fn raytrace( scale: usize, max_depth: usize, ) { + // TODO: This scale shit doesn't work. + // Just force power of two or other solutions to avoid this. + // Can be ok for preview but the actual render could use a different function. + let mut scaled_width = image.width / scale; let mut scaled_height = image.height / scale; // In the case where we get an odd one out we patch the widht and @@ -66,7 +70,7 @@ pub fn raytrace( scaled_width += 1; } - if scaled_width * scale != image.height + if scaled_height * scale != image.height && (image.y + scaled_height * scale + 1 < image.screen_height) { scaled_height += 1; -- cgit v1.2.3