X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fmotion_vectors_fs.glsl;h=315416bdd49d68d838e41c89835aec15ff91ee13;hb=be5e25dee2c54c2a22ca3bbb5bbe0eb6149343be;hp=e6d2759fc0df013159701b1f8c82d84a450f8ec6;hpb=f7db507815e2822d971031c30f25e02b45e9c914;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); }