diff options
author | YimingWu <xp8110@outlook.com> | 2021-04-28 17:40:14 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2021-04-28 17:40:14 +0300 |
commit | bb2f959a07ce7744285a525275ff8766991fffc3 (patch) | |
tree | 8bdb3847a455a1a993cc99b90091f660d5475868 /source/blender/gpencil_modifiers | |
parent | e0fa295bc6f2f99f5679a4d423818d83c67628a2 (diff) |
Fix T87832: Incorrect FOV in line art when sensor fit is not Auto.
Reviewed by Sebastian Parborg
https://developer.blender.org/D11095
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c index 3778e60d813..9c4e428f58a 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -1817,8 +1817,23 @@ static void lineart_main_load_geometries( double asp = ((double)rb->w / (double)rb->h); if (cam->type == CAM_PERSP) { - if (asp < 1) { - fov /= asp; + if (cam->sensor_fit == CAMERA_SENSOR_FIT_AUTO) { + if (asp < 1) { + fov /= asp; + } + else { + fov *= asp; + } + } + else if (cam->sensor_fit == CAMERA_SENSOR_FIT_HOR) { + if (asp < 1) { + fov /= asp; + } + } + else if (cam->sensor_fit == CAMERA_SENSOR_FIT_VERT) { + if (asp > 1) { + fov *= asp; + } } lineart_matrix_perspective_44d(proj, fov, asp, cam->clip_start, cam->clip_end); } |