{
  "name": "Mirror Frames",
  "curve": "Circular InOut",
  "type": "fixed-intro",
  "duration": 0.5,
  "passes": [
    {
      "name": "Mirror Frames",
      "inputs": [
        "default"
      ],
      "glsl": "precision highp float;

varying vec2 textureCoordinate;
varying vec2 sourceTextureCoordinate;

// default uniforms for all filters
uniform float time;
uniform float strength;
uniform vec2 outputSize; // size of the output fbo
uniform vec2 inputSize; // size of the original default input texture
uniform vec2 tex0Size; // size of tex0 for this pass

// default uniforms for transitions and video effects
uniform float progress; // normalized 0-1

// default uniforms for video effects
uniform float duration; // in seconds
uniform float clipDuration; // in seconds

const int LAYERS = 3;
const vec2 center = vec2(0.5,0.5);

// effect uniforms
void main() {

  vec2 uv = sourceTextureCoordinate;
  vec4 color = vec4(0.0);

  float mainScale = mix(1.0, 0.7, progress);

  for(int i = LAYERS; i >= 1; --i){
    float f = float(i) / float(LAYERS);
    float scale_i = mix(mainScale, 1.0, f);
    vec2 p = (uv - center) / scale_i + center;

    float m = step(0.0, p.x) * step(p.x, 1.0) * step(0.0, p.y) * step(p.y, 1.0);

    color = mix(color, sampleInput(p), m);
  }

  {
    vec2 p = (uv - center) / mainScale + center;
    float m = step(0.0,p.x) * step(p.x, 1.0) * step(0.0,p.y) * step(p.y, 1.0);
    color = mix(color, sampleInput(p), m);
  }





  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;
  float2 tex0Size;
 } Uniforms;
constant int LAYERS = 3;
constant float2 center = float2(0.5,0.5);

// effect uniforms
fragment fragmentOut fragmentShader(fragmentIn in [[stage_in]],
 constant Uniforms & uniforms [[buffer(1)]],
 DefaultInputs defaultInputs) {

  float2 uv = in.sourceTextureCoordinate;
  float4 color = float4(0.0);

  float mainScale = mix(1.0, 0.7, uniforms.progress);

  for(int i = LAYERS; i >= 1; --i){
    float f = float(i) / float(LAYERS);
    float scale_i = mix(mainScale, 1.0, f);
    float2 p = (uv - center) / scale_i + center;

    float m = step(0.0, p.x) * step(p.x, 1.0) * step(0.0, p.y) * step(p.y, 1.0);

    color = mix(color, sampleInput(defaultInputs, p), m);
  }

  {
    float2 p = (uv - center) / mainScale + center;
    float m = step(0.0,p.x) * step(p.x, 1.0) * step(0.0,p.y) * step(p.y, 1.0);
    color = mix(color, sampleInput(defaultInputs, p), m);
  }





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