X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=sidebyside;f=shaders%2Fmotion_vectors_fs.glsl;fp=shaders%2Fmotion_vectors_fs.glsl;h=e6d2759fc0df013159701b1f8c82d84a450f8ec6;hb=f7db507815e2822d971031c30f25e02b45e9c914;hp=0000000000000000000000000000000000000000;hpb=75703291fbf045008a3b1ebb20fc46a2617b6b3b;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/motion_vectors_fs.glsl b/shaders/motion_vectors_fs.glsl new file mode 100644 index 0000000..e6d2759 --- /dev/null +++ b/shaders/motion_vectors_fs.glsl @@ -0,0 +1,12 @@ +layout (location = 1) out vec2 oMotionVec; + +in vec3 aMotionVec0; +in vec3 aMotionVec1; + +void compute_motion_vectors() +{ + // Write motion vectors + vec2 vmotion0 = aMotionVec0.xy / aMotionVec0.z; + vec2 vmotion1 = aMotionVec1.xy / aMotionVec1.z; + oMotionVec = vmotion1-vmotion0; +}