i hope your hapy
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / scene_route.fs
index 3ce337b73d721e6dbc77641caf393b8c23c12229..93ed9b1380e3b5171e7111f9c3ed95cabc04ad6c 100644 (file)
@@ -8,6 +8,13 @@ uniform vec3 uBoard1;
 #include "common_scene.glsl"
 #include "motion_vectors_fs.glsl"
 
+float filtered_stripe( in float p, in float ddx, in float ddy )
+{
+   float w = max(abs(ddx), abs(ddy)) + 0.02;
+   float i = (abs(fract((p-0.5*w)/2.0)-0.5)-abs(fract((p+0.5*w)/2.0)-0.5))/w;
+   return 0.5 - i;
+}
+
 void main()
 {
    compute_motion_vectors();
@@ -32,9 +39,13 @@ void main()
    vfrag = pow(uColour.rgb,vec3(1.0/2.2));
    vfrag -= rgarbage.a*0.1;
 
-   if( wgarbage.g < 0.3 )
+   if( wgarbage.g < 0.1 )
       discard;
 
+   float movep = (aUv.x + abs(aUv.y-0.5)*0.4 - g_realtime)*2.0;
+   float stripe = filtered_stripe( movep, dFdx(movep), dFdy(movep) );
+   vfrag *= 0.9+stripe*uColour.a; 
+
    if( g_light_preview == 1 )
    {
       vfrag = vec3(0.5);