summaryrefslogtreecommitdiff
path: root/viewport.h
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-04-13 14:42:59 +0800
committerKeuin <[email protected]>2022-04-13 14:42:59 +0800
commit3caba9694f6e6f0f8b51dcffd7619fa04fbe6c29 (patch)
tree0975252facef9f71931dee7bbd526bcfccf49ad4 /viewport.h
parent4ad345447384ae9327cab0977b95d0b67f8bde57 (diff)
Antialiasing. (not parallelized)
Diffstat (limited to 'viewport.h')
-rw-r--r--viewport.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/viewport.h b/viewport.h
index 51159c9..b4e4e56 100644
--- a/viewport.h
+++ b/viewport.h
@@ -88,8 +88,8 @@ public:
assert(bx < 1.0);
assert(by < 1.0);
const vec3d off{
- .x=1.0 * i / img_hw * half_width + bx,
- .y=1.0 * j / img_hh * half_height + by,
+ .x=(1.0 * i + bx) / img_hw * half_width,
+ .y=(1.0 * j + by) / img_hh * half_height,
.z=0.0
}; // offset on screen plane
const auto dir = r + off; // direction vector from camera to current pixel on screen