Commit: d81206066d403c1a518c41ea2b0fafa0c633ee55
Author: YimingWu
Date: Thu Aug 20 14:15:22 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rBd81206066d403c1a518c41ea2b0fafa0c633ee55
LineArt: Camera shifting aspect ratio fix.
===================================================================
M source/blender/editors/lineart/lineart_cpu.c
===================================================================
diff --git a/source/blender/editors/lineart/lineart_cpu.c
b/source/blender/editors/lineart/lineart_cpu.c
index ad8a70e909a..b1eebcb0f9a 100644
--- a/source/blender/editors/lineart/lineart_cpu.c
+++ b/source/blender/editors/lineart/lineart_cpu.c
@@ -2429,8 +2429,12 @@ LineartRenderBuffer
*ED_lineart_create_render_buffer(Scene *scene)
rb->cam_is_persp = (c->type == CAM_PERSP);
rb->near_clip = c->clip_start;
rb->far_clip = c->clip_end;
- rb->shift_x = c->shiftx;
- rb->shift_y = c->shifty;
+ rb->w = scene->r.xsch;
+ rb->h = scene->r.ysch;
+
+ double asp = ((double)rb->w / (double)rb->h);
+ rb->shift_x = (asp >= 1) ? c->shiftx : c->shiftx * asp;
+ rb->shift_y = (asp <= 1) ? c->shifty : c->shifty * asp;
}
rb->angle_splitting_threshold = scene->lineart.angle_splitting_threshold;
@@ -3473,9 +3477,6 @@ int ED_lineart_compute_feature_lines_internal(Depsgraph
*depsgraph, const int sh
lineart_share.render_buffer_shared = rb;
- rb->w = scene->r.xsch;
- rb->h = scene->r.ysch;
-
rb->triangle_size = lineart_triangle_size_get(rb, scene);
rb->max_occlusion_level = lineart_occlusion_get_max_level(depsgraph);
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs