From 68b8d26cae8e61a0098b2f2b06a7e999c6b1dbea Mon Sep 17 00:00:00 2001 From: Keuin Date: Wed, 20 Apr 2022 13:25:45 +0800 Subject: Remove OVERRIDE_FOV. Add FOV test scene (SCENE_FOV). --- main_simple_scanner.cpp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/main_simple_scanner.cpp b/main_simple_scanner.cpp index 99e166c..e6b6bca 100644 --- a/main_simple_scanner.cpp +++ b/main_simple_scanner.cpp @@ -21,12 +21,10 @@ // Select the scene to render //#define SCENE_DIFFUSE //#define SCENE_REFLECT -#define SCENE_DIALECT - -//#define OVERRIDE_FOV +//#define SCENE_DIALECT +#define SCENE_FOV static constexpr uint64_t default_diffuse_seed = 123456789012345678ULL; -static constexpr double fov_override = 90*(M_PI/180); // T: color depth, V: pos template @@ -42,13 +40,13 @@ void generate_image(uint16_t image_width, uint16_t image_height, double viewport double r = 1.0 * image_width / image_height; hitlist world; -#ifndef OVERRIDE_FOV +#ifndef SCENE_FOV //////////////// // noaa rendering bias_ctx no_bias{}; basic_viewport vp_noaa{ - vec3::zero(), // camera position as the coordinate origin - vec3d{0, 0, -focal_length}, + {-2, 2, 1}, // camera position as the coordinate origin + {0, 0, -1}, image_width, image_height, viewport_width / 2.0, ((double) image_height / image_width) * viewport_width / 2.0, world @@ -58,22 +56,24 @@ void generate_image(uint16_t image_width, uint16_t image_height, double viewport //////////////// // aa rendering aa_viewport vp_aa{ - vec3::zero(), // camera position as the coordinate origin - vec3d{0, 0, -focal_length}, + {-2, 2, 1}, // camera position as the coordinate origin + {0, 0, -1}, image_width, image_height, viewport_width / 2.0, ((double) image_height / image_width) * viewport_width / 2.0, world, samples }; //////////////// #else + // This scene needs custom viewport setting + const auto fov_h = 2 * asin((double)1.0 / 3.0); //////////////// // noaa rendering bias_ctx no_bias{}; basic_viewport vp_noaa{ - vec3::zero(), // camera position as the coordinate origin - vec3d{0, 0, -focal_length}, + {0, 0, 1}, // camera position as the coordinate origin + {0, 0, 0}, image_width, image_height, - fov_override, + fov_h, world }; //////////////// @@ -81,15 +81,17 @@ void generate_image(uint16_t image_width, uint16_t image_height, double viewport //////////////// // aa rendering aa_viewport vp_aa{ - vec3::zero(), // camera position as the coordinate origin - vec3d{0, 0, -focal_length}, + {0, 0, 1}, // camera position as the coordinate origin + {0, 0, 0}, image_width, image_height, - fov_override, + fov_h, world, samples }; //////////////// -#endif + material_diffuse_lambertian materi{0.5}; + world.add_object(std::make_shared(vec3d{0, 0, -2}, 1, materi)); +#endif #ifdef SCENE_DIFFUSE material_diffuse_lambertian materi{0.5}; world.add_object(std::make_shared( -- cgit v1.2.3