From bb2af40ec7dd9a0c41991bc2faaf6eb3f0618016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 24 Feb 2021 11:24:49 +0100 Subject: Fix T85726 Workbench: Orthographic view is blurry This was caused by the window_translate_m4 not offsetting the winmat in the right direction for perspective view. Thus leading to incorrect weights. The workbench sample weight computation was also inverted. This fix will change the sampling pattern for EEVEE too (it will just mirror it in perspective view). --- source/blender/blenlib/intern/math_geom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib/intern/math_geom.c') diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index b7e94e6c512..01cda6c9e4a 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -4886,8 +4886,8 @@ void window_translate_m4(float winmat[4][4], float perspmat[4][4], const float x len1 = (1.0f / len_v3(v1)); len2 = (1.0f / len_v3(v2)); - winmat[2][0] += len1 * winmat[0][0] * x; - winmat[2][1] += len2 * winmat[1][1] * y; + winmat[2][0] -= len1 * winmat[0][0] * x; + winmat[2][1] -= len2 * winmat[1][1] * y; } else { winmat[3][0] += x; -- cgit v1.2.3