summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-05-24 21:37:42 -0700
committerGravatar GitHub2017-05-24 21:37:42 -0700
commitbae3799bd5208d08bb52546ad0723103c94cada3 (patch)
treee4c921df6bf28cdeb50f48d1b7aa4d7a0bc002ed /src/common
parentMerge pull request #2683 from bunnei/telemetry-framework (diff)
parentgl_rasterizer: implement procedural texture (diff)
downloadyuzu-bae3799bd5208d08bb52546ad0723103c94cada3.tar.gz
yuzu-bae3799bd5208d08bb52546ad0723103c94cada3.tar.xz
yuzu-bae3799bd5208d08bb52546ad0723103c94cada3.zip
Merge pull request #2697 from wwylele/proctex
Implemented Procedural Texture (Texture Unit 3)
Diffstat (limited to 'src/common')
-rw-r--r--src/common/vector_math.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/vector_math.h b/src/common/vector_math.h
index 7ca8e15f5..c7a461a1e 100644
--- a/src/common/vector_math.h
+++ b/src/common/vector_math.h
@@ -652,6 +652,16 @@ static inline decltype((X{} * int{} + X{} * int{}) / base) LerpInt(const X& begi
652 return (begin * (base - t) + end * t) / base; 652 return (begin * (base - t) + end * t) / base;
653} 653}
654 654
655// bilinear interpolation. s is for interpolating x00-x01 and x10-x11, and t is for the second
656// interpolation.
657template <typename X>
658inline auto BilinearInterp(const X& x00, const X& x01, const X& x10, const X& x11, const float s,
659 const float t) {
660 auto y0 = Lerp(x00, x01, s);
661 auto y1 = Lerp(x10, x11, s);
662 return Lerp(y0, y1, t);
663}
664
655// Utility vector factories 665// Utility vector factories
656template <typename T> 666template <typename T>
657static inline Vec2<T> MakeVec(const T& x, const T& y) { 667static inline Vec2<T> MakeVec(const T& x, const T& y) {