Fix T101824: Line art flickers when light object has scaling.

Line art doesn't expect light or camera objects to have scaling.
This commit is contained in:
YimingWu 2022-11-25 21:55:44 +08:00
parent ae6e35279f
commit 118afe1de3
Notes: blender-bot 2023-02-14 03:59:42 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #101824, Line Art light/shadow glitch if the light object has non-uniform z axis scale
4 changed files with 11 additions and 3 deletions

@ -1 +1 @@
Subproject commit 946b62da3f9c93b4add8596aef836bf3a29ea27c
Subproject commit bde68da02fde93968dc11b52d42060ac3b81ed37

@ -1 +1 @@
Subproject commit 69b1305f4b74fbd7e847acc6a5566755b9803d78
Subproject commit e6179b3b112298e131bbd0faf648bf0d392b6cdd

View File

@ -3542,6 +3542,10 @@ static LineartData *lineart_create_render_buffer(Scene *scene,
copy_v3db_v3fl(ld->conf.active_camera_pos, active_camera->object_to_world[3]);
}
copy_m4_m4(ld->conf.cam_obmat, camera->object_to_world);
/* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and lights. */
normalize_v3(ld->conf.cam_obmat[0]);
normalize_v3(ld->conf.cam_obmat[1]);
normalize_v3(ld->conf.cam_obmat[2]);
ld->conf.cam_is_persp = (c->type == CAM_PERSP);
ld->conf.near_clip = c->clip_start + clipping_offset;
@ -3570,6 +3574,10 @@ static LineartData *lineart_create_render_buffer(Scene *scene,
Object *light_obj = lmd->light_contour_object;
copy_v3db_v3fl(ld->conf.camera_pos_secondary, light_obj->object_to_world[3]);
copy_m4_m4(ld->conf.cam_obmat_secondary, light_obj->object_to_world);
/* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and lights. */
normalize_v3(ld->conf.cam_obmat_secondary[0]);
normalize_v3(ld->conf.cam_obmat_secondary[1]);
normalize_v3(ld->conf.cam_obmat_secondary[2]);
ld->conf.light_reference_available = true;
if (light_obj->type == OB_LAMP) {
ld->conf.cam_is_persp_secondary = ((Light *)light_obj->data)->type != LA_SUN;

@ -1 +1 @@
Subproject commit dfa16042bf7149475ad318d29a8202d969982abb
Subproject commit 9e33a8678a3b97d2fdb833349657c3cc1c04811f