X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=shaders%2Fvblend.h;fp=shaders%2Fvblend.h;h=ad3f82b1236790ce119a231266379ce831b2d157;hb=403726131f9b460c3264e4f64c46f8aaa82978fe;hp=2a5dacf8bcb16d9db7ede932a3e82b07143ca0b8;hpb=c88172d6968a02a4e643b74cc419c0ac8168d92a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/shaders/vblend.h b/shaders/vblend.h index 2a5dacf..ad3f82b 100644 --- a/shaders/vblend.h +++ b/shaders/vblend.h @@ -17,11 +17,17 @@ static struct vg_shader _shader_vblend = { "\n" "#line 2 0 \n" "#line 1 2 \n" +"const float k_motion_lerp_amount = 0.05;\n" +"\n" +"#line 2 0 \n" +"\n" "out vec3 aMotionVec0;\n" "out vec3 aMotionVec1;\n" "\n" "void vs_motion_out( vec4 vproj0, vec4 vproj1 )\n" "{\n" +" vproj1 = vproj0*(1.0-k_motion_lerp_amount) + vproj1*k_motion_lerp_amount;\n" +"\n" " aMotionVec0 = vec3( vproj0.xy, vproj0.w );\n" " aMotionVec1 = vec3( vproj1.xy, vproj1.w );\n" "}\n" @@ -175,6 +181,10 @@ static struct vg_shader _shader_vblend = { "\n" "#line 12 0 \n" "#line 1 2 \n" +"const float k_motion_lerp_amount = 0.05;\n" +"\n" +"#line 2 0 \n" +"\n" "layout (location = 1) out vec2 oMotionVec;\n" "\n" "in vec3 aMotionVec0;\n" @@ -185,7 +195,8 @@ static struct vg_shader _shader_vblend = { " // Write motion vectors\n" " vec2 vmotion0 = aMotionVec0.xy / aMotionVec0.z;\n" " vec2 vmotion1 = aMotionVec1.xy / aMotionVec1.z;\n" -" oMotionVec = vmotion1-vmotion0;\n" +"\n" +" oMotionVec = (vmotion1-vmotion0) * (1.0/k_motion_lerp_amount);\n" "}\n" "\n" "#line 13 0 \n"