diff options
author | jfons <joan.fonssanchez@gmail.com> | 2022-04-04 16:10:22 +0200 |
---|---|---|
committer | jfons <joan.fonssanchez@gmail.com> | 2022-06-07 13:14:44 +0200 |
commit | ba832d83b2dafcdbb79b93b1e97fd518c12b97bf (patch) | |
tree | a105978a20ea3f2ec4edd53691f7664c0562c1d8 /core | |
parent | 36bd26dc75465d0b64441113bc4055b2cd06b516 (diff) |
Initial TAA implementation
Initial TAA support based on the implementation in Spartan Engine.
Motion vectors are correctly generated for camera and mesh movement, but there is no support for other things like particles or skeleton deformations.
Diffstat (limited to 'core')
-rw-r--r-- | core/math/camera_matrix.cpp | 5 | ||||
-rw-r--r-- | core/math/camera_matrix.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index 9443addd22..57c53b0adb 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -710,6 +710,11 @@ void CameraMatrix::scale_translate_to_fit(const AABB &p_aabb) { matrix[3][3] = 1; } +void CameraMatrix::add_jitter_offset(const Vector2 &p_offset) { + matrix[3][0] += p_offset.x; + matrix[3][1] += p_offset.y; +} + CameraMatrix::operator Transform3D() const { Transform3D tr; const real_t *m = &matrix[0][0]; diff --git a/core/math/camera_matrix.h b/core/math/camera_matrix.h index f1aea5e4e8..a4051cee3b 100644 --- a/core/math/camera_matrix.h +++ b/core/math/camera_matrix.h @@ -95,6 +95,7 @@ struct CameraMatrix { operator String() const; void scale_translate_to_fit(const AABB &p_aabb); + void add_jitter_offset(const Vector2 &p_offset); void make_scale(const Vector3 &p_scale); int get_pixels_per_meter(int p_for_pixel_width) const; operator Transform3D() const; |