From b872ad037aaaffb6783cee9339ce4d876fc1ffca Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 1 Jul 2022 09:40:52 +0200 Subject: Fix T99315: Unit plane track deform compositor node leads to unnecessary blur --- .../blender/compositor/operations/COM_PlaneDistortCommonOperation.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc') diff --git a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc index ddda02c5e80..9c19f55e04f 100644 --- a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc +++ b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc @@ -43,6 +43,11 @@ BLI_INLINE void warp_coord(float x, float y, float matrix[3][3], float uv[2], fl uv[0] = vec[0] / vec[2]; uv[1] = vec[1] / vec[2]; + /* Offset so that pixel center corresponds to a (0.5, 0.5), which helps keeping transformed + * image sharp. */ + uv[0] += 0.5f; + uv[1] += 0.5f; + deriv[0][0] = (matrix[0][0] - matrix[0][2] * uv[0]) / vec[2]; deriv[1][0] = (matrix[0][1] - matrix[0][2] * uv[1]) / vec[2]; deriv[0][1] = (matrix[1][0] - matrix[1][2] * uv[0]) / vec[2]; -- cgit v1.2.3