Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc5
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];