Use GL Transition with swift

Viewed 177

How can i convert below GL Transition code into metal and use in swift

vec4 transition (vec2 uv) {

  vec2 p = uv + progress * sign(direction);

  vec2 f = fract(p);

return mix(
    getToColor(f),
    getFromColor(f),
    step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0)
  );

}

I have done lots of research but didn't found any solution. Please help me.

Thanks

0 Answers
Related