uniform vec3 uBoard0;
uniform vec3 uBoard1;
-in vec2 aUv;
-in vec4 aNorm;
-in vec3 aCo;
-in vec3 aWorldCo;
-flat in ivec4 aLights;
-
#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();
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);
}
// Lighting
-
- vfrag = scene_do_lighting( vfrag, qnorm );
+ vfrag = scene_compute_lighting( vfrag, qnorm, aWorldCo );
oColour = vec4(vfrag, 1.0);
}