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-28 22:40:14 +08:00
parent e0fa295bc6
commit bb2f959a07
Notes: blender-bot 2023-02-14 04:40:22 +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);
}