{
  "name": "Roulette (H-Scroll)",
  "curve": "Quartic Out",
  "type": "fixed-intro",
  "duration": 1.5,
  "passes": [
    {
      "name": " h scroll",
      "inputs": [
        "default"
      ],
      "glsl": "precision highp float;

varying vec2 sourceTextureCoordinate;
uniform float progress; // normalized 0-1

const int SAMPLES = 25;

vec4 dirBlur(vec2 uv, vec2 dir){
  vec3 acc = vec3(0.0);
  float delta = 2.0 / float(SAMPLES);
  for (int i  = 0; i <  SAMPLES; ++i){
    float t = float(i) * delta - 1.0;
    vec2 sampleUV = fract(uv + dir * t);
    acc += sampleInput(sampleUV).rgb;
  }
  return vec4(acc/float(SAMPLES),1.0);
}

// effect uniforms
void main() {
  vec2 uv = sourceTextureCoordinate;
  float t = clamp(progress, 0.0, 1.0);

  float shiftX = t * 6.0;
  uv = fract(uv + vec2(shiftX, 0.0));

  float blurCurve = 1.0 - abs(progress - 0.5) * 2.0;
  blurCurve = clamp(blurCurve, 0.0,1.0);

  float r = radians(0.0);
  vec2 dir = vec2(cos(r),sin(r)) * (0.1 * blurCurve);


  vec4 color = dirBlur(uv,dir);

  gl_FragColor = toOutputFormat(color);
}
",
    "metal": "
using namespace metal;
struct fragmentIn { float2 sourceTextureCoordinate [[user(locn1)]]; };
struct fragmentOut { float4 _gl_FragColor [[color(0)]]; };
typedef struct {
  float4x4 content_transform;
  float4x4 texture_transform;
  float strength;
  float progress;
  float time_sec;
  float duration_sec;
  float clip_duration_sec;
  float2 input_size;
  float2 output_size;
 } Uniforms;
constant int SAMPLES = 25;

float4 dirBlur(float2 uv, float2 dir, DefaultInputs defaultInputs){
  float3 acc = float3(0.0);
  float delta = 2.0 / float(SAMPLES);
  for (int i  = 0; i <  SAMPLES; ++i){
    float t = float(i) * delta - 1.0;
    float2 sampleUV = fract(uv + dir * t);
    acc += sampleInput(defaultInputs, sampleUV).rgb;
  }
  return float4(acc/float(SAMPLES),1.0);
}

// effect uniforms
fragment fragmentOut fragmentShader(fragmentIn in [[stage_in]],
 constant Uniforms & uniforms [[buffer(1)]],
 DefaultInputs defaultInputs) {
  float2 uv = in.sourceTextureCoordinate;
  float t = clamp(uniforms.progress, 0.0, 1.0);

  float shiftX = t * 6.0;
  uv = fract(uv + float2(shiftX, 0.0));

  float blurCurve = 1.0 - abs(uniforms.progress - 0.5) * 2.0;
  blurCurve = clamp(blurCurve, 0.0,1.0);

  float r = (0.0 * M_PI_F / 180.0);
  float2 dir = float2(cos(r),sin(r)) * (0.1 * blurCurve);


  float4 color = dirBlur(uv,dir, defaultInputs);

  return {toOutputFormat(color)};
}
  ",
      "uniforms": {}
    }
  ]
}
