diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-07-01 10:40:52 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-07-01 10:42:48 +0300 |
commit | b872ad037aaaffb6783cee9339ce4d876fc1ffca (patch) | |
tree | d5e0d747d2e671ae2abffaddc5b4d75db1005f4d /source/blender/compositor/operations | |
parent | 16264aebe6e022f9fbb95851d8806681ae5726a3 (diff) |
Fix T99315: Unit plane track deform compositor node leads to unnecessary blur
Diffstat (limited to 'source/blender/compositor/operations')
-rw-r--r-- | source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc | 5 |
1 files changed, 5 insertions, 0 deletions
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]; |