summaryrefslogtreecommitdiff
path: root/racer-tracer/src/render.rs
diff options
context:
space:
mode:
authorSakarias Johansson <sakarias.johansson@goodbyekansas.com>2023-01-16 20:58:55 +0100
committerSakarias Johansson <sakarias.johansson@goodbyekansas.com>2023-01-16 20:58:55 +0100
commit03e5a88f9b7da79749370685e8f5afaf03a25b4a (patch)
tree9e0fd5e12bcd9739f5292864c9da9084a0030489 /racer-tracer/src/render.rs
parent3167ec992f1f81b2252a2db3642fff943c4f14bf (diff)
downloadracer-tracer-03e5a88f9b7da79749370685e8f5afaf03a25b4a.tar.gz
racer-tracer-03e5a88f9b7da79749370685e8f5afaf03a25b4a.tar.xz
racer-tracer-03e5a88f9b7da79749370685e8f5afaf03a25b4a.zip
🎨 Add dialectric material
Diffstat (limited to 'racer-tracer/src/render.rs')
-rw-r--r--racer-tracer/src/render.rs6
1 files changed, 5 insertions, 1 deletions
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;