Fix T87832: Incorrect FOV in line art when sensor fit is not Auto.

Reviewed by Sebastian Parborg

https://developer.blender.org/D11095
This commit is contained in:
YimingWu 2021-04-27 11:26:44 +08:00
parent e714b3a1c3
commit 4ddff574d7
Notes: blender-bot 2023-02-14 06:00:47 +01:00
Referenced by issue #87832, LineArt detects hidden edge when Sensor Fit is Vertical and long Focal Length
1 changed files with 17 additions and 2 deletions

View File

@ -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);
}