X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fmotion_vectors_fs.glsl;h=315416bdd49d68d838e41c89835aec15ff91ee13;hb=403726131f9b460c3264e4f64c46f8aaa82978fe;hp=e6d2759fc0df013159701b1f8c82d84a450f8ec6;hpb=c88172d6968a02a4e643b74cc419c0ac8168d92a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/motion_vectors_fs.glsl b/shaders/motion_vectors_fs.glsl index e6d2759..315416b 100644 --- a/shaders/motion_vectors_fs.glsl +++ b/shaders/motion_vectors_fs.glsl @@ -1,3 +1,5 @@ +#include "motion_vectors_common.glsl" + layout (location = 1) out vec2 oMotionVec; in vec3 aMotionVec0; @@ -8,5 +10,6 @@ void compute_motion_vectors() // Write motion vectors vec2 vmotion0 = aMotionVec0.xy / aMotionVec0.z; vec2 vmotion1 = aMotionVec1.xy / aMotionVec1.z; - oMotionVec = vmotion1-vmotion0; + + oMotionVec = (vmotion1-vmotion0) * (1.0/k_motion_lerp_amount); }