From 3caba9694f6e6f0f8b51dcffd7619fa04fbe6c29 Mon Sep 17 00:00:00 2001 From: Keuin Date: Wed, 13 Apr 2022 14:42:59 +0800 Subject: Antialiasing. (not parallelized) --- viewport.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'viewport.h') 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 -- cgit v1.2.3