gl-transitions 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/compatibility.json +308 -0
  3. package/gl-transitions.js +1 -1
  4. package/gl-transitions.json +1 -1
  5. package/glsl3/ArrowWipe.glsl +100 -0
  6. package/glsl3/BlockSlide.glsl +87 -0
  7. package/glsl3/CellDissolve.glsl +91 -0
  8. package/glsl3/ColorPanelWipe.glsl +75 -0
  9. package/glsl3/Crumple.glsl +173 -0
  10. package/glsl3/EyeBlink.glsl +83 -0
  11. package/glsl3/Gallery.glsl +133 -0
  12. package/glsl3/HeatHaze.glsl +79 -0
  13. package/glsl3/Hologram.glsl +97 -0
  14. package/glsl3/LiquidFill.glsl +102 -0
  15. package/glsl3/PlasmaDissolve.glsl +51 -0
  16. package/glsl3/RingsWipe.glsl +106 -0
  17. package/glsl3/SawtoothWipe.glsl +73 -0
  18. package/glsl3/SnakeBlockWipe.glsl +40 -0
  19. package/glsl3/Snapshot.glsl +86 -0
  20. package/glsl3/Sphere.glsl +95 -0
  21. package/glsl3/SpiralBlockWipe.glsl +65 -0
  22. package/glsl3/VhsTracking.glsl +127 -0
  23. package/glsl3/Vortex.glsl +106 -0
  24. package/index.js +1 -1
  25. package/layouts.json +787 -18
  26. package/llms-full.txt +675 -354
  27. package/llms.txt +204 -185
  28. package/msl/ArrowWipe.metal +391 -0
  29. package/msl/BlockSlide.metal +418 -0
  30. package/msl/CellDissolve.metal +374 -0
  31. package/msl/ColorPanelWipe.metal +314 -0
  32. package/msl/Crumple.metal +766 -0
  33. package/msl/EyeBlink.metal +355 -0
  34. package/msl/Gallery.metal +813 -0
  35. package/msl/HeatHaze.metal +320 -0
  36. package/msl/Hologram.metal +380 -0
  37. package/msl/LiquidFill.metal +373 -0
  38. package/msl/PlasmaDissolve.metal +178 -0
  39. package/msl/RingsWipe.metal +437 -0
  40. package/msl/SawtoothWipe.metal +310 -0
  41. package/msl/SnakeBlockWipe.metal +216 -0
  42. package/msl/Snapshot.metal +321 -0
  43. package/msl/Sphere.metal +345 -0
  44. package/msl/SpiralBlockWipe.metal +281 -0
  45. package/msl/VhsTracking.metal +514 -0
  46. package/msl/Vortex.metal +522 -0
  47. package/package.json +1 -1
  48. package/skills/gl-transitions/references/catalog.md +84 -38
  49. package/sksl/ArrowWipe.sksl +111 -0
  50. package/sksl/BlockSlide.sksl +99 -0
  51. package/sksl/CellDissolve.sksl +103 -0
  52. package/sksl/ColorPanelWipe.sksl +85 -0
  53. package/sksl/Crumple.sksl +179 -0
  54. package/sksl/EyeBlink.sksl +94 -0
  55. package/sksl/Gallery.sksl +139 -0
  56. package/sksl/HeatHaze.sksl +90 -0
  57. package/sksl/Hologram.sksl +108 -0
  58. package/sksl/LiquidFill.sksl +113 -0
  59. package/sksl/PlasmaDissolve.sksl +64 -0
  60. package/sksl/RingsWipe.sksl +115 -0
  61. package/sksl/SawtoothWipe.sksl +83 -0
  62. package/sksl/SnakeBlockWipe.sksl +53 -0
  63. package/sksl/Snapshot.sksl +98 -0
  64. package/sksl/Sphere.sksl +108 -0
  65. package/sksl/SpiralBlockWipe.sksl +76 -0
  66. package/sksl/VhsTracking.sksl +138 -0
  67. package/sksl/Vortex.sksl +116 -0
  68. package/sksl/index.js +1 -1
  69. package/transitions/ArrowWipe.glsl +99 -0
  70. package/transitions/BlockSlide.glsl +86 -0
  71. package/transitions/CellDissolve.glsl +90 -0
  72. package/transitions/ColorPanelWipe.glsl +74 -0
  73. package/transitions/Crumple.glsl +172 -0
  74. package/transitions/EyeBlink.glsl +82 -0
  75. package/transitions/Gallery.glsl +132 -0
  76. package/transitions/HeatHaze.glsl +78 -0
  77. package/transitions/Hologram.glsl +96 -0
  78. package/transitions/LiquidFill.glsl +101 -0
  79. package/transitions/PlasmaDissolve.glsl +50 -0
  80. package/transitions/RingsWipe.glsl +105 -0
  81. package/transitions/SawtoothWipe.glsl +72 -0
  82. package/transitions/SnakeBlockWipe.glsl +39 -0
  83. package/transitions/Snapshot.glsl +85 -0
  84. package/transitions/Sphere.glsl +94 -0
  85. package/transitions/SpiralBlockWipe.glsl +64 -0
  86. package/transitions/VhsTracking.glsl +126 -0
  87. package/transitions/Vortex.glsl +105 -0
  88. package/wgsl/ArrowWipe.wgsl +352 -0
  89. package/wgsl/BlockSlide.wgsl +384 -0
  90. package/wgsl/CellDissolve.wgsl +323 -0
  91. package/wgsl/ColorPanelWipe.wgsl +274 -0
  92. package/wgsl/Crumple.wgsl +709 -0
  93. package/wgsl/EyeBlink.wgsl +308 -0
  94. package/wgsl/Gallery.wgsl +741 -0
  95. package/wgsl/HeatHaze.wgsl +282 -0
  96. package/wgsl/Hologram.wgsl +339 -0
  97. package/wgsl/LiquidFill.wgsl +339 -0
  98. package/wgsl/PlasmaDissolve.wgsl +149 -0
  99. package/wgsl/RingsWipe.wgsl +394 -0
  100. package/wgsl/SawtoothWipe.wgsl +279 -0
  101. package/wgsl/SnakeBlockWipe.wgsl +188 -0
  102. package/wgsl/Snapshot.wgsl +287 -0
  103. package/wgsl/Sphere.wgsl +316 -0
  104. package/wgsl/SpiralBlockWipe.wgsl +250 -0
  105. package/wgsl/VhsTracking.wgsl +462 -0
  106. package/wgsl/Vortex.wgsl +463 -0
package/sksl/index.js CHANGED
@@ -1 +1 @@
1
- module.exports={"Accordion":"// Accordion — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Accordion.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image folds up like a pleated paper toward one side while the incoming one unfolds out of the other, both in 3D with lit and shadowed pleats\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int pleats; \n\nuniform vec2 direction; \n\nuniform float shading; \n\nuniform float perspective; \n\nuniform vec4 backColor; \n\nconst float LIGHT_SIDE = 0.55;\nconst float LIGHT_FRONT = 0.835;\n\nconst float EDGE = 0.0015;\n\nfloat panelLight(float c, float s, float facing) {\n float lambert = (c * LIGHT_FRONT + facing * s * LIGHT_SIDE) / LIGHT_FRONT;\n return mix(1.0, clamp(lambert, 0.08, 1.25), shading);\n}\n\nvec4 pleated(float f, float c, float len, float b, float bLen, bool incoming, bool flipA, bool vertical) {\n float m = 2.0 * float(pleats > 1 ? pleats : 1);\n float s = sqrt(max(1.0 - c * c, 0.0));\n float u = f * m;\n \n float panel = min(floor(u), m - 1.0);\n float fu = u - panel;\n \n float tri = 1.0 - abs(mod(u, 2.0) - 1.0);\n float panelLen = len / m;\n float z = panelLen * s * (1.0 - tri);\n \n float scale = 1.0 / (1.0 + perspective * z);\n float bb = (b - 0.5 * bLen) / scale / bLen + 0.5;\n \n float edge = EDGE * min(1.0, 20.0 * s * c) + 1e-6;\n float cover = clamp(min(bb, 1.0 - bb) * bLen * scale / edge, 0.0, 1.0);\n float a = flipA ? 1.0 - f : f;\n vec2 st = clamp(vertical ? vec2(bb, a) : vec2(a, bb), 0.0, 1.0);\n vec4 img = incoming ? getToColor(st) : getFromColor(st);\n \n float facing = mod(panel, 2.0) < 0.5 ? 1.0 : -1.0;\n float toEdge = min(fu, 1.0 - fu) * panelLen * c;\n float k = 0.5 + 0.5 * clamp(toEdge / EDGE, 0.0, 1.0);\n float light = mix(panelLight(c, s, -facing), panelLight(c, s, facing), k);\n \n float valley = 1.0 - tri;\n light *= 1.0 - 0.4 * shading * s * valley * valley;\n return mix(backColor, vec4(img.rgb * light, img.a), cover);\n}\n\nvec4 transition(vec2 uv) {\n bool vertical = abs(direction.y) > abs(direction.x);\n bool positive = vertical ? direction.y > 0.0 : direction.x > 0.0;\n \n float a = vertical ? uv.y : uv.x;\n if (positive) a = 1.0 - a;\n float b = vertical ? uv.x : uv.y;\n float len = vertical ? 1.0 : ratio;\n float bLen = vertical ? ratio : 1.0;\n\n float p = progress;\n float e = p * p * (3.0 - 2.0 * p);\n e = mix(p, e, 0.8);\n \n float cFrom = 1.0 - e;\n float cTo = e;\n if (a < cFrom || cTo <= 0.0) {\n \n return pleated(a / cFrom, cFrom, len, b * bLen, bLen, false, positive, vertical);\n }\n \n return pleated(1.0 - (1.0 - a) / cTo, cTo, len, b * bLen, bLen, true, positive, vertical);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ApertureWipe":"// ApertureWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ApertureWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A camera aperture opens its turning blades to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int blades; \n\nuniform float rotation; \n\nuniform float shadow; \n\nconst float AA = 0.006;\n\nvec4 transition (vec2 uv) {\n \n vec2 q = (uv - 0.5) * vec2(ratio, 1.0) / (0.5 * length(vec2(ratio, 1.0)));\n float n = clamp(float(blades), 3.0, 12.0);\n float sector = 2.0 * 3.141592653589793 / n;\n float turn = radians(rotation) * progress;\n \n float r = mix(-AA, 1.0 + AA, progress);\n float dist = -1e3;\n float seam = 0.0;\n for (int i = 0; i < 12; i++) {\n if (float(i) < n) {\n float angle = turn + float(i) * sector;\n float d = dot(q, vec2(cos(angle), sin(angle))) - r;\n float next = dot(q, vec2(cos(angle + sector), sin(angle + sector))) - r;\n dist = max(dist, d);\n \n float s = 1.0 - smoothstep(0.0, 0.12, -d);\n seam = max(seam, (1.0 - smoothstep(0.0, AA, d)) * s * s * smoothstep(0.0, AA, next));\n }\n }\n \n float rim = 1.0 - smoothstep(0.0, 0.08, dist);\n float shade = shadow * max(rim * rim, seam) * smoothstep(0.0, 0.1, progress);\n vec4 from = getFromColor(uv);\n from.rgb *= 1.0 - shade;\n return mix(from, getToColor(uv), 1.0 - smoothstep(0.0, AA, dist));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Ascii":"// Ascii — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Ascii.glsl\n// Author: gre\n// License: MIT\n// Description: The image turns into text-mode characters, denser where it is brighter, the characters scramble into those of the incoming image, then resolve back into it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float cellSize; \n\nuniform int colored; \n\nuniform vec4 ink; \n\nuniform vec4 background; \n\nconst float ASPECT = 0.6;\n\nconst float STROKE = 0.05;\n\nfloat hash12(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat segment(vec2 q, vec2 a, vec2 b) {\n vec2 pa = q - a;\n vec2 ba = b - a;\n return length(pa - ba * clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0));\n}\n\nfloat glyph(float g, vec2 q) {\n if (g < 0.5) return 1.0; \n if (g < 1.5) return length(q - vec2(0.0, -0.27)) - 0.035; \n if (g < 2.5) return min(length(q - vec2(0.0, -0.25)), length(q - vec2(0.0, 0.1))) - 0.035; \n if (g < 3.5) return segment(q, vec2(-0.17, 0.0), vec2(0.17, 0.0)) - STROKE; \n if (g < 4.5) { \n return min(segment(q, vec2(-0.18, 0.1), vec2(0.18, 0.1)), segment(q, vec2(-0.18, -0.1), vec2(0.18, -0.1))) - STROKE;\n }\n if (g < 5.5) { \n return min(segment(q, vec2(-0.19, 0.0), vec2(0.19, 0.0)), segment(q, vec2(0.0, -0.19), vec2(0.0, 0.19))) - STROKE;\n }\n if (g < 6.5) { \n float d = segment(q, vec2(0.0, -0.2), vec2(0.0, 0.2));\n d = min(d, segment(q, vec2(-0.18, -0.11), vec2(0.18, 0.11)));\n d = min(d, segment(q, vec2(-0.18, 0.11), vec2(0.18, -0.11)));\n return d - STROKE;\n }\n if (g < 7.5) { \n float d = min(segment(q, vec2(-0.06, -0.3), vec2(-0.1, 0.3)), segment(q, vec2(0.12, -0.3), vec2(0.08, 0.3)));\n d = min(d, min(segment(q, vec2(-0.24, 0.11), vec2(0.24, 0.11)), segment(q, vec2(-0.24, -0.11), vec2(0.24, -0.11))));\n return d - STROKE;\n }\n if (g < 8.5) { \n float d = segment(q, vec2(-0.2, -0.3), vec2(0.2, 0.3));\n d = min(d, abs(length(q - vec2(-0.13, 0.19)) - 0.08));\n d = min(d, abs(length(q - vec2(0.13, -0.19)) - 0.08));\n return d - STROKE;\n }\n \n float d = abs(length(q) - 0.25);\n d = min(d, abs(length(q - vec2(-0.02, 0.0)) - 0.1));\n d = min(d, segment(q, vec2(0.08, 0.1), vec2(0.08, -0.12)));\n return d - 0.8 * STROKE;\n}\n\nfloat density(vec4 c) {\n return floor(pow(clamp(dot(c.rgb, vec3(0.299, 0.587, 0.114)) * c.a, 0.0, 1.0), 0.75) * 9.99);\n}\n\nvec4 cellColor(vec2 center, vec2 dims, bool incoming) {\n vec4 c = vec4(0.0);\n for (int i = 0; i < 4; i++) {\n vec2 o = (vec2(mod(float(i), 2.0), floor(float(i) / 2.0)) - 0.5) * 0.5 * dims;\n vec2 st = clamp((center + o) / vec2(ratio, 1.0) + 0.5, 0.0, 1.0);\n c += incoming ? getToColor(st) : getFromColor(st);\n }\n return c * 0.25;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n float h = cellSize;\n vec2 fp = (uv - 0.5) * vec2(ratio, 1.0);\n vec2 dims = vec2(ASPECT * h, h);\n vec2 cell = floor(fp / dims);\n vec2 center = (cell + 0.5) * dims;\n vec2 q = (fp - center) / h;\n\n \n \n float r = hash12(cell + 100.0);\n float at = 0.4 + 0.2 * r;\n bool incoming = p > at;\n vec4 c = cellColor(center, dims, incoming);\n float g = density(c);\n float scramble = 1.0 - smoothstep(0.02, 0.045, abs(p - at));\n if (hash12(cell + floor(p * 40.0) * vec2(17.0, 31.0)) < scramble) {\n g = 1.0 + floor(9.0 * hash12(cell * 1.7 + floor(p * 40.0) * vec2(5.0, 11.0)));\n }\n\n float cover = 1.0 - smoothstep(-0.02, 0.02, glyph(g, q));\n vec3 tint = (colored != 0) ? mix(c.rgb, c.rgb / max(max(c.r, max(c.g, c.b)), 0.05), 0.7) : ink.rgb;\n float alpha = (colored != 0) ? c.a : ink.a * c.a;\n \n \n vec3 behind = (colored != 0) ? mix(background.rgb, c.rgb, 0.3) : background.rgb;\n vec4 back = vec4(behind, background.a * c.a);\n vec4 text = mix(back, vec4(clamp(tint, 0.0, 1.0), alpha), cover);\n\n \n \n float into = 0.05 + 0.22 * hash12(cell + 200.0);\n float outof = 0.95 - 0.22 * hash12(cell + 300.0);\n float show = smoothstep(into, into + 0.08, p) * (1.0 - smoothstep(outof - 0.08, outof, p));\n vec4 image = p < 0.5 ? getFromColor(uv) : getToColor(uv);\n return mix(image, text, show);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BlockCover":"// BlockCover — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BlockCover.glsl\n// Author: gre\n// License: MIT\n// Description: Blocks of a solid color pop in at random over the outgoing image until they cover the frame, then pop out in another random order to show the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int blocks; \n\nuniform vec4 color; \n\nuniform float pop; \n\nuniform float smoothness; \n\nconst float duration = 0.14; \nconst float cut = 0.45; \nconst float hold = 0.02;\n\nfloat hash (vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat backOut (float t, float c) {\n float u = t - 1.0;\n return 1.0 + (c + 1.0) * u * u * u + c * u * u;\n}\n\nvec2 timing (vec2 cell) {\n return vec2(\n (cut - hold - duration) * hash(cell + 0.5),\n cut + hold + (1.0 - cut - hold - duration) * hash(cell + 71.7));\n}\n\nfloat blockScale (vec2 cell, float c) {\n vec2 t = timing(cell);\n float a = clamp((progress - t.x) / duration, 0.0, 1.0);\n float b = clamp((progress - t.y) / duration, 0.0, 1.0);\n \n return b > 0.0 ? (1.0 - b) * (1.0 - b) : backOut(a, c);\n}\n\nfloat coverage (vec2 q, vec2 cell, float s, float sm) {\n \n float h = s * (0.5 + sm);\n vec2 d = abs(q - cell - 0.5);\n return s > 0.0 ? 1.0 - smoothstep(h - sm, h, max(d.x, d.y)) : 0.0;\n}\n\nvec4 transition (vec2 uv) {\n float nLong = max(float(blocks), 1.0);\n vec2 n = ratio >= 1.0\n ? vec2(nLong, max(1.0, floor(nLong / ratio + 0.5)))\n : vec2(max(1.0, floor(nLong * ratio + 0.5)), nLong);\n vec2 q = uv * n;\n vec2 cell = floor(q);\n float sm = max(smoothness, 0.001);\n float c = 2.0 * clamp(pop, 0.0, 1.0);\n float s = blockScale(cell, c);\n if (s >= 1.0) return color;\n float cover = coverage(q, cell, s, sm);\n \n float u = -2.0 * c / (3.0 * (c + 1.0));\n float reach = backOut(1.0 + u, c) * (0.5 + sm);\n vec2 o = abs(q - cell - 0.5);\n if (max(o.x, o.y) > 1.0 - reach) {\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n vec2 nb = cell + vec2(float(i), float(j));\n vec2 inside = step(vec2(0.0), nb) * step(nb, n - 1.0);\n if (inside.x * inside.y > 0.0 && (i != 0 || j != 0)) {\n cover = max(cover, coverage(q, nb, blockScale(nb, c), sm));\n }\n }\n }\n }\n \n vec2 t = timing(cell);\n vec4 under = progress < 0.5 * (t.x + duration + t.y) ? getFromColor(uv) : getToColor(uv);\n return mix(under, color, cover);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BlockDissolve":"// BlockDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BlockDissolve.glsl\n// Author: nwoeanhinnogaehr\n// License: MIT\n// Description: The incoming image appears in small random blocks\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float blocksize; \n\nfloat rand(vec2 co) {\n return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvec4 transition(vec2 uv) {\n return mix(getFromColor(uv), getToColor(uv), step(rand(floor(uv / blocksize)), progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BloomDissolve":"// BloomDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BloomDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The highlights of the outgoing image blow out into a soft, wide glow that floods the frame; under it the incoming image takes over, then the glow subsides back into its highlights while the image stays sharp\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float spread; \n\nuniform float threshold; \n\nuniform float intensity; \n\nuniform vec3 tint; \n\nconst int PAIRS = 10;\nconst float GOLDEN_ANGLE = 2.399963;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 image(vec2 st, float m) {\n if (m <= 0.0) {\n vec4 c = getFromColor(st);\n return vec4(c.rgb * c.a, c.a);\n }\n if (m >= 1.0) {\n vec4 c = getToColor(st);\n return vec4(c.rgb * c.a, c.a);\n }\n vec4 a = getFromColor(st);\n vec4 b = getToColor(st);\n return mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n}\n\nvec3 glow(vec4 c, float knee) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n return c.rgb * smoothstep(knee, knee + max(0.3 * (1.0 - knee), 1e-3), lum);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float amount = 4.0 * p * (1.0 - p);\n float peak = amount * amount;\n \n float flood = peak * peak * peak;\n \n float m = smoothstep(0.44, 0.56, p);\n if (amount <= 0.0) return m < 0.5 ? getFromColor(uv) : getToColor(uv);\n\n \n vec4 c = image(uv, m);\n if (c.a <= 0.0) return vec4(0.0);\n c.rgb /= c.a;\n\n \n float knee = threshold * (1.0 - 0.3 * peak) * (1.0 - flood);\n float radius = spread * amount;\n \n \n vec2 cell = floor(uv * vec2(ratio, 1.0) * 997.0);\n float spin = 6.2831853 * hash12(cell);\n float shift = hash12(cell + 71.0);\n\n \n \n vec3 bloom = vec3(0.0);\n vec4 soft = vec4(0.0);\n float total = 0.0;\n for (int i = 0; i < PAIRS; i++) {\n float s = (float(i) + shift) / float(PAIRS);\n float r = s * s;\n float a = float(i) * GOLDEN_ANGLE + spin;\n vec2 offset = radius * r * vec2(cos(a) / ratio, sin(a));\n vec4 i0 = image(mirror(uv + offset), m);\n vec4 i1 = image(mirror(uv - offset), m);\n vec3 l = glow(i0, knee) + glow(i1, knee);\n \n float w = 1.0 - 0.75 * s;\n \n bloom += w * mix(vec3(1.0), tint, smoothstep(0.0, 0.5, r)) * l;\n total += w;\n \n float sw = (1.0 - s) * (1.0 - s);\n soft += sw * (i0 + i1);\n }\n bloom /= 2.0 * total;\n \n vec3 blurred = soft.a > 0.0 ? soft.rgb / soft.a : c.rgb;\n vec3 base = mix(c.rgb, blurred, 0.7 * flood);\n bloom *= intensity * peak * (1.0 + 2.0 * flood);\n \n bloom = 0.92 * (1.0 - exp(-bloom));\n\n \n base = min(base * (1.0 + 0.25 * peak), 1.0);\n return vec4(base + bloom - base * bloom, c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BokehDissolve":"// BokehDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BokehDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The image falls out of focus like a camera lens, its highlights swelling into large bright bokeh discs, and the incoming image sharpens back out of its own bokeh\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float radius; \n\nuniform int blades; \n\nuniform float threshold; \n\nuniform float intensity; \n\nconst int TAPS = 16;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat hash12(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat highlight(vec4 c, float t) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n \n if (t >= 1.0) return 0.0;\n float h = smoothstep(t, 1.0, lum);\n return h * h * c.a;\n}\n\nvec4 transition(vec2 uv) {\n \n float t = 1.0 - abs(2.0 * progress - 1.0);\n float k = t * t * (3.0 - 2.0 * t);\n \n float w = smoothstep(0.35, 0.65, progress);\n float r = radius * k;\n \n float boost = 12.0 * intensity * k;\n\n \n float n = blades >= 3 ? float(blades) : 0.0;\n float sector = n > 0.0 ? 2.0 * 3.141592653589793 / n : 1.0;\n float apothem = cos(0.5 * sector);\n\n \n vec2 cell = floor(uv * vec2(ratio, 1.0) * 997.0);\n float spin = 2.0 * 3.141592653589793 * hash12(cell);\n float jitter = hash12(cell + 17.0);\n\n \n bool useFrom = w < 1.0;\n bool useTo = w > 0.0;\n \n \n vec4 s0 = vec4(0.0);\n vec4 s1 = vec4(0.0);\n float t0 = 0.0;\n float t1 = 0.0;\n vec3 l0 = vec3(0.0);\n vec3 l1 = vec3(0.0);\n if (useFrom) {\n vec4 c = getFromColor(uv);\n float h = highlight(c, threshold);\n float wt = 1.0 + boost * h;\n s0 = wt * vec4(c.rgb * c.a, c.a);\n t0 = wt;\n l0 = h * c.rgb;\n }\n if (useTo) {\n vec4 c = getToColor(uv);\n float h = highlight(c, threshold);\n float wt = 1.0 + boost * h;\n s1 = wt * vec4(c.rgb * c.a, c.a);\n t1 = wt;\n l1 = h * c.rgb;\n }\n for (int i = 0; i < TAPS; i++) {\n float fi = float(i);\n float a = fi * 2.39996323 + spin;\n float d = sqrt((fi + jitter) / float(TAPS));\n if (n > 0.0) {\n \n float s = mod(a, sector) - 0.5 * sector;\n d *= apothem / cos(s);\n }\n vec2 st = mirror(uv + r * d * vec2(cos(a) / ratio, sin(a)));\n if (useFrom) {\n vec4 c = getFromColor(st);\n float h = highlight(c, threshold);\n float wt = 1.0 + boost * h;\n s0 += wt * vec4(c.rgb * c.a, c.a);\n t0 += wt;\n l0 += h * c.rgb;\n }\n if (useTo) {\n vec4 c = getToColor(st);\n float h = highlight(c, threshold);\n float wt = 1.0 + boost * h;\n s1 += wt * vec4(c.rgb * c.a, c.a);\n t1 += wt;\n l1 += h * c.rgb;\n }\n }\n vec4 b = mix(useFrom ? s0 / t0 : vec4(0.0), useTo ? s1 / t1 : vec4(0.0), w);\n if (b.a <= 0.0) {\n return vec4(0.0);\n }\n vec3 rgb = b.rgb / b.a;\n \n vec3 light = mix(l0, l1, w) * (intensity * k * 4.0 / float(TAPS + 1));\n rgb = 1.0 - (1.0 - clamp(rgb, 0.0, 1.0)) * exp(-light);\n return vec4(rgb, b.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BookFlip":"// BookFlip — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BookFlip.glsl\n// Author: hong\n// License: MIT\n// Description: The outgoing image turns like a book page from right to left, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat nonZero(float x) {\n return abs(x) < 1e-4 ? (x < 0.0 ? -1e-4 : 1e-4) : x;\n}\n\nvec2 skewRight(vec2 p) {\n float skewX = (p.x - progress)/nonZero(0.5 - progress) * 0.5;\n float skewY = (p.y - 0.5)/(0.5 + progress * (p.x - 0.5) / 0.5)* 0.5 + 0.5;\n return vec2(skewX, skewY);\n}\n\nvec2 skewLeft(vec2 p) {\n float skewX = (p.x - 0.5)/nonZero(progress - 0.5) * 0.5 + 0.5;\n float skewY = (p.y - 0.5) / (0.5 + (1.0 - progress ) * (0.5 - p.x) / 0.5) * 0.5 + 0.5;\n return vec2(skewX, skewY);\n}\n\nvec4 addShade() {\n float shadeVal = max(0.7, abs(progress - 0.5) * 2.0);\n return vec4(vec3(shadeVal ), 1.0);\n}\n\nvec4 transition (vec2 p) {\n float pr = step(1.0 - progress, p.x);\n\n if (p.x < 0.5) {\n return mix(getFromColor(p), getToColor(skewLeft(p)) * addShade(), pr);\n } else {\n return mix(getFromColor(skewRight(p)) * addShade(), getToColor(p), pr);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Bounce":"// Bounce — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Bounce.glsl\n// Author: Adrian Purser\n// License: MIT\n// Description: The outgoing image drops out of the frame with a few bounces, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 shadow_colour; \n\nuniform float shadow_height; \n\nuniform float bounces; \n\nconst float PI = 3.14159265358;\n\nvec4 transition (vec2 uv) {\n float time = progress;\n float stime = sin(time * PI / 2.);\n float phase = time * PI * bounces;\n float y = (abs(cos(phase))) * (1.0 - stime);\n float d = uv.y - y;\n vec4 to = getToColor(uv);\n return mix(\n mix(\n to,\n vec4(shadow_colour.rgb, 1.0), \n step(d, shadow_height) * (1. - mix(\n ((d / shadow_height) * shadow_colour.a) + (1.0 - shadow_colour.a),\n 1.0,\n smoothstep(0.95, 1., progress) \n )) * to.a \n ),\n getFromColor(vec2(uv.x, uv.y + (1.0 - y))),\n step(d, 0.0)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BowTie":"// BowTie — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BowTie.glsl\n// Author: KMojek\n// License: MIT\n// Description: A bow-tie wipe with an adjustable shape that can run in reverse\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float adjust; \n\nuniform int reverse; \n\nfloat check(vec2 p1, vec2 p2, vec2 p3)\n{\n return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);\n}\n\nbool pointInTriangle(vec2 pt, vec2 p1, vec2 p2, vec2 p3)\n{\n\n bool b1 = check(pt, p1, p2) < 0.0;\n bool b2 = check(pt, p2, p3) < 0.0;\n bool b3 = check(pt, p3, p1) < 0.0;\n return b1 == b2 && b2 == b3;\n}\n\nconst float height = 0.5;\n\nvec4 transition_firstHalf( vec2 uv, float prog )\n{\n if ( uv.y < 0.5 )\n {\n vec2 botLeft = vec2( -0., prog-height );\n vec2 botRight = vec2( 1., prog-height );\n vec2 tip = vec2( adjust, prog );\n if ( pointInTriangle( uv, botLeft, botRight, tip ) )\n return getToColor(uv);\n }\n else\n {\n vec2 topLeft = vec2( -0., 1.-prog+height );\n vec2 topRight = vec2( 1., 1.-prog+height );\n vec2 tip = vec2( adjust, 1.-prog );\n if ( pointInTriangle( uv, topLeft, topRight, tip ) )\n return getToColor( uv );\n }\n return getFromColor( uv );\n}\n\nvec4 transition_secondHalf( vec2 uv, float prog )\n{\n if ( uv.x > adjust )\n {\n vec2 top = vec2( prog + height, 1. );\n vec2 bot = vec2( prog + height, -0. );\n vec2 tip = vec2( mix( adjust, 1.0, 2.0 * (prog - 0.5) ), 0.5 );\n if ( pointInTriangle( uv, top, bot, tip) )\n return getFromColor( uv );\n }\n else\n {\n vec2 top = vec2( 1.0-prog - height, 1. );\n vec2 bot = vec2( 1.0-prog - height, -0. );\n vec2 tip = vec2( mix( adjust, 0.0, 2.0 * (prog - 0.5) ), 0.5 );\n if ( pointInTriangle( uv, top, bot, tip) )\n return getFromColor( uv );\n }\n return getToColor( uv );\n}\n\nvec4 transition (vec2 uv) {\n if ( (reverse != 0) )\n return ( progress < 0.5 ) ? transition_secondHalf( uv, 1.-progress ) : transition_firstHalf( uv, 1.-progress );\n else\n return ( progress < 0.5 ) ? transition_firstHalf( uv, progress ) : transition_secondHalf( uv, progress );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BowTieHorizontal":"// BowTieHorizontal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BowTieHorizontal.glsl\n// Author: huynx\n// License: MIT\n// Description: Two triangles grow from the left and right edges into a bow tie that reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst vec2 bottom_left = vec2(0.0, 1.0);\nconst vec2 bottom_right = vec2(1.0, 1.0);\nconst vec2 top_left = vec2(0.0, 0.0);\nconst vec2 top_right = vec2(1.0, 0.0);\nconst vec2 center = vec2(0.5, 0.5);\n\nfloat check(vec2 p1, vec2 p2, vec2 p3)\n{\n return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);\n}\n\nbool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2 p3)\n{\n bool b1, b2, b3;\n b1 = check(pt, p1, p2) < 0.0;\n b2 = check(pt, p2, p3) < 0.0;\n b3 = check(pt, p3, p1) < 0.0;\n return ((b1 == b2) && (b2 == b3));\n}\n\nbool in_left_triangle(vec2 p){\n vec2 vertex1, vertex2, vertex3;\n vertex1 = vec2(progress, 0.5);\n vertex2 = vec2(0.0, 0.5-progress);\n vertex3 = vec2(0.0, 0.5+progress);\n if (PointInTriangle(p, vertex1, vertex2, vertex3))\n {\n return true;\n }\n return false;\n}\n\nbool in_right_triangle(vec2 p){\n vec2 vertex1, vertex2, vertex3;\n vertex1 = vec2(1.0-progress, 0.5);\n vertex2 = vec2(1.0, 0.5-progress);\n vertex3 = vec2(1.0, 0.5+progress);\n if (PointInTriangle(p, vertex1, vertex2, vertex3))\n {\n return true;\n }\n return false;\n}\n\nfloat blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt)\n{\n vec2 lineDir = bot1 - top;\n vec2 perpDir = vec2(lineDir.y, -lineDir.x);\n vec2 dirToPt1 = bot1 - testPt;\n float dist1 = abs(dot(normalize(perpDir), dirToPt1));\n \n lineDir = bot2 - top;\n perpDir = vec2(lineDir.y, -lineDir.x);\n dirToPt1 = bot2 - testPt;\n float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1);\n \n if (min_dist < 0.005) {\n return min_dist / 0.005;\n }\n else {\n return 1.0;\n };\n}\n\nvec4 transition (vec2 uv) {\n if (in_left_triangle(uv))\n {\n if (progress < 0.1)\n {\n return getFromColor(uv);\n }\n if (uv.x < 0.5)\n {\n vec2 vertex1 = vec2(progress, 0.5);\n vec2 vertex2 = vec2(0.0, 0.5-progress);\n vec2 vertex3 = vec2(0.0, 0.5+progress);\n return mix(\n getFromColor(uv),\n getToColor(uv),\n blur_edge(vertex2, vertex3, vertex1, uv)\n );\n }\n else\n {\n if (progress > 0.0)\n {\n return getToColor(uv);\n }\n else\n {\n return getFromColor(uv);\n }\n } \n }\n else if (in_right_triangle(uv))\n {\n if (uv.x >= 0.5)\n {\n vec2 vertex1 = vec2(1.0-progress, 0.5);\n vec2 vertex2 = vec2(1.0, 0.5-progress);\n vec2 vertex3 = vec2(1.0, 0.5+progress);\n return mix(\n getFromColor(uv),\n getToColor(uv),\n blur_edge(vertex2, vertex3, vertex1, uv)\n ); \n }\n else\n {\n return getFromColor(uv);\n }\n }\n else {\n return getFromColor(uv);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BowTieVertical":"// BowTieVertical — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BowTieVertical.glsl\n// Author: huynx\n// License: MIT\n// Description: Two triangles grow from the top and bottom edges into a bow tie that reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat check(vec2 p1, vec2 p2, vec2 p3)\n{\n return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);\n}\n\nbool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2 p3)\n{\n bool b1, b2, b3;\n b1 = check(pt, p1, p2) < 0.0;\n b2 = check(pt, p2, p3) < 0.0;\n b3 = check(pt, p3, p1) < 0.0;\n return ((b1 == b2) && (b2 == b3));\n}\n\nbool in_top_triangle(vec2 p){\n vec2 vertex1, vertex2, vertex3;\n vertex1 = vec2(0.5, progress);\n vertex2 = vec2(0.5-progress, 0.0);\n vertex3 = vec2(0.5+progress, 0.0);\n if (PointInTriangle(p, vertex1, vertex2, vertex3))\n {\n return true;\n }\n return false;\n}\n\nbool in_bottom_triangle(vec2 p){\n vec2 vertex1, vertex2, vertex3;\n vertex1 = vec2(0.5, 1.0 - progress);\n vertex2 = vec2(0.5-progress, 1.0);\n vertex3 = vec2(0.5+progress, 1.0);\n if (PointInTriangle(p, vertex1, vertex2, vertex3))\n {\n return true;\n }\n return false;\n}\n\nfloat blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt)\n{\n vec2 lineDir = bot1 - top;\n vec2 perpDir = vec2(lineDir.y, -lineDir.x);\n vec2 dirToPt1 = bot1 - testPt;\n float dist1 = abs(dot(normalize(perpDir), dirToPt1));\n \n lineDir = bot2 - top;\n perpDir = vec2(lineDir.y, -lineDir.x);\n dirToPt1 = bot2 - testPt;\n float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1);\n \n if (min_dist < 0.005) {\n return min_dist / 0.005;\n }\n else {\n return 1.0;\n };\n}\n\nvec4 transition (vec2 uv) {\n if (in_top_triangle(uv))\n {\n if (progress < 0.1)\n {\n return getFromColor(uv);\n }\n if (uv.y < 0.5)\n {\n vec2 vertex1 = vec2(0.5, progress);\n vec2 vertex2 = vec2(0.5-progress, 0.0);\n vec2 vertex3 = vec2(0.5+progress, 0.0);\n return mix(\n getFromColor(uv),\n getToColor(uv),\n blur_edge(vertex2, vertex3, vertex1, uv)\n );\n }\n else\n {\n if (progress > 0.0)\n {\n return getToColor(uv);\n }\n else\n {\n return getFromColor(uv);\n }\n } \n }\n else if (in_bottom_triangle(uv))\n {\n if (uv.y >= 0.5)\n {\n vec2 vertex1 = vec2(0.5, 1.0-progress);\n vec2 vertex2 = vec2(0.5-progress, 1.0);\n vec2 vertex3 = vec2(0.5+progress, 1.0);\n return mix(\n getFromColor(uv),\n getToColor(uv),\n blur_edge(vertex2, vertex3, vertex1, uv)\n ); \n }\n else\n {\n return getFromColor(uv);\n }\n }\n else {\n return getFromColor(uv);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Box":"// Box — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Box.glsl\n// Author: lql\n// License: MIT\n// Description: The outgoing image shrinks into a box, toward the center or a corner, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int rectIn; \n\nuniform int location; \n\nvec4 transition(vec2 uv) {\n float p = rectIn == 1 ? 1.0 - progress : progress;\n float x1, y1, x2, y2;\n\n \n if (location == 0) {\n x1 = y1 = 0.5 * (1.0 - p);\n x2 = y2 = 1.0 - x1;\n } else {\n \n x1 = (location == 1 || location == 2) ? 0.0 : 1.0 - p;\n y1 = (location == 1 || location == 3) ? 1.0 - p : 0.0;\n x2 = (location == 1 || location == 2) ? p : 1.0;\n y2 = (location == 1 || location == 3) ? 1.0 : p;\n }\n\n \n float in_rect = step(x1, uv.x) * step(uv.x, x2) * step(y1, uv.y) * step(uv.y, y2);\n in_rect = rectIn == 1 ? 1.0 - in_rect : in_rect;\n\n \n return mix(getFromColor(uv), getToColor(uv), in_rect);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BrushWipe":"// BrushWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BrushWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A few broad brush strokes sweep across the frame in turn, back and forth, painting in the incoming image with streaky bristle edges and dry, ragged ends\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strokes; \n\nuniform float angle; \n\nuniform float roughness; \n\nuniform float waviness; \n\nconst float PI = 3.141592653589793;\n\nfloat hash (vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat vnoise (vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nfloat bristles (float t, float u, float seed) {\n return 0.6 * vnoise(vec2(t * 26.0 + seed, u * 1.3 + seed)) + 0.4 * vnoise(vec2(t * 8.0 - seed, u * 0.7));\n}\n\nvec2 stroke (float k, float t, float u, float U, float n, float h) {\n float dir = mod(k, 2.0) < 0.5 ? 1.0 : -1.0;\n float x = u * dir;\n float dur = min(1.0, 1.8 / (n + 0.8));\n float start = n > 1.0 ? k * (1.0 - dur) / (n - 1.0) : 0.0;\n float s = clamp((progress - start) / dur, 0.0, 1.0);\n s = mix(s, s * s * (3.0 - 2.0 * s), 0.7);\n float r = roughness;\n float lag = (0.15 + 0.6 * r) * h; \n float dry = (0.1 + 0.9 * r) * h; \n \n float head = mix(-U, U + lag + 0.3 * h + 1.15 * dry + 0.01, s);\n float b = bristles(t, k * 3.7, k * 17.0);\n float front = head - lag * (1.0 - b) - 0.3 * h * t * t; \n float streak = bristles(t * 1.7, x * 2.0 / h, k * 5.0 + 9.0);\n float along = clamp(((front - x) / (dry + 0.001) - 0.1 - 0.8 * streak) * 6.0, 0.0, 1.0);\n float fringe = 0.1 + 0.7 * r;\n float e = (abs(t) - 1.0) / fringe; \n float reach = 0.5 + 0.5 * vnoise(vec2(x * 2.5 / h, k * 7.0 + (t > 0.0 ? 3.0 : 0.0))); \n float hair = clamp(bristles(t * 1.4, x * 3.0 / h, k * 11.0 + 3.0) * 2.0 - 0.5, 0.0, 1.0);\n float side = clamp((reach * hair - e) * 12.0 + 1.0, 0.0, 1.0);\n float cover = along * side;\n float wet = (1.0 - clamp((progress - start - dur) / 0.25, 0.0, 1.0)) * min(1.0, (1.0 - progress) * 6.0);\n return vec2(cover, cover * wet * (bristles(t * 2.0, x * 2.0 / h, k) - 0.5));\n}\n\nvec4 transition (vec2 uv) {\n float a = angle * PI / 180.0;\n float c = cos(a);\n float sn = sin(a);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float u = c * q.x + sn * q.y; \n float v = -sn * q.x + c * q.y; \n float U = 0.5 * (abs(c) * ratio + abs(sn));\n float V = 0.5 * (abs(sn) * ratio + abs(c));\n float n = max(1.0, floor(strokes + 0.5));\n float h = 2.0 * V / n; \n \n float A = 0.12 * waviness * h;\n float w = v + A * sin(u * 5.0 / U + v * 2.0 / h + 1.3) + 0.5 * A * sin(u * 11.0 / U - v * 3.0 / h);\n float y = (V + 1.5 * A - w) / (2.0 * V + 3.0 * A) * n; \n float hh = (2.0 * V + 3.0 * A) / n;\n float k = clamp(floor(y), 0.0, n - 1.0);\n float cover = 0.0;\n float shade = 0.0;\n for (int i = -1; i <= 1; i++) {\n float j = k + float(i);\n if (j >= 0.0 && j <= n - 1.0) {\n vec2 s = stroke(j, (y - j - 0.5) * 2.0, u, U, n, hh);\n cover = max(cover, s.x);\n shade = mix(shade, s.y, s.x); \n }\n }\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n to.rgb = min(to.rgb * (1.0 + 0.2 * shade), 1.0);\n return mix(from, to, cover);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BurnThrough":"// BurnThrough — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BurnThrough.glsl\n// Author: liubailin2020@gmail.com\n// License: MIT\n// Description: The outgoing image burns away in noisy, glowing patches\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec3 burnColor; \n\nfloat random (in vec2 st) {\n return fract(sin(dot(st.xy,\n vec2(12.9898,78.233)))*\n 43758.5453123);\n}\n\nfloat noise (in vec2 st) {\n vec2 i = floor(st);\n vec2 f = fract(st);\n\n float a = random(i);\n float b = random(i + vec2(1.0, 0.0));\n float c = random(i + vec2(0.0, 1.0));\n float d = random(i + vec2(1.0, 1.0));\n\n vec2 u = f * f * (3.0 - 2.0 * f);\n\n return mix(a, b, u.x) +\n (c - a)* u.y * (1.0 - u.x) +\n (d - b) * u.x * u.y;\n}\n\nfloat fbm (in vec2 st) {\n float value = 0.0;\n float amplitude = .5;\n for (int i = 0; i < 4; i++) {\n value += amplitude * noise(st);\n st *= 2.;\n amplitude *= .5;\n }\n return value;\n}\n\nvec4 transition (vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n float n = fbm(uv * 4.);\n float l = smoothstep(progress, progress + 0.05, n);\n float edge = (1.0 - l) * l * 5.0;\n return mix(to, from, l) + vec4(burnColor, 0.0) * edge;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ButterflyWaveScrawler":"// ButterflyWaveScrawler — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ButterflyWaveScrawler.glsl\n// Author: mandubian\n// License: MIT\n// Description: Wavy, color-separated ripples scramble the outgoing image into the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float amplitude; \nuniform float waves; \nuniform float colorSeparation; \nconst float PI = 3.14159265358979323846264;\nfloat compute(vec2 p, float progress, vec2 center) {\nvec2 o = p*sin(progress * amplitude)-center;\n\nvec2 h = vec2(1., 0.);\n\nfloat theta = acos(dot(o, h)) * waves;\nfloat s = sin((2.*theta - PI) / 24.);\nfloat s2 = s * s;\nreturn (exp(cos(theta)) - 2.*cos(4.*theta) + s2 * s2 * s) / 10.;\n}\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n vec2 p = uv;\n float inv = 1. - progress;\n float disp = compute(p, progress, vec2(0.5, 0.5));\n vec4 texTo = getToColor(p + inv*disp);\n vec4 fromCenter = getFromColor(p + progress*disp);\n vec4 texFrom = vec4(\n getFromColor(p + progress*disp*(1.0 - colorSeparation)).r,\n fromCenter.g,\n getFromColor(p + progress*disp*(1.0 + colorSeparation)).b,\n fromCenter.a);\n return texTo*progress + texFrom*inv;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CameraShake":"// CameraShake — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CameraShake.glsl\n// Author: gre\n// License: MIT\n// Description: The camera jolts violently in random directions, with motion blur and color fringes along each jolt; the cut happens at the peak of the shake, which then settles on the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nuniform float jolts; \n\nuniform float blur; \n\nuniform float split; \n\nconst int TAPS = 10;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec3 jolt(float k) {\n \n float a = 2.4 * k + 1.2 * hash12(vec2(k, 11.0));\n float m = 0.55 + 0.45 * hash12(vec2(k, 23.0));\n return vec3(m * cos(a), m * sin(a), 2.0 * hash12(vec2(k, 37.0)) - 1.0);\n}\n\nfloat envelope(float t) {\n float h = clamp(1.6 * (1.0 - abs(2.0 * t - 1.0)), 0.0, 1.0);\n return h * h * (3.0 - 2.0 * h);\n}\n\nvec4 shot(vec2 uv, float t, bool incoming) {\n float env = envelope(t);\n \n float s = (t - 0.5) * jolts;\n float k = floor(s);\n float g = 1.0 - (s - k);\n float e = 1.0 - g * g * g; \n vec3 j = mix(jolt(k), jolt(k + 1.0), e) * env;\n float omax = 0.14 * strength * env;\n float rmax = 0.07 * strength * env;\n vec2 off = j.xy * omax;\n float roll = j.z * rmax;\n \n float zoom = (cos(rmax) + sin(rmax) * max(ratio, 1.0 / ratio)) / (1.0 - 2.0 * omax);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n q = mat2(cos(roll), sin(roll), -sin(roll), cos(roll)) * q / zoom;\n vec2 p = mirror(q / vec2(ratio, 1.0) + 0.5 + off);\n vec4 c = incoming ? getToColor(p) : getFromColor(p);\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 transition(vec2 uv) {\n \n float open = envelope(progress);\n float shutter = 0.8 * blur / jolts * open;\n float lag = 0.2 * split / jolts * open;\n \n vec2 sumR = vec2(0.0);\n vec2 sumG = vec2(0.0);\n vec2 sumB = vec2(0.0);\n float wsum = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float u = (float(i) + 0.5) / float(TAPS) - 0.5;\n float t = progress + u * shutter;\n \n float w = 1.0 - 1.4 * abs(u);\n \n bool incoming = t >= 0.5;\n \n vec4 r = shot(uv, t + lag, incoming);\n vec4 c = shot(uv, t, incoming);\n vec4 b = shot(uv, t - lag, incoming);\n sumR += w * r.ra;\n sumG += w * c.ga;\n sumB += w * b.ba;\n wsum += w;\n }\n float alpha = (sumR.y + sumG.y + sumB.y) / (3.0 * wsum);\n if (alpha <= 0.0) return vec4(0.0);\n vec3 color = vec3(\n sumR.x / max(sumR.y, 1e-5),\n sumG.x / max(sumG.y, 1e-5),\n sumB.x / max(sumB.y, 1e-5)\n );\n return vec4(color, alpha);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CardSwipe":"// CardSwipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CardSwipe.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is flicked off like the top card of a stack, swinging around a point below it as it flies out, while the incoming card behind it grows to fill the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float rotation; \n\nuniform float depth; \n\nuniform vec4 backColor; \n\nconst float RADIUS = 0.045; \nconst float AA = 0.002; \n\nfloat roundedBox(vec2 q, vec2 b, float r) {\n vec2 d = abs(q) - b + r;\n return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0) - r;\n}\n\nvec4 premultiply(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 transition(vec2 uv) {\n float dl = length(direction);\n vec2 d = dl > 1e-6 ? direction / dl : vec2(0.970143, 0.242536);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n vec2 b = vec2(0.5 * ratio, 0.5);\n float p = progress;\n\n \n \n float h = clamp((p - 0.2) / 0.8, 0.0, 1.0);\n float g = h * h * (3.0 - 2.0 * h);\n float k = 1.0 - g;\n float sc = 1.0 - depth * k;\n float rb = RADIUS * min(1.0, 12.0 * k);\n float db = roundedBox(q, b * sc, rb);\n float cb = clamp(0.5 - db / max(AA * min(1.0, 40.0 * k), 1e-6), 0.0, 1.0);\n vec4 tc = getToColor(clamp(0.5 + (uv - 0.5) / sc, 0.0, 1.0));\n \n tc.rgb *= 1.0 - 0.35 * k * k;\n \n vec4 col = mix(premultiply(backColor), premultiply(tc), cb);\n\n \n float t = clamp(p / 0.75, 0.0, 1.0);\n float lift = smoothstep(0.0, 0.15, p);\n float u = min(t / 0.7, 1.0);\n float swing = u * u * (3.0 - 2.0 * u);\n \n float a = (d.x < 0.0 ? 1.3 : -1.3) * rotation * swing;\n vec2 pivot = vec2(0.0, -1.1);\n \n float ca = cos(a), sa = sin(a);\n vec2 swung = pivot + mat2(ca, sa, -sa, ca) * -pivot;\n float far = 2.0 * length(b) + length(swung) + 0.3;\n vec2 shift = d * far * t * t * (0.4 + 0.6 * t);\n mat2 unrotate = mat2(ca, -sa, sa, ca);\n vec2 r = unrotate * (q - shift - pivot) + pivot;\n float rf = RADIUS * lift;\n\n \n float sh = 0.6 * lift * (1.0 - t);\n if (sh > 0.0) {\n vec2 rs = unrotate * (q - (0.03 * d + vec2(0.0, -0.03)) * lift - shift - pivot) + pivot;\n float ds = roundedBox(rs, b, rf);\n col.rgb *= 1.0 - sh * (1.0 - smoothstep(-0.05, 0.08, ds));\n }\n\n float df = roundedBox(r, b, rf);\n float cf = clamp(0.5 - df / max(AA * min(1.0, 40.0 * lift), 1e-6), 0.0, 1.0);\n vec4 fc = getFromColor(clamp(r / vec2(ratio, 1.0) + 0.5, 0.0, 1.0));\n col = mix(col, premultiply(fc), cf);\n return col.a > 0.0 ? vec4(col.rgb / col.a, col.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Chessboard":"// Chessboard — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Chessboard.glsl\n// Author: lql\n// License: MIT\n// Description: A chessboard pattern of squares reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float grid_num; \n\nvec4 transition(vec2 uv) {\n vec2 st = uv * grid_num;\n vec2 idx = floor(st);\n vec2 grid = fract(st);\n\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n\n float checker = mod(idx.x + idx.y, 2.0);\n float mixFactor;\n\n if (progress <= 0.5) {\n mixFactor = (checker > 0.5) ? step(grid.x, progress * 2.0) : 0.0;\n } else {\n mixFactor = (checker < 0.5) ? step(grid.x, (progress - 0.5) * 2.0) : 1.0;\n }\n\n return mix(a, b, mixFactor);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CircleIris":"// CircleIris — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CircleIris.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: The outgoing image closes into a circle over a background color, then the incoming one opens from it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \n\nuniform vec4 backColor; \n\nvec4 transition (vec2 uv) {\n \n float distance = length(uv - center);\n float radius = sqrt(8.0) * abs(progress - 0.5);\n \n if (distance > radius) {\n return backColor;\n }\n else {\n if (progress < 0.5) return getFromColor(uv);\n else return getToColor(uv);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CircleOpen":"// CircleOpen — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CircleOpen.glsl\n// Author: gre\n// License: MIT\n// Description: A soft-edged circle opens from the center to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float smoothness; \n\nuniform int opening; \n\nconst vec2 center = vec2(0.5, 0.5);\nconst float SQRT_2 = 1.414213562373;\n\nvec4 transition (vec2 uv) {\n float x = (opening != 0) ? progress : 1.-progress;\n float m = smoothstep(-smoothness, 0.0, SQRT_2*distance(center, uv) - x*(1.+smoothness));\n return mix(getFromColor(uv), getToColor(uv), (opening != 0) ? 1.-m : m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ClockWipe":"// ClockWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ClockWipe.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: A wipe that sweeps around the center from a starting angle\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float startingAngle; \n\nvec4 transition (vec2 uv) {\n \n float offset = startingAngle * 3.141592653589 / 180.0;\n float angle = atan(uv.y - 0.5, uv.x - 0.5) + offset;\n float normalizedAngle = (angle + 3.141592653589) / (2.0 * 3.141592653589);\n \n normalizedAngle = normalizedAngle - floor(normalizedAngle);\n\n return mix(\n getFromColor(uv),\n getToColor(uv),\n step(normalizedAngle, progress)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ColorCoords":"// ColorCoords — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ColorCoords.glsl\n// Author: haiyoucuv\n// License: MIT\n// Description: A crossfade in which the colors of one image displace the other\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n\n vec4 coordTo = getToColor(uv);\n vec4 coordFrom = getFromColor(uv);\n\n return mix(\n getFromColor(mix(uv, coordTo.rg, progress)),\n getToColor(mix(coordFrom.rg, uv, progress)),\n progress\n );\n\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ColorDistance":"// ColorDistance — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ColorDistance.glsl\n// Author: P-Seebauer\n// License: MIT\n// Description: Pixels switch to the incoming image in order of how close their colors are\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float power; \n\nvec4 transition(vec2 p) {\n vec4 fTex = getFromColor(p);\n vec4 tTex = getToColor(p);\n float m = step(distance(fTex, tTex), progress);\n return mix(\n mix(fTex, tTex, m),\n tTex,\n pow(progress, power)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ColorPhase":"// ColorPhase — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ColorPhase.glsl\n// Author: gre\n// License: MIT\n// Description: A crossfade in which each color channel changes at a different time\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 fromStep; \n\nuniform vec4 toStep; \n\nvec4 transition (vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n return mix(a, b, smoothstep(fromStep, toStep, vec4(progress)));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ColorWrap":"// ColorWrap — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ColorWrap.glsl\n// Author: Yoni Maltsman @friendlyspinach\n// License: MIT\n// Description: Each color channel of the outgoing image is shifted and wraps around into psychedelic bands, while crossfading to the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float r_strength; \n\nuniform float g_strength; \n\nuniform float b_strength; \n\nvec4 transition (vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n vec3 c = from.rgb + vec3(r_strength, g_strength, b_strength)*progress;\n \n from.rgb = mix(from.rgb, mod(c, 1.0), smoothstep(0.0, 0.1, progress));\n return mix(from, to, progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Comb":"// Comb — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Comb.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is cut into interleaved strips that slide in opposite directions, each pushing the outgoing image out and the incoming one in\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int strips; \n\nuniform int vertical; \n\nvec4 transition (vec2 uv) {\n \n float a = (vertical != 0) ? uv.y : uv.x;\n float b = (vertical != 0) ? uv.x : uv.y;\n \n float dir = mod(floor(b * float(strips)), 2.0) < 0.5 ? 1.0 : -1.0;\n \n float t = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.6);\n float fa = a - dir * t;\n if (fa >= 0.0 && fa <= 1.0) {\n return getFromColor((vertical != 0) ? vec2(b, fa) : vec2(fa, b));\n }\n float ta = fa + dir;\n return getToColor((vertical != 0) ? vec2(b, ta) : vec2(ta, b));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CrazyParametricFun":"// CrazyParametricFun — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CrazyParametricFun.glsl\n// Author: mandubian\n// License: MIT\n// Description: The outgoing image is pulled along a parametric curve into a psychedelic swirl\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float a; \nuniform float b; \nuniform float amplitude; \nuniform float smoothness; \n\nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy;\n vec2 dir = p - vec2(.5);\n float dist = length(dir);\n float x = (a - b) * cos(progress) + b * cos(progress * ((a / b) - 1.) );\n float y = (a - b) * sin(progress) - b * sin(progress * ((a / b) - 1.));\n vec2 offset = dir * vec2(sin(progress * dist * amplitude * x), sin(progress * dist * amplitude * y)) / smoothness;\n return mix(getFromColor(p + offset), getToColor(p), smoothstep(0.2, 1.0, progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CrossWarp":"// CrossWarp — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CrossWarp.glsl\n// Author: Eke Péter <peterekepeter@gmail.com>\n// License: MIT\n// Description: The outgoing image zooms in while the incoming one zooms out into place, sweeping from right to left\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 p) {\n float x = progress;\n x=smoothstep(.0,1.0,(x*2.0+p.x-1.0));\n return mix(getFromColor((p-.5)*(1.-x)+.5), getToColor((p-.5)*x+.5), x);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CrossZoom":"// CrossZoom — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CrossZoom.glsl\n// Author: rectalogic\n// License: MIT\n// Description: A crossfade through a strong zoom blur\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nconst float PI = 3.141592653589793;\n\nfloat Linear_ease(in float begin, in float change, in float duration, in float time) {\n return change * time / duration + begin;\n}\n\nfloat Exponential_easeInOut(in float begin, in float change, in float duration, in float time) {\n if (time == 0.0)\n return begin;\n else if (time == duration)\n return begin + change;\n time = time / (duration / 2.0);\n if (time < 1.0)\n return change / 2.0 * pow(2.0, 10.0 * (time - 1.0)) + begin;\n return change / 2.0 * (-pow(2.0, -10.0 * (time - 1.0)) + 2.0) + begin;\n}\n\nfloat Sinusoidal_easeInOut(in float begin, in float change, in float duration, in float time) {\n return -change / 2.0 * (cos(PI * time / duration) - 1.0) + begin;\n}\n\nfloat rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec4 crossFade(in vec2 uv, in float dissolve) {\n return mix(getFromColor(uv), getToColor(uv), dissolve);\n}\n\nvec4 transition(vec2 uv) {\n vec2 texCoord = uv.xy / vec2(1.0).xy;\n\n \n vec2 center = vec2(Linear_ease(0.25, 0.5, 1.0, progress), 0.5);\n float dissolve = Exponential_easeInOut(0.0, 1.0, 1.0, progress);\n\n \n float strength = Sinusoidal_easeInOut(0.0, strength, 0.5, progress);\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n vec2 toCenter = center - texCoord;\n\n \n float offset = rand(uv);\n\n for (float t = 0.0; t <= 40.0; t++) {\n float percent = (t + offset) / 40.0;\n float weight = 4.0 * (percent - percent * percent);\n color += crossFade(texCoord + toCenter * percent * strength, dissolve) * weight;\n total += weight;\n }\n return color / total;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Crosshatch":"// Crosshatch — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Crosshatch.glsl\n// Author: pthrasher\n// License: MIT\n// Description: The incoming image appears through a crosshatch of lines spreading from the center\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \nuniform float threshold; \nuniform float fadeEdge; \n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\nvec4 transition(vec2 p) {\n float dist = distance(center, p) / threshold;\n float r = progress - min(rand(vec2(p.y, 0.0)), rand(vec2(0.0, p.x)));\n return mix(getFromColor(p), getToColor(p), mix(0.0, mix(step(dist, r), 1.0, smoothstep(1.0-fadeEdge, 1.0, progress)), smoothstep(0.0, fadeEdge, progress))); \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Cube":"// Cube — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Cube.glsl\n// Author: gre\n// License: MIT\n// Description: The two images are faces of a rotating 3D cube, with a floor reflection\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float persp; \nuniform float unzoom; \n\nuniform float reflection; \nuniform float floating; \n\nvec2 project (vec2 p) {\n return p * vec2(1.0, -1.2) + vec2(0.0, -floating/100.);\n}\n\nbool inBounds (vec2 p) {\n return all(lessThan(vec2(0.0), p)) && all(lessThan(p, vec2(1.0)));\n}\n\nvec4 bgColor (vec2 p, vec2 pfr, vec2 pto) {\n vec4 c = vec4(0.0); \n pfr = project(pfr);\n \n if (inBounds(pfr)) {\n c += mix(vec4(0.0), getFromColor(pfr), reflection * mix(1.0, 0.0, pfr.y));\n }\n pto = project(pto);\n if (inBounds(pto)) {\n c += mix(vec4(0.0), getToColor(pto), reflection * mix(1.0, 0.0, pto.y));\n }\n return c;\n}\n\nvec2 xskew (vec2 p, float persp, float center) {\n float x = mix(p.x, 1.0-p.x, center);\n return (\n (\n vec2( x, (p.y - 0.5*(1.0-persp) * x) / (1.0+(persp-1.0)*x) )\n - vec2(0.5-distance(center, 0.5), 0.0)\n )\n * vec2(0.5 / distance(center, 0.5) * (center<0.5 ? 1.0 : -1.0), 1.0)\n + vec2(center<0.5 ? 0.0 : 1.0, 0.0)\n );\n}\n\nvec4 transition(vec2 op) {\n float uz = unzoom * 2.0*(0.5-distance(0.5, progress));\n vec2 p = -uz*0.5+(1.0+uz) * op;\n vec2 fromP = xskew(\n (p - vec2(progress, 0.0)) / vec2(1.0-progress, 1.0),\n 1.0-mix(progress, 0.0, persp),\n 0.0\n );\n vec2 toP = xskew(\n p / vec2(progress, 1.0),\n mix(pow(progress, 2.0), 1.0, persp),\n 1.0\n );\n \n if (inBounds(fromP)) {\n return getFromColor(fromP);\n }\n else if (inBounds(toP)) {\n return getToColor(toP);\n }\n return bgColor(op, fromP, toP);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Curtains":"// Curtains — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Curtains.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image parts in the middle like stage curtains, gathering into shaded folds as it is pulled to the sides\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float folds; \n\nuniform float shading; \n\nuniform float bunch; \n\nuniform float sway; \n\nconst float PI = 3.141592653589793;\n\nvec4 transition (vec2 uv) {\n \n float lag = sway * (1.0 - uv.y);\n float p = progress * (1.0 - lag * (1.0 - progress));\n float open = mix(p, p * p * (3.0 - 2.0 * p), 0.75);\n \n float edge = -bunch * open * open;\n float w = mix(0.5, bunch, open);\n float x = min(uv.x, 1.0 - uv.x) - edge; \n if (x >= w) {\n \n vec4 to = getToColor(uv);\n float shadow = 0.4 * exp((w - x) * 25.0) * clamp((edge + w) * 20.0, 0.0, 1.0);\n return vec4(to.rgb * (1.0 - shadow * open), to.a);\n }\n float t = x / w;\n \n float n = max(1.0, floor(folds * min(ratio, 1.0) + 0.5)); \n float a = 2.0 * PI * n * t;\n float f = 1.0 - (1.0 - open) * (1.0 - open) * (1.0 - open); \n float gather = 0.92 * f;\n float s = 0.5 * (t + gather * sin(a) / (2.0 * PI * n)); \n vec4 c = getFromColor(vec2(uv.x < 0.5 ? s : 1.0 - s, uv.y));\n \n float slope = 3.0 * gather * cos(a) * (uv.x < 0.5 ? 1.0 : -1.0);\n float diffuse = (1.0 + 0.5 * slope) / sqrt(1.25 * (1.0 + slope * slope));\n float crease = 0.5 + 0.5 * sin(a); \n float light = mix(1.0, diffuse * (1.0 - 0.6 * crease * crease), shading * f);\n return vec4(c.rgb * light, c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CurvedWipe":"// CurvedWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CurvedWipe.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is pulled away by its middle: the wipe edge bulges into a smooth curve that leads the way, then flattens as it reaches the far side\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float curvature; \n\nuniform float smoothness; \n\nuniform vec4 shadow; \n\nconst float PI = 3.141592653589793;\n\nfloat ease (float t) {\n return 0.5 * (t + t * t * (3.0 - 2.0 * t));\n}\n\nvec4 transition (vec2 uv) {\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(0.0, 1.0);\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n \n float e = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n float w = 0.5 * (abs(dir.y) * ratio + abs(dir.x));\n vec2 across = vec2(-dir.y, dir.x);\n float d = dot(p, dir);\n \n \n float x = clamp(dot(p, across) / w, -1.0, 1.0);\n float s = max(smoothness, 0.001);\n \n \n float k = clamp(curvature, 0.0, 1.0) * min(1.0, w / e) * (1.0 - x * x);\n float t = progress + k * progress * (1.0 - progress);\n float travel = 2.0 * (e + s);\n float edge = -e - s + travel * ease(t);\n float side = -e - s + travel * ease(progress);\n float m = 1.0 - smoothstep(-s, s, d - edge);\n \n float lift = edge - side;\n float spread = 0.012 + 0.25 * lift;\n \n vec4 to = getToColor(uv);\n vec2 caster = clamp((p + (edge - d) * dir) / vec2(ratio, 1.0) + 0.5, 0.0, 1.0);\n float sh = shadow.a * sin(PI * progress) * exp(-max(edge - d, 0.0) / spread) * m * getFromColor(caster).a * to.a;\n to.rgb = mix(to.rgb, shadow.rgb, sh);\n return mix(getFromColor(uv), to, m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CylinderRoll":"// CylinderRoll — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CylinderRoll.glsl\n// Author: gre\n// License: MIT\n// Description: The frame wraps around a drum that rolls up, the outgoing image turning away over its top in a motion blur and the incoming one coming around from below and unrolling flat\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float curvature; \n\nuniform float blur; \n\nuniform float shading; \n\nuniform float chroma; \n\nuniform int downward; \n\nconst int SAMPLES = 24;\n\nconst float MAX_ANGLE = 1.1;\n\nconst float DIST = 2.6;\n\nconst float ARC = 0.12;\n\nfloat hash(vec2 c) {\n vec2 q = fract(c * vec2(0.1031, 0.1030));\n q += dot(q, q.yx + 33.33);\n return fract((q.x + q.y) * q.x);\n}\n\nfloat fold(float v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 strip(float x, float v) {\n if ((downward != 0) ? v > 1.0 : v < 0.0) {\n return getToColor(vec2(x, fold((downward != 0) ? v - 1.0 : v + 1.0)));\n }\n return getFromColor(vec2(x, fold(v)));\n}\n\nfloat angleAt(float c) {\n c = clamp(c, -0.98 / sqrt(DIST * DIST - 1.0), 0.98 / sqrt(DIST * DIST - 1.0));\n return asin(c * DIST / sqrt(1.0 + c * c)) - atan(c);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float h = 1.0 - abs(2.0 * p - 1.0); \n float e = 0.5 * h * (0.1 + 0.9 * h * h);\n float roll = p < 0.5 ? e : 1.0 - e;\n \n float h3 = h * h * h;\n float peak = h3 * h3;\n\n \n float bend = curvature * (p < 0.5 ? h * (2.0 - h) : h * h * (3.0 - 2.0 * h));\n float phi = MAX_ANGLE * bend + 1e-4;\n float arcK = ARC * bend;\n \n float edgeY = sin(phi) / (DIST - cos(phi));\n\n vec2 n = 2.0 * uv - 1.0;\n \n float xr = n.x * ratio;\n float yn = n.y * (1.0 + arcK * xr * xr);\n float theta = angleAt(yn * edgeY);\n \n float thetaCorner = angleAt((1.0 + arcK * ratio * ratio) * edgeY);\n float width = (DIST - 1.0) / (DIST - cos(theta));\n float zoom = (DIST - cos(thetaCorner)) / (DIST - 1.0);\n float x = 0.5 + 0.5 * n.x / (zoom * width);\n \n float facing = (DIST * cos(theta) - 1.0)\n / sqrt(1.0 + DIST * DIST - 2.0 * DIST * cos(theta)) ;\n float light = mix(1.0, clamp(facing, 0.0, 1.0), shading);\n\n \n float v = 0.5 * (theta / phi + 1.0) + ((downward != 0) ? roll : -roll);\n float len = 0.5 * blur * peak;\n float split = chroma * peak;\n float jitter = hash(uv * 1000.0);\n vec3 color = vec3(0.0);\n vec3 weight = vec3(0.0);\n float alpha = 0.0;\n for (int i = 0; i < SAMPLES; i++) {\n float t = (float(i) + jitter) / float(SAMPLES) - 0.5;\n vec4 img = strip(x, v + t * len);\n \n vec3 w = vec3(max(1.0 - 4.0 * split * t, 0.0), 1.0, max(1.0 + 4.0 * split * t, 0.0));\n color += img.rgb * img.a * w;\n weight += img.a * w;\n alpha += img.a;\n }\n color = color / max(weight, vec3(1e-5));\n return vec4(color * light, alpha / float(SAMPLES));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DefocusBlur":"// DefocusBlur — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DefocusBlur.glsl\n// Author: Sergey Kosarevsky\n// License: MIT\n// Description: A crossfade through an out-of-focus blur\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float blurSize; \n\nvec4 transition(vec2 uv) {\n float T = progress;\n float half_ = 0.5;\n float D = (T < half_) ? mix(0.0, blurSize, T / half_) : mix(blurSize, 0.0, (T - half_) / half_);\n vec4 C0 = getFromColor(uv);\n vec4 C1 = getToColor(uv);\n C0 += getFromColor(vec2(-0.326, -0.406) * D + uv);\n C1 += getToColor(vec2(-0.326, -0.406) * D + uv);\n C0 += getFromColor(vec2(-0.840, -0.074) * D + uv);\n C1 += getToColor(vec2(-0.840, -0.074) * D + uv);\n C0 += getFromColor(vec2(-0.696, 0.457) * D + uv);\n C1 += getToColor(vec2(-0.696, 0.457) * D + uv);\n C0 += getFromColor(vec2(-0.203, 0.621) * D + uv);\n C1 += getToColor(vec2(-0.203, 0.621) * D + uv);\n C0 += getFromColor(vec2( 0.962, -0.195) * D + uv);\n C1 += getToColor(vec2( 0.962, -0.195) * D + uv);\n C0 += getFromColor(vec2( 0.473, -0.480) * D + uv);\n C1 += getToColor(vec2( 0.473, -0.480) * D + uv);\n C0 += getFromColor(vec2( 0.519, 0.767) * D + uv);\n C1 += getToColor(vec2( 0.519, 0.767) * D + uv);\n C0 += getFromColor(vec2( 0.185, -0.893) * D + uv);\n C1 += getToColor(vec2( 0.185, -0.893) * D + uv);\n C0 += getFromColor(vec2( 0.507, 0.064) * D + uv);\n C1 += getToColor(vec2( 0.507, 0.064) * D + uv);\n C0 += getFromColor(vec2( 0.896, 0.412) * D + uv);\n C1 += getToColor(vec2( 0.896, 0.412) * D + uv);\n C0 += getFromColor(vec2(-0.322, -0.933) * D + uv);\n C1 += getToColor(vec2(-0.322, -0.933) * D + uv);\n C0 += getFromColor(vec2(-0.792, -0.598) * D + uv);\n C1 += getToColor(vec2(-0.792, -0.598) * D + uv);\n C0 /= 13.0;\n C1 /= 13.0;\n return mix(C0, C1, T);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DiamondWipe":"// DiamondWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DiamondWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A soft-edged diamond grows from the center to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \n\nuniform float smoothness; \n\nvec4 transition (vec2 uv) {\n \n vec2 d = abs(uv - center) * vec2(ratio, 1.0);\n \n vec2 far = max(center, 1.0 - center) * vec2(ratio, 1.0);\n float dist = (d.x + d.y) / (far.x + far.y);\n float s = max(smoothness, 0.001);\n float m = smoothstep(0.0, s, progress * (1.0 + s) - dist);\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Directional":"// Directional — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Directional.glsl\n// Author: Gaëtan Renaudeau\n// License: MIT\n// Description: The incoming image pushes the outgoing one out in a given direction\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nvec4 transition (vec2 uv) {\n vec2 p = uv + progress * sign(direction);\n vec2 f = fract(p);\n return mix(\n getToColor(f),\n getFromColor(f),\n step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DirectionalEased":"// DirectionalEased — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DirectionalEased.glsl\n// Author: Max Plotnikov\n// License: MIT\n// Description: Like Directional, with an eased movement\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nvec4 transition (vec2 uv) {\n float easing = sqrt((2.0 - progress) * progress);\n vec2 p = uv + easing * sign(direction);\n vec2 f = fract(p);\n return mix(\n getToColor(f),\n getFromColor(f),\n step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DirectionalScaled":"// DirectionalScaled — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DirectionalScaled.glsl\n// Author: Thibaut Foussard\n// License: MIT\n// Description: Like Directional, with both images scaled down while they slide\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \nuniform float scale; \n\nfloat parabola(float x) {\n float y = pow(sin(x * acos(-1.0)), 1.);\n return y;\n}\n\nvec4 transition (vec2 uv) {\n float easedProgress = pow(sin(progress * acos(-1.0) / 2.), 3.);\n vec2 p = uv + easedProgress * sign(direction);\n vec2 f = fract(p);\n \n float s = 1. - (1. - (1. / scale)) * parabola(progress);\n f = (f - 0.5) * s + 0.5;\n \n float mixer = step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0);\n vec4 col = mix(getToColor(f), getFromColor(f), mixer);\n \n float border = step(0., f.x) * step(0., (1. - f.x)) * step(0., f.y) * step(0., 1. - f.y);\n col *= border;\n \n return col;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DirectionalWarp":"// DirectionalWarp — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DirectionalWarp.glsl\n// Author: pschroen\n// License: MIT\n// Description: A diagonal wipe with a warped, smeared edge\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float smoothness; \n\nuniform vec2 direction; \n\nconst vec2 center = vec2(0.5, 0.5);\n\nvec4 transition (vec2 uv) {\n vec2 v = normalize(direction);\n v /= abs(v.x) + abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float m = 1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d - 0.5 + progress * (1.0 + smoothness)));\n return mix(getFromColor((uv - 0.5) * (1.0 - m) + 0.5), getToColor((uv - 0.5) * m + 0.5), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DirectionalWipe":"// DirectionalWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DirectionalWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A soft-edged diagonal wipe\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float smoothness; \n \nconst vec2 center = vec2(0.5, 0.5);\n \nvec4 transition (vec2 uv) {\n vec2 v = normalize(direction);\n v /= abs(v.x)+abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float m =\n (1.0-step(progress, 0.0)) * \n (1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d-0.5+progress*(1.+smoothness))));\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Disintegrate":"// Disintegrate — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Disintegrate.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image crumbles into fine dust from one side, its grains blown away by the wind and fading out, revealing the incoming image underneath\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float particleSize; \n\nuniform vec2 direction; \n\nuniform float spread; \n\nconst int NEAR = 17;\nconst int CANDIDATES = 35;\n\nconst float LIFE = 0.45;\n\nfloat hash12(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n float a = hash12(i);\n float b = hash12(i + vec2(1.0, 0.0));\n float c = hash12(i + vec2(0.0, 1.0));\n float d = hash12(i + vec2(1.0, 1.0));\n return 2.0 * mix(mix(a, b, f.x), mix(c, d, f.x), f.y) - 1.0;\n}\n\nfloat gust(float x) {\n float i = floor(x);\n float f = fract(x);\n f = f * f * (3.0 - 2.0 * f);\n return 2.0 * mix(hash12(vec2(i, 7.0)), hash12(vec2(i + 1.0, 7.0)), f) - 1.0;\n}\n\nfloat release(vec2 center, float h, float halfLength, float s) {\n float front = 1.0 - (center.x + halfLength) / (2.0 * halfLength) + 0.14 * noise(center * s * 6.0) + 0.08 * (h - 0.5);\n return clamp((front + 0.12) / 1.24, 0.0, 1.0) * (1.0 - LIFE);\n}\n\nvec4 transition(vec2 uv) {\n vec2 d = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n vec2 n = vec2(-d.y, d.x);\n \n vec2 fp = (uv - 0.5) * vec2(ratio, 1.0);\n float s = particleSize;\n vec2 g = vec2(dot(fp, d), dot(fp, n)) / s;\n float halfLength = 0.5 * (ratio * abs(d.x) + abs(d.y)) / s;\n \n float reach = min(spread * 0.45 / s, 60.0);\n float px = floor(g.x);\n\n \n vec2 own = floor(g);\n vec4 under = progress > release(own + 0.5, hash12(own), halfLength, s) ? getToColor(uv) : getFromColor(uv);\n vec2 grainUV = vec2(0.5);\n float cover = 0.0;\n for (int i = 0; i < CANDIDATES; i++) {\n \n float fi = float(i);\n float cx = px - fi;\n if (i >= NEAR + 9) {\n cx = floor(px / 4.0) * 4.0 - 4.0 * (fi - float(NEAR + 9) + 8.0);\n } else if (i >= NEAR) {\n cx = floor(px / 2.0) * 2.0 - 2.0 * (fi - float(NEAR) + 8.0);\n }\n \n \n float visible = mod(cx, 4.0) < 0.5 ? 63.0 : mod(cx, 2.0) < 0.5 ? 31.0 : 15.0;\n float drift = 0.3 * gust(cx * s * 4.0);\n \n \n vec2 cell = vec2(cx, floor(g.y - drift * (g.x - cx - 0.5)));\n vec2 center = cell + 0.5;\n vec2 cuv = (center.x * d + center.y * n) * s / vec2(ratio, 1.0) + 0.5;\n if (cuv.x < 0.0 || cuv.x > 1.0 || cuv.y < 0.0 || cuv.y > 1.0) continue;\n float h = hash12(cell);\n float t = (progress - release(center, h, halfLength, s)) / LIFE;\n if (t <= 0.0 || t >= 1.0) continue;\n float r2 = fract(h * 13.7);\n \n float travel = reach * (0.4 + 0.6 * r2) * t * (0.2 + 0.8 * t);\n \n float crumble = smoothstep(0.0, 0.25, t);\n vec2 pos = center + vec2(travel + (fract(h * 71.1) - 0.5) * 0.3 * crumble, drift * travel);\n vec2 local = abs(g - pos);\n float size = mix(0.5, 0.3 * (1.0 - 0.5 * t) * (0.6 + 0.4 * h), crumble);\n float feather = 0.001 + 0.12 * crumble;\n float a = (1.0 - smoothstep(size - feather, size, max(local.x, local.y))) * (1.0 - smoothstep(0.15, 1.0, t))\n * (1.0 - smoothstep(0.6 * visible, visible, travel));\n if (a > cover) {\n cover = a;\n grainUV = cuv;\n }\n }\n return mix(under, getFromColor(grainUV), cover);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DisplacementMap":"// DisplacementMap — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DisplacementMap.glsl\n// Author: Travis Fischer\n// License: MIT\n// Description: A crossfade in which a displacement map (an extra grayscale texture) warps both images\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform shader displacementMap;\nvec4 _texture_displacementMap(vec2 uv) { return vec4(unpremul(displacementMap.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nvec4 transition (vec2 uv) {\n float displacement = _texture_displacementMap( uv).r * strength;\n\n vec2 uvFrom = vec2(uv.x + progress * displacement, uv.y);\n vec2 uvTo = vec2(uv.x - (1.0 - progress) * displacement, uv.y);\n\n return mix(\n getFromColor(uvFrom),\n getToColor(uvTo),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DitherDissolve":"// DitherDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DitherDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image appears through a regular 8x8 ordered dither pattern, like a retro computer screen\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float dotSize; \n\nfloat bayer(vec2 c) {\n float v = 0.0;\n float scale = 16.0;\n for (int i = 0; i < 3; i++) {\n vec2 bit = mod(floor(c), 2.0);\n \n v += scale * (2.0 * abs(bit.x - bit.y) + bit.y);\n c *= 0.5;\n scale *= 0.25;\n }\n return (v + 0.5) / 64.0;\n}\n\nvec4 transition(vec2 uv) {\n vec2 cell = floor(uv * vec2(ratio, 1.0) / dotSize);\n return progress < bayer(cell) ? getFromColor(uv) : getToColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DoomMelt":"// DoomMelt — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DoomMelt.glsl\n// Author: Zeh Fernando\n// License: MIT\n// Description: The outgoing image melts down in uneven columns, like the Doom screen wipe\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int bars; \n\nuniform float amplitude; \n\nuniform float noise; \n\nuniform float frequency; \n\nuniform float dripScale; \n\nfloat rand(int num) {\n return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num) * 10.3) * cos(float(num)));\n}\n\nfloat wave(int num) {\n float fn = float(num) * frequency * 0.1 * float(bars);\n return cos(fn * 0.5) * cos(fn * 0.13) * sin((fn+10.0) * 0.3) / 2.0 + 0.5;\n}\n\nfloat drip(int num) {\n return sin(float(num) / float(bars - 1) * 3.141592) * dripScale;\n}\n\nfloat pos(int num) {\n return (noise == 0.0 ? wave(num) : mix(wave(num), rand(num), noise)) + (dripScale == 0.0 ? 0.0 : drip(num));\n}\n\nvec4 transition(vec2 uv) {\n int bar = int(uv.x * (float(bars)));\n float scale = 1.0 + pos(bar) * amplitude;\n float phase = progress * scale;\n float posY = uv.y / vec2(1.0).y;\n vec2 p;\n vec4 c;\n if (phase + posY < 1.0) {\n p = vec2(uv.x, uv.y + mix(0.0, vec2(1.0).y, phase)) / vec2(1.0).xy;\n c = getFromColor(p);\n } else {\n p = uv.xy / vec2(1.0).xy;\n c = getToColor(p);\n }\n\n \n return c;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Doorway":"// Doorway — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Doorway.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image opens like double doors as the incoming one comes forward, with a floor reflection\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float reflection; \n\nuniform float perspective; \nuniform float depth; \n\nconst vec4 black = vec4(0.0); \nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec2 project (vec2 p) {\n return p * vec2(1.0, -1.2) + vec2(0.0, -0.02);\n}\n\nvec4 bgColor (vec2 p, vec2 pto) {\n vec4 c = black;\n pto = project(pto);\n if (inBounds(pto)) {\n c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y));\n }\n return c;\n}\n\nvec4 transition (vec2 p) {\n vec2 pfr = vec2(-1.), pto = vec2(-1.);\n float middleSlit = 2.0 * abs(p.x-0.5) - progress;\n if (middleSlit > 0.0) {\n pfr = p + (p.x > 0.5 ? -1.0 : 1.0) * vec2(0.5*progress, 0.0);\n float d = 1.0/(1.0+perspective*progress*(1.0-middleSlit));\n pfr.y -= d/2.;\n pfr.y *= d;\n pfr.y += d/2.;\n }\n float size = mix(1.0, depth, 1.-progress);\n pto = (p + vec2(-0.5, -0.5)) * vec2(size, size) + vec2(0.5, 0.5);\n if (inBounds(pfr)) {\n return getFromColor(pfr);\n }\n else if (inBounds(pto)) {\n return getToColor(pto);\n }\n else {\n return bgColor(p, pto);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Dreamy":"// Dreamy — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Dreamy.glsl\n// Author: mikolalysenko\n// License: MIT\n// Description: A crossfade with a gentle wavy distortion\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec2 offset(float progress, float x, float theta) {\n float phase = progress*progress + progress + theta;\n float shifty = 0.03*progress*cos(10.0*(progress+x));\n return vec2(0, shifty);\n}\nvec4 transition(vec2 p) {\n return mix(getFromColor(p + offset(progress, p.x, 0.0)), getToColor(p + offset(1.0-progress, p.x, 3.14)), progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DreamyZoom":"// DreamyZoom — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DreamyZoom.glsl\n// Author: Zeh Fernando\n// License: MIT\n// Description: Zooms and rotates into a bright flash, then out to the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float rotation; \n\nuniform float scale; \n\nvec4 transition(vec2 uv) {\n \n float phase = progress < 0.5 ? progress * 2.0 : (progress - 0.5) * 2.0;\n float angleOffset = progress < 0.5 ? mix(0.0, rotation * 0.03926990816987241548078304229099, phase) : mix(-rotation * 0.03926990816987241548078304229099, 0.0, phase);\n float newScale = progress < 0.5 ? mix(1.0, scale, phase) : mix(scale, 1.0, phase);\n \n vec2 center = vec2(0, 0);\n\n \n vec2 assumedCenter = vec2(0.5, 0.5);\n vec2 p = (uv.xy - vec2(0.5, 0.5)) / newScale * vec2(ratio, 1.0);\n\n \n float angle = atan(p.y, p.x) + angleOffset;\n float dist = distance(center, p);\n p.x = cos(angle) * dist / ratio + 0.5;\n p.y = sin(angle) * dist + 0.5;\n vec4 c = progress < 0.5 ? getFromColor(p) : getToColor(p);\n\n \n \n return vec4(c.rgb + (progress < 0.5 ? mix(0.0, 1.0, phase) : mix(1.0, 0.0, phase)), c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","EdgeGlow":"// EdgeGlow — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/EdgeGlow.glsl\n// Author: Woohyun Kim\n// License: MIT\n// Description: Both images fade through black with their edges glowing\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float edge_thickness; \nuniform float edge_brightness; \n\nvec3 detectEdgeColor(vec3[9] c) {\n \n \n \n \n \n vec3 dx = 2.0 * abs(c[7]-c[1]) + abs(c[2] - c[6]) + abs(c[8] - c[0]);\n\tvec3 dy = 2.0 * abs(c[3]-c[5]) + abs(c[6] - c[8]) + abs(c[0] - c[2]);\n float delta = length(0.25 * (dx + dy) * 0.5);\n\treturn clamp(edge_brightness * delta, 0.0, 1.0) * c[4];\n}\n\nvec4 getFromEdgeColor(vec2 uv) {\n\tvec3 c[9];\n\tfloat alpha = 0.0;\n\tfor (int i=0; i < 3; ++i) for (int j=0; j < 3; ++j)\n\t{\n\t vec4 color = getFromColor(uv + edge_thickness * vec2(i-1,j-1));\n c[3*i + j] = color.rgb;\n if (i == 1 && j == 1) alpha = color.a;\n\t}\n\treturn vec4(detectEdgeColor(c), alpha);\n}\n\nvec4 getToEdgeColor(vec2 uv) {\n\tvec3 c[9];\n\tfloat alpha = 0.0;\n\tfor (int i=0; i < 3; ++i) for (int j=0; j < 3; ++j)\n\t{\n\t vec4 color = getToColor(uv + edge_thickness * vec2(i-1,j-1));\n c[3*i + j] = color.rgb;\n if (i == 1 && j == 1) alpha = color.a;\n\t}\n\treturn vec4(detectEdgeColor(c), alpha);\n}\n\nvec4 transition (vec2 uv) {\n vec4 start = mix(getFromColor(uv), getFromEdgeColor(uv), clamp(2.0 * progress, 0.0, 1.0));\n vec4 end = mix(getToEdgeColor(uv), getToColor(uv), clamp(2.0 * (progress - 0.5), 0.0, 1.0));\n return mix(\n start,\n end,\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Fade":"// Fade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Fade.glsl\n// Author: gre\n// License: MIT\n// Description: A linear crossfade between the two images\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n return mix(\n getFromColor(uv),\n getToColor(uv),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FadeColor":"// FadeColor — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FadeColor.glsl\n// Author: gre\n// License: MIT\n// Description: A fade through a solid color, black by default\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 color; \n\nuniform float colorPhase; \nvec4 transition (vec2 uv) {\n return mix(\n mix(color, getFromColor(uv), smoothstep(1.0-colorPhase, 0.0, progress)),\n mix(color, getToColor(uv), smoothstep( colorPhase, 1.0, progress)),\n progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FadeGrayscale":"// FadeGrayscale — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FadeGrayscale.glsl\n// Author: gre\n// License: MIT\n// Description: A crossfade through grayscale\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float intensity; \n \nvec3 grayscale (vec3 color) {\n return vec3(0.2126*color.r + 0.7152*color.g + 0.0722*color.b);\n}\n \nvec4 transition (vec2 uv) {\n vec4 fc = getFromColor(uv);\n vec4 tc = getToColor(uv);\n return mix(\n mix(vec4(grayscale(fc.rgb), fc.a), fc, smoothstep(1.0-intensity, 0.0, progress)),\n mix(vec4(grayscale(tc.rgb), tc.a), tc, smoothstep( intensity, 1.0, progress)),\n progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FallOver":"// FallOver — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FallOver.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image falls over backward, hinged on its bottom edge, revealing the incoming one behind it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float perspective; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\n\nvec4 transition (vec2 uv) {\n \n float fall = progress * (0.25 + 0.75 * progress);\n float angle = 0.5 * PI * fall;\n float c = cos(angle), s = sin(angle);\n \n \n float dist = 1.0 / max(perspective, 0.01);\n vec3 eye = vec3(0.5 * ratio, 0.5 * c, -dist);\n vec3 dir = vec3(uv.x * ratio, uv.y, 0.0) - eye;\n \n float den = dir.z * c - dir.y * s;\n if (den > 0.0) {\n float t = (eye.y * s - eye.z * c) / den;\n vec3 hit = eye + t * dir;\n vec2 puv = vec2(hit.x / ratio, hit.y * c + hit.z * s);\n if (t > 0.0 && puv.y > 0.0 && puv.y <= 1.0 && puv.x >= 0.0 && puv.x <= 1.0) {\n vec4 col = getFromColor(puv);\n return vec4(col.rgb * (1.0 - shading * s), col.a);\n }\n }\n return getToColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FilmBurn":"// FilmBurn — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FilmBurn.glsl\n// Author: Anastasia Dunbar\n// License: MIT\n// Description: Glowing film-burn light leaks wash over the image and reveal the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float Seed; \nfloat sigmoid(float x, float a) {\n float b = pow(x*2.,a)/2.;\n if (x > .5) {\n b = 1.-pow(2.-(x*2.),a)/2.;\n }\n\treturn b;\n}\nfloat rand(float co){\n return fract(sin((co*24.9898)+Seed)*43758.5453);\n}\nfloat rand(vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\nfloat apow(float a,float b) { return pow(abs(a),b)*sign(b); }\nvec3 pow3(vec3 a,vec3 b) { return vec3(apow(a.r,b.r),apow(a.g,b.g),apow(a.b,b.b)); }\nfloat smooth_mix(float a,float b,float c) { return mix(a,b,sigmoid(c,2.)); }\nfloat random(vec2 co, float shft){\n co += 10.;\n return smooth_mix(fract(sin(dot(co.xy ,vec2(12.9898+(floor(shft)*.5),78.233+Seed))) * 43758.5453),fract(sin(dot(co.xy ,vec2(12.9898+(floor(shft+1.)*.5),78.233+Seed))) * 43758.5453),fract(shft));\n}\nfloat smooth_random(vec2 co, float shft) {\n\treturn smooth_mix(smooth_mix(random(floor(co),shft),random(floor(co+vec2(1.,0.)),shft),fract(co.x)),smooth_mix(random(floor(co+vec2(0.,1.)),shft),random(floor(co+vec2(1.,1.)),shft),fract(co.x)),fract(co.y));\n}\nvec4 blendedColor(vec2 p) {\n return mix(getFromColor(p), getToColor(p), sigmoid(progress,10.));\n}\n\nvec4 transition(vec2 p) {\n vec3 f = vec3(0.);\n for (float i = 0.; i < 13.; i++) {\n f += sin(((p.x*rand(i)*6.)+(progress*8.))+rand(i+1.43))*sin(((p.y*rand(i+4.4)*6.)+(progress*6.))+rand(i+2.4));\n f += 1.-clamp(length(p-vec2(smooth_random(vec2(progress*1.3),i+1.),smooth_random(vec2(progress*.5),i+6.25)))*mix(20.,70.,rand(i)),0.,1.);\n }\n f += 4.;\n f /= 11.;\n f = pow3(f*vec3(1.,0.7,0.6),vec3(1.,2.-sin(progress*3.14159265358979323),1.3));\n f *= sin(progress*3.14159265358979323);\n \n p -= .5;\n p *= 1.+(smooth_random(vec2(progress*5.),6.3)*sin(progress*3.14159265358979323)*.05);\n p += .5;\n \n vec4 blurred_image = vec4(0.);\n float bluramount = sin(progress*3.14159265358979323)*.03;\n\n for (float i = 0.; i < 50.; i++) { \n vec2 q = vec2(cos(degrees((i/50.)*360.)),sin(degrees((i/50.)*360.))) * (rand(vec2(i,p.x+p.y))+bluramount); \n vec2 uv2 = p+(q*bluramount);\n blurred_image += blendedColor(uv2);\n }\n blurred_image /= 50.;\n \n return blurred_image+vec4(f,0.);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FilmDissolve":"// FilmDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FilmDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: A cross-dissolve blended in linear light, as light adds up on film: the frame keeps its brightness all the way through and the highlights of each image shine through the other\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float overlap; \n\nuniform float smoothness; \n\nvec3 toLinear(vec3 c) {\n vec3 lo = c / 12.92;\n vec3 hi = pow((c + 0.055) / 1.055, vec3(2.4));\n return mix(lo, hi, vec3(greaterThan(c, vec3(0.04045))));\n}\n\nvec3 toSrgb(vec3 c) {\n vec3 lo = c * 12.92;\n vec3 hi = 1.055 * pow(c, vec3(1.0 / 2.4)) - 0.055;\n return mix(lo, hi, vec3(greaterThan(c, vec3(0.0031308))));\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n if (progress <= 0.0) return a;\n if (progress >= 1.0) return b;\n\n float t = mix(progress, smoothstep(0.0, 1.0, progress), smoothness);\n\n \n vec3 la = toLinear(clamp(a.rgb, 0.0, 1.0)) * a.a;\n vec3 lb = toLinear(clamp(b.rgb, 0.0, 1.0)) * b.a;\n vec3 base = mix(la, lb, t);\n float alpha = mix(a.a, b.a, t);\n\n \n \n float extra = overlap * min(t, 1.0 - t);\n vec3 excess = extra * (la + lb);\n vec3 room = max(vec3(alpha) - base, vec3(1e-5));\n vec3 color = base + room * (1.0 - exp(-excess / room));\n\n if (alpha <= 0.0) return vec4(0.0);\n return vec4(toSrgb(clamp(color / alpha, 0.0, 1.0)), alpha);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FilmStrip":"// FilmStrip — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FilmStrip.glsl\n// Author: gre\n// License: MIT\n// Description: The picture slips like film in a projector gate: it shrinks to show the sprocket holes, the strip runs down with motion blur and a slight weave, then the incoming frame lands in place\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int frames; \n\nuniform float shrink; \n\nuniform float blur; \n\nuniform float weave; \n\nuniform vec4 filmColor; \n\nuniform vec4 holeColor; \n\nconst float FRAME_LINE = 0.08;\n\nconst float HOLES = 4.0;\nconst int SAMPLES = 16;\n\nfloat dither(vec2 cell) {\n return fract(52.9829189 * fract(dot(cell, vec2(0.06711056, 0.00583715))));\n}\n\nvec4 film(float x, float y, float base, float n, float aa, float holeX, vec2 holeSize, float holes) {\n float pitch = 1.0 + FRAME_LINE;\n float jy = floor(y / pitch);\n float j = base + jy;\n float fy = y - jy * pitch;\n vec4 c = filmColor;\n if (x >= 0.0 && x <= 1.0 && fy <= 1.0) {\n vec2 q = vec2(x, fy);\n c = j < n ? getFromColor(q) : getToColor(q);\n }\n \n float inside = min(min(x, 1.0 - x) * ratio, min(fy, 1.0 - fy));\n c = mix(filmColor, c, clamp(inside / aa + 0.5, 0.0, 1.0));\n \n float hy = mod(y, pitch / HOLES) - 0.5 * pitch / HOLES;\n float hx = (abs(x - 0.5) - holeX) * ratio;\n vec2 dd = abs(vec2(hx, hy)) - holeSize + 0.3 * holeSize.x;\n float sd = length(max(dd, 0.0)) + min(max(dd.x, dd.y), 0.0) - 0.3 * holeSize.x;\n return mix(c, holeColor, clamp(0.5 - sd / aa, 0.0, 1.0) * holes);\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n float n = max(float(frames), 1.0);\n float pitch = 1.0 + FRAME_LINE;\n float p = progress;\n \n float env = smoothstep(0.0, 0.3, p) * (1.0 - smoothstep(0.7, 1.0, p));\n float k = 1.0 - shrink * env;\n \n float x0 = clamp((p - 0.15) / 0.7, 0.0, 1.0);\n float slip = x0 * x0 * x0 * (x0 * (x0 * 6.0 - 15.0) + 10.0);\n float speed = 30.0 * x0 * x0 * (1.0 - x0) * (1.0 - x0) / 0.7; \n \n float wob = weave * env;\n \n float dx = wob * smoothstep(0.0, 0.1, shrink) * (0.006 * sin(p * 47.0) + 0.004 * sin(p * 113.0 + 1.3));\n float dy = wob * 0.012 * sin(p * 71.0 + 0.4) * (1.0 - speed / 2.7);\n\n \n float frameSlip = slip * n;\n float base = floor(frameSlip);\n float x = (uv.x - 0.5) / k + 0.5 + dx;\n float y = (uv.y - 0.5) / k + 0.5 + dy + (frameSlip - base) * pitch;\n \n float aa = 0.002 * min(1.0, 10.0 * env) * min(1.0, 20.0 * shrink) + 1e-4;\n \n float margin = 0.5 * shrink / max(1.0 - shrink, 0.01);\n float holeX = 0.5 + 0.5 * margin;\n vec2 holeSize = vec2(0.28 * margin * ratio, 0.11 * pitch / HOLES);\n float holes = smoothstep(0.0, 0.02, margin);\n\n \n float len = blur * 0.06 * speed * n;\n vec4 color = vec4(0.0);\n if (len < 1e-5) {\n color = film(x, y, base, n, aa, holeX, holeSize, holes);\n } else {\n \n float jitter = dither(floor(uv * vec2(ratio, 1.0) * 540.0));\n for (int i = 0; i < SAMPLES; i++) {\n float t = (float(i) + jitter) / float(SAMPLES) - 0.5;\n vec4 c = film(x, y + t * len, base, n, aa, holeX, holeSize, holes);\n color += vec4(c.rgb * c.a, c.a);\n }\n color /= float(SAMPLES);\n color.rgb = color.a > 0.0 ? color.rgb / color.a : vec3(0.0);\n }\n \n color.rgb *= 1.0 - 0.08 * wob * (0.5 + 0.5 * sin(p * 157.0));\n return color;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Fisheye":"// Fisheye — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Fisheye.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image bulges toward the viewer through a strong fisheye lens, then the incoming one flattens back into place\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nvec4 transition(vec2 uv) {\n \n \n float h = smoothstep(0.0, 1.0, 1.0 - abs(2.0 * progress - 1.0));\n float k = 1.0 - pow(max(1.0 - strength, 0.01), h);\n \n vec2 aspect = vec2(ratio, 1.0);\n vec2 c = (uv - 0.5) * aspect;\n float r = length(c) / length(0.5 * aspect);\n \n \n vec2 q = 0.5 + (uv - 0.5) * (1.0 - k + k * r * r);\n return mix(getFromColor(q), getToColor(q), smoothstep(0.38, 0.62, progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FlameWipe":"// FlameWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FlameWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A wall of flames sweeps across the frame, scorching the outgoing image ahead of it and leaving the incoming image under a fading warm glow\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float height; \n\nuniform float scorch; \n\nuniform float glow; \n\nuniform vec3 color; \n\nconst float BAND = 0.45;\n\nconst float PAD = 0.3;\n\nconst float RAGGED = 0.05;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nfloat noise(vec2 v) {\n vec2 i = floor(v);\n vec2 f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash12(i), hash12(i + vec2(1.0, 0.0)), f.x),\n mix(hash12(i + vec2(0.0, 1.0)), hash12(i + vec2(1.0, 1.0)), f.x), f.y);\n}\n\nfloat fbm(vec2 v) {\n float sum = 0.0;\n float amp = 0.5;\n for (int i = 0; i < 4; i++) {\n sum += amp * noise(v);\n v = v * 2.03 + vec2(17.3, 9.1);\n amp *= 0.5;\n }\n return sum / 0.9375;\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec3 fire(float h) {\n vec3 c = mix(vec3(0.22, 0.01, 0.0), color * color * vec3(1.0, 0.6, 0.4), smoothstep(0.0, 0.3, h));\n c = mix(c, color, smoothstep(0.25, 0.55, h));\n c = mix(c, vec3(1.0, 0.8, 0.35), smoothstep(0.55, 0.8, h));\n return mix(c, vec3(1.0, 0.96, 0.82), smoothstep(0.8, 1.0, h));\n}\n\nfloat climbing(float s, float size) {\n return (0.42 + 0.56 * size) * 6.75 * s * (1.0 - s) * (1.0 - s);\n}\n\nvec4 transition(vec2 uv) {\n vec2 dir = length(direction) > 1e-5 ? normalize(direction) : vec2(1.0, 0.0);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n \n float rise = height * dir.y;\n \n float w = 0.05 + 0.35 * height;\n float reach = w * (1.75 + 0.6 * abs(dir.x));\n \n float extent = 0.5 * (abs(dir.x) * ratio + abs(dir.y)) + PAD;\n float e = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.3);\n \n float burn = smoothstep(0.0, 0.12, progress) * (1.0 - smoothstep(0.88, 1.0, progress));\n float scorchAmount = scorch * smoothstep(0.0, 0.2, progress);\n float glowAmount = glow * (1.0 - smoothstep(0.75, 1.0, progress));\n \n float t = progress * 5.0;\n\n float side = dot(q, vec2(-dir.y, dir.x));\n float front = mix(-extent, extent, e) + RAGGED * (2.0 * noise(vec2(side * 4.0, t * 0.4)) - 1.0);\n \n float k = dot(q, dir) - front;\n\n \n \n \n float billow = noise(vec2(q.x * 3.0 + 5.0, q.y * 2.5 - t * 1.6));\n float y = q.y * 3.0 - t * 1.4;\n float y2 = y + 0.5;\n float climb = max(climbing(fract(y), hash12(vec2(floor(y), 3.0))),\n climbing(fract(y2), hash12(vec2(floor(y2), 7.0))));\n billow = mix(billow, 0.4 * billow + climb, abs(dir.x));\n float lineWidth = w * (0.25 + 1.5 * billow);\n float line = 1.0 - smoothstep(0.0, lineWidth, abs(k));\n float tongue = 0.0;\n if (abs(rise) > 1e-4) {\n float s = k / rise;\n if (s >= 0.0) tongue = clamp(1.0 - s, 0.0, 1.0);\n }\n float heat = max(line, tongue) * burn;\n float near = 1.0 - smoothstep(0.0, BAND, abs(k));\n\n \n vec2 h = q * vec2(9.0, 5.0) + vec2(0.0, -t * 3.0);\n vec2 shimmer = (vec2(noise(h), noise(h + 31.7)) - 0.5) * 0.012 * min(near + heat, 1.0) * burn;\n vec4 a = getFromColor(mirror(uv + shimmer));\n vec4 b = getToColor(uv);\n\n \n float brown = k > 0.0 ? scorchAmount * near : 0.0;\n float lum = dot(a.rgb, vec3(0.299, 0.587, 0.114));\n a.rgb = mix(a.rgb, lum * vec3(0.9, 0.55, 0.28), brown) * (1.0 - 0.35 * brown) * (1.0 - 0.9 * brown * near * near);\n \n float g = k < 0.0 ? glowAmount * near : 0.0;\n b.rgb = b.rgb * mix(vec3(1.0), vec3(1.0, 0.6, 0.35), 0.7 * g) + color * 0.4 * g * g;\n\n \n if (k >= max(BAND, max(rise, reach))) return a.a > 0.0 ? a : vec4(0.0);\n if (-k >= max(BAND, max(-rise, reach))) return b.a > 0.0 ? b : vec4(0.0);\n\n \n float m = smoothstep(-0.5 * w, 0.5 * w, k);\n vec4 c = mix(vec4(b.rgb * b.a, b.a), vec4(a.rgb * a.a, a.a), m);\n if (c.a <= 0.0) return vec4(0.0);\n vec3 col = c.rgb / c.a;\n\n \n vec2 f = vec2(q.x * mix(10.0, 6.0, abs(dir.x)), q.y * mix(1.8, 3.2, abs(dir.x)) - t * 2.4);\n float sway = fbm(vec2(q.x * 2.5, q.y * 1.5 - t * 1.2));\n float n = fbm(f + vec2(1.5 * sway - 0.75, 0.0));\n n = clamp(1.7 * n - 0.35, 0.0, 1.0);\n \n float core = (1.0 - smoothstep(0.0, 0.35 * lineWidth, abs(k + 0.4 * w * (sway - 0.5)))) * burn * (1.0 - 0.5 * abs(dir.x));\n \n float root = rise > 0.0 ? clamp(-k / w, 0.0, 1.0) : rise < 0.0 ? clamp(k / w, 0.0, 1.0) : 0.0;\n root *= abs(dir.y);\n float flame = clamp(heat * 0.95 + 0.45 * core * (0.75 + 0.25 * n) - (1.0 - n) * 1.1 * (1.0 - 0.8 * root), 0.0, 1.0);\n\n \n \n \n float body = smoothstep(0.0, 0.08 + 0.5 * root, flame);\n col = col * (1.0 - 0.7 * body) + fire(flame) * (0.45 + 0.65 * flame) * body;\n col += color * 0.25 * heat * heat * (1.0 - body);\n return vec4(clamp(col, 0.0, 1.0), c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FlashFade":"// FlashFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FlashFade.glsl\n// Author: gre\n// License: MIT\n// Description: A crossfade that brightens toward a color in the middle\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec3 color ;\nvec4 transition (vec2 uv) {\n return mix(\n getFromColor(uv) + vec4(progress*color, 0.0),\n getToColor(uv) + vec4((1.0-progress)*color, 0.0),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FlowerWipe":"// FlowerWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FlowerWipe.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: A flower shape with several petals grows to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int segments; \n\nvec4 transition (vec2 uv) {\n \n float angle = atan(uv.y - 0.5, uv.x - 0.5) - 0.5 * 3.14159265359;\n float normalized = (angle + 1.5 * 3.14159265359) * (2.0 * 3.14159265359);\n \n float radius = (cos(float(segments) * angle) + 4.0) / 4.0;\n float difference = length(uv - vec2(0.5, 0.5));\n \n if (difference > radius * progress)\n return getFromColor(uv);\n else\n return getToColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FlyEye":"// FlyEye — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FlyEye.glsl\n// Author: gre\n// License: MIT\n// Description: The image breaks into a fly's-eye grid of lenses with color separation\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float size; \nuniform float zoom; \nuniform float colorSeparation; \n\nvec4 transition(vec2 p) {\n float inv = 1. - progress;\n vec2 disp = size*vec2(cos(zoom*p.x), sin(zoom*p.y));\n vec4 texTo = getToColor(p + inv*disp);\n vec4 fromCenter = getFromColor(p + progress*disp);\n vec4 texFrom = vec4(\n getFromColor(p + progress*disp*(1.0 - colorSeparation)).r,\n fromCenter.g,\n getFromColor(p + progress*disp*(1.0 + colorSeparation)).b,\n fromCenter.a);\n return texTo*progress + texFrom*inv;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Fold":"// Fold — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Fold.glsl\n// Author: nwoeanhinnogaehr\n// License: MIT\n// Description: The incoming image unfolds from the left while the outgoing one folds away to the right\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n \n if (progress == 0.0 || uv.x > progress) return getFromColor((uv - vec2(progress, 0.0)) / vec2(1.0 - progress, 1.0));\n return getToColor(uv / vec2(progress, 1.0));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GlitchBands":"// GlitchBands — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlitchBands.glsl\n// Author: Yoni Maltsman @friendlyspinach\n// License: MIT\n// Description: A crossfade with glitchy horizontal bands and color shifts\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float ampx; \n\nuniform float ampy; \n\nvec4 transition (vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n float r = from.r;\n float g = from.g;\n float b = from.b;\n float sphere = r*r + g*g + b*b - 1.0; \n float spiralX = cos(sphere - uv.x/(progress + .01));\n float spiralY = sin(sphere - uv.y/(progress+.01));\n vec2 st = uv;\n st.x = fract(ampx*st.x*spiralX); \n st.y = fract(ampy*st.y*spiralY);\n vec2 diff = uv - st;\n from = getFromColor(uv + progress*diff);\n return mix(from, to, progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GlitchDisplace":"// GlitchDisplace — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlitchDisplace.glsl\n// Author: Matt DesLauriers\n// License: MIT\n// Description: Blocks of the image are displaced in a glitch that flashes into the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat random(vec2 co)\n{\n float a = 12.9898;\n float b = 78.233;\n float c = 43758.5453;\n float dt= dot(co.xy ,vec2(a,b));\n float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\nfloat voronoi( in vec2 x ) {\n vec2 p = floor( x );\n vec2 f = fract( x );\n float res = 8.0;\n for( float j=-1.; j<=1.; j++ )\n for( float i=-1.; i<=1.; i++ ) {\n vec2 b = vec2( i, j );\n vec2 r = b - f + random( p + b );\n float d = dot( r, r );\n res = min( res, d );\n }\n return sqrt( res );\n}\n\nvec2 displace(vec4 tex, vec2 texCoord, float dotDepth, float textureDepth, float strength) {\n float b = voronoi(.003 * texCoord + 2.0);\n float g = voronoi(0.2 * texCoord);\n float r = voronoi(texCoord - 1.0);\n vec4 dt = tex * 1.0;\n vec4 dis = dt * dotDepth + 1.0 - tex * textureDepth;\n\n dis.x = dis.x - 1.0 + textureDepth*dotDepth;\n dis.y = dis.y - 1.0 + textureDepth*dotDepth;\n dis.x *= strength;\n dis.y *= strength;\n vec2 res_uv = texCoord ;\n res_uv.x = res_uv.x + dis.x - 0.0;\n res_uv.y = res_uv.y + dis.y;\n return res_uv;\n}\n\nfloat ease1(float t) {\n return t == 0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) - 10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\nfloat ease2(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy;\n vec4 color1 = getFromColor(p);\n vec4 color2 = getToColor(p);\n vec2 disp = displace(color1, p, 0.33, 0.7, 1.0-ease1(progress));\n vec2 disp2 = displace(color2, p, 0.33, 0.5, ease2(progress));\n vec4 dColor1 = getToColor(disp);\n vec4 dColor2 = getFromColor(disp2);\n float val = ease1(progress);\n vec3 gray = vec3(dot(min(dColor2, dColor1).rgb, vec3(0.299, 0.587, 0.114)));\n dColor2 = vec4(gray * 2.0, dColor2.a);\n color1 = mix(color1, dColor2, smoothstep(0.0, 0.5, progress));\n color2 = mix(color2, dColor1, smoothstep(1.0, 0.5, progress));\n return mix(color1, color2, val);\n \n\n \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GlitchFlicker":"// GlitchFlicker — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlitchFlicker.glsl\n// Author: bread\n// License: MIT\n// Description: A flickering glitch with RGB offset, ghosting and scanlines that flashes back to the outgoing image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float frameRate; \nuniform float rgbOffset; \nuniform float blockAmount; \nuniform float ghostAmount; \nuniform float redCyan; \nuniform float scanline; \n\nfloat sat(float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nfloat hash12(vec2 p) {\n p = fract(p * vec2(443.8975, 397.2973));\n p += dot(p, p.yx + 19.19);\n return fract(p.x * p.y);\n}\n\nvec2 safeUv(vec2 uv) {\n return clamp(uv, vec2(0.001), vec2(0.999));\n}\n\nfloat frameReveal(float f) {\n if (f < 0.5) return 0.00;\n if (f < 1.5) return 0.28;\n if (f < 2.5) return 0.43;\n if (f < 3.5) return 0.46;\n if (f < 4.5) return 0.38;\n if (f < 5.5) return 0.48;\n if (f < 6.5) return 0.26;\n if (f < 7.5) return 0.10;\n if (f < 8.5) return 0.00;\n if (f < 9.5) return 0.00;\n if (f < 10.5) return 0.30;\n if (f < 11.5) return 0.58;\n if (f < 12.5) return 1.00;\n if (f < 13.5) return 0.70;\n if (f < 14.5) return 0.42;\n if (f < 15.5) return 0.55;\n if (f < 16.5) return 0.72;\n if (f < 17.5) return 0.88;\n if (f < 18.5) return 0.34;\n if (f < 19.5) return 0.48;\n if (f < 20.5) return 0.56;\n if (f < 21.5) return 0.76;\n if (f < 22.5) return 0.93;\n return 1.00;\n}\n\nfloat frameGlitch(float f) {\n if (f < 0.5) return 0.00;\n if (f < 6.5) return 0.92;\n if (f < 10.5) return 0.38;\n if (f < 11.5) return 0.78;\n if (f < 12.5) return 0.12;\n if (f < 17.5) return 0.74;\n if (f < 22.5) return 0.88;\n if (f < 23.5) return 0.28;\n return 0.00;\n}\n\nvec4 chromaFrom(vec2 uv, float amt) {\n vec2 o = vec2(amt, 0.0);\n vec4 center = getFromColor(safeUv(uv));\n return vec4(\n getFromColor(safeUv(uv + o)).r,\n center.g,\n getFromColor(safeUv(uv - o)).b,\n center.a\n );\n}\n\nvec4 chromaTo(vec2 uv, float amt) {\n vec2 o = vec2(amt, 0.0);\n vec4 center = getToColor(safeUv(uv));\n return vec4(\n getToColor(safeUv(uv - o)).r,\n center.g,\n getToColor(safeUv(uv + o)).b,\n center.a\n );\n}\n\nfloat blockMask(vec2 uv, float f) {\n vec2 big = floor(uv * vec2(4.0, 2.0));\n vec2 small = floor(uv * vec2(8.0, 4.0));\n\n float wide = step(0.48, hash12(vec2(big.x, f * 1.37)));\n float chunks = step(0.56, hash12(small + vec2(f * 2.11, f * 0.73)));\n\n float verticalCut = smoothstep(\n -0.035,\n 0.035,\n uv.x - mix(0.18, 0.78, hash12(vec2(f, 4.7)))\n );\n\n return sat(mix(wide, chunks, 0.38) * 0.72 + verticalCut * 0.28);\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n float f = floor(progress * frameRate);\n float reveal = frameReveal(f);\n float glitch = frameGlitch(f);\n\n float rnd = hash12(vec2(f, 9.13));\n vec2 jitter = vec2(\n (rnd - 0.5) * 0.042,\n (hash12(vec2(f, 2.71)) - 0.5) * 0.010\n ) * glitch;\n\n vec2 fromUv = safeUv(uv + jitter);\n vec2 toUv = safeUv(uv - jitter * 0.55);\n\n float block = blockMask(uv, f);\n float localReveal = sat(\n reveal +\n (block - 0.5) * blockAmount * glitch +\n (hash12(vec2(f, floor(uv.y * 9.0))) - 0.5) * 0.18 * glitch\n );\n\n localReveal = smoothstep(0.22, 0.78, localReveal);\n\n vec4 oldClip = chromaFrom(fromUv, rgbOffset * glitch);\n vec4 newClip = chromaTo(toUv, rgbOffset * glitch);\n\n vec4 color = mix(oldClip, newClip, localReveal);\n\n float leftWash = (1.0 - smoothstep(0.10, 0.78, uv.x)) * glitch;\n float cyanWash = smoothstep(0.08, 0.62, uv.x) * (1.0 - smoothstep(0.86, 1.0, uv.x)) * glitch;\n\n vec3 redGhost = oldClip.rgb * vec3(1.34, 0.42, 0.38);\n vec3 cyanGhost = newClip.rgb * vec3(0.48, 1.12, 1.24);\n\n color.rgb = mix(color.rgb, redGhost, leftWash * redCyan * 0.42);\n color.rgb = mix(color.rgb, cyanGhost, cyanWash * redCyan * 0.30);\n\n \n \n float oldReturn = glitch * (1.0 - smoothstep(0.94, 1.0, reveal));\n oldReturn *= 0.18 + 0.52 * (1.0 - abs(localReveal - 0.5) * 2.0);\n color.rgb = mix(color.rgb, oldClip.rgb, oldReturn * ghostAmount);\n\n float lines = sin((uv.y + f * 0.017) * 1080.0);\n color.rgb += lines * scanline * glitch;\n\n float exposurePulse = (hash12(vec2(f, 12.4)) - 0.35) * 0.10 * glitch;\n color.rgb += exposurePulse;\n\n return vec4(sat(color.r), sat(color.g), sat(color.b), color.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GlitchMemories":"// GlitchMemories — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlitchMemories.glsl\n// Author: Gunnar Roth\n// License: MIT\n// Description: A crossfade with glitchy, color-shifted blocks\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 p) {\n vec2 block = floor(p.xy / vec2(16));\n vec2 uv_noise = block / vec2(64);\n uv_noise += floor(vec2(progress) * vec2(1200.0, 3500.0)) / vec2(64);\n vec2 dist = progress > 0.0 ? (fract(uv_noise) - 0.5) * 0.3 *(1.0 -progress) : vec2(0.0);\n vec2 red = p + dist * 0.2;\n vec2 green = p + dist * .3;\n vec2 blue = p + dist * .5;\n\n vec4 center = mix(getFromColor(green), getToColor(green), progress);\n return vec4(mix(getFromColor(red), getToColor(red), progress).r, center.g, mix(getFromColor(blue), getToColor(blue), progress).b, center.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GlowDissolve":"// GlowDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlowDissolve.glsl\n// Author: hjm1fb\n// License: MIT\n// Description: The incoming image spreads over the outgoing one with a hot, glowing edge\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float uLineWidth; \n\nuniform vec3 uSpreadClr; \n\nuniform vec3 uHotClr; \nuniform float uPow; \nuniform float uIntensity; \n\nvec2 hash(vec2 p) \n{\n p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));\n return -1.0 + 2.0 * fract(sin(p) * 43758.5453123);\n}\n\nfloat noise(in vec2 p) {\n const float K1 = 0.366025404; \n const float K2 = 0.211324865; \n\n vec2 i = floor(p + (p.x + p.y) * K1);\n vec2 a = p - i + (i.x + i.y) * K2;\n float m = step(a.y, a.x);\n vec2 o = vec2(m, 1.0 - m);\n vec2 b = a - o + K2;\n vec2 c = a - 1.0 + 2.0 * K2;\n vec3 h = max(0.5 - vec3(dot(a, a), dot(b, b), dot(c, c)), 0.0);\n vec3 n = h * h * h * h * vec3(dot(a, hash(i + 0.0)), dot(b, hash(i + o)), dot(c, hash(i + 1.0)));\n return dot(n, vec3(70.0));\n}\n\nvec4 transition(vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n vec4 outColor;\n float burn;\n burn = 0.5 + 0.5 * (0.299 * from.r + 0.587 * from.g + 0.114 * from.b);\n\n float show = burn - progress;\n if (show < 0.001) {\n outColor = to;\n } else {\n float factor = 1.0 - smoothstep(0.0, uLineWidth, show);\n vec3 burnColor = mix(uSpreadClr, uHotClr, factor);\n burnColor = pow(burnColor, vec3(uPow)) * uIntensity;\n vec3 finalRGB = mix(from.rgb, burnColor, factor * step(0.0001, progress));\n outColor = vec4(finalRGB, from.a); \n }\n return outColor;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GooeyWipe":"// GooeyWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GooeyWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Soft, glossy blobs of liquid pop up over the outgoing image, swell and melt into each other, revealing the incoming image until they cover the whole frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float blobs; \n\nuniform float smoothness; \n\nuniform vec4 highlight; \n\nuniform vec4 shadow; \n\nfloat hash (vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nvec2 fold (vec2 p) {\n return 1.0 - abs(1.0 - mod(p, 2.0));\n}\n\nvec3 blob (vec2 cell, float rStart, float rEnd) {\n vec2 c = cell + 0.5 + 0.7 * (vec2(hash(cell + 0.5), hash(cell + 41.3)) - 0.5);\n float t0 = 0.02 + 0.43 * hash(cell + 17.9); \n float s = clamp((progress - t0) / (1.0 - t0), 0.0, 1.0);\n \n float pop = clamp((progress - t0) / 0.12, 0.0, 1.0);\n pop = 1.0 - (1.0 - pop) * (1.0 - pop) * (1.0 - pop);\n float r = mix(rStart, 0.18, pop) + (rEnd - 0.18) * s * sqrt(s);\n r += 0.05 * sin(pop * 9.0) * (1.0 - s) * pop;\n return vec3(r, c);\n}\n\nvec4 transition (vec2 uv) {\n float n = max(1.0, floor(blobs + 0.5));\n float cellSize = max(ratio, 1.0) / n;\n vec2 q = vec2(uv.x * ratio, uv.y) / cellSize; \n vec2 base = floor(q);\n float k = 0.02 + 0.25 * smoothness; \n float w = 0.16; \n \n \n float rStart = -(0.03 + 4.0 * k);\n float rEnd = 0.85 * sqrt(2.0) + w + 0.05;\n \n \n float m = 1e3; \n float sum = 0.0;\n vec2 grad = vec2(0.0);\n float rNear = 0.0; \n for (int j = -3; j <= 3; j++) {\n for (int i = -3; i <= 3; i++) {\n vec3 b = blob(base + vec2(float(i), float(j)), rStart, rEnd);\n vec2 dq = q - b.yz;\n float l = length(dq);\n float dist = l - b.x;\n vec2 g = dq / max(l, 1e-4);\n if (dist < m) {\n float scale = exp((dist - m) / k);\n sum = sum * scale + 1.0;\n grad = grad * scale + g;\n m = dist;\n rNear = b.x;\n } else {\n float wt = exp((m - dist) / k);\n sum += wt;\n grad += wt * g;\n }\n }\n }\n float d = m - k * log(sum); \n grad /= sum;\n float aa = 0.012 * n / 5.0;\n float inside = 1.0 - smoothstep(-aa, aa, d);\n \n float h = clamp(-d / w, 0.0, 1.0);\n float settle = 1.0 - smoothstep(0.45, 0.85, progress);\n float tilt = (1.0 - h) * (1.0 - h) * settle;\n vec3 nrm = normalize(vec3(grad * tilt * 3.0, 1.0));\n vec3 halfway = normalize(vec3(-0.35, 0.45, 1.0) + vec3(0.0, 0.0, 1.0));\n float spec = pow(max(dot(nrm, halfway), 0.0), 200.0) * settle;\n \n float shade = 1.0 - tilt * (0.25 + 0.3 * clamp(dot(grad, vec2(0.6, -0.8)) + 0.3, 0.0, 1.0));\n vec4 to = getToColor(fold(uv - grad * tilt * 0.01 * cellSize / vec2(ratio, 1.0)));\n float t2 = tilt * tilt;\n float gloss = 0.3 * t2 * t2; \n to.rgb = mix(to.rgb * shade, highlight.rgb, clamp(spec + gloss, 0.0, 1.0) * highlight.a);\n vec4 from = getFromColor(uv);\n float sh = shadow.a * (1.0 - smoothstep(0.0, 0.15, d + 0.03)) * smoothstep(0.0, 0.3, rNear);\n from.rgb = mix(from.rgb, shadow.rgb, sh);\n return mix(from, to, inside);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GridFlip":"// GridFlip — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GridFlip.glsl\n// Author: TimDonselaar\n// License: MIT\n// Description: The image splits into a grid of tiles that flip one by one to the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 size; \nuniform float pause; \nuniform float dividerWidth; \n\nuniform vec4 bgcolor; \nuniform float randomness; \n \nfloat rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nfloat getDelta(vec2 p) {\n vec2 rectanglePos = floor(vec2(size) * p);\n vec2 rectangleSize = vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y);\n float top = rectangleSize.y * (rectanglePos.y + 1.0);\n float bottom = rectangleSize.y * rectanglePos.y;\n float left = rectangleSize.x * rectanglePos.x;\n float right = rectangleSize.x * (rectanglePos.x + 1.0);\n float minX = min(abs(p.x - left), abs(p.x - right));\n float minY = min(abs(p.y - top), abs(p.y - bottom));\n return min(minX, minY);\n}\n\nfloat getDividerSize() {\n vec2 rectangleSize = vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y);\n return min(rectangleSize.x, rectangleSize.y) * dividerWidth;\n}\n\nvec4 transition(vec2 p) {\n if(progress < pause) {\n float currentProg = progress / pause;\n float a = 1.0;\n if(getDelta(p) < getDividerSize()) {\n a = 1.0 - currentProg;\n }\n return mix(bgcolor, getFromColor(p), a);\n }\n else if(progress < 1.0 - pause){\n if(getDelta(p) < getDividerSize()) {\n return bgcolor;\n } else {\n float currentProg = (progress - pause) / (1.0 - pause * 2.0);\n vec2 q = p;\n vec2 rectanglePos = floor(vec2(size) * q);\n \n float r = rand(rectanglePos) - randomness;\n float cp = smoothstep(0.0, 1.0 - r, currentProg);\n \n float rectangleSize = 1.0 / vec2(size).x;\n float delta = rectanglePos.x * rectangleSize;\n float offset = rectangleSize / 2.0 + delta;\n \n p.x = (p.x - offset)/abs(cp - 0.5)*0.5 + offset;\n vec4 a = getFromColor(p);\n vec4 b = getToColor(p);\n \n float s = step(abs(vec2(size).x * (q.x - delta) - 0.5), abs(cp - 0.5));\n return mix(bgcolor, mix(b, a, step(cp, 0.5)), s);\n }\n }\n else {\n float currentProg = (progress - 1.0 + pause) / pause;\n float a = 1.0;\n if(getDelta(p) < getDividerSize()) {\n a = currentProg;\n }\n return mix(bgcolor, getToColor(p), a);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Halftone":"// Halftone — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Halftone.glsl\n// Author: gre\n// License: MIT\n// Description: The image breaks into printed halftone dots whose size follows its shades, the dots reshape into the incoming image, then merge back into it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float dots; \n\nuniform float angle; \n\nuniform vec4 paper; \n\nfloat dotRadius(vec4 c) {\n float shade = 1.0 - dot(c.rgb, vec3(0.299, 0.587, 0.114));\n return mix(0.1, 0.74, sqrt(clamp(shade, 0.0, 1.0))) * c.a;\n}\n\nvec4 transition(vec2 uv) {\n \n float h = smoothstep(0.0, 0.3, progress) * (1.0 - smoothstep(0.7, 1.0, progress));\n float t = (progress - 0.3) / 0.4;\n \n float a = radians(angle);\n mat2 rot = mat2(cos(a), sin(a), -sin(a), cos(a));\n vec2 scale = vec2(ratio, 1.0) * dots / min(ratio, 1.0);\n vec2 g = rot * ((uv - 0.5) * scale);\n vec2 base = floor(g - 0.5) + 0.5;\n vec4 pixel = progress < 0.5 ? getFromColor(uv) : getToColor(uv);\n \n float best = 1e3;\n vec4 ink = pixel;\n for (int i = 0; i < 4; i++) {\n vec2 center = base + vec2(mod(float(i), 2.0), floor(float(i) / 2.0));\n vec2 cuv = (center * rot) / scale + 0.5; \n vec4 cf = getFromColor(cuv);\n vec4 ct = getToColor(cuv);\n float m = smoothstep(0.0, 1.0, clamp(2.5 * t - 1.5 * cuv.x, 0.0, 1.0));\n \n float r = mix(0.78, mix(dotRadius(cf), dotRadius(ct), m), h);\n float sd = length(g - center) - r;\n if (sd < best) {\n best = sd;\n ink = mix(pixel, mix(cf, ct, m), h);\n }\n }\n return mix(paper, ink, 1.0 - smoothstep(-0.06, 0.06, best));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","HeartWipe":"// HeartWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HeartWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A heart shape grows from the center to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat inHeart (vec2 p, vec2 center, float size) {\n if (size==0.0) return 0.0;\n vec2 o = (p-center)/(1.6*size);\n float a = o.x*o.x+o.y*o.y-0.3;\n return step(a*a*a, o.x*o.x*o.y*o.y*o.y);\n}\nvec4 transition (vec2 uv) {\n return mix(\n getFromColor(uv),\n getToColor(uv),\n inHeart(uv, vec2(0.5, 0.4), progress)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Hexagonalize":"// Hexagonalize — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Hexagonalize.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: Both images turn into hexagons, crossfade, then sharpen again\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int steps; \n\nuniform float horizontalHexagons; \n\nstruct Hexagon {\n float q;\n float r;\n float s;\n};\n\nHexagon createHexagon(float q, float r){\n Hexagon hex;\n hex.q = q;\n hex.r = r;\n hex.s = -q - r;\n return hex;\n}\n\nHexagon roundHexagon(Hexagon hex){\n \n float q = floor(hex.q + 0.5);\n float r = floor(hex.r + 0.5);\n float s = floor(hex.s + 0.5);\n\n float deltaQ = abs(q - hex.q);\n float deltaR = abs(r - hex.r);\n float deltaS = abs(s - hex.s);\n\n if (deltaQ > deltaR && deltaQ > deltaS)\n q = -r - s;\n else if (deltaR > deltaS)\n r = -q - s;\n else\n s = -q - r;\n\n return createHexagon(q, r);\n}\n\nHexagon hexagonFromPoint(vec2 point, float size) {\n \n point.y /= ratio;\n point = (point - 0.5) / size;\n \n float q = (sqrt(3.0) / 3.0) * point.x + (-1.0 / 3.0) * point.y;\n float r = 0.0 * point.x + 2.0 / 3.0 * point.y;\n\n Hexagon hex = createHexagon(q, r);\n return roundHexagon(hex);\n \n}\n\nvec2 pointFromHexagon(Hexagon hex, float size) {\n \n float x = (sqrt(3.0) * hex.q + (sqrt(3.0) / 2.0) * hex.r) * size + 0.5;\n float y = (0.0 * hex.q + (3.0 / 2.0) * hex.r) * size + 0.5;\n \n return vec2(x, y * ratio);\n}\n\nvec4 transition (vec2 uv) {\n \n float dist = 2.0 * min(progress, 1.0 - progress);\n dist = steps > 0 ? ceil(dist * float(steps)) / float(steps) : dist;\n \n float size = (sqrt(3.0) / 3.0) * dist / horizontalHexagons;\n \n vec2 point = dist > 0.0 ? pointFromHexagon(hexagonFromPoint(uv, size), size) : uv;\n\n return mix(getFromColor(point), getToColor(point), progress);\n \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Honeycomb":"// Honeycomb — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Honeycomb.glsl\n// Author: gre\n// License: MIT\n// Description: The image splits into hexagons that spin and shrink away in a wave from the center, uncovering the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float size; \n\nfloat hexDist(vec2 p) {\n p = abs(p);\n return max(p.x, dot(p, vec2(0.5, 0.8660254)));\n}\n\nmat2 rotation(float a) {\n return mat2(cos(a), sin(a), -sin(a), cos(a));\n}\n\nfloat hexMask(vec2 local, float s, float a, float e) {\n float r = (0.52 + e) * s;\n return 1.0 - smoothstep(r - e, r, hexDist(rotation(-a) * local));\n}\n\nvec2 hexUv(vec2 uv, vec2 local, vec2 cellToUv, float s, float a) {\n return uv + cellToUv * (rotation(-a) * local / max(s, 0.001) - local);\n}\n\nvec4 transition(vec2 uv) {\n \n vec2 toCells = vec2(ratio, 1.0) * size / min(ratio, 1.0);\n vec2 p = (uv - 0.5) * toCells;\n const vec2 grid = vec2(1.0, 1.7320508);\n vec2 a = (floor(p / grid) + 0.5) * grid;\n vec2 b = (floor((p - 0.5 * grid) / grid) + 1.0) * grid;\n vec2 center = dot(p - a, p - a) < dot(p - b, p - b) ? a : b;\n vec2 local = p - center;\n\n \n float d = min(length(center / toCells * vec2(ratio, 1.0)) / (0.5 * length(vec2(ratio, 1.0))), 1.0);\n float t = clamp((progress - 0.6 * d) / 0.4, 0.0, 1.0);\n\n \n \n float s = 1.0 - smoothstep(0.1, 1.0, t);\n float turn = 1.8 * t * (2.0 - t);\n vec4 fromTile = getFromColor(hexUv(uv, local, 1.0 / toCells, s, turn));\n fromTile.rgb *= 1.0 - 0.3 * t;\n vec4 below = getToColor(uv);\n below.rgb *= 1.0 - 0.5 * hexMask(local - vec2(0.06, -0.08) * s, s, turn, 0.2);\n return mix(below, fromTile, hexMask(local, s, turn, 0.03));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","HorizontalClose":"// HorizontalClose — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HorizontalClose.glsl\n// Author: martiniti\n// License: MIT\n// Description: The incoming image closes in from the top and bottom edges toward the middle\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n\n float s = 2.0 - abs((uv.y - 0.5) / (progress - 1.0)) - 2.0 * progress;\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n smoothstep(0.5, 0.0, s)\n ); \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","HorizontalOpen":"// HorizontalOpen — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HorizontalOpen.glsl\n// Author: martiniti\n// License: MIT\n// Description: The incoming image opens from a line in the middle toward the top and bottom edges\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n \n float regress = 1.0 - progress;\n\n float s = 2.0 - abs((uv.y - 0.5) / (regress - 1.0)) - 2.0 * regress;\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n smoothstep(0.0, 0.5, s)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","HsvFade":"// HsvFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HsvFade.glsl\n// Author: nwoeanhinnogaehr\n// License: MIT\n// Description: A crossfade through the HSV color space that cycles through hues\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec3 hsv2rgb(vec3 c) {\n const vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvec3 rgb2hsv(vec3 c) {\n const vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + 0.001)), d / (q.x + 0.001), q.x);\n}\n\nvec4 transition(vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n vec3 m = mix(rgb2hsv(from.rgb), rgb2hsv(to.rgb), progress);\n return vec4(hsv2rgb(m), mix(from.a, to.a, progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","InkBleed":"// InkBleed — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/InkBleed.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image spreads over the outgoing one like drops of ink in water, blooming from a few points with curling, wispy edges and a darker rim, until it fills the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float drops; \n\nuniform float tendrils; \n\nuniform float rim; \n\nuniform float seed; \n\nfloat hash (vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat vnoise (vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nfloat fbm (vec2 p) {\n float v = 0.0;\n float a = 0.5;\n for (int i = 0; i < 4; i++) {\n v += a * vnoise(p);\n p = mat2(1.6, 1.2, -1.2, 1.6) * p + 7.3;\n a *= 0.5;\n }\n return v / 0.9375;\n}\n\nvec2 fold (vec2 p) {\n return 1.0 - abs(1.0 - mod(p, 2.0));\n}\n\nvec4 transition (vec2 uv) {\n float p = progress;\n vec2 q = vec2(uv.x * ratio, uv.y);\n \n vec2 o = vec2(seed * 3.1, seed * 1.7);\n vec2 sq = q * 2.2 + o;\n vec2 w1 = vec2(fbm(sq + vec2(0.0, 0.6 * p)), fbm(sq + vec2(5.2, 1.3) - vec2(0.5 * p, 0.0)));\n vec2 w2 = vec2(fbm(sq + 3.0 * w1 + vec2(1.7, 9.2)), fbm(sq + 3.0 * w1 + vec2(8.3, 2.8)));\n float swirl = fbm(sq * 0.8 + 2.5 * w2) - 0.5; \n vec2 flow = w2 - 0.5;\n float amp = 0.05 + 0.35 * tendrils;\n float n = clamp(floor(drops + 0.5), 1.0, 8.0);\n float rimW = 0.1;\n float feather = 0.05; \n float margin = 1.2 * amp + rimW + 0.08; \n float f = -1e3; \n float fs = -1e3; \n for (int i = 0; i < 8; i++) {\n float fi = float(i);\n if (fi < n) {\n vec2 hs = vec2(fi * 7.13 + seed, fi * 3.71 - seed);\n vec2 c = vec2(mix(0.15, 0.85, hash(hs)) * ratio, mix(0.15, 0.85, hash(hs + 19.7)));\n float start = 0.2 * fi / n;\n float s = clamp((p - start) / (1.0 - start), 0.0, 1.0);\n \n vec2 m = max(c, vec2(ratio, 1.0) - c);\n float far = length(m) + margin;\n float s3 = s * s * s;\n float r = (far + 0.02) * s * (0.35 + 0.65 * s3 * s3) - 0.02;\n \n float reach = amp * min(1.0, max(r, 0.0) * 5.0);\n float g = r - length(q - c + 1.3 * reach * flow) + reach * 0.9 * swirl;\n f = max(f, g);\n fs = max(fs, g - 0.15 * (1.0 - min(1.0, s * 12.0)));\n }\n }\n float aa = 0.003;\n float inside = smoothstep(-aa, aa, f);\n \n float wisp = 1.0 - smoothstep(0.0, 0.08, abs(fbm(sq * 2.0 + 5.0 * w2) - 0.5));\n float soft = smoothstep(-feather, 0.0, fs) * (0.35 + 0.4 * wisp);\n float haze = 0.35 * wisp * (1.0 - smoothstep(0.0, 0.1, -fs));\n float cover = max(inside, max(soft, haze));\n \n float edge = 1.0 - smoothstep(0.0, rimW, f);\n vec4 to = getToColor(fold(uv - 0.015 * edge * flow / vec2(ratio, 1.0)));\n to.rgb = mix(to.rgb, to.rgb * to.rgb * 0.7, rim * edge);\n return mix(getFromColor(uv), to, cover);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","InvertedPageCurl":"// InvertedPageCurl — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/InvertedPageCurl.glsl\n// Author: Hewlett-Packard\n// License: BSD 3 Clause\n// Description: The outgoing image curls away like a page, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst float MIN_AMOUNT = -0.16;\nconst float MAX_AMOUNT = 1.5;\n\nconst float PI = 3.141592653589793;\n\nconst float scale = 512.0;\nconst float sharpness = 3.0;\n\nconst float cylinderRadius = 1.0 / PI / 2.0;\n\nfloat amount;\nfloat cylinderCenter;\nfloat cylinderAngle;\n\nvec3 hitPoint(float hitAngle, float yc, vec3 point, mat3 rrotation)\n{\n float hitPoint = hitAngle / (2.0 * PI);\n point.y = hitPoint;\n return rrotation * point;\n}\n\nvec4 antiAlias(vec4 color1, vec4 color2, float distanc)\n{\n distanc *= scale;\n if (distanc < 0.0) return color2;\n if (distanc > 2.0) return color1;\n float dd = pow(1.0 - distanc / 2.0, sharpness);\n return ((color2 - color1) * dd) + color1;\n}\n\nfloat distanceToEdge(vec3 point)\n{\n float dx = abs(point.x > 0.5 ? 1.0 - point.x : point.x);\n float dy = abs(point.y > 0.5 ? 1.0 - point.y : point.y);\n if (point.x < 0.0) dx = -point.x;\n if (point.x > 1.0) dx = point.x - 1.0;\n if (point.y < 0.0) dy = -point.y;\n if (point.y > 1.0) dy = point.y - 1.0;\n if ((point.x < 0.0 || point.x > 1.0) && (point.y < 0.0 || point.y > 1.0)) return sqrt(dx * dx + dy * dy);\n return min(dx, dy);\n}\n\nvec4 seeThrough(float yc, vec2 p, mat3 rotation, mat3 rrotation)\n{\n float hitAngle = PI - (acos(clamp(yc / cylinderRadius, -1.0, 1.0)) - cylinderAngle);\n vec3 point = hitPoint(hitAngle, yc, rotation * vec3(p, 1.0), rrotation);\n if (yc <= 0.0 && (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0))\n {\n return getToColor(p);\n }\n\n if (yc > 0.0) return getFromColor(p);\n\n vec4 color = getFromColor(point.xy);\n vec4 tcolor = vec4(0.0);\n\n return antiAlias(color, tcolor, distanceToEdge(point));\n}\n\nvec4 seeThroughWithShadow(float yc, vec2 p, vec3 point, mat3 rotation, mat3 rrotation)\n{\n float shadow = distanceToEdge(point) * 30.0;\n shadow = (1.0 - shadow) / 3.0;\n\n if (shadow < 0.0) shadow = 0.0; else shadow *= amount;\n\n vec4 shadowColor = seeThrough(yc, p, rotation, rrotation);\n shadowColor.r -= shadow;\n shadowColor.g -= shadow;\n shadowColor.b -= shadow;\n\n return shadowColor;\n}\n\nvec4 backside(float yc, vec3 point)\n{\n vec4 color = getFromColor(point.xy);\n float gray = (color.r + color.b + color.g) / 15.0;\n gray += (8.0 / 10.0) * (pow(max(0.0, 1.0 - abs(yc / cylinderRadius)), 2.0 / 10.0) / 2.0 + (5.0 / 10.0));\n color.rgb = vec3(gray);\n return color;\n}\n\nvec4 behindSurface(vec2 p, float yc, vec3 point, mat3 rrotation)\n{\n float safeAmount = amount >= 0.0 ? max(amount, 1e-4) : min(amount, -1e-4);\n float shado = (1.0 - ((-cylinderRadius - yc) / safeAmount * 7.0)) / 6.0;\n shado *= 1.0 - abs(point.x - 0.5);\n\n yc = (-cylinderRadius - cylinderRadius - yc);\n\n float hitAngle = (acos(clamp(yc / cylinderRadius, -1.0, 1.0)) + cylinderAngle) - PI;\n point = hitPoint(hitAngle, yc, point, rrotation);\n\n if (yc < 0.0 && point.x >= 0.0 && point.y >= 0.0 && point.x <= 1.0 && point.y <= 1.0 && (hitAngle < PI || amount > 0.5))\n {\n float dx = point.x - 0.5;\n float dy = point.y - 0.5;\n shado = 1.0 - (sqrt(dx * dx + dy * dy) / (71.0 / 100.0));\n float nyc = -yc / cylinderRadius;\n shado *= nyc * nyc * nyc;\n shado *= 0.5;\n }\n else\n {\n shado = 0.0;\n }\n vec4 to = getToColor(p);\n return vec4(to.rgb - shado, to.a);\n}\n\nvec4 transition(vec2 p) {\n amount = progress * (MAX_AMOUNT - MIN_AMOUNT) + MIN_AMOUNT;\n cylinderCenter = amount;\n cylinderAngle = 2.0 * PI * amount;\n\n const float angle = 100.0 * PI / 180.0;\n float c = cos(-angle);\n float s = sin(-angle);\n\n mat3 rotation = mat3( c, s, 0,\n -s, c, 0,\n -0.801, 0.8900, 1\n );\n c = cos(angle);\n s = sin(angle);\n\n mat3 rrotation = mat3(\tc, s, 0,\n -s, c, 0,\n 0.98500, 0.985, 1\n );\n\n vec3 point = rotation * vec3(p, 1.0);\n\n float yc = point.y - cylinderCenter;\n\n if (yc < -cylinderRadius)\n {\n \n return behindSurface(p,yc, point, rrotation);\n }\n\n if (yc > cylinderRadius)\n {\n \n return getFromColor(p);\n }\n\n float hitAngle = (acos(clamp(yc / cylinderRadius, -1.0, 1.0)) + cylinderAngle) - PI;\n\n float hitAngleMod = mod(hitAngle, 2.0 * PI);\n if ((hitAngleMod > PI && amount < 0.5) || (hitAngleMod > PI/2.0 && amount < 0.0))\n {\n return seeThrough(yc, p, rotation, rrotation);\n }\n\n point = hitPoint(hitAngle, yc, point, rrotation);\n\n if (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0)\n {\n return seeThroughWithShadow(yc, p, point, rotation, rrotation);\n }\n\n vec4 color = backside(yc, point);\n\n vec4 otherColor;\n if (yc < 0.0)\n {\n float dx2 = point.x - 0.5;\n float dy2 = point.y - 0.5;\n float shado = 1.0 - (sqrt(dx2 * dx2 + dy2 * dy2) / 0.71);\n float nyc2 = -yc / cylinderRadius;\n shado *= nyc2 * nyc2 * nyc2;\n shado *= 0.5;\n otherColor = vec4(0.0, 0.0, 0.0, shado * getToColor(p).a); \n }\n else\n {\n otherColor = getFromColor(p);\n }\n\n color = antiAlias(color, otherColor, cylinderRadius - abs(yc));\n\n vec4 cl = seeThroughWithShadow(yc, p, point, rotation, rrotation);\n float dist = distanceToEdge(point);\n\n return antiAlias(color, cl, dist);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Kaleidoscope":"// Kaleidoscope — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Kaleidoscope.glsl\n// Author: nwoeanhinnogaehr\n// License: MIT\n// Description: A crossfade through a spinning kaleidoscope\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float speed; \nuniform float angle; \nuniform float power; \n\nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy;\n vec2 q = p;\n float t = pow(progress, power)*speed;\n p = p -0.5;\n for (int i = 0; i < 7; i++) {\n p = vec2(sin(t)*p.x + cos(t)*p.y, sin(t)*p.y - cos(t)*p.x);\n t += angle;\n p = abs(mod(p, 2.0) - 1.0);\n }\n abs(mod(p, 1.0));\n return mix(\n mix(getFromColor(q), getToColor(q), progress),\n mix(getFromColor(p), getToColor(p), progress), 1.0 - 2.0*abs(progress - 0.5));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LeafWipe":"// LeafWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LeafWipe.glsl\n// Author: @Flexi23\n// License: MIT\n// Description: A leaf shape grows from the center to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n if(progress == 0.0){\n return getFromColor(uv);\n }\n vec2 leaf_uv = (uv - vec2(0.5))/10./pow(progress,3.5);\n\tleaf_uv.y += 0.35;\n\tfloat r = 0.18;\n\tfloat o = atan(leaf_uv.y, leaf_uv.x);\n return mix(getFromColor(uv), getToColor(uv), 1.-step(1. - length(leaf_uv)+r*(1.+sin(o))*(1.+0.9 * cos(8.*o))*(1.+0.1*cos(24.*o))*(0.9+0.05*cos(200.*o)), 1.));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LeftRight":"// LeftRight — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LeftRight.glsl\n// Author: zhmy\n// License: MIT\n// Description: The outgoing image shrinks away to the left while the incoming one slides in from the right\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst vec4 black = vec4(0.0); \nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n vec2 spfr,spto = vec2(-1.);\n\n float size = mix(1.0, 3.0, progress*0.2);\n spto = (uv + vec2(-0.5,-0.5))*vec2(size,size)+vec2(0.5,0.5);\n spfr = (uv - vec2(1.-progress, 0.0));\n if(inBounds(spfr)){\n return getToColor(spfr);\n }else if(inBounds(spto)){\n return getFromColor(spto) * (1.0 - progress);\n } else{\n return black;\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LensFlare":"// LensFlare — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LensFlare.glsl\n// Author: gre\n// License: MIT\n// Description: A bright light sweeps across the frame and flares the lens: a long thin horizontal streak, a glowing core and a trail of colored ghost reflections; at its peak the incoming image spreads out from the light under its glare\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float angle; \n\nuniform float height; \n\nuniform float intensity; \n\nuniform vec3 color; \n\nconst int BLOOM_TAPS = 12;\nconst int GHOSTS = 6;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 premultiplied(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 frame(vec2 st, float m) {\n if (m <= 0.0) return premultiplied(getFromColor(st));\n if (m >= 1.0) return premultiplied(getToColor(st));\n return mix(premultiplied(getFromColor(st)), premultiplied(getToColor(st)), m);\n}\n\nvec3 highlight(vec4 c) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n return c.rgb * smoothstep(0.55, 0.95, lum);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n if (p <= 0.0) return getFromColor(uv);\n if (p >= 1.0) return getToColor(uv);\n\n \n float env = 4.0 * p * (1.0 - p);\n float peak = pow(env, 24.0);\n \n vec2 aspect = vec2(ratio, 1.0);\n vec2 q = (uv - 0.5) * aspect;\n float r = radians(angle);\n vec2 dir = vec2(cos(r), -sin(r));\n vec2 normal = vec2(-dir.y, dir.x);\n \n float t = p - 0.5;\n float travel = 0.5 * (abs(dir.x) * ratio + abs(dir.y)) + 0.3;\n float along = travel * (2.0 * t) * (0.55 + 1.8 * t * t);\n vec2 src = dir * along + normal * height;\n\n vec2 d = q - src;\n float dist = length(d);\n float k = intensity * env;\n\n \n \n float cut = mix(0.2, 0.06, clamp(intensity, 0.0, 1.0));\n float s = clamp((p - 0.5 + cut) / (2.0 * cut), 0.0, 1.0);\n float soft = 0.3;\n float reach = 0.5 * length(aspect) + length(src) + soft;\n float front = s * (reach + soft);\n float m = smoothstep(front, front - soft, dist);\n vec4 base = frame(uv, m);\n\n \n float ax = abs(d.x);\n float ay = abs(d.y);\n float thin = exp(-ay * 140.0) * exp(-ax * 0.7);\n float wide = exp(-ay * 30.0) * exp(-ax * 1.6);\n vec3 tint = color;\n vec3 streak = (thin * mix(vec3(1.0), tint, smoothstep(0.0, 0.3, ax)) + 0.5 * wide * tint) * 3.0;\n\n \n vec3 core = vec3(1.0, 0.97, 0.92) * exp(-dist * dist * 600.0) * 3.0 + mix(vec3(1.0), tint, 0.5) * exp(-dist * 7.0) * 0.6;\n\n \n vec3 ghosts = vec3(0.0);\n for (int i = 0; i < GHOSTS; i++) {\n float fi = float(i);\n float f = -0.45 + 0.42 * fi + 0.08 * sin(fi * 2.3);\n vec2 g = -src * f;\n float size = 0.025 + 0.06 * fract(fi * 0.618 + 0.2);\n float gd = length(q - g) / size;\n \n float disc = smoothstep(1.0, 0.8, gd) * (0.35 + 0.65 * smoothstep(0.4, 0.95, gd));\n vec3 hue = mix(tint, vec3(1.0, 0.65, 0.35), fract(fi * 0.53));\n hue = mix(hue, vec3(0.5, 1.0, 0.6), step(4.5, fi) * 0.6);\n ghosts += disc * hue * 0.45;\n }\n\n \n vec3 bloom = vec3(0.0);\n if (peak > 1e-3) {\n float radius = 0.06 * env;\n for (int i = 0; i < BLOOM_TAPS; i++) {\n float fi = float(i);\n float a = fi * 2.39996;\n float rr = radius * sqrt((fi + 0.5) / float(BLOOM_TAPS));\n vec2 o = vec2(cos(a), sin(a)) * rr / aspect;\n bloom += highlight(frame(mirror(uv + o), m));\n }\n bloom /= float(BLOOM_TAPS);\n }\n\n \n vec3 glare = mix(vec3(1.0), tint, 0.5) * peak * (0.45 + 2.2 * exp(-dist * 3.0));\n\n vec3 light = k * (streak + core + ghosts) + intensity * (bloom * 2.5 * peak + glare);\n light = 1.0 - exp(-light);\n\n \n vec3 c = base.rgb + light * base.a - base.rgb * light;\n if (base.a <= 0.0) return vec4(0.0);\n return vec4(clamp(c / base.a, 0.0, 1.0), base.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LightRays":"// LightRays — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LightRays.glsl\n// Author: gre\n// License: MIT\n// Description: Shafts of light burst from the highlights of the outgoing image and stream outward from a slowly drifting center; at their peak the incoming image takes over and its own rays shrink back into its highlights\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \n\nuniform float drift; \n\nuniform float reach; \n\nuniform float threshold; \n\nuniform float intensity; \n\nuniform vec3 tint; \n\nconst int TAPS = 20;\n\nconst float SHAFTS = 23.0;\nconst float PI = 3.141592653589793;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nfloat shaftNoise(float t, float n, float seed) {\n float x = t * n;\n float i = floor(x);\n float f = x - i;\n float a = hash12(vec2(mod(i, n), seed));\n float b = hash12(vec2(mod(i + 1.0, n), seed));\n return mix(a, b, f * f * (3.0 - 2.0 * f));\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec3 glow(vec4 c, float knee) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n return c.rgb * c.a * smoothstep(knee, knee + 0.2, lum);\n}\n\nvec3 light(vec2 st, float knee, float m) {\n if (m <= 0.0) return glow(getFromColor(st), knee);\n if (m >= 1.0) return glow(getToColor(st), knee);\n return mix(glow(getFromColor(st), knee), glow(getToColor(st), knee), m);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float amount = p < 0.5 ? smoothstep(0.0, 0.5, p) : 1.0 - smoothstep(0.5, 1.0, p);\n float peak = amount * amount * amount;\n float m = smoothstep(0.46, 0.54, p);\n vec4 fromColor = getFromColor(uv);\n vec4 toColor = getToColor(uv);\n if (amount <= 0.0) return m < 0.5 ? fromColor : toColor;\n\n \n vec2 origin = center + vec2(drift * (p - 0.5), 0.0);\n float len = reach * amount;\n \n float knee = mix(threshold, 0.75 * threshold, peak);\n \n \n float jitter = hash12(floor(uv * vec2(ratio, 1.0) * 997.0));\n\n \n vec3 rays = vec3(0.0);\n float total = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float s = (float(i) + jitter) / float(TAPS);\n float w = exp(-2.0 * s);\n \n vec3 hue = mix(vec3(1.0), tint, smoothstep(0.0, 0.6, s));\n rays += w * hue * light(mirror(mix(uv, origin, s * len)), knee, m);\n total += w;\n }\n \n vec2 d = (uv - origin) * vec2(ratio, 1.0);\n \n float turn = length(d) > 1e-6 ? atan(d.y, d.x) / (2.0 * PI) + 0.5 : 0.0;\n float shafts = 0.6 * shaftNoise(fract(turn + 0.03 * p), SHAFTS, 1.0) + 0.4 * shaftNoise(fract(turn - 0.05 * p), 2.0 * SHAFTS + 1.0, 7.0);\n \n rays *= mix(1.0, mix(0.2, 1.6, smoothstep(0.15, 0.85, shafts)), smoothstep(0.0, 0.3, length(d)));\n rays *= intensity * amount * (1.0 + 3.0 * peak) / total;\n \n rays = 0.9 * (1.0 - exp(-rays));\n\n \n \n vec4 c = mix(vec4(fromColor.rgb * fromColor.a, fromColor.a), vec4(toColor.rgb * toColor.a, toColor.a), m);\n if (c.a <= 0.0) return vec4(0.0);\n vec3 base = min(c.rgb / c.a * (1.0 + 0.2 * peak), 1.0);\n return vec4(base + rays - base * rays, c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LightStreaks":"// LightStreaks — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LightStreaks.glsl\n// Author: gre\n// License: MIT\n// Description: The highlights of the outgoing image flare into long horizontal (or vertical) lens streaks while it smears with motion blur; at the peak the incoming image takes over and its streaks shrink back into its highlights as it sharpens\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float reach; \n\nuniform float threshold; \n\nuniform float intensity; \n\nuniform vec3 tint; \n\nuniform float blur; \n\nuniform int vertical; \n\nconst int BLUR_TAPS = 6;\n\nconst int STREAK_TAPS = 11;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 frame(vec2 st, float m) {\n if (m <= 0.0) return getFromColor(st);\n if (m >= 1.0) return getToColor(st);\n return mix(getFromColor(st), getToColor(st), m);\n}\n\nvec3 glow(vec4 c, float knee) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n return c.rgb * c.a * smoothstep(knee, knee + 0.2, lum);\n}\n\nvec4 light(vec2 st, float m, bool incoming) {\n if (m <= 0.0) return getFromColor(st);\n if (m >= 1.0) return getToColor(st);\n return incoming ? getToColor(st) : getFromColor(st);\n}\n\nfloat lightWeight(float m, bool incoming) {\n if (m <= 0.0 || m >= 1.0) return 1.0;\n return incoming ? 2.0 * m : 2.0 * (1.0 - m);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float amount = p < 0.5 ? smoothstep(0.0, 0.5, p) : pow(2.0 - 2.0 * p, 3.0);\n float peak = amount * amount * amount;\n float m = smoothstep(0.44, 0.56, p);\n vec2 axis = (vertical != 0) ? vec2(0.0, 1.0) : vec2(1.0, 0.0);\n \n \n float jitter = hash12(floor(uv * vec2(ratio, 1.0) * 997.0)) - 0.5;\n\n \n float smear = blur * amount;\n vec3 base = vec3(0.0);\n float alpha = 0.0;\n float total = 0.0;\n for (int i = 0; i < BLUR_TAPS; i++) {\n float t = (float(i) + 0.5 + jitter) / float(BLUR_TAPS) - 0.5;\n float w = 1.0 - abs(t);\n total += w;\n bool incoming = mod(float(i), 2.0) > 0.5;\n w *= lightWeight(m, incoming);\n vec4 c = light(mirror(uv + axis * t * smear), m, incoming);\n base += w * c.rgb * c.a;\n alpha += w * c.a;\n }\n base /= total;\n alpha /= total;\n\n \n float falloff = 0.25 * reach * amount;\n float knee = mix(threshold, 0.8 * threshold, peak);\n vec3 streak = glow(frame(uv, m), knee);\n float weights = 1.0;\n for (int k = 1; k <= STREAK_TAPS; k++) {\n \n float d = exp(0.14 * (float(k) + 0.8 * jitter)) - 1.0;\n float span = 0.14 * (d + 1.0);\n \n vec3 hue = mix(vec3(1.0), tint, smoothstep(0.0, 0.8, d));\n hue *= exp(-d * vec3(0.6, 0.2, -0.15));\n float w = exp(-d) * span * 4.0;\n bool incoming = mod(float(k), 2.0) > 0.5;\n vec4 ahead = light(mirror(uv + axis * d * falloff), m, incoming);\n vec4 behind = light(mirror(uv - axis * d * falloff), m, !incoming);\n streak += w * hue * (glow(ahead, knee) * lightWeight(m, incoming) + glow(behind, knee) * lightWeight(m, !incoming));\n weights += 2.0 * w;\n }\n streak *= intensity * amount * (0.6 + 2.4 * peak) * 2.0 / weights;\n \n streak = 0.85 * (1.0 - exp(-streak));\n\n \n base = min(base * (1.0 + 0.2 * peak), vec3(alpha));\n vec3 color = base + streak - base * streak;\n float a = alpha + max(streak.r, max(streak.g, streak.b)) * (1.0 - alpha);\n return vec4(clamp(color / max(a, 1e-5), 0.0, 1.0), a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LightWipe":"// LightWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LightWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A band of intense light sweeps across the frame like a glint on glass, blooming the highlights of both images, and leaves the incoming image behind it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float width; \n\nuniform float intensity; \n\nuniform vec3 color; \n\nconst int TAPS = 12;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat ease(float t) {\n return 0.5 * (t + t * t * (3.0 - 2.0 * t));\n}\n\nvec4 frame(vec2 st, float m) {\n return mix(getFromColor(st), getToColor(st), m);\n}\n\nvec3 highlight(vec4 c) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n return c.rgb * c.a * smoothstep(0.45, 1.0, lum);\n}\n\nvec4 transition(vec2 uv) {\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n \n float e = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n float w = max(width, 0.001);\n float s = 0.35 * w;\n \n float margin = s + 2.0 * w;\n float pos = -e - margin + 2.0 * (e + margin) * ease(progress);\n \n float d = dot(p, dir) - pos;\n float m = 1.0 - smoothstep(-s, s, d);\n\n \n float env = smoothstep(0.0, 0.2, progress) * (1.0 - smoothstep(0.8, 1.0, progress));\n \n float core = exp(-d * d / (w * w));\n float g = (d + 2.2 * w) / (0.3 * w);\n float glint = 0.45 * exp(-g * g);\n float halo = 0.35 * exp(-abs(d) / (5.0 * w));\n float band = (core + glint + halo) * env * intensity;\n \n float glow = (core + glint) * env * intensity;\n\n vec4 c = frame(uv, m);\n\n \n vec3 bloom = vec3(0.0);\n \n float spread = min(3.0 * w, 0.12);\n for (int i = 0; i < TAPS; i++) {\n float t = (float(i) + 0.5) / float(TAPS) * 2.0 - 1.0;\n vec2 st = mirror((p + dir * (t * spread)) / vec2(ratio, 1.0) + 0.5);\n \n float dq = dot((st - 0.5) * vec2(ratio, 1.0), dir) - pos;\n bloom += (1.0 - abs(t)) * highlight(frame(st, 1.0 - smoothstep(-s, s, dq)));\n }\n \n bloom /= 0.5 * float(TAPS);\n\n \n vec3 hue = mix(color, vec3(1.0), core * core);\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n \n vec3 light = hue * band * (0.3 + 0.9 * lum) + hue * bloom * glow * 4.0 + hue * core * env * intensity * 1.6;\n vec3 rgb = 1.0 - (1.0 - c.rgb) * exp(-light);\n \n return vec4(rgb, c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LinearBlur":"// LinearBlur — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LinearBlur.glsl\n// Author: gre\n// License: MIT\n// Description: A crossfade through a blur\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float intensity; \nconst int passes = 6;\n\nvec4 transition(vec2 uv) {\n vec4 c1 = vec4(0.0);\n vec4 c2 = vec4(0.0);\n\n float disp = intensity*(0.5-distance(0.5, progress));\n for (int xi=0; xi<passes; xi++)\n {\n float x = float(xi) / float(passes) - 0.5;\n for (int yi=0; yi<passes; yi++)\n {\n float y = float(yi) / float(passes) - 0.5;\n vec2 v = vec2(x,y);\n float d = disp;\n c1 += getFromColor( uv + d*v);\n c2 += getToColor( uv + d*v);\n }\n }\n c1 /= float(passes*passes);\n c2 /= float(passes*passes);\n return mix(c1, c2, progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LissajousTiles":"// LissajousTiles — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LissajousTiles.glsl\n// Author: Boundless <info@boundless-beta.com>\n// License: MIT\n// Description: The image breaks into a grid of tiles that swirl along Lissajous curves, in a Scanimate style, and flip one by one to the incoming image before settling back\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float speed; \n\nuniform vec2 freq; \n\nuniform float offset; \n\nuniform float zoom; \n\nuniform float fade; \n\nconst vec2 grid = vec2(10.,10.); \nconst float TAU = 6.283185307;\n\nvec4 transition (vec2 uv) {\n \n float p = 1.-pow(1.-smoothstep(0.,1.,1.-abs(1.-2.*progress)),3.); \n \n for (float jBig = grid.y-1.; jBig >= 0.; jBig--) {\n for (float iBig = grid.x-1.; iBig >= 0.; iBig--) {\n float i = iBig/grid.x;\n float j = jBig/grid.y;\n float k = i/grid.y+j; \n vec2 uv0 = uv + vec2(i,j) - 0.5 + 0.5/grid + vec2(cos(k*TAU*freq.x+progress*6.*speed),sin(k*TAU*freq.y+progress*6.*(1.+offset)*speed))*zoom/2.;\n uv0 = mix(uv, uv0, p);\n if (uv0.x >= i && uv0.x < i+1./grid.x && uv0.y >= j && uv0.y < j+1./grid.y) { \n float tileMix = clamp(progress*((1.+fade)*2.*progress)-fade+k*fade, 0., 1.);\n return mix(getFromColor(uv0), getToColor(uv0), tileMix);\n }\n }\n }\n return vec4(0.); \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LumaWipe":"// LumaWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LumaWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A wipe that follows the brightness of a grayscale mask (the luma texture)\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform shader luma;\nvec4 _texture_luma(vec2 uv) { return vec4(unpremul(luma.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n return mix(\n getToColor(uv),\n getFromColor(uv),\n step(progress, _texture_luma( uv).r)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LuminanceMelt":"// LuminanceMelt — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LuminanceMelt.glsl\n// Author: 0gust1\n// License: MIT\n// Description: The outgoing image melts away in noisy vertical streaks, depending on its brightness\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int direction; \n\nuniform float l_threshold; \n\nuniform int above; \n\nfloat rand(vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n {\n const vec4 C = vec4(0.211324865405187, \n 0.366025403784439, \n -0.577350269189626, \n 0.024390243902439); \n\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n vec2 i1;\n \n \n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n \n \n \n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n i = mod289(i); \n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n\t\t+ i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\nfloat luminance(vec4 color){\n \n return color.r*0.299+color.g*0.587+color.b*0.114;\n}\n\nvec4 transition(vec2 uv) {\n vec2 center = vec2(1.0, (direction != 0));\n vec2 p = uv.xy / vec2(1.0).xy;\n if (progress == 0.0) {\n return getFromColor(p);\n } else if (progress == 1.0) {\n return getToColor(p);\n } else {\n float x = progress;\n float dist = distance(center, p)- progress*exp(snoise(vec2(p.x, 0.0)));\n float r = x - rand(vec2(p.x, 0.1));\n float m;\n if((above != 0)){\n m = dist <= r && luminance(getFromColor(p))>l_threshold ? 1.0 : (progress*progress*progress);\n }\n else{\n m = dist <= r && luminance(getFromColor(p))<l_threshold ? 1.0 : (progress*progress*progress); \n }\n return mix(getFromColor(p), getToColor(p), m); \n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Morph":"// Morph — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Morph.glsl\n// Author: paniq\n// License: MIT\n// Description: A crossfade in which each image is displaced by the other's colors, like a morph\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nvec4 transition(vec2 p) {\n vec4 ca = getFromColor(p);\n vec4 cb = getToColor(p);\n \n vec2 oa = (((ca.rg+ca.b)*0.5)*2.0-1.0);\n vec2 ob = (((cb.rg+cb.b)*0.5)*2.0-1.0);\n vec2 oc = mix(oa,ob,0.5)*strength;\n \n float w0 = progress;\n float w1 = 1.0-w0;\n return mix(getFromColor(p+oc*w0), getToColor(p-oc*w1), progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Mosaic":"// Mosaic — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Mosaic.glsl\n// Author: Xaychru\n// License: MIT\n// Description: The view pans across a mosaic of rotated tiles from both images and settles on the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int endx; \nuniform int endy; \n\nfloat Rand(vec2 v) {\n return fract(sin(dot(v.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\nvec2 Rotate(vec2 v, float a) {\n mat2 rm = mat2(cos(a), -sin(a),\n sin(a), cos(a));\n return rm*v;\n}\nfloat CosInterpolation(float x) {\n return -cos(x*3.14159265358979323)/2.+.5;\n}\nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy - .5;\n vec2 rp = p;\n float rpr = (progress*2.-1.);\n float z = -(rpr*rpr*2.) + 3.;\n float az = abs(z);\n rp *= az;\n rp += mix(vec2(.5, .5), vec2(float(endx) + .5, float(endy) + .5), CosInterpolation(progress)*CosInterpolation(progress));\n vec2 mrp = mod(rp, 1.);\n vec2 crp = rp;\n bool onEnd = int(floor(crp.x))==endx&&int(floor(crp.y))==endy;\n if(!onEnd) {\n float ang = float(int(Rand(floor(crp))*4.))*.5*3.14159265358979323;\n mrp = vec2(.5) + Rotate(mrp-vec2(.5), ang);\n }\n if(onEnd || Rand(floor(crp))>.5) {\n return getToColor(mrp);\n } else {\n return getFromColor(mrp);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","MosaicBlend":"// MosaicBlend — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MosaicBlend.glsl\n// Author: Sergey Kosarevsky\n// License: MIT\n// Description: Both images break into large blocks that blend, then sharpen into the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float pixelSize; \n\nvec4 transition(vec2 uv) {\n float T = progress;\n float half_ = 0.5;\n float size = (T < half_) ? mix(1.0, pixelSize, T / half_) : mix(pixelSize, 1.0, (T - half_) / half_);\n float D = size * 0.005;\n \n vec2 UV = (uv - 0.5) / D;\n vec2 coord = clamp(D * (ceil(UV - 0.5)) + 0.5, 0.0, 1.0);\n vec4 C0 = getFromColor(coord);\n vec4 C1 = getToColor(coord);\n return mix(C0, C1, T);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","MosaicFade":"// MosaicFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MosaicFade.glsl\n// Author: YueDev\n// License: MIT\n// Description: Both images break into mosaic blocks that blend, then sharpen into the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float mosaicNum;\n\nvec2 getMosaicUV(vec2 uv) {\n float mosaicWidth = 2.0 / mosaicNum * min(progress, 1.0 - progress);\n float mX = floor(uv.x / mosaicWidth) + 0.5;\n float mY = floor(uv.y / mosaicWidth) + 0.5;\n return vec2(mX * mosaicWidth, mY * mosaicWidth);\n}\n\nvec4 transition (vec2 uv) {\n vec2 mosaicUV = min(progress, 1.0 - progress) == 0.0 ? uv : getMosaicUV(uv);\n return mix(getFromColor(mosaicUV), getToColor(mosaicUV), progress * progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","MultiplyBlend":"// MultiplyBlend — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MultiplyBlend.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: A crossfade through the multiplied blend of both images\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 blend(vec4 a, vec4 b) {\n return a * b;\n}\n\nvec4 transition (vec2 uv) {\n \n vec4 blended = blend(getFromColor(uv), getToColor(uv));\n \n if (progress < 0.5)\n return mix(getFromColor(uv), blended, 2.0 * progress);\n else\n return mix(blended, getToColor(uv), 2.0 * progress - 1.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","NoiseDissolve":"// NoiseDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/NoiseDissolve.glsl\n// Author: towrabbit\n// License: MIT\n// Description: The incoming image appears pixel by pixel in random noise\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat random (vec2 st) {\n return fract(sin(dot(st.xy,vec2(12.9898,78.233)))*43758.5453123);\n}\nvec4 transition (vec2 uv) {\n vec4 leftSide = getFromColor(uv);\n vec4 rightSide = getToColor(uv);\n float uvz = floor(random(uv)+progress);\n return mix(leftSide,rightSide,uvz);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Overexposure":"// Overexposure — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Overexposure.glsl\n// Author: Ben Zhang\n// License: MIT\n// Description: A crossfade through a washed-out, overexposed white\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \nconst float PI = 3.141592653589793;\n\nvec4 transition (vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n\n \n float from_m = 1.0 - progress + sin(PI * progress) * strength;\n float to_m = progress + sin(PI * progress) * strength;\n \n return vec4(\n from.r * from.a * from_m + to.r * to.a * to_m,\n from.g * from.a * from_m + to.g * to.a * to_m,\n from.b * from.a * from_m + to.b * to.a * to_m,\n mix(from.a, to.a, progress)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PaperTear":"// PaperTear — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PaperTear.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image tears in two along a ragged line, and the halves are pulled apart to reveal the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float roughness; \n\nuniform float tilt; \n\nuniform float rim; \n\nuniform vec4 paper; \n\nuniform vec4 shadow; \n\nfloat tri (float x) {\n return abs(fract(x) - 0.5) - 0.25;\n}\n\nfloat meander (float y) {\n return 0.5 * ratio + roughness * (0.5 * sin(y * 4.7 + 1.3) + 0.25 * sin(y * 11.3 + 4.1));\n}\n\nfloat tear (float y) {\n return meander(y) + roughness * (0.1 * sin(y * 29.0 + 0.7) + 0.35 * tri(y * 19.0 + sin(y * 7.0)) + 0.12 * tri(y * 47.0 + 0.6 * sin(y * 13.0)));\n}\n\nfloat fibers (float y, float seed) {\n return rim * (0.7 + 0.3 * sin(y * 37.0 + seed) + 0.4 * tri(y * 83.0 + seed));\n}\n\nvec2 unfold (vec2 q, float away, float lean) {\n return vec2(q.x + away + lean * q.y, q.y);\n}\n\nvec4 torn (vec4 bg, vec4 col, float e, float limit, float aa) {\n vec4 c = vec4(mix(col.rgb, paper.rgb, clamp(0.5 + e / aa, 0.0, 1.0) * paper.a), col.a);\n return mix(bg, c, clamp(0.5 - (e - limit) / aa, 0.0, 1.0));\n}\n\nvec4 transition (vec2 uv) {\n float p = progress;\n float away = p * p * (0.5 * ratio + 0.1 + roughness + 2.0 * rim); \n float lean = tilt * p * (2.0 - p);\n float fiber = smoothstep(0.0, 0.15, p); \n float aa = 0.002 * fiber + 1e-6;\n vec2 q = vec2(uv.x * ratio, uv.y);\n vec2 l = unfold(q, away, lean);\n vec2 r = unfold(vec2(ratio - q.x, q.y), away, lean);\n float el = l.x - tear(l.y); \n float er = r.x - (ratio - tear(r.y)); \n \n vec2 sq = q - vec2(0.01, 0.0);\n float dl = unfold(sq, away, lean).x - meander(sq.y);\n float dr = unfold(vec2(ratio - sq.x, sq.y), away, lean).x - (ratio - meander(sq.y));\n vec4 to = getToColor(uv);\n float sh = shadow.a * (1.0 - smoothstep(-0.02, 0.08, min(dl, dr)));\n vec4 c = vec4(mix(to.rgb, shadow.rgb, sh), to.a);\n \n if (r.x >= 0.0) {\n c = torn(c, getFromColor(vec2(1.0 - r.x / ratio, r.y)), er, fibers(r.y, 2.0) * 1.5 * fiber, aa);\n }\n if (l.x >= 0.0) {\n c = torn(c, getFromColor(vec2(l.x / ratio, l.y)), el, fibers(l.y, 0.0) * fiber, aa);\n }\n return c;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PerlinDissolve":"// PerlinDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PerlinDissolve.glsl\n// Author: Rich Harris\n// License: MIT\n// Description: The incoming image appears through blobs of Perlin noise\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float scale; \n\nuniform float smoothness; \n\nuniform float seed; \n\nfloat random(vec2 co)\n{\n float a = seed;\n float b = 78.233;\n float c = 43758.5453;\n float dt= dot(co.xy ,vec2(a,b));\n float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\n\nfloat noise (in vec2 st) {\n vec2 i = floor(st);\n vec2 f = fract(st);\n\n \n float a = random(i);\n float b = random(i + vec2(1.0, 0.0));\n float c = random(i + vec2(0.0, 1.0));\n float d = random(i + vec2(1.0, 1.0));\n\n \n\n \n vec2 u = f*f*(3.0-2.0*f);\n \n\n \n return mix(a, b, u.x) +\n (c - a)* u.y * (1.0 - u.x) +\n (d - b) * u.x * u.y;\n}\n\nvec4 transition (vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n float n = noise(uv * scale);\n\n float p = mix(-smoothness, 1.0 + smoothness, progress);\n float lower = p - smoothness;\n float higher = p + smoothness;\n\n float q = smoothstep(lower, higher, n);\n\n return mix(\n from,\n to,\n 1.0 - q\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PhotoDevelop":"// PhotoDevelop — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PhotoDevelop.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image washes out to a blank cream card, then the incoming image develops on it like an instant photo: shadows first, faint and tinted, then its contrast and colors come up and it settles\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 card; \n\nuniform float wash; \n\nuniform float tint; \n\nvec3 saturation(vec3 c, float s) {\n float lum = dot(c, vec3(0.2126, 0.7152, 0.0722));\n return mix(vec3(lum), c, s);\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n float p = progress;\n if (p <= 0.0) return a;\n if (p >= 1.0) return b;\n\n \n float split = mix(0.1, 0.7, clamp(wash, 0.0, 1.0));\n float cardAlpha = card.a * mix(a.a, b.a, smoothstep(0.6 * split, split + 0.1, p));\n vec3 cardColor = card.rgb * cardAlpha;\n\n \n float w = smoothstep(0.0, split, p);\n float fromLum = dot(a.rgb, vec3(0.2126, 0.7152, 0.0722));\n float wl = clamp(w * (1.0 + 0.5 * fromLum), 0.0, 1.0);\n vec3 washed = mix(a.rgb, mix(vec3(fromLum), a.rgb, 0.4), w) * a.a;\n vec3 outgoing = mix(washed, cardColor, wl);\n float outAlpha = mix(a.a, cardAlpha, wl);\n\n \n float x = clamp((p - split) / max(1.0 - split, 1e-3), 0.0, 1.0);\n float d = 1.0 - pow(1.0 - x, 1.5);\n float lum = dot(b.rgb, vec3(0.2126, 0.7152, 0.0722));\n \n float dev = clamp((d - 0.45 * lum) / 0.55, 0.0, 1.0);\n dev = dev * dev * (3.0 - 2.0 * dev);\n \n float early = 1.0 - smoothstep(0.2, 0.95, d);\n vec3 tinted = saturation(b.rgb, smoothstep(0.3, 1.0, d));\n tinted = mix(vec3(0.6), tinted, mix(0.55, 1.0, d));\n vec3 tone = mix(vec3(-0.2, 0.06, 0.1), vec3(0.12, -0.1, 0.06), smoothstep(0.15, 0.6, lum));\n tinted += tone * tint * early;\n vec3 incoming = mix(cardColor, clamp(tinted, 0.0, 1.0) * b.a, dev);\n float inAlpha = mix(cardAlpha, b.a, dev);\n\n vec3 color = p < split ? outgoing : incoming;\n float alpha = p < split ? outAlpha : inAlpha;\n if (alpha <= 0.0) return vec4(0.0);\n return vec4(clamp(color / alpha, 0.0, 1.0), alpha);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Pinwheel":"// Pinwheel — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Pinwheel.glsl\n// Author: Mr Speaker\n// License: MIT\n// Description: A spinning pinwheel reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float speed; \n\nvec4 transition(vec2 uv) {\n \n vec2 p = uv.xy / vec2(1.0).xy;\n \n float circPos = atan(p.y - 0.5, p.x - 0.5) + progress * speed;\n float modPos = mod(circPos, 3.1415 / 4.);\n float signed = sign(progress - modPos);\n \n return mix(getToColor(p), getFromColor(p), step(signed, 0.5));\n \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PixelStretch":"// PixelStretch — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PixelStretch.glsl\n// Author: gre\n// License: MIT\n// Description: A line sweeps across the frame and drags the outgoing image's pixels behind it as long streaks, which shorten as it goes and reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float stretch; \n\nuniform float chroma; \n\nuniform float softness; \n\nuniform float jitter; \n\nfloat hash(float n) {\n n = fract(n * 0.1031);\n n *= n + 33.33;\n n *= n + n;\n return fract(n);\n}\n\nfloat smax(float x, float y, float k) {\n float h = max(k - abs(x - y), 0.0) / k;\n return max(x, y) + h * h * k * 0.25;\n}\n\nvec2 at(vec2 uv, float s0, float s, vec2 d, float ext) {\n return clamp(uv + d * (s - s0) * ext, 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n vec2 d = normalize(direction + vec2(1e-6, 0.0));\n \n float ext = abs(d.x) + abs(d.y);\n float s = 0.5 + dot(uv - 0.5, d) / ext;\n \n vec2 n = vec2(-d.y, d.x);\n float t = dot((uv - 0.5) * vec2(ratio, 1.0), n);\n float row = floor(t * 540.0);\n float clump = floor(t * 60.0);\n float rnd = 0.6 * hash(row + 17.0) + 0.4 * hash(clump + 311.0);\n\n float p = progress;\n float k = softness + 1e-4;\n \n \n float margin = k + 0.002;\n float a = mix(-margin, 1.0 + margin, mix(p, p * p * (3.0 - 2.0 * p), 0.5));\n\n \n \n float h = clamp(4.0 * a * (1.0 - a), 0.0, 1.0);\n float len = stretch * h * (1.0 - 0.6 * jitter * rnd);\n float split = 0.02 * chroma * h;\n\n \n vec4 fr = getFromColor(at(uv, s, smax(s, a + split, k), d, ext));\n vec4 fg = getFromColor(at(uv, s, smax(s, a, k), d, ext));\n vec4 fb = getFromColor(at(uv, s, smax(s, a - split, k), d, ext));\n vec4 streak = vec4(fr.r, fg.g, fb.b, fg.a);\n \n float behind = step(s, a);\n streak.rgb *= 1.0 + 0.06 * jitter * h * (hash(row * 3.0 + 5.0) - 0.5) * behind;\n\n \n float w = smoothstep(len - k, len + k, a - s);\n return mix(streak, getToColor(uv), w);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Pixelize":"// Pixelize — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Pixelize.glsl\n// Author: gre\n// License: MIT\n// Description: Both images pixelate, crossfade, then sharpen again\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 squaresMin; \n\nuniform int steps; \n\nvec4 transition(vec2 uv) {\n float d = min(progress, 1.0 - progress);\n float dist = steps>0 ? ceil(d * float(steps)) / float(steps) : d;\n vec2 squareSize = 2.0 * dist / vec2(squaresMin);\n vec2 p = dist>0.0 ? (floor(uv / squareSize) + 0.5) * squareSize : uv;\n return mix(getFromColor(p), getToColor(p), progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PlusWipe":"// PlusWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PlusWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A plus-shaped cross grows from the center and widens its arms until the incoming image fills the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float smoothness; \n\nuniform int reverse; \n\nfloat boxDist (vec2 p, vec2 halfSize) {\n vec2 d = abs(p) - halfSize;\n return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);\n}\n\nfloat plus (vec2 q, float t, float s) {\n vec2 frame = vec2(0.5 * ratio, 0.5);\n float k = min(frame.x, frame.y);\n \n \n vec2 halfWidth = k * t + (frame - k) * t * t;\n \n float halfLength = 3.0 * max(frame.x, frame.y) * t;\n float d = min(boxDist(q, vec2(halfLength, halfWidth.y)), boxDist(q, vec2(halfWidth.x, halfLength)));\n \n \n return 1.0 - smoothstep(0.0, s, d + s * (1.0 - t));\n}\n\nvec4 transition (vec2 uv) {\n \n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float s = max(smoothness, 0.001);\n float m = (reverse != 0) ? 1.0 - plus(q, 1.0 - progress, s) : plus(q, progress, s);\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PolkaDotsCurtain":"// PolkaDotsCurtain — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PolkaDotsCurtain.glsl\n// Author: bobylito\n// License: MIT\n// Description: The incoming image appears through growing polka dots\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst float SQRT_2 = 1.414213562373;\n\nuniform float dots; \nuniform vec2 center; \n\nvec4 transition(vec2 uv) {\n bool nextImage = distance(fract(uv * dots), vec2(0.5, 0.5)) < ( progress / distance(uv, center));\n return nextImage ? getToColor(uv) : getFromColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PopIn":"// PopIn — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PopIn.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image pops in as a rounded card over the outgoing one, with an elastic overshoot: too big, a bit small, then it settles into the full frame as its corners square off\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \n\nuniform float bounce; \n\nuniform float corner; \n\nuniform float shadow; \n\nconst float PI = 3.141592653589793;\n\nfloat roundedBox(vec2 p, vec2 b, float r) {\n vec2 q = abs(p) - b + r;\n return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - r;\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n \n float easeOut = 1.0 - (1.0 - t) * (1.0 - t) * (1.0 - t);\n float spring = 1.0 - exp(-1.5 * t) * cos(2.5 * PI * t) * (1.0 - t);\n float s = mix(easeOut, spring, bounce);\n\n \n vec2 asp = vec2(ratio, 1.0);\n float side = min(ratio, 1.0);\n vec2 cardCenter = center + (0.5 - center) * s;\n vec2 halfSize = 0.5 * s * asp;\n float r = corner * s * side * (1.0 - t);\n float aa = 0.002;\n \n float d = roundedBox((uv - cardCenter) * asp, halfSize, r) - aa;\n float cover = clamp(0.5 - d / aa, 0.0, 1.0) * smoothstep(0.0, 0.08, t);\n\n \n float k = min(s, 1.0) * side;\n float blur = 0.05 * k + 1e-4;\n vec2 offset = vec2(0.0, -0.03 * k);\n float ds = roundedBox((uv - cardCenter - offset) * asp, halfSize, r);\n float shade = shadow * (1.0 - smoothstep(-blur, blur, ds)) * smoothstep(0.0, 0.15, t);\n\n vec4 a = getFromColor(uv);\n \n a.rgb *= 1.0 - shade;\n \n vec4 b = getToColor(clamp((uv - center) / max(s, 1e-4) + center, 0.0, 1.0));\n \n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), cover);\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PowerKaleido":"// PowerKaleido — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PowerKaleido.glsl\n// Author: Boundless\n// License: MIT\n// Description: The image folds into an animated kaleidoscope before revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst float rad = 120.; \nconst float deg = rad / 180. * 3.14159265358979;\nuniform float scale; \nuniform float z; \nuniform float speed; \nvec2 refl(vec2 p,vec2 o,vec2 n)\n{\n\treturn 2.0*o+2.0*n*dot(p-o,n)-p;\n}\n\nvec2 rot(vec2 p, vec2 o, float a)\n{\n float s = sin(a);\n float c = cos(a);\n\treturn o + mat2(c, -s, s, c) * (p - o);\n}\n\nvec4 mainImage(vec2 uv)\n{\n float dist = scale / 10.;\n vec2 uv0 = uv;\n\tuv -= 0.5;\n uv.x *= ratio;\n uv *= z;\n uv = rot(uv, vec2(0.0), progress*speed);\n \n\tfloat theta = progress*6.+3.14159265358979/.5;\n\tfor(int iter = 0; iter < 10; iter++) {\n for(float i = 0.; i < 2. * 3.14159265358979; i+=deg) {\n\t float ts = sign(asin(cos(i))) == 1.0 ? 1.0 : 0.0;\n if(((ts == 1.0) && (uv.y-dist*cos(i) > tan(i)*(uv.x+dist*+sin(i)))) || ((ts == 0.0) && (uv.y-dist*cos(i) < tan(i)*(uv.x+dist*+sin(i))))) {\n uv = refl(vec2(uv.x+sin(i)*dist*2.,uv.y-cos(i)*dist*2.), vec2(0.,0.), vec2(cos(i),sin(i)));\n }\n }\n }\n uv += 0.5;\n uv = rot(uv, vec2(0.5), progress*-speed);\n uv -= 0.5;\n uv.x /= ratio;\n uv += 0.5;\n uv = 2.*abs(uv/2.-floor(uv/2.+0.5));\n vec2 uvMix = mix(uv,uv0,cos(progress*3.14159265358979*2.)/2.+0.5);\n vec4 color = mix(getFromColor(uvMix),getToColor(uvMix),cos((progress-1.)*3.14159265358979)/2.+0.5);\n\treturn color;\n \n}\nvec4 transition (vec2 uv) {\n vec4 color = mainImage(uv);\n return color;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Prisms":"// Prisms — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Prisms.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is cut into 3D prisms that turn in a cascade, like a rotating billboard, from the outgoing image on one face to the incoming one on the next\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int slats; \n\nuniform float stagger; \n\nuniform float perspective; \n\nuniform float shading; \n\nuniform int horizontal; \n\nuniform vec4 backColor; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.002;\n\nvec4 transition (vec2 uv) {\n float n = float(slats);\n \n float a = (horizontal != 0) ? uv.y : uv.x;\n float b = (horizontal != 0) ? uv.x : uv.y;\n \n float hw = 0.5 / n * ((horizontal != 0) ? 1.0 : ratio);\n float k = min(perspective * hw, 0.5);\n float bScale = (horizontal != 0) ? ratio : 1.0;\n \n vec4 near1 = vec4(0.0), near2 = vec4(0.0);\n float cover1 = 0.0, cover2 = 0.0;\n float z1 = -2.0, z2 = -2.0;\n for (int d = -1; d <= 1; d++) {\n float i = floor(a * n) + float(d);\n if (i < 0.0 || i > n - 1.0) continue;\n \n float order = ((horizontal != 0) ? n - 1.0 - i : i) / (n - 1.0);\n float t = clamp((progress - stagger * order) / (1.0 - stagger), 0.0, 1.0);\n t = mix(t, t * t * (3.0 - 2.0 * t), 0.7);\n float c = cos(0.5 * PI * t);\n float s = sin(0.5 * PI * t);\n \n float edge = EDGE * min(1.0, 20.0 * s * c) + 1e-6;\n \n float x = 2.0 * (a * n - i) - 1.0;\n for (int f = 0; f < 2; f++) {\n \n float cf = f == 0 ? c : s;\n if (cf < 1e-4) continue;\n \n float u = f == 0 ? (x + s) / c : (x - c) / s;\n float z = f == 0 ? u * s + c : s - u * c;\n if (abs(u) > 1.0 || z <= z2) continue;\n \n float scale = 1.0 - k * (z - 1.0);\n float y = (b - 0.5) * scale + 0.5;\n if (y < 0.0 || y > 1.0) continue;\n \n float outer = f == 0 ? 1.0 + u : 1.0 - u;\n float cover = clamp(outer * hw * cf / edge, 0.0, 1.0)\n * clamp(min(y, 1.0 - y) * bScale / scale / edge, 0.0, 1.0);\n float sa = (i + 0.5 + 0.5 * u) / n;\n vec2 p = (horizontal != 0) ? vec2(y, sa) : vec2(sa, y);\n vec4 img = f == 0 ? getFromColor(p) : getToColor(p);\n \n float lambert = clamp(f == 0 ? c - 0.6 * s : s + 0.6 * c, 0.0, 1.0);\n vec4 color = vec4(img.rgb * mix(1.0 - shading, 1.0, lambert), img.a);\n if (z > z1) {\n near2 = near1; cover2 = cover1; z2 = z1;\n near1 = color; cover1 = cover; z1 = z;\n } else {\n near2 = color; cover2 = cover; z2 = z;\n }\n }\n }\n return mix(mix(backColor, near2, cover2), near1, cover1);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Puzzle":"// Puzzle — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Puzzle.glsl\n// Author: gre\n// License: MIT\n// Description: The image is cut into jigsaw puzzle pieces that lift one after another and fall away, revealing the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float pieces; \n\nuniform float shadow; \n\nfloat hash(vec2 c) {\n vec2 p = fract(c * vec2(0.1031, 0.1030));\n p += dot(p, p.yx + 33.33);\n return fract((p.x + p.y) * p.x);\n}\n\nfloat boxDist(vec2 p, vec2 halfSize) {\n vec2 q = abs(p) - halfSize;\n return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0);\n}\n\nfloat pieceDist(vec2 p, vec2 c, vec2 grid, float aspect) {\n vec2 halfSize = vec2(0.5 * aspect, 0.5);\n float d = boxDist(p, halfSize);\n float tabs = 1e3;\n for (int e = 0; e < 4; e++) {\n \n vec2 dir = e == 0 ? vec2(1.0, 0.0) : e == 1 ? vec2(-1.0, 0.0) : e == 2 ? vec2(0.0, 1.0) : vec2(0.0, -1.0);\n vec2 key = c + min(dir, 0.0);\n vec2 next = c + dir;\n if (next.x >= 0.0 && next.y >= 0.0 && next.x < grid.x && next.y < grid.y) {\n float h = hash(key + (e < 2 ? vec2(0.0) : vec2(71.0, 37.0)));\n \n bool tab = (h < 0.5) == (dir.x + dir.y > 0.0);\n vec2 out1 = dir * (tab ? 1.0 : -1.0);\n vec2 along = vec2(abs(dir.y), abs(dir.x));\n vec2 edge = dir * halfSize + along * (fract(h * 2.0) - 0.5) * 0.16;\n float k = min(\n length(p - edge - out1 * 0.15) - 0.125,\n boxDist(p - edge - out1 * 0.06, abs(dir) * 0.08 + along * 0.085));\n if (tab) tabs = min(tabs, k);\n else d = max(d, -k);\n }\n }\n return min(d, tabs);\n}\n\nvec4 transition(vec2 uv) {\n \n float rows = ratio < 1.0 ? floor(pieces / ratio + 0.5) : pieces;\n float cols = ratio < 1.0 ? pieces : floor(pieces * ratio + 0.5);\n vec2 grid = vec2(cols, rows);\n float aspect = ratio * rows / cols;\n vec2 g = uv * grid;\n vec2 cell = floor(g);\n\n const float aa = 0.01; \n float boardSum = 0.0;\n float allSum = 0.0;\n \n float prio1 = -1.0, prio2 = -1.0, cov1 = 0.0, cov2 = 0.0, shade1 = 1.0, shade2 = 1.0;\n vec2 uv1 = uv, uv2 = uv;\n float shadowAll = 0.0;\n float seam = 1.0;\n for (int i = 0; i < 9; i++) {\n vec2 c = cell + vec2(mod(float(i), 3.0), floor(float(i) / 3.0)) - 1.0;\n if (c.x < 0.0 || c.y < 0.0 || c.x >= cols || c.y >= rows) continue;\n vec2 center = c + 0.5;\n vec2 local = (g - center) * vec2(aspect, 1.0);\n float h = hash(c + vec2(13.0, 7.0));\n \n float diag = (c.x / max(cols - 1.0, 1.0) + (rows - 1.0 - c.y) / max(rows - 1.0, 1.0)) * 0.5;\n float delay = (diag + 1.2 * (h - 0.5) * diag * (1.0 - diag)) * 0.6;\n float t = clamp((progress - delay) / 0.4, 0.0, 1.0);\n\n \n float d0 = pieceDist(local, c, grid, aspect);\n float w = 1.0 - smoothstep(-aa, aa, d0);\n allSum += w;\n if (t <= 0.0) {\n boardSum += w;\n seam = min(seam, abs(d0));\n continue;\n }\n \n float lift = smoothstep(0.0, 0.25, t);\n float fall = clamp((t - 0.2) / 0.8, 0.0, 1.0);\n fall *= fall;\n float s = max(1.0 - fall, 0.001);\n float a = (h - 0.5) * 3.0 * fall;\n vec2 off = vec2(0.0, -1.2 * fall);\n mat2 rot = mat2(cos(a), -sin(a), sin(a), cos(a));\n vec2 pl = rot * (local - off) / s;\n float dp = pieceDist(pl, c, grid, aspect);\n float cov = (1.0 - smoothstep(-aa, aa, dp * s)) * min(s * 20.0, 1.0); \n \n float shade = (1.0 - 0.5 * fall) * (1.0 - 0.3 * lift * (1.0 - smoothstep(0.0, 0.035, -dp)));\n vec2 puv = (center + pl / vec2(aspect, 1.0)) / grid;\n \n vec2 sl = rot * (local - off - vec2(0.08, -0.1) * lift) / s;\n float sh = (1.0 - smoothstep(-0.05, 0.12, pieceDist(sl, c, grid, aspect) * s)) * lift * (1.0 - fall) * shadow;\n \n shadowAll = max(shadowAll, max(sh, w * lift * (1.0 - smoothstep(0.2, 0.5, t)) * shadow));\n float prio = delay;\n if (cov > 0.0 && prio > prio1) {\n prio2 = prio1; cov2 = cov1; uv2 = uv1; shade2 = shade1;\n prio1 = prio; cov1 = cov; uv1 = puv; shade1 = shade;\n } else if (cov > 0.0 && prio > prio2) {\n prio2 = prio; cov2 = cov; uv2 = puv; shade2 = shade;\n }\n }\n vec4 base = mix(getToColor(uv), getFromColor(uv), boardSum / max(allSum, 0.001));\n \n base.rgb *= (1.0 - shadowAll) * (1.0 - 0.4 * smoothstep(0.0, 0.1, progress) * (1.0 - smoothstep(0.0, 0.015, seam)));\n vec4 p2 = getFromColor(uv2);\n p2.rgb *= shade2;\n vec4 p1 = getFromColor(uv1);\n p1.rgb *= shade1;\n return mix(mix(base, p2, cov2), p1, cov1);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RadialWipe":"// RadialWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RadialWipe.glsl\n// Author: Xaychru\n// License: MIT\n// Description: A radial wipe that sweeps around the center like a clock hand\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float smoothness; \n\nconst float PI = 3.141592653589;\n\nvec4 transition(vec2 p) {\n vec2 rp = p*2.-1.;\n return mix(\n getToColor(p),\n getFromColor(p),\n smoothstep(0., smoothness, atan(rp.y,rp.x) - (progress-.5) * PI * 2.5)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RandomSquares":"// RandomSquares — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RandomSquares.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image appears in random squares\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 size; \n\nuniform float smoothness; \n \nfloat rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec4 transition(vec2 p) {\n float r = rand(floor(vec2(size) * p));\n float m = smoothstep(0.0, -smoothness, r - (progress * (1.0 + smoothness)));\n return mix(getFromColor(p), getToColor(p), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RectangleCover":"// RectangleCover — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RectangleCover.glsl\n// Author: martiniti\n// License: MIT\n// Description: A rectangle grows from the center to cover the outgoing image, then shrinks to reveal the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 bgcolor; \n\nvec4 transition(vec2 p) {\n float s = pow(2.0 * abs(progress - 0.5), 3.0);\n \n vec2 sq = p.xy / vec2(1.0).xy;\n \n \n vec2 bl = step(vec2(abs(1. - 2.*progress)), sq + .25);\n float dist = bl.x * bl.y;\n\n \n vec2 tr = step(vec2(abs(1. - 2.*progress)), 1.25-sq);\n dist *= 1. * tr.x * tr.y;\n \n return mix(\n progress < 0.5 ? getFromColor(p) : getToColor(p),\n bgcolor,\n step(s, dist)\n );\n \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RectangleIris":"// RectangleIris — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RectangleIris.glsl\n// Author: martiniti\n// License: MIT\n// Description: The outgoing image shrinks into a small rectangle over a background color, then the incoming one grows from it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 bgcolor; \n\nvec4 transition(vec2 uv) {\n \n float s = pow(2.0 * abs(progress - 0.5), 3.0);\n \n vec2 q = uv.xy / vec2(1.0).xy;\n \n \n vec2 bl = step(vec2(1.0 - 2.0*abs(progress - 0.5)), q + 0.25);\n \n \n vec2 tr = step(vec2(1.0 - 2.0*abs(progress - 0.5)), 1.25 - q);\n \n float dist = length(1.0 - bl.x * bl.y * tr.x * tr.y);\n \n return mix(\n progress < 0.5 ? getFromColor(uv) : getToColor(uv),\n bgcolor,\n step(s, dist)\n );\n \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Refraction":"// Refraction — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Refraction.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is seen through flowing liquid glass that bends the outgoing image more and more, with rainbow fringes, flares up as the incoming image takes over, then calms down and clears\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nuniform float scale; \n\nuniform float dispersion; \n\nuniform float brightness; \n\nconst int TAPS = 7;\n\nfloat surface(vec2 q, float t) {\n q += 0.45 * vec2(sin(1.3 * q.y + 0.9 * t), sin(1.1 * q.x - 1.2 * t));\n float h = sin(q.x + 0.6 * t) * sin(1.2 * q.y - 0.8 * t);\n h += 0.5 * sin(dot(q, vec2(1.6, -1.2)) + 1.4 * t);\n h += 0.3 * sin(dot(q, vec2(-1.1, 2.9)) - 1.9 * t + 1.7 * sin(0.9 * q.x));\n h += 0.15 * sin(dot(q, vec2(4.3, 3.1)) + 2.6 * t);\n return h;\n}\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec3 spectrum(float w) {\n vec3 c = vec3(\n 1.0 - smoothstep(0.0, 0.55, w) + 0.35 * smoothstep(0.75, 1.0, w),\n 1.0 - abs(2.0 * w - 1.0) * 1.2,\n smoothstep(0.45, 1.0, w)\n );\n return clamp(c, 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float h = 1.0 - abs(2.0 * p - 1.0);\n float amount = h * h * (2.0 - h);\n\n \n vec2 q = (uv - 0.5) * vec2(ratio, 1.0) * scale;\n float t = 3.0 * p;\n float e = 0.01;\n vec2 slope = vec2(\n surface(q + vec2(e, 0.0), t) - surface(q - vec2(e, 0.0), t),\n surface(q + vec2(0.0, e), t) - surface(q - vec2(0.0, e), t)\n ) / (2.0 * e);\n vec2 offset = slope * strength * amount / scale;\n \n \n float wave = clamp(0.5 * surface(q, t), -1.0, 1.0);\n float m = smoothstep(-0.015, 0.015, p - 0.5 + 0.1 * wave);\n\n \n vec3 color = vec3(0.0);\n vec3 weights = vec3(0.0);\n float alpha = 0.0;\n \n float jitter = hash12(uv * vec2(ratio, 1.0) * 1000.0) - 0.5;\n for (int i = 0; i < TAPS; i++) {\n float w = float(i) / float(TAPS - 1);\n float wj = (float(i) + jitter) / float(TAPS - 1);\n vec2 st = mirror(uv + offset * (1.0 + dispersion * (wj - 0.5) * 1.6));\n vec4 c = mix(getFromColor(st), getToColor(st), m);\n vec3 s = spectrum(w);\n color += s * c.rgb * c.a;\n weights += s;\n alpha += c.a;\n }\n alpha /= float(TAPS);\n color = color / weights / max(alpha, 1e-5);\n\n \n float flare = 2.0 * brightness * pow(h, 8.0);\n color = color * (1.0 + flare) / (1.0 + flare * color);\n color += 0.1 * flare * dot(color, vec3(0.3333));\n return vec4(clamp(color, 0.0, 1.0), alpha);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Revolve":"// Revolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Revolve.glsl\n// Author: bread\n// License: MIT\n// Description: The outgoing image swirls and zooms with motion blur into the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \nuniform float direction; \nuniform float maxRotation; \nuniform float peakZoom; \nuniform float swirl; \nuniform float barrel; \nuniform float motionBlur; \nuniform float switchStart; \nuniform float switchEnd; \nuniform float shadow; \n\nfloat sat(float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nfloat ease(float x) {\n x = sat(x);\n return x * x * (3.0 - 2.0 * x);\n}\n\nfloat revolveEnvelope(float t) {\n float rise = ease((t - 0.10) / 0.33);\n float fall = 1.0 - ease((t - 0.43) / 0.29);\n return rise * fall;\n}\n\nvec2 rotate2(vec2 p, float a) {\n float s = sin(a);\n float c = cos(a);\n return vec2(c * p.x - s * p.y, s * p.x + c * p.y);\n}\n\nvec2 warpUv(vec2 uv, float t) {\n float e = revolveEnvelope(t);\n\n vec2 p = uv - center;\n p.x *= ratio;\n\n float r = length(p);\n float edgeSpin = maxRotation * e;\n float coreSpin = swirl * e * pow(1.0 - sat(r / 0.96), 1.55);\n float visibleAngle = direction * (edgeSpin + coreSpin);\n\n p = rotate2(p, -visibleAngle);\n\n float sc = 1.0 + (peakZoom - 1.0) * pow(e, 0.85);\n p /= sc;\n\n float rr = length(p);\n p *= 1.0 + barrel * e * rr * rr * 2.8;\n\n p.x /= ratio;\n return clamp(p + center, vec2(0.001), vec2(0.999));\n}\n\nvec4 sampleRevolve(vec2 uv, float t) {\n vec2 p = warpUv(uv, t);\n float reveal = smoothstep(switchStart, switchEnd, t);\n return mix(getFromColor(p), getToColor(p), reveal);\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n float e = revolveEnvelope(progress);\n float span = 0.060 * motionBlur * e;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n for (int i = -8; i <= 8; i++) {\n float x = float(i) / 8.0;\n float w = 1.0 - abs(x);\n w = w * w + 0.01;\n\n float t = sat(progress + x * span);\n color += sampleRevolve(uv, t) * w;\n total += w;\n }\n\n color /= total;\n\n vec2 q = uv - vec2(0.5);\n q.x *= ratio;\n float vignette = 1.0 - shadow * e * smoothstep(0.35, 0.95, length(q));\n color.rgb *= vignette;\n\n return color;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Ripple":"// Ripple — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Ripple.glsl\n// Author: gre\n// License: MIT\n// Description: Ripples spread from the center while crossfading\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float amplitude; \n\nuniform float speed; \n\nvec4 transition (vec2 uv) {\n vec2 dir = uv - vec2(.5);\n float dist = length(dir);\n vec2 offset = dir * (sin(progress * dist * amplitude - progress * speed) + .5) / 30. * progress;\n return mix(\n getFromColor(uv + offset),\n getToColor(uv),\n smoothstep(0.2, 1.0, progress)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Rolls":"// Rolls — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Rolls.glsl\n// Author: Mark Craig\n// License: MIT\n// Description: The outgoing image rolls away around a corner, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int type; \n\nuniform int RotDown; \n\nvec4 transition(vec2 uv)\n{\nfloat theta, c1, s1;\nvec2 iResolution = vec2(ratio, 1.0);\nvec2 uvi;\n\nif (type == 0) { theta = ((RotDown != 0) ? 3.14159265358979323846 : -3.14159265358979323846) / 2.0 * progress; uvi.x = 1.0 - uv.x; uvi.y = uv.y; }\nelse if (type == 1) { theta = ((RotDown != 0) ? 3.14159265358979323846 : -3.14159265358979323846) / 2.0 * progress; uvi = uv; }\nelse if (type == 2) { theta = ((RotDown != 0) ? -3.14159265358979323846 : 3.14159265358979323846) / 2.0 * progress; uvi.x = uv.x; uvi.y = 1.0 - uv.y; }\nelse if (type == 3) { theta = ((RotDown != 0) ? -3.14159265358979323846 : 3.14159265358979323846) / 2.0 * progress; uvi = 1.0 - uv; }\nc1 = cos(theta); s1 = sin(theta);\nvec2 uv2;\nuv2.x = (uvi.x * iResolution.x * c1 - uvi.y * iResolution.y * s1);\nuv2.y = (uvi.x * iResolution.x * s1 + uvi.y * iResolution.y * c1);\nif ((uv2.x >= 0.0) && (uv2.x <= iResolution.x) && (uv2.y >= 0.0) && (uv2.y <= iResolution.y))\n\t{\n\tuv2 /= iResolution;\n\tif (type == 0) { uv2.x = 1.0 - uv2.x; }\n\telse if (type == 2) { uv2.y = 1.0 - uv2.y; }\n\telse if (type == 3) { uv2 = 1.0 - uv2; }\n\treturn(getFromColor(uv2));\n\t}\nreturn(getToColor(uv));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RotateFade":"// RotateFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RotateFade.glsl\n// Author: haiyoucuv\n// License: MIT\n// Description: The images spin around the center while crossfading\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec2 rotate2D(in vec2 uv, in float angle){\n \n return uv * mat2(cos(angle), -sin(angle), sin(angle), cos(angle));\n}\nvec4 transition (vec2 uv) {\n \n vec2 p = fract(rotate2D(uv - 0.5, progress * 3.1415926 * 2.0) + 0.5);\n\n return mix(\n getFromColor(p),\n getToColor(p),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RotateScaleFade":"// RotateScaleFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RotateScaleFade.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: The outgoing image spins and zooms while fading to the incoming one, over a background color\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \n\nuniform float rotations; \n\nuniform float scale; \n\nuniform vec4 backColor; \n\nvec4 transition (vec2 uv) {\n \n vec2 difference = uv - center;\n vec2 dir = normalize(difference);\n float dist = length(difference);\n \n float angle = 2.0 * 3.14159265359 * rotations * progress;\n \n float c = cos(angle);\n float s = sin(angle);\n \n float currentScale = mix(scale, 1.0, 2.0 * abs(progress - 0.5));\n \n vec2 rotatedDir = vec2(dir.x * c - dir.y * s, dir.x * s + dir.y * c);\n vec2 rotatedUv = center + rotatedDir * dist / currentScale;\n \n if (rotatedUv.x < 0.0 || rotatedUv.x > 1.0 ||\n rotatedUv.y < 0.0 || rotatedUv.y > 1.0)\n return backColor;\n \n return mix(getFromColor(rotatedUv), getToColor(rotatedUv), progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RotateScaleVanish":"// RotateScaleVanish — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RotateScaleVanish.glsl\n// Author: Mark Craig\n// License: MIT\n// Description: The outgoing image spins and shrinks away over the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int FadeInSecond; \n\nuniform int ReverseEffect; \n\nuniform int ReverseRotation; \n\nvec4 transition(vec2 uv)\n{\nvec2 iResolution = vec2(ratio, 1.0);\nfloat t = (ReverseEffect != 0) ? 1.0 - progress : progress;\nfloat theta = (ReverseRotation != 0) ? 6.283185307179586476925286766559 * t : -6.283185307179586476925286766559 * t;\nfloat c1 = cos(theta);\nfloat s1 = sin(theta);\nfloat rad = max(0.00001, 1.0 - t);\nfloat xc1 = (uv.x - 0.5) * iResolution.x;\nfloat yc1 = (uv.y - 0.5) * iResolution.y;\nfloat xc2 = (xc1 * c1 - yc1 * s1) / rad;\nfloat yc2 = (xc1 * s1 + yc1 * c1) / rad;\nvec2 uv2 = vec2(xc2 + iResolution.x / 2.0, yc2 + iResolution.y / 2.0);\nvec4 col3;\nvec4 ColorTo = (ReverseEffect != 0) ? getFromColor(uv) : getToColor(uv);\nif ((uv2.x >= 0.0) && (uv2.x <= iResolution.x) && (uv2.y >= 0.0) && (uv2.y <= iResolution.y))\n\t{\n\tuv2 /= iResolution;\n\tcol3 = (ReverseEffect != 0) ? getToColor(uv2) : getFromColor(uv2);\n\t}\nelse { col3 = (FadeInSecond != 0) ? vec4(0.0) : ColorTo; } \nreturn((1.0 - t) * col3 + t * ColorTo); \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ScaleIn":"// ScaleIn — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ScaleIn.glsl\n// Author: haiyoucuv\n// License: MIT\n// Description: The incoming image scales in from the center while fading in\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 scale(in vec2 uv){\n uv = 0.5 + (uv - 0.5) * progress;\n return getToColor(uv);\n}\n\nvec4 transition (vec2 uv) {\n return mix(\n getFromColor(uv),\n scale(uv),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Shatter":"// Shatter — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Shatter.glsl\n// Author: lbl\n// License: MIT\n// Description: The outgoing image shatters into fragments that fly away\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat random(vec2 par) {\n return fract(sin(dot(par.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvec2 random2(vec2 par) {\n float rand = random(par);\n return vec2(rand, random(par + rand));\n}\n\nvec4 transition (vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n const float duration = 8.0;\n float time = progress * duration;\n vec2 point[10];\n for (int i = 0; i < 10; i++) {\n point[i] = random2(vec2(float(i)));\n }\n\n vec4 col = getToColor(uv);\n\n for (int i = 0; i < 10; i++) {\n vec2 dir = normalize(random2(vec2(float(i), float(i) + 11.)));\n float v = (1.0 + random(dir) * 0.5) * 0.2;\n vec2 ofst = dir * clamp(time - 0.5, 0.0, duration) * v;\n vec2 U = uv - ofst;\n\n if (U.x < 0.0 || U.x > 1.0 || U.y < 0.0 || U.y > 1.0) continue;\n\n float dist_i = distance(U, point[i]);\n bool closest = true;\n for (int j = 0; j < 10; j++) {\n if (distance(U, point[j]) < dist_i) {\n closest = false;\n break;\n }\n }\n\n if (closest) {\n col = getFromColor(U);\n break;\n }\n }\n return col;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Shred":"// Shred — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Shred.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is cut into paper strips that drop away at uneven speeds, tilting as they fall, revealing the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int strips; \n\nuniform float stagger; \n\nuniform float tilt; \n\nuniform float shadow; \n\nfloat hash (float n) {\n n = fract(n * 0.1031);\n n *= n + 33.33;\n n *= n + n;\n return fract(n);\n}\n\nvec4 transition (vec2 uv) {\n float n = float(strips);\n float w = ratio / n; \n vec2 q = vec2(uv.x * ratio, uv.y);\n vec4 color = getToColor(uv);\n float cover = -1.0;\n float shade = 0.0;\n \n float maxTilt = min(tilt, 2.0 * w);\n for (int d = -3; d <= 3; d++) {\n float i = floor(uv.x * n) + float(d);\n if (i < 0.0 || i > n - 1.0) continue;\n \n float delay = stagger * max(0.0, 1.25 * hash(i + 1.0) - 0.25);\n float speed = 1.0 + 0.5 * hash(i + 71.0);\n float t = clamp((progress - delay) / (1.0 - delay), 0.0, 1.0);\n \n float fall = (0.4 * t + 0.6 * t * t) * (1.0 + w * (0.5 + tilt)) * speed;\n float angle = maxTilt * (2.0 * hash(i + 37.0) - 1.0) * t;\n \n float lift = min(1.0, 8.0 * t);\n float gap = 0.06 * w * lift;\n \n vec2 v = q - vec2((i + 0.5) * w, 0.5 - fall);\n float ca = cos(angle), sa = sin(angle);\n vec2 l = vec2(ca * v.x + sa * v.y, ca * v.y - sa * v.x);\n vec2 edge = vec2(0.5 * w - gap, 0.5) - abs(l);\n \n vec2 so = abs(l - lift * vec2(0.15 * w, -0.25 * w)) - vec2(0.5 * w - gap, 0.5);\n shade = max(shade, lift * (1.0 - smoothstep(0.0, 0.5 * w, max(so.x, so.y))));\n if (min(edge.x, edge.y) >= 0.0 && fall > cover) {\n vec2 p = vec2((i + 0.5) * w + l.x, 0.5 + l.y);\n vec4 img = getFromColor(vec2(p.x / ratio, p.y));\n \n float cut = lift * (1.0 - smoothstep(0.0, 0.25 * w, edge.x));\n color = vec4(img.rgb * (1.0 - 0.5 * shadow * cut), img.a);\n cover = fall;\n }\n }\n if (cover < 0.0) {\n color = vec4(color.rgb * (1.0 - 0.6 * shadow * shade), color.a);\n }\n return color;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SimpleFlip":"// SimpleFlip — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SimpleFlip.glsl\n// Author: nwoeanhinnogaehr\n// License: MIT\n// Description: The outgoing image flips around the vertical axis into the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n vec2 q = uv;\n uv.x = (uv.x - 0.5) / abs(progress - 0.5) * 0.5 + 0.5;\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n \n return mix(a, b, step(0.5, progress)) * step(abs(q.x - 0.5), abs(progress - 0.5));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SimpleZoom":"// SimpleZoom — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SimpleZoom.glsl\n// Author: 0gust1\n// License: MIT\n// Description: Zooms into the outgoing image, then fades to the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float zoom_quickness; \nvec2 zoom(vec2 uv, float amount) {\n return 0.5 + ((uv - 0.5) * (1.0-amount));\t\n}\n\nvec4 transition (vec2 uv) {\n float nQuick = clamp(zoom_quickness,0.2,1.0);\n return mix(\n getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))),\n getToColor(uv),\n smoothstep(nQuick-0.2, 1.0, progress)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SimpleZoomOut":"// SimpleZoomOut — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SimpleZoomOut.glsl\n// Author: Tianshuo\n// License: MIT\n// Description: The incoming image zooms out into place while fading in\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float zoom_quickness; \n\nuniform int fade; \nvec2 zoom(vec2 uv, float amount) {\n return 0.5 + ((uv - 0.5) * (1.0-amount));\t\n}\n\nvec4 transition (vec2 uv) {\n float nQuick = clamp(zoom_quickness,0.2,1.0);\n return mix(\n getFromColor(uv),\n getToColor(zoom(uv,1.-smoothstep(1.-nQuick, 1., progress))),\n (fade != 0)?smoothstep(1.0-nQuick, 1., progress):(progress<1.0-nQuick?0.0:1.0)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SlideAwayRight":"// SlideAwayRight — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SlideAwayRight.glsl\n// Author: lizhongjian\n// License: MIT\n// Description: The outgoing image slides to the right, uncovering a crossfade to the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n vec2 newUV = uv;\n newUV.x -= progress;\n if(uv.x >= progress)\n {\n return getFromColor(newUV);\n }\n\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Slides":"// Slides — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Slides.glsl\n// Author: Mark Craig\n// License: MIT\n// Description: The outgoing image slides out, or the incoming one slides in, toward an edge, a corner or the center\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int type; \n\nuniform int In; \n\nvec4 transition(vec2 uv)\n{\nvec2 uv0 = uv;\nfloat rad = (In != 0) ? progress : 1.0 - progress;\nfloat xc1, yc1;\n\nif (type == 0) { xc1 = .5 - rad / 2.0; yc1 = 0.0; }\nelse if (type == 1) { xc1 = 1.0 - rad; yc1 = .5 - rad / 2.0; }\nelse if (type == 2) { xc1 = .5 - rad / 2.0; yc1 = 1.0 - rad; }\nelse if (type == 3) { xc1 = 0.0; yc1 = .5 - rad / 2.0; }\nelse if (type == 4) { xc1 = 1.0 - rad; yc1 = 0.0; }\nelse if (type == 5) { xc1 = 1.0 - rad; yc1 = 1.0 - rad; }\nelse if (type == 6) { xc1 = 0.0; yc1 = 1.0 - rad; }\nelse if (type == 7) { xc1 = 0.0; yc1 = 0.0; }\nelse if (type == 8) { xc1 = .5 - rad / 2.0; yc1 = .5 - rad / 2.0; }\nuv.y = 1.0 - uv.y;\nvec2 uv2;\nif ((uv.x >= xc1) && (uv.x <= xc1 + rad) && (uv.y >= yc1) && (uv.y <= yc1 + rad))\n\t{\n\tuv2 = vec2((uv.x - xc1) / rad, 1.0 - (uv.y - yc1) / rad);\n\treturn((In != 0) ? getToColor(uv2) : getFromColor(uv2));\n\t}\nreturn((In != 0) ? getFromColor(uv0) : getToColor(uv0));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SmokeDissolve":"// SmokeDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SmokeDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: Billowing smoke drifts in across the outgoing image, with lit tops, darker folds and wispy edges, and thickens until it covers the frame; as it thins out and drifts away, the incoming image shows through\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float scale; \n\nuniform float spread; \n\nuniform float softness; \n\nuniform vec4 color; \n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nfloat vnoise(vec2 v) {\n vec2 i = floor(v);\n vec2 f = fract(v);\n f = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash12(i), hash12(i + vec2(1.0, 0.0)), f.x),\n mix(hash12(i + vec2(0.0, 1.0)), hash12(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nfloat fbm(vec2 v) {\n float sum = 0.0;\n float amp = 0.5;\n for (int i = 0; i < 4; i++) {\n sum += amp * vnoise(v);\n v = mat2(1.6, 1.2, -1.2, 1.6) * v + 5.3;\n amp *= 0.5;\n }\n return sum / 0.9375;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 pos = (uv - 0.5) * vec2(ratio, 1.0);\n\n \n float len = length(direction);\n vec2 dir = len > 1e-4 ? direction / len : vec2(0.0);\n float ext = 0.5 * (abs(dir.x) * ratio + abs(dir.y)) + 1e-4;\n float along = len > 1e-4 ? 0.5 + 0.5 * dot(pos, dir) / ext : 0.5;\n\n \n \n float arrive = (p / 0.45) * (1.0 + spread) - spread * along;\n float leave = ((p - 0.55) / 0.45) * (1.0 + spread) - spread * along;\n float body = smoothstep(0.0, 1.0, arrive) * (1.0 - smoothstep(0.0, 1.0, leave));\n \n float m = smoothstep(0.48, 0.52, p);\n \n if (body <= 0.0) return m < 0.5 ? getFromColor(uv) : getToColor(uv);\n\n \n vec2 q = (pos - direction * (p - 0.5)) * scale;\n vec2 churn = vec2(0.5 * p, -0.35 * p);\n vec2 warp = vec2(fbm(q + vec2(3.1, 1.7) + churn), fbm(q + vec2(8.3, 2.8) - churn));\n vec2 w = q + 1.1 * (warp - 0.5);\n float n = fbm(w);\n \n \n float lit = 0.53 * (vnoise(w) - vnoise(w + vec2(0.0, 0.2)));\n \n float wisp = vnoise(w * 3.3 - 2.0 * churn) - 0.5;\n\n \n float edge = 2.0 * body - (1.0 - smoothstep(0.1, 0.6, n)) + 1.6 * body * (1.0 - body) * wisp;\n float d = smoothstep(0.0, softness, edge) * mix(0.5, 1.0, smoothstep(0.2, 0.9, body));\n\n \n vec4 base;\n if (m <= 0.0) base = getFromColor(uv);\n else if (m >= 1.0) base = getToColor(uv);\n else {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n base = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n base = base.a > 0.0 ? vec4(base.rgb / base.a, base.a) : vec4(0.0);\n }\n if (d <= 0.0) return base;\n\n \n float shade = 0.92 + 1.3 * lit;\n shade *= mix(0.76, 1.04, smoothstep(0.25, 0.75, n));\n shade = mix(1.0, shade, 0.3 + 0.7 * d);\n vec3 smoke = clamp(color.rgb * shade, 0.0, 1.0);\n\n \n return mix(base, vec4(smoke, color.a), d);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SpiralWipe":"// SpiralWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SpiralWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A spiral arm winds out from the center and widens to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float turns; \n\nuniform float smoothness; \n\nuniform int clockwise; \n\nfloat arm (float s, float d) {\n \n float end = -0.5 + (turns + 0.5) / 0.6;\n float tip = mix(-0.5, end, progress);\n s = max(s, -0.5);\n float width = sqrt(clamp((tip - s) / max(end - s, 0.001), 0.0, 1.0));\n \n float e = smoothness + 0.005 * turns;\n return smoothstep(0.0, e, width * (0.5 + e) - d);\n}\n\nvec4 transition (vec2 uv) {\n \n vec2 q = (uv - 0.5) * vec2(ratio, 1.0) / (0.5 * length(vec2(ratio, 1.0)));\n \n float a = dot(q, q) < 1e-12 ? 0.0 : atan(q.x, q.y) / (2.0 * 3.141592653589793);\n a = fract((clockwise != 0) ? a : -a);\n \n float w = length(q) * turns - a;\n float n = floor(w);\n float f = w - n;\n \n float m = max(arm(n + a, abs(f - 0.5)), max(arm(n + 1.0 + a, 1.5 - f), arm(n - 1.0 + a, f + 0.5)));\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplatterWipe":"// SplatterWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplatterWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Splats of paint land one after another, each popping in with a spiky outline, flung droplets and a few drips running down, revealing the incoming image until they cover the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float splats; \n\nuniform float spikiness; \n\nuniform float droplets; \n\nuniform float drips; \n\nuniform float rim; \n\nuniform float seed; \n\nconst float PI = 3.141592653589793;\n\nconst float SPIKES = 14.0;\n\nconst float REACH = 1.25;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nfloat turnNoise(float t, float n, vec2 key) {\n float x = t * n;\n float i = floor(x);\n float f = x - i;\n float a = hash12(key + vec2(mod(i, n), 61.0));\n float b = hash12(key + vec2(mod(i + 1.0, n), 61.0));\n return mix(a, b, f * f * (3.0 - 2.0 * f));\n}\n\nfloat smax(float a, float b, float k) {\n float h = max(k - abs(a - b), 0.0) / k;\n return max(a, b) + h * h * k * 0.25;\n}\n\nfloat splat(vec2 q, vec2 cell, vec2 key) {\n float t0 = 0.01 + 0.6 * hash12(key + vec2(3.0, 0.0)); \n if (progress <= t0) return -1.0;\n vec2 c = cell + 0.5 + 0.3 * (vec2(hash12(key + vec2(5.0, 1.0)), hash12(key + vec2(9.0, 2.0))) - 0.5);\n vec2 d = q - c;\n float l = length(d);\n \n if (l > REACH + 0.1) return -1.0;\n \n float pop = clamp((progress - t0) / 0.08, 0.0, 1.0);\n pop = 1.0 - (1.0 - pop) * (1.0 - pop) * (1.0 - pop);\n float x = clamp((progress - t0) / (0.96 - t0), 0.0, 1.0);\n float grow = x * x * x;\n float r0 = 0.42 + 0.2 * hash12(key + vec2(11.0, 3.0));\n \n float rc = mix(r0 * pop, 1.03, grow);\n\n float a = l > 1e-5 ? atan(d.y, d.x) / (2.0 * PI) + 0.5 : 0.0;\n \n float lumps = mix(0.3, 0.06, grow) * (turnNoise(a, 5.0, key) - 0.5) + mix(0.18, 0.06, grow) * (turnNoise(a, 19.0, key + 3.0) - 0.5);\n float f = rc * (1.0 + lumps) - l;\n\n \n \n float s = floor(a * SPIKES);\n float spike = -1.0;\n for (int k = -1; k <= 1; k++) {\n float sl = s + float(k);\n vec2 sk = key + vec2(mod(sl, SPIKES), 17.0);\n float h = hash12(sk);\n float w0 = (0.022 + 0.03 * hash12(sk + 1.5)) * pop;\n float len = max(min(spikiness * (0.06 + 0.6 * h * h) * pop, REACH - 1.2 * w0 - rc), 0.0);\n if (len > 0.0) {\n \n float w = w0 * min(len / 0.06, 1.0);\n float ang = (sl + 0.5 + 0.4 * (hash12(sk + 0.5) - 0.5)) / SPIKES * 2.0 * PI - PI;\n vec2 dir = vec2(cos(ang), sin(ang));\n float along = dot(d, dir);\n float across = abs(d.x * dir.y - d.y * dir.x);\n float u = clamp((along - rc) / len, 0.0, 1.0);\n float ray = min(w * (1.0 - 0.7 * u) - across, rc + len - along);\n if (h > 0.5) ray = max(ray, w * 1.2 - length(d - dir * (rc + len)));\n spike = max(spike, ray);\n }\n }\n f = smax(f, spike, 0.08);\n\n \n for (int j = 0; j < 5; j++) {\n vec2 dk = key + vec2(float(j), 29.0);\n float hr = hash12(dk + 0.5);\n float rad = (0.015 + 0.05 * hr * hr) * clamp(droplets * 5.0 - float(j), 0.0, 1.0) * pop;\n if (rad > 0.0) {\n float da = 2.0 * PI * hash12(dk);\n float dist = min(r0 + 0.08 + 0.5 * hash12(dk + 1.5), REACH - rad) * mix(0.5, 1.0, pop);\n f = max(f, rad - length(d - dist * vec2(cos(da), sin(da))));\n }\n }\n\n \n if (drips > 0.0) {\n float run = clamp((progress - t0 - 0.03) / 0.45, 0.0, 1.0);\n run = run * (2.0 - run);\n for (int j = 0; j < 2; j++) {\n vec2 dk = key + vec2(float(j), 43.0);\n float xo = (hash12(dk) - 0.5) * r0;\n float dw = (0.03 + 0.02 * hash12(dk + 0.5)) * pop;\n float top = sqrt(r0 * r0 - xo * xo) * pop;\n float bottom = min(top + drips * (0.25 + 0.75 * hash12(dk + 1.5)) * run, sqrt(REACH * REACH - xo * xo) - 1.6 * dw);\n float dx = abs(d.x - xo);\n float drip = min(dw - dx, min(d.y + bottom, -d.y));\n float tip = dw * 1.4 - length(vec2(dx, d.y + bottom + 0.2 * dw));\n f = smax(f, max(drip, tip), 0.05);\n }\n }\n return f;\n}\n\nvec4 transition(vec2 uv) {\n float n = max(1.0, floor(splats + 0.5));\n float cellSize = max(ratio, 1.0) / n;\n vec2 q = vec2(uv.x * ratio, uv.y) / cellSize; \n vec2 base = floor(q);\n vec2 sd = seed * vec2(7.0, 13.0);\n float f = -1.0;\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n vec2 cell = base + vec2(float(i), float(j));\n f = max(f, splat(q, cell, cell + sd));\n }\n }\n float aa = 0.0025 / cellSize; \n float inside = smoothstep(-aa, aa, f);\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n \n float e = clamp(f / 0.045, 0.0, 1.0);\n float amount = rim * (1.0 - smoothstep(0.75, 1.0, progress));\n float dark = (1.0 - e) * (1.0 - e) * 0.6;\n float gloss = smoothstep(0.2, 0.4, e) * (1.0 - smoothstep(0.4, 0.7, e)) * 0.3;\n to.rgb = mix(to.rgb * (1.0 - dark * amount), vec3(1.0), gloss * amount * to.a);\n return mix(from, to, inside);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideInHorizontal":"// SplitSlideInHorizontal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideInHorizontal.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The incoming image slides in as two halves moving horizontally in opposite directions\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (reverse != 0) ? -1.0 : 1.0;\n vec2 toP = (uv.y > 0.5) ?\n vec2((uv.x - (progress * modifier)) + modifier, uv.y) :\n vec2((uv.x + (progress * modifier)) - modifier, uv.y);\n\n vec2 fromP = uv;\n\n return inBounds(toP) ? getToColor(toP) : getFromColor(fromP);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideInOutHorizontal":"// SplitSlideInOutHorizontal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideInOutHorizontal.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The halves of both images slide horizontally in opposite directions, out and in at once\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (uv.y > 0.5 ? 1.0 : -1.0) * ((reverse != 0) ? -1.0 : 1.0) ;\n vec2 fromP = vec2(uv.x + (progress * modifier), uv.y);\n vec2 toP = vec2((uv.x + (progress * modifier)) - modifier, uv.y);\n\n return inBounds(fromP) ? getFromColor(fromP) : getToColor(toP);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideInOutVertical":"// SplitSlideInOutVertical — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideInOutVertical.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The halves of both images slide vertically in opposite directions, out and in at once\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (uv.x > 0.5 ? 1.0 : -1.0) * ((reverse != 0) ? -1.0 : 1.0) ;\n vec2 fromP = vec2(uv.x, uv.y + (progress * modifier));\n vec2 toP = vec2(uv.x, (uv.y + (progress * modifier)) - modifier);\n\n return inBounds(fromP) ? getFromColor(fromP) : getToColor(toP);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideInVertical":"// SplitSlideInVertical — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideInVertical.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The incoming image slides in as two halves moving vertically in opposite directions\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (reverse != 0) ? -1.0 : 1.0;\n vec2 p = (uv.x > 0.5) ?\n vec2(uv.x, (uv.y - (progress * modifier)) + modifier) :\n vec2(uv.x, (uv.y + (progress * modifier)) - modifier);\n\n return inBounds(p) ? getToColor(p) : getFromColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideOutHorizontal":"// SplitSlideOutHorizontal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideOutHorizontal.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The outgoing image slides out as two halves moving horizontally in opposite directions\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (uv.y > 0.5 ? 1.0 : -1.0) * ((reverse != 0) ? -1.0 : 1.0) ;\n vec2 p = vec2(uv.x + (progress * modifier), uv.y);\n\n return inBounds(p) ? getFromColor(p) : getToColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideOutVertical":"// SplitSlideOutVertical — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideOutVertical.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The outgoing image slides out as two halves moving vertically in opposite directions\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (uv.x > 0.5 ? 1.0 : -1.0) * ((reverse != 0) ? -1.0 : 1.0) ;\n vec2 p = vec2(uv.x, uv.y + (progress * modifier));\n\n return inBounds(p) ? getFromColor(p) : getToColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SquaresWipe":"// SquaresWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SquaresWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Squares grow along a diagonal sweep to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 squares;\n\nuniform vec2 direction;\n\nuniform float smoothness; \n\nconst vec2 center = vec2(0.5, 0.5);\nvec4 transition (vec2 p) {\n vec2 v = normalize(direction);\n v /= abs(v.x)+abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float offset = smoothness;\n float pr = smoothstep(-offset, 0.0, v.x * p.x + v.y * p.y - (d-0.5+progress*(1.+offset)));\n vec2 squarep = fract(p*vec2(squares));\n vec2 squaremin = vec2(pr/2.0);\n vec2 squaremax = vec2(1.0 - pr/2.0);\n float a = (1.0 - step(progress, 0.0)) * step(squaremin.x, squarep.x) * step(squaremin.y, squarep.y) * step(squarep.x, squaremax.x) * step(squarep.y, squaremax.y);\n return mix(getFromColor(p), getToColor(p), a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Squeeze":"// Squeeze — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Squeeze.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is squeezed into a line with color separation, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float colorSeparation; \n \nvec4 transition (vec2 uv) {\n float y = 0.5 + (uv.y-0.5) / (1.0-progress);\n if (y < 0.0 || y > 1.0) {\n return getToColor(uv);\n }\n else {\n vec2 fp = vec2(uv.x, y);\n vec2 off = progress * vec2(0.0, colorSeparation);\n vec4 c = getFromColor(fp);\n vec4 cn = getFromColor(fp - off);\n vec4 cp = getFromColor(fp + off);\n return vec4(cn.r, c.g, cp.b, c.a);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StarWipe":"// StarWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StarWipe.glsl\n// Author: Ben Lucas\n// License: MIT\n// Description: A growing star reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float border_thickness;\nuniform float star_rotation;\n\nuniform vec4 border_color; \n\nuniform vec2 star_center;\n\nvec2 rotate(vec2 v, float theta) {\n float cosTheta = cos(theta);\n float sinTheta = sin(theta);\n\n return vec2(\n cosTheta * v.x - sinTheta * v.y,\n sinTheta * v.x + cosTheta * v.y\n );\n}\n\nbool inStar(vec2 uv, vec2 center, float radius){\n vec2 uv_centered = uv - center;\n uv_centered = rotate(uv_centered, star_rotation * 1.2566370614359172);\n float theta = atan(uv_centered.y, uv_centered.x) + 3.141592653589793;\n\n vec2 uv_rotated = rotate(uv_centered, -1.2566370614359172 * (floor(theta / 1.2566370614359172) + 0.5));\n\n float slope = 0.3;\n if(uv_rotated.y > 0.0){\n return (radius + uv_rotated.x * slope > uv_rotated.y);\n } else {\n return (-radius - uv_rotated.x * slope < uv_rotated.y);\n }\n}\n\nvec4 transition (vec2 uv) {\n float progressScaled = (2.0 * border_thickness + 1.0) * progress - border_thickness;\n if(inStar(uv, star_center, progressScaled)){\n return getToColor(uv);\n } else if(inStar(uv, star_center, progressScaled+border_thickness)){\n return border_color;\n } else {\n return getFromColor(uv);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StaticFade":"// StaticFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StaticFade.glsl\n// Author: Ben Lucas\n// License: MIT\n// Description: Cuts to the incoming image halfway, hidden behind a burst of TV static\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float n_noise_pixels ; \nuniform float static_luminosity ; \n\nfloat rnd (vec2 st) {\n return fract(sin(dot(st.xy,\n vec2(10.5302340293,70.23492931)))*\n 12345.5453123);\n}\n\nvec4 staticNoise (vec2 st, float offset, float luminosity, float alpha) {\n float staticR = luminosity * rnd(st * vec2(offset * 2.0, offset * 3.0));\n float staticG = luminosity * rnd(st * vec2(offset * 3.0, offset * 5.0));\n float staticB = luminosity * rnd(st * vec2(offset * 5.0, offset * 7.0));\n return vec4(staticR, staticG, staticB, alpha);\n}\n\nfloat staticIntensity(float t)\n{\n float transitionProgress = abs(2.0*(t-0.5));\n float transformedThreshold =1.2*(1.0 - transitionProgress)-0.1;\n return min(1.0, transformedThreshold);\n}\n \nvec4 transition (vec2 uv) {\n\n float baseMix = step(0.5, progress);\n vec4 transitionMix = mix(\n getFromColor(uv),\n getToColor(uv),\n baseMix\n );\n \n vec2 uvStatic = floor(uv * n_noise_pixels)/n_noise_pixels;\n \n vec4 staticColor = staticNoise(uvStatic, progress, static_luminosity, transitionMix.a); \n\n float staticThresh = staticIntensity(progress);\n float staticMix = step(rnd(uvStatic), staticThresh);\n\n return mix(transitionMix, staticColor, staticMix);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StaticWipe":"// StaticWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StaticWipe.glsl\n// Author: Ben Lucas\n// License: MIT\n// Description: A wipe from top to bottom with a band of TV static at its edge\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat rnd (vec2 st) {\n return fract(sin(dot(st.xy,\n vec2(10,70)))*\n 12345.5453123);\n}\n\nuniform int u_transitionUpToDown; \n\nuniform float u_max_static_span; \n\nvec4 transition (vec2 uv) {\n \n\n float span = u_max_static_span*pow(sin(3.14159265359*progress),0.5);\n \n float transitionEdge = (u_transitionUpToDown != 0) ? 1.0-uv.y : uv.y;\n float mixRatio = 1.0 - step(progress, transitionEdge);\n\n vec4 transitionMix = mix(\n getFromColor(uv),\n getToColor(uv),\n mixRatio\n );\n \n float noiseEnvelope = smoothstep(progress-span, progress, transitionEdge) * (1.0 - smoothstep(progress, progress + span, transitionEdge));\n vec4 noise = vec4(vec3(rnd(uv*(1.0+progress))), transitionMix.a); \n \n\n return mix(transitionMix, noise, noiseEnvelope);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StereoViewer":"// StereoViewer — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StereoViewer.glsl\n// Author: Ted Schundler\n// License: BSD 2 Clause\n// Description: Both images shrink into rounded cards that swap, like a stereo viewer toy\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float zoom; \n\nuniform float corner_radius; \n\nconst vec4 black = vec4(0.0); \nconst vec2 c00 = vec2(0.0, 0.0); \nconst vec2 c01 = vec2(0.0, 1.0);\nconst vec2 c11 = vec2(1.0, 1.0);\nconst vec2 c10 = vec2(1.0, 0.0);\n\nbool in_corner(vec2 p, vec2 corner, vec2 radius) {\n \n vec2 axis = (c11 - corner) - corner;\n\n \n \n p = p - (corner + axis * radius);\n p *= axis / radius;\n return (p.x > 0.0 && p.y > -1.0) || (p.y > 0.0 && p.x > -1.0) || dot(p, p) < 1.0;\n}\n\nbool test_rounded_mask(vec2 p, vec2 corner_size) {\n return\n in_corner(p, c00, corner_size) &&\n in_corner(p, c01, corner_size) &&\n in_corner(p, c10, corner_size) &&\n in_corner(p, c11, corner_size);\n}\n\nvec4 screen(vec4 a, vec4 b) {\n return 1.0 - (1.0 - a) * (1.0 -b);\n}\n\nvec4 unscreen(vec4 c) {\n return 1.0 - sqrt(1.0 - c);\n}\n\nvec4 sample_with_corners_from(vec2 p, vec2 corner_size) {\n p = (p - 0.5) / zoom + 0.5;\n if (!test_rounded_mask(p, corner_size)) {\n return black;\n }\n return unscreen(getFromColor(p));\n}\n\nvec4 sample_with_corners_to(vec2 p, vec2 corner_size) {\n p = (p - 0.5) / zoom + 0.5;\n if (!test_rounded_mask(p, corner_size)) {\n return black;\n }\n return unscreen(getToColor(p));\n}\n\nvec4 simple_sample_with_corners_from(vec2 p, vec2 corner_size, float zoom_amt) {\n p = (p - 0.5) / (1.0 - zoom_amt + zoom * zoom_amt) + 0.5;\n if (!test_rounded_mask(p, corner_size)) {\n return black;\n }\n return getFromColor(p);\n}\n\nvec4 simple_sample_with_corners_to(vec2 p, vec2 corner_size, float zoom_amt) {\n p = (p - 0.5) / (1.0 - zoom_amt + zoom * zoom_amt) + 0.5;\n if (!test_rounded_mask(p, corner_size)) {\n return black;\n }\n return getToColor(p);\n}\n\nmat3 rotate2d(float angle, float ratio) {\n float s = sin(angle);\n float c = cos(angle);\n return mat3(\n c, s ,0.0,\n -s, c, 0.0,\n 0.0, 0.0, 1.0);\n}\n\nmat3 translate2d(float x, float y) {\n return mat3(\n 1.0, 0.0, 0,\n 0.0, 1.0, 0,\n -x, -y, 1.0);\n}\n\nmat3 scale2d(float x, float y) {\n return mat3(\n x, 0.0, 0,\n 0.0, y, 0,\n 0, 0, 1.0);\n}\n\nvec4 get_cross_rotated(vec3 p3, float angle, vec2 corner_size, float ratio) {\n angle = angle * angle; \n angle /= 2.4; \n\n mat3 center_and_scale = translate2d(-0.5, -0.5) * scale2d(1.0, ratio);\n mat3 unscale_and_uncenter = scale2d(1.0, 1.0/ratio) * translate2d(0.5,0.5);\n mat3 slide_left = translate2d(-2.0,0.0);\n mat3 slide_right = translate2d(2.0,0.0);\n mat3 rotate = rotate2d(angle, ratio);\n\n mat3 op_a = center_and_scale * slide_right * rotate * slide_left * unscale_and_uncenter;\n mat3 op_b = center_and_scale * slide_left * rotate * slide_right * unscale_and_uncenter;\n\n vec4 a = sample_with_corners_from((op_a * p3).xy, corner_size);\n vec4 b = sample_with_corners_from((op_b * p3).xy, corner_size);\n\n return screen(a, b);\n}\n\nvec4 get_cross_masked(vec3 p3, float angle, vec2 corner_size, float ratio) {\n angle = 1.0 - angle;\n angle = angle * angle; \n angle /= 2.4;\n\n vec4 img;\n\n mat3 center_and_scale = translate2d(-0.5, -0.5) * scale2d(1.0, ratio);\n mat3 unscale_and_uncenter = scale2d(1.0 / zoom, 1.0 / (zoom * ratio)) * translate2d(0.5,0.5);\n mat3 slide_left = translate2d(-2.0,0.0);\n mat3 slide_right = translate2d(2.0,0.0);\n mat3 rotate = rotate2d(angle, ratio);\n\n mat3 op_a = center_and_scale * slide_right * rotate * slide_left * unscale_and_uncenter;\n mat3 op_b = center_and_scale * slide_left * rotate * slide_right * unscale_and_uncenter;\n\n bool mask_a = test_rounded_mask((op_a * p3).xy, corner_size);\n bool mask_b = test_rounded_mask((op_b * p3).xy, corner_size);\n\n if (mask_a || mask_b) {\n img = sample_with_corners_to(p3.xy, corner_size);\n return screen(mask_a ? img : black, mask_b ? img : black);\n } else {\n return black;\n }\n}\n\nvec4 transition(vec2 uv) {\n float a;\n vec2 p=uv.xy/vec2(1.0).xy;\n vec3 p3 = vec3(p.xy, 1.0); \n\n \n vec2 corner_size = vec2(corner_radius / ratio, corner_radius);\n\n if (progress <= 0.0) {\n \n return getFromColor(p);\n } else if (progress < 0.1) {\n \n a = progress / 0.1;\n return simple_sample_with_corners_from(p, corner_size * a, a);\n } else if (progress < 0.48) {\n \n a = (progress - 0.1)/0.38;\n return get_cross_rotated(p3, a, corner_size, ratio);\n } else if (progress < 0.9) {\n \n \n return get_cross_masked(p3, (progress - 0.52)/0.38, corner_size, ratio);\n } else if (progress < 1.0) {\n \n a = (1.0 - progress) / 0.1;\n return simple_sample_with_corners_to(p, corner_size * a, a);\n } else {\n \n return getToColor(p);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StretchSlide":"// StretchSlide — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StretchSlide.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image stretches out long as it shoots away to one side, pulling in the incoming one squashed behind it, which overshoots and springs back to its shape\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float stretch; \n\nuniform float bounce; \n\nconst float PI = 3.14159265;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n float dl = length(direction);\n vec2 d = dl > 1e-6 ? direction / dl : vec2(-1.0, 0.0);\n vec2 n = vec2(-d.y, d.x);\n \n float ext = abs(d.x) + abs(d.y);\n vec2 q = uv - 0.5;\n float s = 0.5 + dot(q, d) / ext;\n float t = progress;\n\n \n float land = mix(1.0, 0.5, bounce);\n float m = 3.0 * bounce; \n float x = clamp(t / land, 0.0, 1.0);\n float e = x * x * (3.0 - 2.0 * x) + m * x * x * (x - 1.0);\n \n float w = 2.5 * PI;\n float u = clamp((t - land) / max(1.0 - land, 1e-4), 0.0, 1.0);\n float osc = m * (1.0 - land) / (land * w) * exp(-u) * sin(w * u) * (1.0 - u) * (1.0 - u);\n \n \n float len = e + max(osc, 0.0);\n float bulge = 1.0 - e + 3.0 * max(-osc, 0.0);\n\n \n float g = 1.0 + 0.6 * stretch * bulge;\n vec2 pt = q + d * (s / max(len, 1e-4) - s) * ext;\n pt -= n * dot(pt, n) * (1.0 - 1.0 / g);\n vec4 b = getToColor(mirror(pt + 0.5));\n\n \n \n float l = 1.0 + 4.0 * stretch * e;\n float k = clamp(1.6 * stretch * e, 0.0, 0.8);\n float y = max(s - e, 0.0) / l;\n \n float v = 2.0 * y / ((1.0 + k) + sqrt((1.0 + k) * (1.0 + k) - 4.0 * k * y));\n vec4 a = getFromColor(mirror(q + d * (v - s) * ext + 0.5));\n\n \n return (s < len || t >= land) ? b : a;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StripDatamoshGlitch":"// StripDatamoshGlitch — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StripDatamoshGlitch.glsl\n// Author: bread\n// License: MIT\n// Description: A datamosh glitch: torn strips, chroma shifts and scan noise drag the outgoing image into the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \nuniform float horizontalBars; \nuniform float verticalSlits; \nuniform float tear; \nuniform float chroma; \nuniform float residue; \nuniform float noiseAmount; \nuniform float scanAmount; \nuniform float flashAmount; \n\nconst float PI = 3.141592653589793;\n\nfloat hash(float n) {\n return fract(sin(n) * 43758.5453123);\n}\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat sat(float v) {\n return clamp(v, 0.0, 1.0);\n}\n\nfloat burst() {\n return pow(max(0.0, sin(progress * PI)), 0.42) * strength;\n}\n\nvec2 safeUv(vec2 uv) {\n return clamp(uv, vec2(0.0), vec2(1.0));\n}\n\nfloat stripeY(vec2 uv, float density, float seed, float minWidth, float maxWidth) {\n float y = uv.y * density + seed * 0.137;\n float id = floor(y);\n float f = fract(y);\n float c = hash(vec2(id, seed));\n float w = mix(minWidth, maxWidth, hash(vec2(id + 9.17, seed + 2.31)));\n return 1.0 - smoothstep(w, w + 0.018, abs(f - c));\n}\n\nfloat stripeX(vec2 uv, float density, float seed, float minWidth, float maxWidth) {\n float x = uv.x * density + seed * 0.091;\n float id = floor(x);\n float f = fract(x);\n float c = hash(vec2(id, seed + 41.0));\n float w = mix(minWidth, maxWidth, hash(vec2(id + 4.7, seed + 8.9)));\n return 1.0 - smoothstep(w, w + 0.012, abs(f - c));\n}\n\nfloat brokenGate(vec2 uv, float row, float rnd, float frame) {\n float segs = mix(1.0, 9.0, hash(vec2(row, frame + 44.0)));\n float seg = floor(uv.x * segs);\n return step(0.16, hash(vec2(seg, row + frame * 3.0 + rnd)));\n}\n\nfloat horizontalMask(vec2 uv, float frame) {\n float r1 = floor((uv.y + hash(frame) * 0.031) * horizontalBars * 0.38);\n float r2 = floor((uv.y + hash(frame + 2.0) * 0.013) * horizontalBars);\n float r3 = floor((uv.y + hash(frame + 7.0) * 0.006) * horizontalBars * 3.4);\n\n float thick = stripeY(uv, horizontalBars * 0.38, frame + 1.0, 0.035, 0.22);\n float mid = stripeY(uv, horizontalBars, frame + 4.0, 0.014, 0.11);\n float hair = stripeY(uv, horizontalBars * 3.4, frame + 9.0, 0.004, 0.035);\n\n thick *= step(0.42, hash(vec2(r1, frame + 10.0)));\n mid *= step(0.48, hash(vec2(r2, frame + 20.0)));\n hair *= step(0.62, hash(vec2(r3, frame + 30.0)));\n\n thick *= brokenGate(uv, r1, hash(vec2(r1, frame)), frame);\n mid *= brokenGate(uv, r2, hash(vec2(r2, frame)), frame + 3.0);\n\n return sat(max(thick, max(mid, hair)));\n}\n\nfloat verticalMask(vec2 uv, float frame) {\n float col = floor((uv.x + hash(frame + 12.0) * 0.017) * verticalSlits);\n float slit = stripeX(uv, verticalSlits, frame + 13.0, 0.01, 0.075);\n slit *= step(0.66, hash(vec2(col, frame + 19.0)));\n return sat(slit);\n}\n\nvec4 chromaFrom(vec2 uv, vec2 s) {\n uv = safeUv(uv);\n vec4 center = getFromColor(uv);\n return vec4(\n getFromColor(safeUv(uv + s)).r,\n center.g,\n getFromColor(safeUv(uv - s)).b,\n center.a\n );\n}\n\nvec4 chromaTo(vec2 uv, vec2 s) {\n uv = safeUv(uv);\n vec4 center = getToColor(uv);\n return vec4(\n getToColor(safeUv(uv - s)).r,\n center.g,\n getToColor(safeUv(uv + s)).b,\n center.a\n );\n}\n\nvec2 distortUv(vec2 uv, float dir, float b, float h, float v, float frame) {\n float row = floor(uv.y * horizontalBars);\n float col = floor(uv.x * verticalSlits);\n\n float rowRnd = hash(vec2(row, frame));\n float colRnd = hash(vec2(col, frame + 27.0));\n\n float xTear = (rowRnd - 0.5) * 2.0 * tear * b * h;\n xTear += sin(uv.y * 120.0 + progress * 95.0) * 0.006 * b;\n\n float yDrag = (colRnd - 0.5) * 0.13 * b * v;\n float micro = (hash(vec2(row, col + frame)) - 0.5) * 0.018 * b * max(h, v);\n\n return uv + vec2(xTear * dir + micro, yDrag);\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n float b = burst();\n float frame = floor(progress * 30.0);\n\n float h = horizontalMask(uv, frame);\n float v = verticalMask(uv, frame);\n float glitch = sat(max(h, v * 0.75));\n\n float row = floor(uv.y * horizontalBars);\n float rowRnd = hash(vec2(row, frame + 5.0));\n\n float bandDelay = (rowRnd - 0.5) * 0.30 * h;\n float reveal = smoothstep(0.18, 0.84, progress + bandDelay);\n\n vec2 split = vec2(chroma * b * (1.0 + 1.7 * glitch), chroma * 0.22 * b * v);\n\n vec2 fromUv = distortUv(uv, 1.0, b, h, v, frame);\n vec2 toUv = distortUv(uv, -1.0, b, h, v, frame);\n\n vec4 color = mix(\n chromaFrom(fromUv, split),\n chromaTo(toUv, split),\n reveal\n );\n\n \n vec2 smearUv = uv;\n smearUv.x += (rowRnd - 0.5) * 0.46 * b * h;\n smearUv.y += (hash(vec2(row, frame + 31.0)) - 0.5) * 0.045 * b * h;\n\n float sliceReveal = smoothstep(0.28, 0.78, progress + (rowRnd - 0.5) * 0.22);\n vec4 sliceColor = mix(\n chromaFrom(smearUv, split * 1.65),\n chromaTo(smearUv - vec2((rowRnd - 0.5) * 0.18 * b, 0.0), split * 1.65),\n sliceReveal\n );\n\n color = mix(color, sliceColor, h * b * residue);\n\n \n float hairLine = stripeY(uv, 190.0, frame + 55.0, 0.002, 0.012);\n hairLine *= step(0.70, hash(vec2(floor(uv.y * 190.0), frame + 56.0)));\n color.rgb += vec3(0.72, 0.90, 1.0) * hairLine * b * 0.28;\n\n float scan = 0.5 + 0.5 * sin(uv.y * 980.0 + progress * 130.0);\n color.rgb *= 1.0 - scanAmount * b * scan;\n\n vec2 nCell = floor(uv * vec2(360.0 * ratio, 210.0));\n float n = hash(nCell + vec2(frame * 7.0, frame * 13.0));\n color.rgb += (n - 0.5) * noiseAmount * b * (0.55 + glitch);\n\n \n float luma = dot(color.rgb, vec3(0.299, 0.587, 0.114));\n color.rgb = mix(color.rgb, vec3(luma), 0.18 * b * glitch);\n\n float strobe = step(0.78, hash(vec2(frame, 3.14))) * pow(b, 1.65);\n color.rgb += vec3(strobe * flashAmount);\n\n return vec4(clamp(color.rgb, vec3(0.0), vec3(1.0)), color.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Swap":"// Swap — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Swap.glsl\n// Author: gre\n// License: MIT\n// Description: The two images swap places in 3D, with a floor reflection\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float reflection; \n\nuniform float perspective; \nuniform float depth; \n \nconst vec4 black = vec4(0.0); \nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n \nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n \nvec2 project (vec2 p) {\n return p * vec2(1.0, -1.2) + vec2(0.0, -0.02);\n}\n \nvec4 bgColor (vec2 p, vec2 pfr, vec2 pto) {\n vec4 c = black;\n pfr = project(pfr);\n if (inBounds(pfr)) {\n c += mix(black, getFromColor(pfr), reflection * mix(1.0, 0.0, pfr.y));\n }\n pto = project(pto);\n if (inBounds(pto)) {\n c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y));\n }\n return c;\n}\n \nvec4 transition(vec2 p) {\n vec2 pfr, pto = vec2(-1.);\n \n float size = mix(1.0, depth, progress);\n float persp = perspective * progress;\n pfr = (p + vec2(-0.0, -0.5)) * vec2(size/(1.0-perspective*progress), size/(1.0-size*persp*p.x)) + vec2(0.0, 0.5);\n \n size = mix(1.0, depth, 1.-progress);\n persp = perspective * (1.-progress);\n pto = (p + vec2(-1.0, -0.5)) * vec2(size/(1.0-perspective*(1.0-progress)), size/(1.0-size*persp*(0.5-p.x))) + vec2(1.0, 0.5);\n\n if (progress < 0.5) {\n if (inBounds(pfr)) {\n return getFromColor(pfr);\n }\n if (inBounds(pto)) {\n return getToColor(pto);\n } \n }\n if (inBounds(pto)) {\n return getToColor(pto);\n }\n if (inBounds(pfr)) {\n return getFromColor(pfr);\n }\n return bgColor(p, pfr, pto);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Swirl":"// Swirl — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Swirl.glsl\n// Author: Sergey Kosarevsky\n// License: MIT\n// Description: Both images swirl around the center while crossfading\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 UV)\n{\n\tfloat Radius = 1.0;\n\n\tfloat T = progress;\n\n\tUV -= vec2( 0.5, 0.5 );\n\n\tfloat Dist = length(UV);\n\n\tif ( Dist < Radius )\n\t{\n\t\tfloat Percent = (Radius - Dist) / Radius;\n\t\tfloat A = ( T <= 0.5 ) ? mix( 0.0, 1.0, T/0.5 ) : mix( 1.0, 0.0, (T-0.5)/0.5 );\n\t\tfloat Theta = Percent * Percent * A * 8.0 * 3.14159;\n\t\tfloat S = sin( Theta );\n\t\tfloat C = cos( Theta );\n\t\tUV = vec2( dot(UV, vec2(C, -S)), dot(UV, vec2(S, C)) );\n\t}\n\tUV += vec2( 0.5, 0.5 );\n\n\tvec4 C0 = getFromColor(UV);\n\tvec4 C1 = getToColor(UV);\n\n\treturn mix( C0, C1, T );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TangentMotionBlur":"// TangentMotionBlur — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TangentMotionBlur.glsl\n// Author: chenkai\n// License: MIT\n// Description: The outgoing image is flung away along a curve with motion blur\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n \n\nvec4 motionBlurFrom(vec2 _st, vec2 speed) {\n vec2 texCoord = _st.xy / vec2(1.0).xy;\n \n vec3 color = vec3(0.0);\n float alpha = 0.0;\n float total = 0.0;\n float offset = rand(_st);\n for (float t = 0.0; t <= 20.0; t++) {\n float percent = (t + offset) / 20.0;\n float weight = 4.0 * (percent - percent * percent);\n vec2 newuv = texCoord + speed * percent;\n newuv = fract(newuv);\n vec4 c = getFromColor(newuv);\n color += c.rgb * c.a * weight;\n alpha += c.a * weight;\n total += weight;\n }\n return vec4(color / max(alpha, 1e-5), alpha / total);\n}\n\nvec4 motionBlurTo(vec2 _st, vec2 speed) {\n vec2 texCoord = _st.xy / vec2(1.0).xy;\n vec3 color = vec3(0.0);\n float alpha = 0.0;\n float total = 0.0;\n float offset = rand(_st);\n for (float t = 0.0; t <= 20.0; t++) {\n float percent = (t + offset) / 20.0;\n float weight = 4.0 * (percent - percent * percent);\n vec2 newuv = texCoord + speed * percent;\n newuv = fract(newuv);\n vec4 c = getToColor(newuv);\n color += c.rgb * c.a * weight;\n alpha += c.a * weight;\n total += weight;\n }\n return vec4(color / max(alpha, 1e-5), alpha / total);\n}\n\nfloat A(float aA1, float aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\nfloat B(float aA1, float aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n}\nfloat C(float aA1) {\n return 3.0 * aA1;\n}\nfloat GetSlope(float aT, float aA1, float aA2) {\n return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\nfloat CalcBezier(float aT, float aA1, float aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n}\nfloat GetTForX(float aX, float mX1, float mX2) {\n \n float aGuessT = aX;\n for (int i = 0; i < 4; ++i) {\n float currentSlope = GetSlope(aGuessT, mX1, mX2);\n if (currentSlope == 0.0) return aGuessT;\n float currentX = CalcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\nfloat KeySpline(float aX, float mX1, float mY1, float mX2, float mY2) {\n if (mX1 == mY1 && mX2 == mY2) return aX; \n return CalcBezier(GetTForX(aX, mX1, mX2), mY1, mY2); \n}\n\nfloat normpdf(float x) {\n float d = x - .5;\n return exp(-20.*d*d);\n}\n\nvec2 rotateUv(vec2 uv, float angle, vec2 anchor, float zDirection) {\n uv = uv - anchor; \n float s = sin(angle);\n\tfloat c = cos(angle);\n\tmat2 m = mat2(c, -s, s, c);\n uv = m * uv;\n uv += anchor; \n return uv;\n}\n\nvec4 transition (vec2 uv) {\n \n vec2 myst = uv;\n float animationTime = progress; \n float easingTime = KeySpline(animationTime, .68,.01,.17,.98);\n float blur = normpdf(easingTime);\n float r = 0.;\n float rotation = 180./180.*3.14159;\n if (easingTime <= .5) {\n r = rotation * easingTime;\n } else {\n r = -rotation + rotation * easingTime;\n }\n\n \n vec2 mystCurrent = myst;\n mystCurrent.y *= 1./ratio;\n mystCurrent = rotateUv(mystCurrent, r, vec2(1., 0.), -1.);\n mystCurrent.y *= ratio;\n \n \n float timeInterval = 0.0167*2.0;\n if (easingTime <= .5) {\n r = rotation * (easingTime+timeInterval);\n } else {\n r = -rotation + rotation * (easingTime+timeInterval);\n }\n \n \n vec2 mystNext = myst;\n mystNext.y *= 1./ratio;\n mystNext = rotateUv(mystNext, r, vec2(1., 0.), -1.);\n mystNext.y *= ratio;\n \n \n vec2 speed = (mystNext - mystCurrent) / timeInterval * blur * 0.5;\n if (easingTime <= .5) {\n return motionBlurFrom(mystCurrent, speed);\n } else {\n return motionBlurTo(mystCurrent, speed);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TilesWave":"// TilesWave — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TilesWave.glsl\n// Author: numb3r23\n// License: MIT\n// Description: The incoming image is revealed tile by tile in a diagonal wave\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 tileCount; \nuniform int flipX; \nuniform int flipY; \n\nvec4 transition(vec2 uv) {\n vec2 tileSize = 1.0 / vec2(tileCount);\n vec2 posInTile = fract(uv * vec2(tileCount));\n vec2 tileNum = floor(uv * vec2(tileCount));\n float countTiles = float(tileCount.x * tileCount.y);\n\n \n float offset = (tileNum.y + tileNum.x * float(tileCount.y)) / countTiles;\n float timeOffset = clamp((progress - offset) * countTiles, 0.0, 0.5);\n float sinTime = 1.0 - abs(cos(fract(timeOffset) * 3.1415926));\n\n vec2 texC = posInTile;\n\n if (sinTime <= 0.5) {\n if ((flipX != 0)) {\n if (texC.x < sinTime || texC.x > 1.0 - sinTime)\n return getFromColor(uv);\n texC.x = texC.x < 0.5\n ? (texC.x - sinTime) * 0.5 / (0.5 - sinTime)\n : (texC.x - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;\n }\n if ((flipY != 0)) {\n if (texC.y < sinTime || texC.y > 1.0 - sinTime)\n return getFromColor(uv);\n texC.y = texC.y < 0.5\n ? (texC.y - sinTime) * 0.5 / (0.5 - sinTime)\n : (texC.y - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;\n }\n vec2 globalUV = tileNum * tileSize + texC * tileSize;\n return getFromColor(globalUV);\n } else {\n if ((flipX != 0)) {\n if (texC.x > sinTime || texC.x < 1.0 - sinTime)\n return getToColor(uv);\n texC.x = texC.x < 0.5\n ? (texC.x - sinTime) * 0.5 / (0.5 - sinTime)\n : (texC.x - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;\n texC.x = 1.0 - texC.x;\n }\n if ((flipY != 0)) {\n if (texC.y > sinTime || texC.y < 1.0 - sinTime)\n return getToColor(uv);\n texC.y = texC.y < 0.5\n ? (texC.y - sinTime) * 0.5 / (0.5 - sinTime)\n : (texC.y - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;\n texC.y = 1.0 - texC.y;\n }\n vec2 globalUV = tileNum * tileSize + texC * tileSize;\n return getToColor(globalUV);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TopBottom":"// TopBottom — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TopBottom.glsl\n// Author: zhmy\n// License: MIT\n// Description: The outgoing image shrinks away upward while the incoming one slides in from the bottom\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst vec4 black = vec4(0.0); \nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n vec2 spfr,spto = vec2(-1.);\n float size = mix(1.0, 3.0, progress*0.2);\n spto = (uv + vec2(-0.5,-0.5))*vec2(size,size)+vec2(0.5,0.5);\n spfr = (uv + vec2(0.0, 1.0 - progress));\n if(inBounds(spfr)){\n return getToColor(spfr);\n } else if(inBounds(spto)){\n return getFromColor(spto) * (1.0 - progress);\n } else{\n return black;\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Tunnel":"// Tunnel — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Tunnel.glsl\n// Author: gre\n// License: MIT\n// Description: The camera flies down a tunnel lined with the outgoing image toward the incoming one, which opens at its far end and grows to fill the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float speed; \n\nuniform float twist; \n\nvec2 rotate(vec2 v, float a) {\n float c = cos(a);\n float s = sin(a);\n return vec2(c * v.x - s * v.y, s * v.x + c * v.y);\n}\n\nvec4 transition(vec2 uv) {\n vec2 aspect = vec2(ratio, 1.0);\n vec2 c = (uv - 0.5) * aspect;\n float r = length(c);\n \n \n \n \n float R = length(0.5 * aspect);\n float far = 1.0 + speed;\n \n float e = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.7);\n float d = pow(far, 1.0 - e);\n float t = far - d; \n \n float k = r * d < R ? d / far : R / (R + t * r); \n float a = twist * min(t * r / R, t / d); \n vec4 walls = getFromColor(0.5 + rotate(c * k, a) / aspect);\n walls.rgb *= 0.4 + 0.6 * sqrt(k); \n \n float open = smoothstep(0.0, 0.6, progress);\n vec2 q = 0.5 + (uv - 0.5) * d / max(open, 1e-4);\n vec2 inside = step(0.0, q) * step(q, vec2(1.0));\n return mix(walls, getToColor(q), inside.x * inside.y * step(r * d, R));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TvLostSignal":"// TvLostSignal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TvLostSignal.glsl\n// Author: mernking (gitlab.com/Godswork)\n// License: MIT\n// Description: A crossfade with drifting tracking lines and tearing, like a TV losing its signal\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n}\n\nvec4 transition(vec2 uv) {\n\n float p = progress;\n float strength = sin(p * 3.14159265);\n\n vec2 tv = uv;\n\n vec4 fromColor = getFromColor(tv);\n vec4 toColor = getToColor(tv);\n\n vec4 color = mix(fromColor, toColor, p);\n\n \n float lineY = floor(tv.y * 120.0);\n\n float noise = hash(vec2(lineY, p * 20.0));\n\n float line = step(0.92, noise);\n\n \n float drift =\n sin(tv.y * 30.0 + p * 10.0)\n * 0.02\n * strength;\n\n vec4 shiftedFrom = getFromColor(tv + vec2(drift, 0.0));\n vec4 shiftedTo = getToColor(tv + vec2(drift, 0.0));\n\n vec4 lineColor = mix(shiftedFrom, shiftedTo, p);\n\n \n color = mix(color, lineColor, line * strength);\n\n \n float scan =\n sin(tv.y * 900.0) * 0.03;\n\n color.rgb -= scan * strength;\n\n return color;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TvRoll":"// TvRoll — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TvRoll.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image rolls faster and faster, like an old TV losing its vertical hold, then the roll slows down and locks on the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int rolls; \n\nuniform float barHeight; \n\nuniform vec4 barColor; \n\nvec4 picture(vec2 uv, float y, float m) {\n float period = 1.0 + barHeight;\n y = mod(y, period);\n if (y > 1.0) return barColor;\n vec2 q = vec2(uv.x, y);\n return mix(getFromColor(q), getToColor(q), m);\n}\n\nvec4 transition(vec2 uv) {\n float period = 1.0 + barHeight;\n \n float s = progress * progress * (3.0 - 2.0 * progress);\n float offset = period * fract(float(rolls) * s);\n float speed = 4.0 * progress * (1.0 - progress); \n float m = smoothstep(0.42, 0.58, progress); \n \n vec2 p = uv + vec2(0.004 * speed * sin(uv.y * 9.0 + progress * 30.0), 0.0);\n \n vec4 c = vec4(0.0);\n for (int i = 0; i < 5; i++) {\n c += picture(p, p.y + offset - 0.0015 * float(rolls) * speed * float(i), m);\n }\n c /= 5.0;\n \n float scan = 0.5 + 0.5 * sin(uv.y * 400.0);\n float flicker = 0.08 * (0.5 + 0.5 * sin(progress * 97.0));\n c.rgb *= 1.0 - speed * (0.08 * scan + flicker);\n return c;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TvStatic":"// TvStatic — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TvStatic.glsl\n// Author: Brandon Anzaldi\n// License: MIT\n// Description: Cuts to full-screen TV static, then to the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float offset; \n\nhighp float noise(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt= dot(co.xy * progress, vec2(a, b));\n highp float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\n\nvec4 transition(vec2 p) {\n if (progress < offset) {\n return getFromColor(p);\n } else if (progress > (1.0 - offset)) {\n return getToColor(p);\n } else {\n return vec4(vec3(noise(p)), max(getFromColor(p).a, getToColor(p).a)); \n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TvTurnOff":"// TvTurnOff — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TvTurnOff.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image collapses into a glowing line and a dot, like an old TV turned off, then the incoming image powers on from the dot\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 color; \n\nuniform float glow; \n\nvec4 getColor(vec2 uv, bool isFrom) {\n return isFrom ? getFromColor(uv) : getToColor(uv);\n}\n\nvec4 screen(vec2 uv, float t, bool isFrom) {\n float collapse = smoothstep(0.0, 0.4, t); \n float shrink = smoothstep(0.3, 0.65, t); \n float fade = 0.4 * smoothstep(0.75, 1.0, t); \n float radius = 0.01 * (1.0 - fade);\n \n vec2 size = vec2(mix(0.5 * ratio, radius, shrink), mix(0.5, radius, collapse));\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n vec2 q = clamp(0.5 + 0.5 * p / size, 0.0, 1.0);\n vec4 c = getColor(q, isFrom);\n \n float white = smoothstep(0.4, 1.0, collapse);\n vec4 light = vec4(mix(min(c.rgb * (1.0 + 2.0 * collapse), 1.0), vec3(1.0), white), c.a);\n \n vec2 d = abs(p) - size;\n float dist = length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);\n float inside = clamp(1.0 - dist / 0.004, 0.0, 1.0);\n \n vec4 mid = getColor(vec2(0.5), isFrom);\n vec4 halo = vec4(mix(mix(mid.rgb, vec3(1.0), 0.7), vec3(1.0, 0.92, 0.8), shrink), mid.a);\n float h = 1.0 - exp(-2.0 * glow * white * exp(-max(dist, 0.0) / (0.02 + 0.04 * shrink)));\n vec4 col = mix(color, halo, h * (1.0 - fade));\n return mix(col, light, inside * (1.0 - fade));\n}\n\nvec4 transition(vec2 uv) {\n if (progress < 0.5) {\n return screen(uv, 2.0 * progress, true);\n }\n return screen(uv, 2.0 - 2.0 * progress, false);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","UndulatingBurnOut":"// UndulatingBurnOut — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/UndulatingBurnOut.glsl\n// Author: pthrasher\n// License: MIT\n// Description: A circle with a wavy edge burns out from the center to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float smoothness; \n\nuniform vec2 center; \n\nuniform vec4 color; \n\nconst float M_PI = 3.14159265358979323846;\n\nfloat quadraticInOut(float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n\nfloat getGradient(float r, float dist) {\n float d = r - dist;\n return mix(\n smoothstep(-smoothness, 0.0, r - dist * (1.0 + smoothness)),\n -1.0 - step(0.005, d),\n step(-0.005, d) * step(d, 0.01)\n );\n}\n\nfloat getWave(vec2 p){\n vec2 _p = p - center; \n float rads = atan(_p.y, _p.x);\n float degs = degrees(rads) + 180.0;\n vec2 range = vec2(0.0, M_PI * 30.0);\n vec2 domain = vec2(0.0, 360.0);\n float ratio = (M_PI * 30.0) / 360.0;\n degs = degs * ratio;\n float x = progress;\n float magnitude = mix(0.02, 0.09, smoothstep(0.0, 1.0, x));\n float offset = mix(40.0, 30.0, smoothstep(0.0, 1.0, x));\n float ease_degs = quadraticInOut(sin(degs));\n float deg_wave_pos = (ease_degs * magnitude) * sin(x * offset);\n \n \n \n return x - max(smoothness, 0.01) * (1.0 - smoothstep(0.0, 0.1, x)) + deg_wave_pos;\n}\n\nvec4 transition(vec2 p) {\n float dist = distance(center, p);\n float m = getGradient(getWave(p), dist);\n vec4 cfrom = getFromColor(p);\n vec4 cto = getToColor(p);\n return mix(mix(cfrom, cto, m), mix(cfrom, color, 0.75), step(m, -2.0));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","VerticalClose":"// VerticalClose — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/VerticalClose.glsl\n// Author: martiniti\n// License: MIT\n// Description: The incoming image closes in from the left and right edges toward the middle\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n\n float s = 2.0 - abs((uv.x - 0.5) / (progress - 1.0)) - 2.0 * progress;\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n smoothstep(0.5, 0.0, s)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","VerticalOpen":"// VerticalOpen — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/VerticalOpen.glsl\n// Author: martiniti\n// License: MIT\n// Description: The incoming image opens from a line in the middle toward the left and right edges\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n\n float regress = 1.0 - progress;\n float s = 2.0 - abs((uv.x - 0.5) / (regress - 1.0)) - 2.0 * regress;\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n smoothstep(0.0, 0.5, s)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WaterDrop":"// WaterDrop — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WaterDrop.glsl\n// Author: Paweł Płóciennik\n// License: MIT\n// Description: Ripples spread from the center like a drop falling into water, crossfading to the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float amplitude; \n\nuniform float speed; \n\nvec4 transition(vec2 p) {\n vec2 dir = p - vec2(.5);\n float dist = length(dir);\n\n if (dist > progress) {\n return mix(getFromColor( p), getToColor( p), progress);\n } else {\n vec2 offset = dir * sin(dist * amplitude - progress * speed);\n return mix(getFromColor( p + offset), getToColor( p), progress);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WedgeWipe":"// WedgeWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WedgeWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Two hands sweep away from each other around the center, opening a widening wedge that reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float angle; \n\nuniform float smoothness; \n\nuniform vec2 center; \n\nvec4 transition (vec2 uv) {\n \n if (progress >= 1.0) return getToColor(uv);\n \n vec2 q = (uv - center) * vec2(ratio, 1.0);\n float a = radians(angle);\n \n vec2 p = vec2(abs(q.x * cos(a) - q.y * sin(a)), q.x * sin(a) + q.y * cos(a));\n \n float spread = 3.141592653589793 * progress;\n vec2 hand = vec2(sin(spread), cos(spread));\n \n float l = length(p);\n float d = length(p - hand * clamp(dot(p, hand), 0.0, l)) * sign(hand.y * p.x - hand.x * p.y);\n \n \n float s = max(smoothness, 0.001);\n float m = 1.0 - smoothstep(0.0, s, d + s * (1.0 - progress));\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WhipPan":"// WhipPan — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WhipPan.glsl\n// Author: gre\n// License: MIT\n// Description: A fast camera pan that streaks both images with motion blur, the incoming one arriving from the opposite side\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float blur; \n\nconst int SAMPLES = 24;\n\nvec4 strip(vec2 q, vec2 d) {\n vec2 qt = q + d;\n \n if (dot(q - 0.5, -d) < 0.5 * dot(d, d)) {\n return getFromColor(clamp(q, 0.0, 1.0));\n }\n return getToColor(clamp(qt, 0.0, 1.0));\n}\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvec4 transition(vec2 uv) {\n vec2 d = sign(direction);\n \n float p = progress;\n float h = 1.0 - abs(2.0 * p - 1.0); \n \n float e = 0.5 * h * (0.1 + 0.9 * h * h);\n float pos = p < 0.5 ? e : 1.0 - e;\n float len = blur * h * (0.1 + 2.7 * h * h) / 2.8; \n\n vec2 q = uv - d * pos;\n \n float jitter = rand(uv);\n vec3 color = vec3(0.0);\n float alpha = 0.0;\n for (int i = 0; i < SAMPLES; i++) {\n float t = (float(i) + jitter) / float(SAMPLES) - 0.5;\n vec4 c = strip(q + d * t * len, d);\n color += c.rgb * c.a;\n alpha += c.a;\n }\n return vec4(color / max(alpha, 1e-5), alpha / float(SAMPLES));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WhipSpin":"// WhipSpin — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WhipSpin.glsl\n// Author: gre\n// License: MIT\n// Description: The camera rolls faster and faster around the center of the frame, streaking the outgoing image in a spin blur, then the incoming one takes over mid-spin and slows to a stop\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float turns; \n\nuniform float blur; \n\nuniform float chroma; \n\nuniform float zoom; \n\nconst float PI = 3.141592653589793;\nconst int SAMPLES = 24;\n\nfloat hash(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nvec2 mirror(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nfloat rollAngle(float t) {\n float halfTurn = PI * turns;\n if (t < 0.5) {\n float x = 2.0 * t;\n return halfTurn * x * x * x;\n }\n float x = 2.0 - 2.0 * t;\n return -halfTurn * x * x * x;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n float h = 1.0 - abs(2.0 * p - 1.0); \n \n float shutter = blur * 0.1 * h;\n float scale = 1.0 + zoom * h * h * h;\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float jitter = hash(uv * vec2(ratio, 1.0) * 731.0);\n vec3 color = vec3(0.0);\n vec3 weight = vec3(0.0);\n float alpha = 0.0;\n for (int i = 0; i < SAMPLES; i++) {\n float s = (float(i) + jitter) / float(SAMPLES) - 0.5;\n float t = clamp(p + s * shutter, 0.0, 1.0);\n float a = rollAngle(t);\n float c = cos(a), sn = sin(a);\n vec2 r = vec2(c * q.x + sn * q.y, -sn * q.x + c * q.y) / scale;\n vec2 suv = mirror(r / vec2(ratio, 1.0) + 0.5);\n vec4 col = t < 0.5 ? getFromColor(suv) : getToColor(suv);\n \n vec3 w = max(vec3(1.0 - 4.0 * chroma * s, 1.0, 1.0 + 4.0 * chroma * s), 0.0);\n color += col.rgb * col.a * w;\n weight += col.a * w;\n alpha += col.a;\n }\n return vec4(color / max(weight, vec3(1e-5)), alpha / float(SAMPLES));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WhipTilt":"// WhipTilt — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WhipTilt.glsl\n// Author: gre\n// License: MIT\n// Description: The camera tilts fast from the outgoing image to the incoming one, set edge to edge at an angle above it, streaking both in perspective with a vertical motion blur\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int down; \n\nuniform float blur; \n\nuniform float chroma; \n\nuniform float perspective; \n\nconst float PI = 3.141592653589793;\nconst int SAMPLES = 24;\n\nfloat hash(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nvec2 mirror(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nfloat tilt(float t) {\n float h = 1.0 - abs(2.0 * t - 1.0);\n float e = 0.5 * h * h * h * h;\n return t < 0.5 ? e : 1.0 - e;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n float h = 1.0 - abs(2.0 * p - 1.0); \n \n float shutter = blur * 0.25 * h * h;\n \n \n float halfFov = mix(15.0, 45.0, perspective) * PI / 180.0;\n float dist = 0.5 / tan(halfFov);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n if ((down != 0)) q.y = -q.y;\n float jitter = hash(uv * vec2(ratio, 1.0) * 731.0);\n vec3 color = vec3(0.0);\n vec3 weight = vec3(0.0);\n float alpha = 0.0;\n for (int i = 0; i < SAMPLES; i++) {\n float s = (float(i) + jitter) / float(SAMPLES) - 0.5;\n float t = clamp(p + s * shutter, 0.0, 1.0);\n float a = 2.0 * halfFov * tilt(t);\n \n vec2 r = q * cos(halfFov) / cos(halfFov - a);\n \n float c0 = cos(a), s0 = sin(a);\n vec2 d0 = vec2(r.y * c0 + dist * s0, dist * c0 - r.y * s0);\n float b = a - 2.0 * halfFov;\n float c1 = cos(b), s1 = sin(b);\n vec2 d1 = vec2(r.y * c1 + dist * s1, dist * c1 - r.y * s1);\n \n bool incoming = d1.y > d0.y;\n vec2 d = incoming ? d1 : d0;\n vec2 hit = dist / d.y * vec2(r.x, d.x);\n if ((down != 0)) hit.y = -hit.y;\n vec2 suv = mirror(hit / vec2(ratio, 1.0) + 0.5);\n vec4 col = incoming ? getToColor(suv) : getFromColor(suv);\n \n vec3 w = max(vec3(1.0 - 4.0 * chroma * s, 1.0, 1.0 + 4.0 * chroma * s), 0.0);\n color += col.rgb * col.a * w;\n weight += col.a * w;\n alpha += col.a;\n }\n return vec4(color / max(weight, vec3(1e-5)), alpha / float(SAMPLES));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Wind":"// Wind — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Wind.glsl\n// Author: gre\n// License: MIT\n// Description: A ragged left-to-right wipe, as if the image was blown away by the wind\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float size; \n\nuniform int reversed; \n\nfloat rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec4 transition (vec2 uv) {\n float x = (reversed != 0) ? 1. - uv.x : uv.x;\n float r = rand(vec2(0, uv.y));\n float m = smoothstep(0.0, -size, x*(1.0-size) + size*r - (progress * (1.0 + size)));\n return mix(\n getFromColor(uv),\n getToColor(uv),\n m\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WindowBlinds":"// WindowBlinds — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WindowBlinds.glsl\n// Author: Fabien Benetou\n// License: MIT\n// Description: A crossfade through horizontal window blinds\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n float t = progress;\n \n if (mod(floor(uv.y*100.*progress),2.)==0.)\n t*=2.-.5;\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n mix(t, progress, smoothstep(0.8, 1.0, progress))\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WindowSlices":"// WindowSlices — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WindowSlices.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image appears through vertical slices that widen\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float count; \n\nuniform float smoothness; \n\nvec4 transition (vec2 p) {\n float pr = smoothstep(-smoothness, 0.0, p.x - progress * (1.0 + smoothness));\n float s = step(pr, fract(count * p.x));\n return mix(getFromColor(p), getToColor(p), s);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WipeDown":"// WipeDown — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeDown.glsl\n// Author: Jake Nelson\n// License: MIT\n// Description: A hard-edged wipe from top to bottom\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4 b=getToColor(p);\n return mix(a, b, step(1.0-p.y,progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WipeLeft":"// WipeLeft — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeLeft.glsl\n// Author: Jake Nelson\n// License: MIT\n// Description: A hard-edged wipe from right to left\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4 b=getToColor(p);\n return mix(a, b, step(1.0-p.x,progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WipeRight":"// WipeRight — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeRight.glsl\n// Author: Jake Nelson\n// License: MIT\n// Description: A hard-edged wipe from left to right\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4 b=getToColor(p);\n return mix(a, b, step(0.0+p.x,progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WipeUp":"// WipeUp — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeUp.glsl\n// Author: Jake Nelson\n// License: MIT\n// Description: A hard-edged wipe from bottom to top\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4 b=getToColor(p);\n return mix(a, b, step(0.0+p.y,progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ZoomInCircles":"// ZoomInCircles — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ZoomInCircles.glsl\n// Author: dycm8009\n// License: MIT\n// Description: Concentric rings of the outgoing image zoom at different speeds before revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec2 zoom(vec2 uv, float amount) {\n return 0.5 + ((uv - 0.5) * amount);\t\n}\n\nvec4 transition(vec2 uv) {\n vec2 ratio2 = vec2(1.0, 1.0 / ratio);\n \n \n \n vec2 r = 2.0 * ((vec2(uv.xy) - 0.5) * ratio2);\n float pro = progress / 0.8;\n float z = pro * 0.2;\n float t = 0.0;\n if (pro > 1.0) {\n z = 0.2 + (pro - 1.0) * 5.;\n t = clamp((progress - 0.8) / 0.07, 0.0, 1.0);\n }\n if (length(r) < 0.5+z) {\n \n }\n else if (length(r) < 0.8+z*1.5) {\n uv = zoom(uv, 1.0 - 0.15 * pro);\n t = t * 0.5;\n }\n else if (length(r) < 1.2+z*2.5) {\n uv = zoom(uv, 1.0 - 0.2 * pro);\n t = t * 0.2;\n }\n else {\n uv = zoom(uv, 1.0 - 0.25 * pro);\n }\n return mix(getFromColor(uv), getToColor(uv), t);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ZoomInOut":"// ZoomInOut — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ZoomInOut.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: Zooms into the outgoing image until it blurs into a flat color, then out to the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec2 zoom(vec2 uv, float amount) {\n return 0.5 + ((uv - 0.5) * (1.0 - amount));\n}\n\nvec4 transition (vec2 uv) {\n float zoomFrom = smoothstep(0.0, 1.0, progress * 2.0);\n float zoomTo = smoothstep(0.0, 1.0, (1.0 - progress) * 2.0);\n float crossfade = smoothstep(0.4, 0.6, progress);\n return mix(\n getFromColor(zoom(uv, zoomFrom)),\n getToColor(zoom(uv, zoomTo)),\n crossfade\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ZoomWipeLeft":"// ZoomWipeLeft — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ZoomWipeLeft.glsl\n// Author: Handk\n// License: MIT\n// Description: Zooms into the outgoing image, then the incoming one wipes in from right to left\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float zoom_quickness; \nvec2 zoom(vec2 uv, float amount) {\n if(amount<0.5)\n return 0.5 + ((uv - 0.5) * (1.0-amount));\n else\n return 0.5 + ((uv - 0.5) * (amount));\n \n}\n\nvec4 transition (vec2 uv) {\n float nQuick = clamp(zoom_quickness,0.0,0.5);\n if(progress<0.5){\n vec4 c= mix(\n getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))),\n getToColor(uv),\n step(0.5, progress)\n );\n \n return c;\n }\n else{\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 d=getFromColor(p);\n vec4 e=getToColor(p);\n vec4 f= mix(d, e, step(1.0-p.x,(progress-0.5)*2.0));\n \n return f;\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ZoomWipeRight":"// ZoomWipeRight — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ZoomWipeRight.glsl\n// Author: Handk\n// License: MIT\n// Description: Zooms into the outgoing image, then the incoming one wipes in from left to right\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float zoom_quickness; \nvec2 zoom(vec2 uv, float amount) {\n if(amount<0.5)\n return 0.5 + ((uv - 0.5) * (1.0-amount));\n else\n return 0.5 + ((uv - 0.5) * (amount));\n \n}\n\nvec4 transition (vec2 uv) {\n float nQuick = clamp(zoom_quickness,0.0,0.5);\n if(progress<0.5){\n vec4 c= mix(\n getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))),\n getToColor(uv),\n step(0.5, progress)\n );\n \n return c;\n }\n else{\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 d=getFromColor(p);\n vec4 e=getToColor(p);\n vec4 f= mix(d, e, step(0.0+p.x,(progress-0.5)*2.0));\n \n return f;\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n"};
1
+ module.exports={"Accordion":"// Accordion — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Accordion.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image folds up like a pleated paper toward one side while the incoming one unfolds out of the other, both in 3D with lit and shadowed pleats\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int pleats; \n\nuniform vec2 direction; \n\nuniform float shading; \n\nuniform float perspective; \n\nuniform vec4 backColor; \n\nconst float LIGHT_SIDE = 0.55;\nconst float LIGHT_FRONT = 0.835;\n\nconst float EDGE = 0.0015;\n\nfloat panelLight(float c, float s, float facing) {\n float lambert = (c * LIGHT_FRONT + facing * s * LIGHT_SIDE) / LIGHT_FRONT;\n return mix(1.0, clamp(lambert, 0.08, 1.25), shading);\n}\n\nvec4 pleated(float f, float c, float len, float b, float bLen, bool incoming, bool flipA, bool vertical) {\n float m = 2.0 * float(pleats > 1 ? pleats : 1);\n float s = sqrt(max(1.0 - c * c, 0.0));\n float u = f * m;\n \n float panel = min(floor(u), m - 1.0);\n float fu = u - panel;\n \n float tri = 1.0 - abs(mod(u, 2.0) - 1.0);\n float panelLen = len / m;\n float z = panelLen * s * (1.0 - tri);\n \n float scale = 1.0 / (1.0 + perspective * z);\n float bb = (b - 0.5 * bLen) / scale / bLen + 0.5;\n \n float edge = EDGE * min(1.0, 20.0 * s * c) + 1e-6;\n float cover = clamp(min(bb, 1.0 - bb) * bLen * scale / edge, 0.0, 1.0);\n float a = flipA ? 1.0 - f : f;\n vec2 st = clamp(vertical ? vec2(bb, a) : vec2(a, bb), 0.0, 1.0);\n vec4 img = incoming ? getToColor(st) : getFromColor(st);\n \n float facing = mod(panel, 2.0) < 0.5 ? 1.0 : -1.0;\n float toEdge = min(fu, 1.0 - fu) * panelLen * c;\n float k = 0.5 + 0.5 * clamp(toEdge / EDGE, 0.0, 1.0);\n float light = mix(panelLight(c, s, -facing), panelLight(c, s, facing), k);\n \n float valley = 1.0 - tri;\n light *= 1.0 - 0.4 * shading * s * valley * valley;\n return mix(backColor, vec4(img.rgb * light, img.a), cover);\n}\n\nvec4 transition(vec2 uv) {\n bool vertical = abs(direction.y) > abs(direction.x);\n bool positive = vertical ? direction.y > 0.0 : direction.x > 0.0;\n \n float a = vertical ? uv.y : uv.x;\n if (positive) a = 1.0 - a;\n float b = vertical ? uv.x : uv.y;\n float len = vertical ? 1.0 : ratio;\n float bLen = vertical ? ratio : 1.0;\n\n float p = progress;\n float e = p * p * (3.0 - 2.0 * p);\n e = mix(p, e, 0.8);\n \n float cFrom = 1.0 - e;\n float cTo = e;\n if (a < cFrom || cTo <= 0.0) {\n \n return pleated(a / cFrom, cFrom, len, b * bLen, bLen, false, positive, vertical);\n }\n \n return pleated(1.0 - (1.0 - a) / cTo, cTo, len, b * bLen, bLen, true, positive, vertical);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ApertureWipe":"// ApertureWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ApertureWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A camera aperture opens its turning blades to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int blades; \n\nuniform float rotation; \n\nuniform float shadow; \n\nconst float AA = 0.006;\n\nvec4 transition (vec2 uv) {\n \n vec2 q = (uv - 0.5) * vec2(ratio, 1.0) / (0.5 * length(vec2(ratio, 1.0)));\n float n = clamp(float(blades), 3.0, 12.0);\n float sector = 2.0 * 3.141592653589793 / n;\n float turn = radians(rotation) * progress;\n \n float r = mix(-AA, 1.0 + AA, progress);\n float dist = -1e3;\n float seam = 0.0;\n for (int i = 0; i < 12; i++) {\n if (float(i) < n) {\n float angle = turn + float(i) * sector;\n float d = dot(q, vec2(cos(angle), sin(angle))) - r;\n float next = dot(q, vec2(cos(angle + sector), sin(angle + sector))) - r;\n dist = max(dist, d);\n \n float s = 1.0 - smoothstep(0.0, 0.12, -d);\n seam = max(seam, (1.0 - smoothstep(0.0, AA, d)) * s * s * smoothstep(0.0, AA, next));\n }\n }\n \n float rim = 1.0 - smoothstep(0.0, 0.08, dist);\n float shade = shadow * max(rim * rim, seam) * smoothstep(0.0, 0.1, progress);\n vec4 from = getFromColor(uv);\n from.rgb *= 1.0 - shade;\n return mix(from, getToColor(uv), 1.0 - smoothstep(0.0, AA, dist));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ArrowWipe":"// ArrowWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ArrowWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A notched arrowhead window onto the incoming image flies in from the edge behind it (or appears at the center), then swells until it fills the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float notch; \n\nuniform float width; \n\nuniform int count; \n\nuniform int origin; \n\nuniform float smoothness; \n\nfloat arrow(vec2 q, float tip, float back, vec2 tipN, vec2 notchN) {\n float front = dot(vec2(q.x - tip, q.y), tipN);\n float rear = dot(vec2(back - q.x, -q.y), notchN);\n return max(front, rear);\n}\n\nvec4 transition(vec2 uv) {\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n vec2 across = vec2(-dir.y, dir.x);\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n vec2 q = vec2(dot(p, dir), abs(dot(p, across)));\n\n float s = max(smoothness, 0.001);\n float n = clamp(notch, 0.0, 0.9);\n float h = radians(0.5 * clamp(width, 20.0, 160.0));\n float cot = cos(h) / sin(h);\n \n vec2 tipN = vec2(sin(h), cos(h));\n float notchLen = length(vec2(1.0, n * cot));\n vec2 notchN = vec2(1.0, n * cot) / notchLen;\n \n float tipPad = s / sin(h);\n\n \n vec2 c1 = vec2(0.5 * ratio, 0.5);\n vec2 c2 = vec2(0.5 * ratio, -0.5);\n vec2 k1 = vec2(abs(dot(c1, dir)), abs(dot(c1, across)));\n vec2 k2 = vec2(abs(dot(c2, dir)), abs(dot(c2, across)));\n \n float e = max(k1.x, k2.x);\n float r = 0.5 / max(abs(dir.x) / ratio, abs(dir.y));\n \n \n float tipMin = max(k1.x + k1.y * cot, k2.x + k2.y * cot) + tipPad;\n float notchMax = min(min(n * cot * k1.y - k1.x, n * cot * k2.y - k2.x), -r) - s * notchLen;\n\n \n \n float body = 0.5 * (1.0 - n);\n \n float cover = max(tipMin, -notchMax) / body;\n\n float t = progress;\n float o; \n float l; \n if ((origin != 0)) {\n o = 0.0;\n l = cover * t * (0.4 + 0.6 * t);\n } else {\n \n float l0 = 0.92 * min(1.0, ratio) / max(1.0, 2.0 * tan(h));\n \n float o0 = -e - 2.0 * tipPad - body * l0;\n \n float u = 1.0 - clamp(t / 0.65, 0.0, 1.0);\n float fly = 1.0 - u * u * u;\n \n float grow = clamp((t - 0.3) / 0.7, 0.0, 1.0);\n o = mix(o0, 0.0, fly);\n l = mix(l0, cover, grow * grow * (2.0 - grow));\n }\n\n \n float gap = (1.0 - n) * 1.35;\n float d = arrow(q, o + body * l, o - body * l, tipN, notchN);\n for (int i = 1; i < 3; i++) {\n if (i < count) {\n float back = o - float(i) * gap * l;\n d = min(d, arrow(q, back + body * l, back - body * l, tipN, notchN));\n }\n }\n \n float m = 1.0 - smoothstep(-s, s, d + 2.0 * s * (1.0 - t));\n\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Ascii":"// Ascii — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Ascii.glsl\n// Author: gre\n// License: MIT\n// Description: The image turns into text-mode characters, denser where it is brighter, the characters scramble into those of the incoming image, then resolve back into it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float cellSize; \n\nuniform int colored; \n\nuniform vec4 ink; \n\nuniform vec4 background; \n\nconst float ASPECT = 0.6;\n\nconst float STROKE = 0.05;\n\nfloat hash12(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat segment(vec2 q, vec2 a, vec2 b) {\n vec2 pa = q - a;\n vec2 ba = b - a;\n return length(pa - ba * clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0));\n}\n\nfloat glyph(float g, vec2 q) {\n if (g < 0.5) return 1.0; \n if (g < 1.5) return length(q - vec2(0.0, -0.27)) - 0.035; \n if (g < 2.5) return min(length(q - vec2(0.0, -0.25)), length(q - vec2(0.0, 0.1))) - 0.035; \n if (g < 3.5) return segment(q, vec2(-0.17, 0.0), vec2(0.17, 0.0)) - STROKE; \n if (g < 4.5) { \n return min(segment(q, vec2(-0.18, 0.1), vec2(0.18, 0.1)), segment(q, vec2(-0.18, -0.1), vec2(0.18, -0.1))) - STROKE;\n }\n if (g < 5.5) { \n return min(segment(q, vec2(-0.19, 0.0), vec2(0.19, 0.0)), segment(q, vec2(0.0, -0.19), vec2(0.0, 0.19))) - STROKE;\n }\n if (g < 6.5) { \n float d = segment(q, vec2(0.0, -0.2), vec2(0.0, 0.2));\n d = min(d, segment(q, vec2(-0.18, -0.11), vec2(0.18, 0.11)));\n d = min(d, segment(q, vec2(-0.18, 0.11), vec2(0.18, -0.11)));\n return d - STROKE;\n }\n if (g < 7.5) { \n float d = min(segment(q, vec2(-0.06, -0.3), vec2(-0.1, 0.3)), segment(q, vec2(0.12, -0.3), vec2(0.08, 0.3)));\n d = min(d, min(segment(q, vec2(-0.24, 0.11), vec2(0.24, 0.11)), segment(q, vec2(-0.24, -0.11), vec2(0.24, -0.11))));\n return d - STROKE;\n }\n if (g < 8.5) { \n float d = segment(q, vec2(-0.2, -0.3), vec2(0.2, 0.3));\n d = min(d, abs(length(q - vec2(-0.13, 0.19)) - 0.08));\n d = min(d, abs(length(q - vec2(0.13, -0.19)) - 0.08));\n return d - STROKE;\n }\n \n float d = abs(length(q) - 0.25);\n d = min(d, abs(length(q - vec2(-0.02, 0.0)) - 0.1));\n d = min(d, segment(q, vec2(0.08, 0.1), vec2(0.08, -0.12)));\n return d - 0.8 * STROKE;\n}\n\nfloat density(vec4 c) {\n return floor(pow(clamp(dot(c.rgb, vec3(0.299, 0.587, 0.114)) * c.a, 0.0, 1.0), 0.75) * 9.99);\n}\n\nvec4 cellColor(vec2 center, vec2 dims, bool incoming) {\n vec4 c = vec4(0.0);\n for (int i = 0; i < 4; i++) {\n vec2 o = (vec2(mod(float(i), 2.0), floor(float(i) / 2.0)) - 0.5) * 0.5 * dims;\n vec2 st = clamp((center + o) / vec2(ratio, 1.0) + 0.5, 0.0, 1.0);\n c += incoming ? getToColor(st) : getFromColor(st);\n }\n return c * 0.25;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n float h = cellSize;\n vec2 fp = (uv - 0.5) * vec2(ratio, 1.0);\n vec2 dims = vec2(ASPECT * h, h);\n vec2 cell = floor(fp / dims);\n vec2 center = (cell + 0.5) * dims;\n vec2 q = (fp - center) / h;\n\n \n \n float r = hash12(cell + 100.0);\n float at = 0.4 + 0.2 * r;\n bool incoming = p > at;\n vec4 c = cellColor(center, dims, incoming);\n float g = density(c);\n float scramble = 1.0 - smoothstep(0.02, 0.045, abs(p - at));\n if (hash12(cell + floor(p * 40.0) * vec2(17.0, 31.0)) < scramble) {\n g = 1.0 + floor(9.0 * hash12(cell * 1.7 + floor(p * 40.0) * vec2(5.0, 11.0)));\n }\n\n float cover = 1.0 - smoothstep(-0.02, 0.02, glyph(g, q));\n vec3 tint = (colored != 0) ? mix(c.rgb, c.rgb / max(max(c.r, max(c.g, c.b)), 0.05), 0.7) : ink.rgb;\n float alpha = (colored != 0) ? c.a : ink.a * c.a;\n \n \n vec3 behind = (colored != 0) ? mix(background.rgb, c.rgb, 0.3) : background.rgb;\n vec4 back = vec4(behind, background.a * c.a);\n vec4 text = mix(back, vec4(clamp(tint, 0.0, 1.0), alpha), cover);\n\n \n \n float into = 0.05 + 0.22 * hash12(cell + 200.0);\n float outof = 0.95 - 0.22 * hash12(cell + 300.0);\n float show = smoothstep(into, into + 0.08, p) * (1.0 - smoothstep(outof - 0.08, outof, p));\n vec4 image = p < 0.5 ? getFromColor(uv) : getToColor(uv);\n return mix(image, text, show);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BlockCover":"// BlockCover — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BlockCover.glsl\n// Author: gre\n// License: MIT\n// Description: Blocks of a solid color pop in at random over the outgoing image until they cover the frame, then pop out in another random order to show the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int blocks; \n\nuniform vec4 color; \n\nuniform float pop; \n\nuniform float smoothness; \n\nconst float duration = 0.14; \nconst float cut = 0.45; \nconst float hold = 0.02;\n\nfloat hash (vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat backOut (float t, float c) {\n float u = t - 1.0;\n return 1.0 + (c + 1.0) * u * u * u + c * u * u;\n}\n\nvec2 timing (vec2 cell) {\n return vec2(\n (cut - hold - duration) * hash(cell + 0.5),\n cut + hold + (1.0 - cut - hold - duration) * hash(cell + 71.7));\n}\n\nfloat blockScale (vec2 cell, float c) {\n vec2 t = timing(cell);\n float a = clamp((progress - t.x) / duration, 0.0, 1.0);\n float b = clamp((progress - t.y) / duration, 0.0, 1.0);\n \n return b > 0.0 ? (1.0 - b) * (1.0 - b) : backOut(a, c);\n}\n\nfloat coverage (vec2 q, vec2 cell, float s, float sm) {\n \n float h = s * (0.5 + sm);\n vec2 d = abs(q - cell - 0.5);\n return s > 0.0 ? 1.0 - smoothstep(h - sm, h, max(d.x, d.y)) : 0.0;\n}\n\nvec4 transition (vec2 uv) {\n float nLong = max(float(blocks), 1.0);\n vec2 n = ratio >= 1.0\n ? vec2(nLong, max(1.0, floor(nLong / ratio + 0.5)))\n : vec2(max(1.0, floor(nLong * ratio + 0.5)), nLong);\n vec2 q = uv * n;\n vec2 cell = floor(q);\n float sm = max(smoothness, 0.001);\n float c = 2.0 * clamp(pop, 0.0, 1.0);\n float s = blockScale(cell, c);\n if (s >= 1.0) return color;\n float cover = coverage(q, cell, s, sm);\n \n float u = -2.0 * c / (3.0 * (c + 1.0));\n float reach = backOut(1.0 + u, c) * (0.5 + sm);\n vec2 o = abs(q - cell - 0.5);\n if (max(o.x, o.y) > 1.0 - reach) {\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n vec2 nb = cell + vec2(float(i), float(j));\n vec2 inside = step(vec2(0.0), nb) * step(nb, n - 1.0);\n if (inside.x * inside.y > 0.0 && (i != 0 || j != 0)) {\n cover = max(cover, coverage(q, nb, blockScale(nb, c), sm));\n }\n }\n }\n }\n \n vec2 t = timing(cell);\n vec4 under = progress < 0.5 * (t.x + duration + t.y) ? getFromColor(uv) : getToColor(uv);\n return mix(under, color, cover);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BlockDissolve":"// BlockDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BlockDissolve.glsl\n// Author: nwoeanhinnogaehr\n// License: MIT\n// Description: The incoming image appears in small random blocks\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float blocksize; \n\nfloat rand(vec2 co) {\n return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvec4 transition(vec2 uv) {\n return mix(getFromColor(uv), getToColor(uv), step(rand(floor(uv / blocksize)), progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BlockSlide":"// BlockSlide — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BlockSlide.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is cut into a grid of blocks that slide out one after another in a staggered cascade, some of them shrinking as they go, while the blocks of the incoming image slide in behind them to take their place\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 grid; \n\nuniform vec2 direction; \n\nuniform float stagger; \n\nuniform float zoom; \n\nuniform vec4 background; \n\nconst int MAX_BLOCKS = 40;\n\nfloat hash(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n bool vertical = abs(direction.y) > abs(direction.x);\n bool backward = vertical ? direction.y < 0.0 : direction.x < 0.0;\n vec2 g = max(vec2(grid), 1.0);\n \n float a = vertical ? uv.y : uv.x;\n float b = vertical ? uv.x : uv.y;\n if (backward) a = 1.0 - a;\n float n = min(vertical ? g.y : g.x, float(MAX_BLOCKS));\n float strips = vertical ? g.x : g.y;\n \n float r = min(floor(b * strips), strips - 1.0);\n \n float rowOrder = strips > 1.0 ? (vertical ? r : strips - 1.0 - r) / (strips - 1.0) : 0.0;\n float st = clamp(stagger, 0.0, 0.95);\n float z = clamp(zoom, 0.0, 0.9);\n \n float an = a * n;\n float bn = b * strips - r;\n\n \n \n \n float rear = clamp((progress - st * mix(rowOrder, 1.0, 0.2)) / (1.0 - st), 0.0, 1.0);\n rear = rear * rear * (3.0 - 2.0 * rear);\n\n for (int k = 0; k < MAX_BLOCKS; k++) {\n float i = float(k);\n if (i >= n) break;\n \n float order = mix(rowOrder, n > 1.0 ? (n - 1.0 - i) / (n - 1.0) : 0.0, 0.2);\n float p = clamp((progress - st * order) / (1.0 - st), 0.0, 1.0);\n p = p * p * (3.0 - 2.0 * p);\n float pin = max(0.0, 1.0 - (1.0 - rear) * (1.0 + (n - 1.0 - i) / n));\n \n float zi = hash(vec2(i, r) + 3.7) < 0.5 ? z : 0.0;\n \n \n \n float sFrom = 1.0 - zi * p * p;\n float sTo = 1.0 - zi * (1.0 - pin) * (1.0 - pin);\n vec4 l = vec4(\n (an - i - p * n - 0.5 * (1.0 - sFrom)) / sFrom,\n (bn - 0.5 * (1.0 - sFrom)) / sFrom,\n (an - i - (pin - 1.0) * n - 0.5 * (1.0 - sTo)) / sTo,\n (bn - 0.5 * (1.0 - sTo)) / sTo);\n bool inFrom = all(greaterThanEqual(l.xy, vec2(0.0))) && all(lessThan(l.xy, vec2(1.0)));\n bool inTo = all(greaterThanEqual(l.zw, vec2(0.0))) && all(lessThan(l.zw, vec2(1.0)));\n if (inFrom || inTo) {\n \n vec2 q = (vec2(i, r) + (inTo ? l.zw : l.xy)) / vec2(n, strips);\n if (backward) q.x = 1.0 - q.x;\n q = vertical ? q.yx : q;\n return inTo ? getToColor(q) : getFromColor(q);\n }\n }\n return background;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BloomDissolve":"// BloomDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BloomDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The highlights of the outgoing image blow out into a soft, wide glow that floods the frame; under it the incoming image takes over, then the glow subsides back into its highlights while the image stays sharp\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float spread; \n\nuniform float threshold; \n\nuniform float intensity; \n\nuniform vec3 tint; \n\nconst int PAIRS = 10;\nconst float GOLDEN_ANGLE = 2.399963;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 image(vec2 st, float m) {\n if (m <= 0.0) {\n vec4 c = getFromColor(st);\n return vec4(c.rgb * c.a, c.a);\n }\n if (m >= 1.0) {\n vec4 c = getToColor(st);\n return vec4(c.rgb * c.a, c.a);\n }\n vec4 a = getFromColor(st);\n vec4 b = getToColor(st);\n return mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n}\n\nvec3 glow(vec4 c, float knee) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n return c.rgb * smoothstep(knee, knee + max(0.3 * (1.0 - knee), 1e-3), lum);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float amount = 4.0 * p * (1.0 - p);\n float peak = amount * amount;\n \n float flood = peak * peak * peak;\n \n float m = smoothstep(0.44, 0.56, p);\n if (amount <= 0.0) return m < 0.5 ? getFromColor(uv) : getToColor(uv);\n\n \n vec4 c = image(uv, m);\n if (c.a <= 0.0) return vec4(0.0);\n c.rgb /= c.a;\n\n \n float knee = threshold * (1.0 - 0.3 * peak) * (1.0 - flood);\n float radius = spread * amount;\n \n \n vec2 cell = floor(uv * vec2(ratio, 1.0) * 997.0);\n float spin = 6.2831853 * hash12(cell);\n float shift = hash12(cell + 71.0);\n\n \n \n vec3 bloom = vec3(0.0);\n vec4 soft = vec4(0.0);\n float total = 0.0;\n for (int i = 0; i < PAIRS; i++) {\n float s = (float(i) + shift) / float(PAIRS);\n float r = s * s;\n float a = float(i) * GOLDEN_ANGLE + spin;\n vec2 offset = radius * r * vec2(cos(a) / ratio, sin(a));\n vec4 i0 = image(mirror(uv + offset), m);\n vec4 i1 = image(mirror(uv - offset), m);\n vec3 l = glow(i0, knee) + glow(i1, knee);\n \n float w = 1.0 - 0.75 * s;\n \n bloom += w * mix(vec3(1.0), tint, smoothstep(0.0, 0.5, r)) * l;\n total += w;\n \n float sw = (1.0 - s) * (1.0 - s);\n soft += sw * (i0 + i1);\n }\n bloom /= 2.0 * total;\n \n vec3 blurred = soft.a > 0.0 ? soft.rgb / soft.a : c.rgb;\n vec3 base = mix(c.rgb, blurred, 0.7 * flood);\n bloom *= intensity * peak * (1.0 + 2.0 * flood);\n \n bloom = 0.92 * (1.0 - exp(-bloom));\n\n \n base = min(base * (1.0 + 0.25 * peak), 1.0);\n return vec4(base + bloom - base * bloom, c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BokehDissolve":"// BokehDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BokehDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The image falls out of focus like a camera lens, its highlights swelling into large bright bokeh discs, and the incoming image sharpens back out of its own bokeh\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float radius; \n\nuniform int blades; \n\nuniform float threshold; \n\nuniform float intensity; \n\nconst int TAPS = 16;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat hash12(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat highlight(vec4 c, float t) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n \n if (t >= 1.0) return 0.0;\n float h = smoothstep(t, 1.0, lum);\n return h * h * c.a;\n}\n\nvec4 transition(vec2 uv) {\n \n float t = 1.0 - abs(2.0 * progress - 1.0);\n float k = t * t * (3.0 - 2.0 * t);\n \n float w = smoothstep(0.35, 0.65, progress);\n float r = radius * k;\n \n float boost = 12.0 * intensity * k;\n\n \n float n = blades >= 3 ? float(blades) : 0.0;\n float sector = n > 0.0 ? 2.0 * 3.141592653589793 / n : 1.0;\n float apothem = cos(0.5 * sector);\n\n \n vec2 cell = floor(uv * vec2(ratio, 1.0) * 997.0);\n float spin = 2.0 * 3.141592653589793 * hash12(cell);\n float jitter = hash12(cell + 17.0);\n\n \n bool useFrom = w < 1.0;\n bool useTo = w > 0.0;\n \n \n vec4 s0 = vec4(0.0);\n vec4 s1 = vec4(0.0);\n float t0 = 0.0;\n float t1 = 0.0;\n vec3 l0 = vec3(0.0);\n vec3 l1 = vec3(0.0);\n if (useFrom) {\n vec4 c = getFromColor(uv);\n float h = highlight(c, threshold);\n float wt = 1.0 + boost * h;\n s0 = wt * vec4(c.rgb * c.a, c.a);\n t0 = wt;\n l0 = h * c.rgb;\n }\n if (useTo) {\n vec4 c = getToColor(uv);\n float h = highlight(c, threshold);\n float wt = 1.0 + boost * h;\n s1 = wt * vec4(c.rgb * c.a, c.a);\n t1 = wt;\n l1 = h * c.rgb;\n }\n for (int i = 0; i < TAPS; i++) {\n float fi = float(i);\n float a = fi * 2.39996323 + spin;\n float d = sqrt((fi + jitter) / float(TAPS));\n if (n > 0.0) {\n \n float s = mod(a, sector) - 0.5 * sector;\n d *= apothem / cos(s);\n }\n vec2 st = mirror(uv + r * d * vec2(cos(a) / ratio, sin(a)));\n if (useFrom) {\n vec4 c = getFromColor(st);\n float h = highlight(c, threshold);\n float wt = 1.0 + boost * h;\n s0 += wt * vec4(c.rgb * c.a, c.a);\n t0 += wt;\n l0 += h * c.rgb;\n }\n if (useTo) {\n vec4 c = getToColor(st);\n float h = highlight(c, threshold);\n float wt = 1.0 + boost * h;\n s1 += wt * vec4(c.rgb * c.a, c.a);\n t1 += wt;\n l1 += h * c.rgb;\n }\n }\n vec4 b = mix(useFrom ? s0 / t0 : vec4(0.0), useTo ? s1 / t1 : vec4(0.0), w);\n if (b.a <= 0.0) {\n return vec4(0.0);\n }\n vec3 rgb = b.rgb / b.a;\n \n vec3 light = mix(l0, l1, w) * (intensity * k * 4.0 / float(TAPS + 1));\n rgb = 1.0 - (1.0 - clamp(rgb, 0.0, 1.0)) * exp(-light);\n return vec4(rgb, b.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BookFlip":"// BookFlip — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BookFlip.glsl\n// Author: hong\n// License: MIT\n// Description: The outgoing image turns like a book page from right to left, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat nonZero(float x) {\n return abs(x) < 1e-4 ? (x < 0.0 ? -1e-4 : 1e-4) : x;\n}\n\nvec2 skewRight(vec2 p) {\n float skewX = (p.x - progress)/nonZero(0.5 - progress) * 0.5;\n float skewY = (p.y - 0.5)/(0.5 + progress * (p.x - 0.5) / 0.5)* 0.5 + 0.5;\n return vec2(skewX, skewY);\n}\n\nvec2 skewLeft(vec2 p) {\n float skewX = (p.x - 0.5)/nonZero(progress - 0.5) * 0.5 + 0.5;\n float skewY = (p.y - 0.5) / (0.5 + (1.0 - progress ) * (0.5 - p.x) / 0.5) * 0.5 + 0.5;\n return vec2(skewX, skewY);\n}\n\nvec4 addShade() {\n float shadeVal = max(0.7, abs(progress - 0.5) * 2.0);\n return vec4(vec3(shadeVal ), 1.0);\n}\n\nvec4 transition (vec2 p) {\n float pr = step(1.0 - progress, p.x);\n\n if (p.x < 0.5) {\n return mix(getFromColor(p), getToColor(skewLeft(p)) * addShade(), pr);\n } else {\n return mix(getFromColor(skewRight(p)) * addShade(), getToColor(p), pr);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Bounce":"// Bounce — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Bounce.glsl\n// Author: Adrian Purser\n// License: MIT\n// Description: The outgoing image drops out of the frame with a few bounces, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 shadow_colour; \n\nuniform float shadow_height; \n\nuniform float bounces; \n\nconst float PI = 3.14159265358;\n\nvec4 transition (vec2 uv) {\n float time = progress;\n float stime = sin(time * PI / 2.);\n float phase = time * PI * bounces;\n float y = (abs(cos(phase))) * (1.0 - stime);\n float d = uv.y - y;\n vec4 to = getToColor(uv);\n return mix(\n mix(\n to,\n vec4(shadow_colour.rgb, 1.0), \n step(d, shadow_height) * (1. - mix(\n ((d / shadow_height) * shadow_colour.a) + (1.0 - shadow_colour.a),\n 1.0,\n smoothstep(0.95, 1., progress) \n )) * to.a \n ),\n getFromColor(vec2(uv.x, uv.y + (1.0 - y))),\n step(d, 0.0)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BowTie":"// BowTie — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BowTie.glsl\n// Author: KMojek\n// License: MIT\n// Description: A bow-tie wipe with an adjustable shape that can run in reverse\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float adjust; \n\nuniform int reverse; \n\nfloat check(vec2 p1, vec2 p2, vec2 p3)\n{\n return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);\n}\n\nbool pointInTriangle(vec2 pt, vec2 p1, vec2 p2, vec2 p3)\n{\n\n bool b1 = check(pt, p1, p2) < 0.0;\n bool b2 = check(pt, p2, p3) < 0.0;\n bool b3 = check(pt, p3, p1) < 0.0;\n return b1 == b2 && b2 == b3;\n}\n\nconst float height = 0.5;\n\nvec4 transition_firstHalf( vec2 uv, float prog )\n{\n if ( uv.y < 0.5 )\n {\n vec2 botLeft = vec2( -0., prog-height );\n vec2 botRight = vec2( 1., prog-height );\n vec2 tip = vec2( adjust, prog );\n if ( pointInTriangle( uv, botLeft, botRight, tip ) )\n return getToColor(uv);\n }\n else\n {\n vec2 topLeft = vec2( -0., 1.-prog+height );\n vec2 topRight = vec2( 1., 1.-prog+height );\n vec2 tip = vec2( adjust, 1.-prog );\n if ( pointInTriangle( uv, topLeft, topRight, tip ) )\n return getToColor( uv );\n }\n return getFromColor( uv );\n}\n\nvec4 transition_secondHalf( vec2 uv, float prog )\n{\n if ( uv.x > adjust )\n {\n vec2 top = vec2( prog + height, 1. );\n vec2 bot = vec2( prog + height, -0. );\n vec2 tip = vec2( mix( adjust, 1.0, 2.0 * (prog - 0.5) ), 0.5 );\n if ( pointInTriangle( uv, top, bot, tip) )\n return getFromColor( uv );\n }\n else\n {\n vec2 top = vec2( 1.0-prog - height, 1. );\n vec2 bot = vec2( 1.0-prog - height, -0. );\n vec2 tip = vec2( mix( adjust, 0.0, 2.0 * (prog - 0.5) ), 0.5 );\n if ( pointInTriangle( uv, top, bot, tip) )\n return getFromColor( uv );\n }\n return getToColor( uv );\n}\n\nvec4 transition (vec2 uv) {\n if ( (reverse != 0) )\n return ( progress < 0.5 ) ? transition_secondHalf( uv, 1.-progress ) : transition_firstHalf( uv, 1.-progress );\n else\n return ( progress < 0.5 ) ? transition_firstHalf( uv, progress ) : transition_secondHalf( uv, progress );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BowTieHorizontal":"// BowTieHorizontal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BowTieHorizontal.glsl\n// Author: huynx\n// License: MIT\n// Description: Two triangles grow from the left and right edges into a bow tie that reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst vec2 bottom_left = vec2(0.0, 1.0);\nconst vec2 bottom_right = vec2(1.0, 1.0);\nconst vec2 top_left = vec2(0.0, 0.0);\nconst vec2 top_right = vec2(1.0, 0.0);\nconst vec2 center = vec2(0.5, 0.5);\n\nfloat check(vec2 p1, vec2 p2, vec2 p3)\n{\n return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);\n}\n\nbool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2 p3)\n{\n bool b1, b2, b3;\n b1 = check(pt, p1, p2) < 0.0;\n b2 = check(pt, p2, p3) < 0.0;\n b3 = check(pt, p3, p1) < 0.0;\n return ((b1 == b2) && (b2 == b3));\n}\n\nbool in_left_triangle(vec2 p){\n vec2 vertex1, vertex2, vertex3;\n vertex1 = vec2(progress, 0.5);\n vertex2 = vec2(0.0, 0.5-progress);\n vertex3 = vec2(0.0, 0.5+progress);\n if (PointInTriangle(p, vertex1, vertex2, vertex3))\n {\n return true;\n }\n return false;\n}\n\nbool in_right_triangle(vec2 p){\n vec2 vertex1, vertex2, vertex3;\n vertex1 = vec2(1.0-progress, 0.5);\n vertex2 = vec2(1.0, 0.5-progress);\n vertex3 = vec2(1.0, 0.5+progress);\n if (PointInTriangle(p, vertex1, vertex2, vertex3))\n {\n return true;\n }\n return false;\n}\n\nfloat blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt)\n{\n vec2 lineDir = bot1 - top;\n vec2 perpDir = vec2(lineDir.y, -lineDir.x);\n vec2 dirToPt1 = bot1 - testPt;\n float dist1 = abs(dot(normalize(perpDir), dirToPt1));\n \n lineDir = bot2 - top;\n perpDir = vec2(lineDir.y, -lineDir.x);\n dirToPt1 = bot2 - testPt;\n float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1);\n \n if (min_dist < 0.005) {\n return min_dist / 0.005;\n }\n else {\n return 1.0;\n };\n}\n\nvec4 transition (vec2 uv) {\n if (in_left_triangle(uv))\n {\n if (progress < 0.1)\n {\n return getFromColor(uv);\n }\n if (uv.x < 0.5)\n {\n vec2 vertex1 = vec2(progress, 0.5);\n vec2 vertex2 = vec2(0.0, 0.5-progress);\n vec2 vertex3 = vec2(0.0, 0.5+progress);\n return mix(\n getFromColor(uv),\n getToColor(uv),\n blur_edge(vertex2, vertex3, vertex1, uv)\n );\n }\n else\n {\n if (progress > 0.0)\n {\n return getToColor(uv);\n }\n else\n {\n return getFromColor(uv);\n }\n } \n }\n else if (in_right_triangle(uv))\n {\n if (uv.x >= 0.5)\n {\n vec2 vertex1 = vec2(1.0-progress, 0.5);\n vec2 vertex2 = vec2(1.0, 0.5-progress);\n vec2 vertex3 = vec2(1.0, 0.5+progress);\n return mix(\n getFromColor(uv),\n getToColor(uv),\n blur_edge(vertex2, vertex3, vertex1, uv)\n ); \n }\n else\n {\n return getFromColor(uv);\n }\n }\n else {\n return getFromColor(uv);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BowTieVertical":"// BowTieVertical — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BowTieVertical.glsl\n// Author: huynx\n// License: MIT\n// Description: Two triangles grow from the top and bottom edges into a bow tie that reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat check(vec2 p1, vec2 p2, vec2 p3)\n{\n return (p1.x - p3.x) * (p2.y - p3.y) - (p2.x - p3.x) * (p1.y - p3.y);\n}\n\nbool PointInTriangle (vec2 pt, vec2 p1, vec2 p2, vec2 p3)\n{\n bool b1, b2, b3;\n b1 = check(pt, p1, p2) < 0.0;\n b2 = check(pt, p2, p3) < 0.0;\n b3 = check(pt, p3, p1) < 0.0;\n return ((b1 == b2) && (b2 == b3));\n}\n\nbool in_top_triangle(vec2 p){\n vec2 vertex1, vertex2, vertex3;\n vertex1 = vec2(0.5, progress);\n vertex2 = vec2(0.5-progress, 0.0);\n vertex3 = vec2(0.5+progress, 0.0);\n if (PointInTriangle(p, vertex1, vertex2, vertex3))\n {\n return true;\n }\n return false;\n}\n\nbool in_bottom_triangle(vec2 p){\n vec2 vertex1, vertex2, vertex3;\n vertex1 = vec2(0.5, 1.0 - progress);\n vertex2 = vec2(0.5-progress, 1.0);\n vertex3 = vec2(0.5+progress, 1.0);\n if (PointInTriangle(p, vertex1, vertex2, vertex3))\n {\n return true;\n }\n return false;\n}\n\nfloat blur_edge(vec2 bot1, vec2 bot2, vec2 top, vec2 testPt)\n{\n vec2 lineDir = bot1 - top;\n vec2 perpDir = vec2(lineDir.y, -lineDir.x);\n vec2 dirToPt1 = bot1 - testPt;\n float dist1 = abs(dot(normalize(perpDir), dirToPt1));\n \n lineDir = bot2 - top;\n perpDir = vec2(lineDir.y, -lineDir.x);\n dirToPt1 = bot2 - testPt;\n float min_dist = min(abs(dot(normalize(perpDir), dirToPt1)), dist1);\n \n if (min_dist < 0.005) {\n return min_dist / 0.005;\n }\n else {\n return 1.0;\n };\n}\n\nvec4 transition (vec2 uv) {\n if (in_top_triangle(uv))\n {\n if (progress < 0.1)\n {\n return getFromColor(uv);\n }\n if (uv.y < 0.5)\n {\n vec2 vertex1 = vec2(0.5, progress);\n vec2 vertex2 = vec2(0.5-progress, 0.0);\n vec2 vertex3 = vec2(0.5+progress, 0.0);\n return mix(\n getFromColor(uv),\n getToColor(uv),\n blur_edge(vertex2, vertex3, vertex1, uv)\n );\n }\n else\n {\n if (progress > 0.0)\n {\n return getToColor(uv);\n }\n else\n {\n return getFromColor(uv);\n }\n } \n }\n else if (in_bottom_triangle(uv))\n {\n if (uv.y >= 0.5)\n {\n vec2 vertex1 = vec2(0.5, 1.0-progress);\n vec2 vertex2 = vec2(0.5-progress, 1.0);\n vec2 vertex3 = vec2(0.5+progress, 1.0);\n return mix(\n getFromColor(uv),\n getToColor(uv),\n blur_edge(vertex2, vertex3, vertex1, uv)\n ); \n }\n else\n {\n return getFromColor(uv);\n }\n }\n else {\n return getFromColor(uv);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Box":"// Box — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Box.glsl\n// Author: lql\n// License: MIT\n// Description: The outgoing image shrinks into a box, toward the center or a corner, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int rectIn; \n\nuniform int location; \n\nvec4 transition(vec2 uv) {\n float p = rectIn == 1 ? 1.0 - progress : progress;\n float x1, y1, x2, y2;\n\n \n if (location == 0) {\n x1 = y1 = 0.5 * (1.0 - p);\n x2 = y2 = 1.0 - x1;\n } else {\n \n x1 = (location == 1 || location == 2) ? 0.0 : 1.0 - p;\n y1 = (location == 1 || location == 3) ? 1.0 - p : 0.0;\n x2 = (location == 1 || location == 2) ? p : 1.0;\n y2 = (location == 1 || location == 3) ? 1.0 : p;\n }\n\n \n float in_rect = step(x1, uv.x) * step(uv.x, x2) * step(y1, uv.y) * step(uv.y, y2);\n in_rect = rectIn == 1 ? 1.0 - in_rect : in_rect;\n\n \n return mix(getFromColor(uv), getToColor(uv), in_rect);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BrushWipe":"// BrushWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BrushWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A few broad brush strokes sweep across the frame in turn, back and forth, painting in the incoming image with streaky bristle edges and dry, ragged ends\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strokes; \n\nuniform float angle; \n\nuniform float roughness; \n\nuniform float waviness; \n\nconst float PI = 3.141592653589793;\n\nfloat hash (vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat vnoise (vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nfloat bristles (float t, float u, float seed) {\n return 0.6 * vnoise(vec2(t * 26.0 + seed, u * 1.3 + seed)) + 0.4 * vnoise(vec2(t * 8.0 - seed, u * 0.7));\n}\n\nvec2 stroke (float k, float t, float u, float U, float n, float h) {\n float dir = mod(k, 2.0) < 0.5 ? 1.0 : -1.0;\n float x = u * dir;\n float dur = min(1.0, 1.8 / (n + 0.8));\n float start = n > 1.0 ? k * (1.0 - dur) / (n - 1.0) : 0.0;\n float s = clamp((progress - start) / dur, 0.0, 1.0);\n s = mix(s, s * s * (3.0 - 2.0 * s), 0.7);\n float r = roughness;\n float lag = (0.15 + 0.6 * r) * h; \n float dry = (0.1 + 0.9 * r) * h; \n \n float head = mix(-U, U + lag + 0.3 * h + 1.15 * dry + 0.01, s);\n float b = bristles(t, k * 3.7, k * 17.0);\n float front = head - lag * (1.0 - b) - 0.3 * h * t * t; \n float streak = bristles(t * 1.7, x * 2.0 / h, k * 5.0 + 9.0);\n float along = clamp(((front - x) / (dry + 0.001) - 0.1 - 0.8 * streak) * 6.0, 0.0, 1.0);\n float fringe = 0.1 + 0.7 * r;\n float e = (abs(t) - 1.0) / fringe; \n float reach = 0.5 + 0.5 * vnoise(vec2(x * 2.5 / h, k * 7.0 + (t > 0.0 ? 3.0 : 0.0))); \n float hair = clamp(bristles(t * 1.4, x * 3.0 / h, k * 11.0 + 3.0) * 2.0 - 0.5, 0.0, 1.0);\n float side = clamp((reach * hair - e) * 12.0 + 1.0, 0.0, 1.0);\n float cover = along * side;\n float wet = (1.0 - clamp((progress - start - dur) / 0.25, 0.0, 1.0)) * min(1.0, (1.0 - progress) * 6.0);\n return vec2(cover, cover * wet * (bristles(t * 2.0, x * 2.0 / h, k) - 0.5));\n}\n\nvec4 transition (vec2 uv) {\n float a = angle * PI / 180.0;\n float c = cos(a);\n float sn = sin(a);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float u = c * q.x + sn * q.y; \n float v = -sn * q.x + c * q.y; \n float U = 0.5 * (abs(c) * ratio + abs(sn));\n float V = 0.5 * (abs(sn) * ratio + abs(c));\n float n = max(1.0, floor(strokes + 0.5));\n float h = 2.0 * V / n; \n \n float A = 0.12 * waviness * h;\n float w = v + A * sin(u * 5.0 / U + v * 2.0 / h + 1.3) + 0.5 * A * sin(u * 11.0 / U - v * 3.0 / h);\n float y = (V + 1.5 * A - w) / (2.0 * V + 3.0 * A) * n; \n float hh = (2.0 * V + 3.0 * A) / n;\n float k = clamp(floor(y), 0.0, n - 1.0);\n float cover = 0.0;\n float shade = 0.0;\n for (int i = -1; i <= 1; i++) {\n float j = k + float(i);\n if (j >= 0.0 && j <= n - 1.0) {\n vec2 s = stroke(j, (y - j - 0.5) * 2.0, u, U, n, hh);\n cover = max(cover, s.x);\n shade = mix(shade, s.y, s.x); \n }\n }\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n to.rgb = min(to.rgb * (1.0 + 0.2 * shade), 1.0);\n return mix(from, to, cover);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","BurnThrough":"// BurnThrough — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BurnThrough.glsl\n// Author: liubailin2020@gmail.com\n// License: MIT\n// Description: The outgoing image burns away in noisy, glowing patches\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec3 burnColor; \n\nfloat random (in vec2 st) {\n return fract(sin(dot(st.xy,\n vec2(12.9898,78.233)))*\n 43758.5453123);\n}\n\nfloat noise (in vec2 st) {\n vec2 i = floor(st);\n vec2 f = fract(st);\n\n float a = random(i);\n float b = random(i + vec2(1.0, 0.0));\n float c = random(i + vec2(0.0, 1.0));\n float d = random(i + vec2(1.0, 1.0));\n\n vec2 u = f * f * (3.0 - 2.0 * f);\n\n return mix(a, b, u.x) +\n (c - a)* u.y * (1.0 - u.x) +\n (d - b) * u.x * u.y;\n}\n\nfloat fbm (in vec2 st) {\n float value = 0.0;\n float amplitude = .5;\n for (int i = 0; i < 4; i++) {\n value += amplitude * noise(st);\n st *= 2.;\n amplitude *= .5;\n }\n return value;\n}\n\nvec4 transition (vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n float n = fbm(uv * 4.);\n float l = smoothstep(progress, progress + 0.05, n);\n float edge = (1.0 - l) * l * 5.0;\n return mix(to, from, l) + vec4(burnColor, 0.0) * edge;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ButterflyWaveScrawler":"// ButterflyWaveScrawler — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ButterflyWaveScrawler.glsl\n// Author: mandubian\n// License: MIT\n// Description: Wavy, color-separated ripples scramble the outgoing image into the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float amplitude; \nuniform float waves; \nuniform float colorSeparation; \nconst float PI = 3.14159265358979323846264;\nfloat compute(vec2 p, float progress, vec2 center) {\nvec2 o = p*sin(progress * amplitude)-center;\n\nvec2 h = vec2(1., 0.);\n\nfloat theta = acos(dot(o, h)) * waves;\nfloat s = sin((2.*theta - PI) / 24.);\nfloat s2 = s * s;\nreturn (exp(cos(theta)) - 2.*cos(4.*theta) + s2 * s2 * s) / 10.;\n}\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n vec2 p = uv;\n float inv = 1. - progress;\n float disp = compute(p, progress, vec2(0.5, 0.5));\n vec4 texTo = getToColor(p + inv*disp);\n vec4 fromCenter = getFromColor(p + progress*disp);\n vec4 texFrom = vec4(\n getFromColor(p + progress*disp*(1.0 - colorSeparation)).r,\n fromCenter.g,\n getFromColor(p + progress*disp*(1.0 + colorSeparation)).b,\n fromCenter.a);\n return texTo*progress + texFrom*inv;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CameraShake":"// CameraShake — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CameraShake.glsl\n// Author: gre\n// License: MIT\n// Description: The camera jolts violently in random directions, with motion blur and color fringes along each jolt; the cut happens at the peak of the shake, which then settles on the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nuniform float jolts; \n\nuniform float blur; \n\nuniform float split; \n\nconst int TAPS = 10;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec3 jolt(float k) {\n \n float a = 2.4 * k + 1.2 * hash12(vec2(k, 11.0));\n float m = 0.55 + 0.45 * hash12(vec2(k, 23.0));\n return vec3(m * cos(a), m * sin(a), 2.0 * hash12(vec2(k, 37.0)) - 1.0);\n}\n\nfloat envelope(float t) {\n float h = clamp(1.6 * (1.0 - abs(2.0 * t - 1.0)), 0.0, 1.0);\n return h * h * (3.0 - 2.0 * h);\n}\n\nvec4 shot(vec2 uv, float t, bool incoming) {\n float env = envelope(t);\n \n float s = (t - 0.5) * jolts;\n float k = floor(s);\n float g = 1.0 - (s - k);\n float e = 1.0 - g * g * g; \n vec3 j = mix(jolt(k), jolt(k + 1.0), e) * env;\n float omax = 0.14 * strength * env;\n float rmax = 0.07 * strength * env;\n vec2 off = j.xy * omax;\n float roll = j.z * rmax;\n \n float zoom = (cos(rmax) + sin(rmax) * max(ratio, 1.0 / ratio)) / (1.0 - 2.0 * omax);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n q = mat2(cos(roll), sin(roll), -sin(roll), cos(roll)) * q / zoom;\n vec2 p = mirror(q / vec2(ratio, 1.0) + 0.5 + off);\n vec4 c = incoming ? getToColor(p) : getFromColor(p);\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 transition(vec2 uv) {\n \n float open = envelope(progress);\n float shutter = 0.8 * blur / jolts * open;\n float lag = 0.2 * split / jolts * open;\n \n vec2 sumR = vec2(0.0);\n vec2 sumG = vec2(0.0);\n vec2 sumB = vec2(0.0);\n float wsum = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float u = (float(i) + 0.5) / float(TAPS) - 0.5;\n float t = progress + u * shutter;\n \n float w = 1.0 - 1.4 * abs(u);\n \n bool incoming = t >= 0.5;\n \n vec4 r = shot(uv, t + lag, incoming);\n vec4 c = shot(uv, t, incoming);\n vec4 b = shot(uv, t - lag, incoming);\n sumR += w * r.ra;\n sumG += w * c.ga;\n sumB += w * b.ba;\n wsum += w;\n }\n float alpha = (sumR.y + sumG.y + sumB.y) / (3.0 * wsum);\n if (alpha <= 0.0) return vec4(0.0);\n vec3 color = vec3(\n sumR.x / max(sumR.y, 1e-5),\n sumG.x / max(sumG.y, 1e-5),\n sumB.x / max(sumB.y, 1e-5)\n );\n return vec4(color, alpha);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CardSwipe":"// CardSwipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CardSwipe.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is flicked off like the top card of a stack, swinging around a point below it as it flies out, while the incoming card behind it grows to fill the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float rotation; \n\nuniform float depth; \n\nuniform vec4 backColor; \n\nconst float RADIUS = 0.045; \nconst float AA = 0.002; \n\nfloat roundedBox(vec2 q, vec2 b, float r) {\n vec2 d = abs(q) - b + r;\n return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0) - r;\n}\n\nvec4 premultiply(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 transition(vec2 uv) {\n float dl = length(direction);\n vec2 d = dl > 1e-6 ? direction / dl : vec2(0.970143, 0.242536);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n vec2 b = vec2(0.5 * ratio, 0.5);\n float p = progress;\n\n \n \n float h = clamp((p - 0.2) / 0.8, 0.0, 1.0);\n float g = h * h * (3.0 - 2.0 * h);\n float k = 1.0 - g;\n float sc = 1.0 - depth * k;\n float rb = RADIUS * min(1.0, 12.0 * k);\n float db = roundedBox(q, b * sc, rb);\n float cb = clamp(0.5 - db / max(AA * min(1.0, 40.0 * k), 1e-6), 0.0, 1.0);\n vec4 tc = getToColor(clamp(0.5 + (uv - 0.5) / sc, 0.0, 1.0));\n \n tc.rgb *= 1.0 - 0.35 * k * k;\n \n vec4 col = mix(premultiply(backColor), premultiply(tc), cb);\n\n \n float t = clamp(p / 0.75, 0.0, 1.0);\n float lift = smoothstep(0.0, 0.15, p);\n float u = min(t / 0.7, 1.0);\n float swing = u * u * (3.0 - 2.0 * u);\n \n float a = (d.x < 0.0 ? 1.3 : -1.3) * rotation * swing;\n vec2 pivot = vec2(0.0, -1.1);\n \n float ca = cos(a), sa = sin(a);\n vec2 swung = pivot + mat2(ca, sa, -sa, ca) * -pivot;\n float far = 2.0 * length(b) + length(swung) + 0.3;\n vec2 shift = d * far * t * t * (0.4 + 0.6 * t);\n mat2 unrotate = mat2(ca, -sa, sa, ca);\n vec2 r = unrotate * (q - shift - pivot) + pivot;\n float rf = RADIUS * lift;\n\n \n float sh = 0.6 * lift * (1.0 - t);\n if (sh > 0.0) {\n vec2 rs = unrotate * (q - (0.03 * d + vec2(0.0, -0.03)) * lift - shift - pivot) + pivot;\n float ds = roundedBox(rs, b, rf);\n col.rgb *= 1.0 - sh * (1.0 - smoothstep(-0.05, 0.08, ds));\n }\n\n float df = roundedBox(r, b, rf);\n float cf = clamp(0.5 - df / max(AA * min(1.0, 40.0 * lift), 1e-6), 0.0, 1.0);\n vec4 fc = getFromColor(clamp(r / vec2(ratio, 1.0) + 0.5, 0.0, 1.0));\n col = mix(col, premultiply(fc), cf);\n return col.a > 0.0 ? vec4(col.rgb / col.a, col.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CellDissolve":"// CellDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CellDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: Irregular cells, like cracked mud or soap foam, switch to the incoming image one by one, with an optional bright border glowing along the cracks between them\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float cells; \n\nuniform float smoothness; \n\nuniform float border; \n\nuniform vec4 borderColor; \n\nuniform float seed; \n\nconst float AA = 0.0015;\n\nvec2 hash22(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.xx + p3.yz) * p3.zy);\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n if (progress <= 0.0) return a;\n if (progress >= 1.0) return b;\n\n float n = max(cells, 1.0);\n \n vec2 p = uv * vec2(ratio, 1.0) * n;\n vec2 i = floor(p);\n vec2 f = p - i;\n vec2 offset = vec2(17.31, 41.97) * seed;\n\n \n vec2 mg = vec2(0.0);\n vec2 mr = vec2(0.0);\n float md = 8.0;\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 g = vec2(float(x), float(y));\n vec2 r = g + hash22(i + g + offset) - f;\n float d = dot(r, r);\n if (d < md) {\n md = d;\n mr = r;\n mg = g;\n }\n }\n }\n\n \n \n float edge = 8.0;\n for (int y = -2; y <= 2; y++) {\n for (int x = -2; x <= 2; x++) {\n vec2 g = mg + vec2(float(x), float(y));\n vec2 r = g + hash22(i + g + offset) - f;\n vec2 dr = r - mr;\n if (dot(dr, dr) > 0.00001) {\n edge = min(edge, dot(0.5 * (mr + r), normalize(dr)));\n }\n }\n }\n \n edge /= n;\n\n \n float h = hash22(i + mg + offset + 97.13).x;\n float w = clamp(smoothness, 0.0, 1.0);\n float start = h * (1.0 - w);\n float m = w > 0.0 ? smoothstep(start, start + w, progress) : step(start, progress);\n\n \n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n\n \n float open = smoothstep(0.0, 0.2, progress) * (1.0 - smoothstep(0.8, 1.0, progress));\n float bw = max(border, 0.0) * open;\n if (bw > 0.0) {\n float l = 1.0 - smoothstep(0.5 * bw - AA, 0.5 * bw + AA, edge);\n float ba = borderColor.a * l * min(1.0, bw / (2.0 * AA));\n c = vec4(borderColor.rgb * ba, ba) + c * (1.0 - ba);\n }\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Chessboard":"// Chessboard — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Chessboard.glsl\n// Author: lql\n// License: MIT\n// Description: A chessboard pattern of squares reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float grid_num; \n\nvec4 transition(vec2 uv) {\n vec2 st = uv * grid_num;\n vec2 idx = floor(st);\n vec2 grid = fract(st);\n\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n\n float checker = mod(idx.x + idx.y, 2.0);\n float mixFactor;\n\n if (progress <= 0.5) {\n mixFactor = (checker > 0.5) ? step(grid.x, progress * 2.0) : 0.0;\n } else {\n mixFactor = (checker < 0.5) ? step(grid.x, (progress - 0.5) * 2.0) : 1.0;\n }\n\n return mix(a, b, mixFactor);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CircleIris":"// CircleIris — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CircleIris.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: The outgoing image closes into a circle over a background color, then the incoming one opens from it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \n\nuniform vec4 backColor; \n\nvec4 transition (vec2 uv) {\n \n float distance = length(uv - center);\n float radius = sqrt(8.0) * abs(progress - 0.5);\n \n if (distance > radius) {\n return backColor;\n }\n else {\n if (progress < 0.5) return getFromColor(uv);\n else return getToColor(uv);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CircleOpen":"// CircleOpen — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CircleOpen.glsl\n// Author: gre\n// License: MIT\n// Description: A soft-edged circle opens from the center to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float smoothness; \n\nuniform int opening; \n\nconst vec2 center = vec2(0.5, 0.5);\nconst float SQRT_2 = 1.414213562373;\n\nvec4 transition (vec2 uv) {\n float x = (opening != 0) ? progress : 1.-progress;\n float m = smoothstep(-smoothness, 0.0, SQRT_2*distance(center, uv) - x*(1.+smoothness));\n return mix(getFromColor(uv), getToColor(uv), (opening != 0) ? 1.-m : m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ClockWipe":"// ClockWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ClockWipe.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: A wipe that sweeps around the center from a starting angle\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float startingAngle; \n\nvec4 transition (vec2 uv) {\n \n float offset = startingAngle * 3.141592653589 / 180.0;\n float angle = atan(uv.y - 0.5, uv.x - 0.5) + offset;\n float normalizedAngle = (angle + 3.141592653589) / (2.0 * 3.141592653589);\n \n normalizedAngle = normalizedAngle - floor(normalizedAngle);\n\n return mix(\n getFromColor(uv),\n getToColor(uv),\n step(normalizedAngle, progress)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ColorCoords":"// ColorCoords — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ColorCoords.glsl\n// Author: haiyoucuv\n// License: MIT\n// Description: A crossfade in which the colors of one image displace the other\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n\n vec4 coordTo = getToColor(uv);\n vec4 coordFrom = getFromColor(uv);\n\n return mix(\n getFromColor(mix(uv, coordTo.rg, progress)),\n getToColor(mix(coordFrom.rg, uv, progress)),\n progress\n );\n\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ColorDistance":"// ColorDistance — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ColorDistance.glsl\n// Author: P-Seebauer\n// License: MIT\n// Description: Pixels switch to the incoming image in order of how close their colors are\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float power; \n\nvec4 transition(vec2 p) {\n vec4 fTex = getFromColor(p);\n vec4 tTex = getToColor(p);\n float m = step(distance(fTex, tTex), progress);\n return mix(\n mix(fTex, tTex, m),\n tTex,\n pow(progress, power)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ColorPanelWipe":"// ColorPanelWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ColorPanelWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Solid color panels, slightly staggered, sweep across and cover the frame, then sweep off the far side and reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform int panels; \n\nuniform vec4 color1; \n\nuniform vec4 color2; \n\nuniform vec4 color3; \n\nuniform float stagger; \n\nuniform float skew; \n\nconst float cut = 0.46;\nconst float hold = 0.01;\n\nconst float aa = 0.0015;\n\nfloat ease(float t) {\n float s = clamp(t, 0.0, 1.0);\n float u = 1.0 - s * s * (3.0 - 2.0 * s);\n return 1.0 - u * u * u;\n}\n\nfloat cover(float x, float back, float front) {\n return smoothstep(back - aa, back + aa, x) * (1.0 - smoothstep(front - aa, front + aa, x));\n}\n\nvec4 transition(vec2 uv) {\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n float k = clamp(skew, -1.0, 1.0);\n \n vec2 a = (dir + k * vec2(-dir.y, dir.x)) / sqrt(1.0 + k * k);\n float x = dot(p, a);\n \n float e = 0.5 * (abs(a.x) * ratio + abs(a.y));\n float start = -e - 2.0 * aa;\n float span = 2.0 * (e + 2.0 * aa);\n\n int n = panels < 1 ? 1 : panels > 3 ? 3 : panels;\n float m = float(n - 1);\n float st = clamp(stagger, 0.0, 1.0);\n \n vec2 d = vec2(cut - hold, 1.0 - cut - hold) / (1.0 + m * st);\n\n \n \n float front0 = start + span * ease(progress / d.x);\n float back0 = start + span * ease((progress - 1.0 + d.y) / d.y);\n vec4 c = mix(getToColor(uv), getFromColor(uv), step(0.5 * (front0 + back0), x));\n c = mix(c, color1, cover(x, back0, front0));\n\n \n for (int i = 1; i < 3; i++) {\n if (i < n) {\n vec2 t = float(i) * st * d;\n float front = start + span * ease((progress - t.x) / d.x);\n float back = start + span * ease((progress - 1.0 + d.y + t.y) / d.y);\n c = mix(c, i == 1 ? color2 : color3, cover(x, back, front));\n }\n }\n return c.a > 0.0 ? c : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ColorPhase":"// ColorPhase — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ColorPhase.glsl\n// Author: gre\n// License: MIT\n// Description: A crossfade in which each color channel changes at a different time\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 fromStep; \n\nuniform vec4 toStep; \n\nvec4 transition (vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n return mix(a, b, smoothstep(fromStep, toStep, vec4(progress)));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ColorWrap":"// ColorWrap — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ColorWrap.glsl\n// Author: Yoni Maltsman @friendlyspinach\n// License: MIT\n// Description: Each color channel of the outgoing image is shifted and wraps around into psychedelic bands, while crossfading to the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float r_strength; \n\nuniform float g_strength; \n\nuniform float b_strength; \n\nvec4 transition (vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n vec3 c = from.rgb + vec3(r_strength, g_strength, b_strength)*progress;\n \n from.rgb = mix(from.rgb, mod(c, 1.0), smoothstep(0.0, 0.1, progress));\n return mix(from, to, progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Comb":"// Comb — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Comb.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is cut into interleaved strips that slide in opposite directions, each pushing the outgoing image out and the incoming one in\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int strips; \n\nuniform int vertical; \n\nvec4 transition (vec2 uv) {\n \n float a = (vertical != 0) ? uv.y : uv.x;\n float b = (vertical != 0) ? uv.x : uv.y;\n \n float dir = mod(floor(b * float(strips)), 2.0) < 0.5 ? 1.0 : -1.0;\n \n float t = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.6);\n float fa = a - dir * t;\n if (fa >= 0.0 && fa <= 1.0) {\n return getFromColor((vertical != 0) ? vec2(b, fa) : vec2(fa, b));\n }\n float ta = fa + dir;\n return getToColor((vertical != 0) ? vec2(b, ta) : vec2(ta, b));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CrazyParametricFun":"// CrazyParametricFun — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CrazyParametricFun.glsl\n// Author: mandubian\n// License: MIT\n// Description: The outgoing image is pulled along a parametric curve into a psychedelic swirl\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float a; \nuniform float b; \nuniform float amplitude; \nuniform float smoothness; \n\nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy;\n vec2 dir = p - vec2(.5);\n float dist = length(dir);\n float x = (a - b) * cos(progress) + b * cos(progress * ((a / b) - 1.) );\n float y = (a - b) * sin(progress) - b * sin(progress * ((a / b) - 1.));\n vec2 offset = dir * vec2(sin(progress * dist * amplitude * x), sin(progress * dist * amplitude * y)) / smoothness;\n return mix(getFromColor(p + offset), getToColor(p), smoothstep(0.2, 1.0, progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CrossWarp":"// CrossWarp — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CrossWarp.glsl\n// Author: Eke Péter <peterekepeter@gmail.com>\n// License: MIT\n// Description: The outgoing image zooms in while the incoming one zooms out into place, sweeping from right to left\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 p) {\n float x = progress;\n x=smoothstep(.0,1.0,(x*2.0+p.x-1.0));\n return mix(getFromColor((p-.5)*(1.-x)+.5), getToColor((p-.5)*x+.5), x);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CrossZoom":"// CrossZoom — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CrossZoom.glsl\n// Author: rectalogic\n// License: MIT\n// Description: A crossfade through a strong zoom blur\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nconst float PI = 3.141592653589793;\n\nfloat Linear_ease(in float begin, in float change, in float duration, in float time) {\n return change * time / duration + begin;\n}\n\nfloat Exponential_easeInOut(in float begin, in float change, in float duration, in float time) {\n if (time == 0.0)\n return begin;\n else if (time == duration)\n return begin + change;\n time = time / (duration / 2.0);\n if (time < 1.0)\n return change / 2.0 * pow(2.0, 10.0 * (time - 1.0)) + begin;\n return change / 2.0 * (-pow(2.0, -10.0 * (time - 1.0)) + 2.0) + begin;\n}\n\nfloat Sinusoidal_easeInOut(in float begin, in float change, in float duration, in float time) {\n return -change / 2.0 * (cos(PI * time / duration) - 1.0) + begin;\n}\n\nfloat rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec4 crossFade(in vec2 uv, in float dissolve) {\n return mix(getFromColor(uv), getToColor(uv), dissolve);\n}\n\nvec4 transition(vec2 uv) {\n vec2 texCoord = uv.xy / vec2(1.0).xy;\n\n \n vec2 center = vec2(Linear_ease(0.25, 0.5, 1.0, progress), 0.5);\n float dissolve = Exponential_easeInOut(0.0, 1.0, 1.0, progress);\n\n \n float strength = Sinusoidal_easeInOut(0.0, strength, 0.5, progress);\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n vec2 toCenter = center - texCoord;\n\n \n float offset = rand(uv);\n\n for (float t = 0.0; t <= 40.0; t++) {\n float percent = (t + offset) / 40.0;\n float weight = 4.0 * (percent - percent * percent);\n color += crossFade(texCoord + toCenter * percent * strength, dissolve) * weight;\n total += weight;\n }\n return color / total;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Crosshatch":"// Crosshatch — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Crosshatch.glsl\n// Author: pthrasher\n// License: MIT\n// Description: The incoming image appears through a crosshatch of lines spreading from the center\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \nuniform float threshold; \nuniform float fadeEdge; \n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\nvec4 transition(vec2 p) {\n float dist = distance(center, p) / threshold;\n float r = progress - min(rand(vec2(p.y, 0.0)), rand(vec2(0.0, p.x)));\n return mix(getFromColor(p), getToColor(p), mix(0.0, mix(step(dist, r), 1.0, smoothstep(1.0-fadeEdge, 1.0, progress)), smoothstep(0.0, fadeEdge, progress))); \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Crumple":"// Crumple — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Crumple.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image crumples into a creased paper ball, shaded along its folds, which is then tossed away to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int creases; \n\nuniform float size; \n\nuniform vec2 direction; \n\nuniform vec4 paper; \n\nuniform vec4 shadow; \n\nconst float PI = 3.14159265;\n\nvec2 hash2(vec2 p) {\n p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));\n return fract(sin(p) * 43758.5453);\n}\n\nmat2 rot(float a) {\n float s = sin(a);\n float c = cos(a);\n return mat2(c, -s, s, c);\n}\n\nfloat frame(vec2 a) {\n return min(0.5 * ratio / max(abs(a.x), 1e-4), 0.5 / max(abs(a.y), 1e-4));\n}\n\nfloat outline(vec2 a, float c, float k, float radius) {\n float rect = frame(a);\n float th = atan(a.y, a.x);\n float buckle = 0.03 + 0.05 * abs(sin(4.0 * th + 0.7)) + 0.03 * abs(sin(9.0 * th + 2.0)) + 0.015 * abs(sin(23.0 * th + 1.3));\n \n float i = floor((th / (2.0 * PI) + 0.5) * 9.0);\n float a0 = i * 2.0 * PI / 9.0 - PI;\n float a1 = a0 + 2.0 * PI / 9.0;\n vec2 v0 = vec2(cos(a0), sin(a0)) * (0.78 + 0.27 * hash2(vec2(mod(i, 9.0), 3.0)).x);\n vec2 v1 = vec2(cos(a1), sin(a1)) * (0.78 + 0.27 * hash2(vec2(mod(i + 1.0, 9.0), 3.0)).x);\n vec2 e = v1 - v0;\n float ball = radius * (v0.x * e.y - v0.y * e.x) / (a.x * e.y - a.y * e.x);\n return mix(rect * mix(1.0, 0.75, c) * (1.0 - c * buckle), ball, k);\n}\n\nvoid fold(vec2 x, float seed, int n, vec2 span, float len, float c, float px, float weight,\n inout vec2 grad, inout vec2 shift, inout float valley, inout float ridge) {\n float tilt = 2.0 / sqrt(float(n));\n for (int i = 0; i < 32; i++) {\n if (i >= n) break;\n float fi = float(i);\n vec2 h = hash2(vec2(fi, seed));\n vec2 g = hash2(vec2(fi, seed + 11.8));\n vec2 o = (h - 0.5) * 2.0 * span;\n vec2 nrm = vec2(cos(2.0 * PI * g.x), sin(2.0 * PI * g.x));\n float d = dot(x - o, nrm);\n float along = dot(x - o, vec2(-nrm.y, nrm.x));\n float l = len * (0.5 + g.y);\n float start = 0.4 * fi / float(n);\n float act = weight * smoothstep(start, start + 0.3, c) * (1.0 - smoothstep(0.5 * l, l, abs(along)));\n float amp = (h.x > 0.5 ? 1.0 : -1.0) * (0.5 + 0.5 * h.y);\n float side = d / (abs(d) + px);\n grad += act * amp * side * nrm * tilt;\n shift += act * 0.03 * side * nrm;\n float line = 1.0 - smoothstep(0.0, 2.0 * px, abs(d));\n if (amp < 0.0) valley += act * line;\n else ridge += act * line * amp;\n }\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n vec4 b = getToColor(uv);\n if (progress >= 1.0) return b;\n\n \n float c = smoothstep(0.0, 0.6, progress);\n float k = smoothstep(0.1, 0.62, progress);\n float t = smoothstep(0.58, 1.0, progress);\n t *= t;\n\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n float radius = max(size, 0.01) * mix(1.0, 0.6, t);\n \n \n float reach = 0.5 * (abs(dir.x) * ratio + abs(dir.y)) + 1.2 * radius + 0.3;\n float bend = dir.x < 0.0 ? -1.0 : 1.0;\n vec2 center = dir * reach * t + vec2(-dir.y, dir.x) * 0.15 * bend * sin(PI * t);\n float angle = 0.6 * c - 5.0 * bend * t;\n \n float lift = 0.012 * c + 0.06 * t;\n\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n\n \n vec2 sp = rot(angle) * (p - center - vec2(0.6, -1.0) * lift);\n float sl = length(sp);\n float sd = sl - outline(sl > 1e-5 ? sp / sl : vec2(1.0, 0.0), c, k, radius);\n float blur = 0.005 + 1.2 * lift;\n vec4 col = vec4(mix(b.rgb, shadow.rgb, shadow.a * c * (1.0 - smoothstep(-blur, blur, sd))), b.a);\n\n vec2 q = rot(angle) * (p - center);\n float l = length(q);\n vec2 dq = l > 1e-5 ? q / l : vec2(1.0, 0.0);\n float edge = outline(dq, c, k, radius);\n \n \n float aa = 0.003 * smoothstep(0.0, 0.1, progress) + 1e-5;\n float inside = 1.0 - smoothstep(-aa, aa, l - edge);\n if (inside <= 0.0) return col;\n\n \n \n float r = l / edge;\n float rect = frame(dq);\n vec2 s = dq * rect * mix(r, r * (0.6 + 0.4 * r), k);\n\n \n int count = creases < 1 ? 1 : creases;\n vec2 grad = vec2(0.0);\n vec2 shift = vec2(0.0);\n float valley = 0.0;\n float ridge = 0.0;\n fold(s, 7.3, count, 0.45 * vec2(ratio, 1.0), 0.6, c, 0.003 * rect / edge, 1.0 - 0.8 * k, grad, shift, valley, ridge);\n vec2 g2 = vec2(0.0);\n vec2 s2 = vec2(0.0);\n float v2 = 0.0;\n float r2 = 0.0;\n fold(q / radius, 2.9, count, vec2(0.7), 8.0, k, 0.003 / radius, k, g2, s2, v2, r2);\n grad += g2 * 0.8;\n vec2 piece = s + shift + s2 * 3.0;\n\n \n \n float rr = clamp(l / (radius * 1.1), 0.0, 1.0);\n vec3 sphere = vec3(q / (radius * 1.1) * k * 0.8, sqrt(1.0 - 0.64 * rr * rr * k));\n vec3 n = normalize(sphere + vec3(grad, 0.0));\n n.xy = rot(-angle) * n.xy;\n vec3 light = normalize(vec3(-0.5, 0.6, 0.8));\n float diffuse = max(dot(n, light), 0.0);\n vec3 hv = normalize(light + vec3(0.0, 0.0, 1.0));\n \n float spec = max(pow(max(dot(n, hv), 0.0), 20.0) - pow(hv.z, 20.0), 0.0);\n float level = light.z;\n float relief = min(2.0 * c, 1.0);\n float shade = 1.0 + relief * ((0.12 + diffuse) / (0.12 + level) - 1.0) + 0.7 * spec * relief;\n shade -= 0.2 * relief * min(valley, 1.0);\n \n shade *= 1.0 - 0.3 * k * smoothstep(0.6, 1.0, r);\n\n \n vec2 f = piece / vec2(ratio, 1.0) + 0.5;\n vec4 img = getFromColor(1.0 - abs(1.0 - mod(f, 2.0)));\n \n img.rgb = mix(img.rgb, paper.rgb, 0.6 * min(ridge, 1.0) * paper.a * c);\n vec4 ball = vec4(img.rgb * shade, img.a);\n\n \n float m = inside * ball.a;\n vec4 o = vec4(mix(col.rgb * col.a, ball.rgb, m), mix(col.a, 1.0, m));\n return o.a > 0.0 ? vec4(o.rgb / o.a, o.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Cube":"// Cube — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Cube.glsl\n// Author: gre\n// License: MIT\n// Description: The two images are faces of a rotating 3D cube, with a floor reflection\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float persp; \nuniform float unzoom; \n\nuniform float reflection; \nuniform float floating; \n\nvec2 project (vec2 p) {\n return p * vec2(1.0, -1.2) + vec2(0.0, -floating/100.);\n}\n\nbool inBounds (vec2 p) {\n return all(lessThan(vec2(0.0), p)) && all(lessThan(p, vec2(1.0)));\n}\n\nvec4 bgColor (vec2 p, vec2 pfr, vec2 pto) {\n vec4 c = vec4(0.0); \n pfr = project(pfr);\n \n if (inBounds(pfr)) {\n c += mix(vec4(0.0), getFromColor(pfr), reflection * mix(1.0, 0.0, pfr.y));\n }\n pto = project(pto);\n if (inBounds(pto)) {\n c += mix(vec4(0.0), getToColor(pto), reflection * mix(1.0, 0.0, pto.y));\n }\n return c;\n}\n\nvec2 xskew (vec2 p, float persp, float center) {\n float x = mix(p.x, 1.0-p.x, center);\n return (\n (\n vec2( x, (p.y - 0.5*(1.0-persp) * x) / (1.0+(persp-1.0)*x) )\n - vec2(0.5-distance(center, 0.5), 0.0)\n )\n * vec2(0.5 / distance(center, 0.5) * (center<0.5 ? 1.0 : -1.0), 1.0)\n + vec2(center<0.5 ? 0.0 : 1.0, 0.0)\n );\n}\n\nvec4 transition(vec2 op) {\n float uz = unzoom * 2.0*(0.5-distance(0.5, progress));\n vec2 p = -uz*0.5+(1.0+uz) * op;\n vec2 fromP = xskew(\n (p - vec2(progress, 0.0)) / vec2(1.0-progress, 1.0),\n 1.0-mix(progress, 0.0, persp),\n 0.0\n );\n vec2 toP = xskew(\n p / vec2(progress, 1.0),\n mix(pow(progress, 2.0), 1.0, persp),\n 1.0\n );\n \n if (inBounds(fromP)) {\n return getFromColor(fromP);\n }\n else if (inBounds(toP)) {\n return getToColor(toP);\n }\n return bgColor(op, fromP, toP);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Curtains":"// Curtains — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Curtains.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image parts in the middle like stage curtains, gathering into shaded folds as it is pulled to the sides\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float folds; \n\nuniform float shading; \n\nuniform float bunch; \n\nuniform float sway; \n\nconst float PI = 3.141592653589793;\n\nvec4 transition (vec2 uv) {\n \n float lag = sway * (1.0 - uv.y);\n float p = progress * (1.0 - lag * (1.0 - progress));\n float open = mix(p, p * p * (3.0 - 2.0 * p), 0.75);\n \n float edge = -bunch * open * open;\n float w = mix(0.5, bunch, open);\n float x = min(uv.x, 1.0 - uv.x) - edge; \n if (x >= w) {\n \n vec4 to = getToColor(uv);\n float shadow = 0.4 * exp((w - x) * 25.0) * clamp((edge + w) * 20.0, 0.0, 1.0);\n return vec4(to.rgb * (1.0 - shadow * open), to.a);\n }\n float t = x / w;\n \n float n = max(1.0, floor(folds * min(ratio, 1.0) + 0.5)); \n float a = 2.0 * PI * n * t;\n float f = 1.0 - (1.0 - open) * (1.0 - open) * (1.0 - open); \n float gather = 0.92 * f;\n float s = 0.5 * (t + gather * sin(a) / (2.0 * PI * n)); \n vec4 c = getFromColor(vec2(uv.x < 0.5 ? s : 1.0 - s, uv.y));\n \n float slope = 3.0 * gather * cos(a) * (uv.x < 0.5 ? 1.0 : -1.0);\n float diffuse = (1.0 + 0.5 * slope) / sqrt(1.25 * (1.0 + slope * slope));\n float crease = 0.5 + 0.5 * sin(a); \n float light = mix(1.0, diffuse * (1.0 - 0.6 * crease * crease), shading * f);\n return vec4(c.rgb * light, c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CurvedWipe":"// CurvedWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CurvedWipe.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is pulled away by its middle: the wipe edge bulges into a smooth curve that leads the way, then flattens as it reaches the far side\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float curvature; \n\nuniform float smoothness; \n\nuniform vec4 shadow; \n\nconst float PI = 3.141592653589793;\n\nfloat ease (float t) {\n return 0.5 * (t + t * t * (3.0 - 2.0 * t));\n}\n\nvec4 transition (vec2 uv) {\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(0.0, 1.0);\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n \n float e = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n float w = 0.5 * (abs(dir.y) * ratio + abs(dir.x));\n vec2 across = vec2(-dir.y, dir.x);\n float d = dot(p, dir);\n \n \n float x = clamp(dot(p, across) / w, -1.0, 1.0);\n float s = max(smoothness, 0.001);\n \n \n float k = clamp(curvature, 0.0, 1.0) * min(1.0, w / e) * (1.0 - x * x);\n float t = progress + k * progress * (1.0 - progress);\n float travel = 2.0 * (e + s);\n float edge = -e - s + travel * ease(t);\n float side = -e - s + travel * ease(progress);\n float m = 1.0 - smoothstep(-s, s, d - edge);\n \n float lift = edge - side;\n float spread = 0.012 + 0.25 * lift;\n \n vec4 to = getToColor(uv);\n vec2 caster = clamp((p + (edge - d) * dir) / vec2(ratio, 1.0) + 0.5, 0.0, 1.0);\n float sh = shadow.a * sin(PI * progress) * exp(-max(edge - d, 0.0) / spread) * m * getFromColor(caster).a * to.a;\n to.rgb = mix(to.rgb, shadow.rgb, sh);\n return mix(getFromColor(uv), to, m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CylinderRoll":"// CylinderRoll — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CylinderRoll.glsl\n// Author: gre\n// License: MIT\n// Description: The frame wraps around a drum that rolls up, the outgoing image turning away over its top in a motion blur and the incoming one coming around from below and unrolling flat\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float curvature; \n\nuniform float blur; \n\nuniform float shading; \n\nuniform float chroma; \n\nuniform int downward; \n\nconst int SAMPLES = 24;\n\nconst float MAX_ANGLE = 1.1;\n\nconst float DIST = 2.6;\n\nconst float ARC = 0.12;\n\nfloat hash(vec2 c) {\n vec2 q = fract(c * vec2(0.1031, 0.1030));\n q += dot(q, q.yx + 33.33);\n return fract((q.x + q.y) * q.x);\n}\n\nfloat fold(float v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 strip(float x, float v) {\n if ((downward != 0) ? v > 1.0 : v < 0.0) {\n return getToColor(vec2(x, fold((downward != 0) ? v - 1.0 : v + 1.0)));\n }\n return getFromColor(vec2(x, fold(v)));\n}\n\nfloat angleAt(float c) {\n c = clamp(c, -0.98 / sqrt(DIST * DIST - 1.0), 0.98 / sqrt(DIST * DIST - 1.0));\n return asin(c * DIST / sqrt(1.0 + c * c)) - atan(c);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float h = 1.0 - abs(2.0 * p - 1.0); \n float e = 0.5 * h * (0.1 + 0.9 * h * h);\n float roll = p < 0.5 ? e : 1.0 - e;\n \n float h3 = h * h * h;\n float peak = h3 * h3;\n\n \n float bend = curvature * (p < 0.5 ? h * (2.0 - h) : h * h * (3.0 - 2.0 * h));\n float phi = MAX_ANGLE * bend + 1e-4;\n float arcK = ARC * bend;\n \n float edgeY = sin(phi) / (DIST - cos(phi));\n\n vec2 n = 2.0 * uv - 1.0;\n \n float xr = n.x * ratio;\n float yn = n.y * (1.0 + arcK * xr * xr);\n float theta = angleAt(yn * edgeY);\n \n float thetaCorner = angleAt((1.0 + arcK * ratio * ratio) * edgeY);\n float width = (DIST - 1.0) / (DIST - cos(theta));\n float zoom = (DIST - cos(thetaCorner)) / (DIST - 1.0);\n float x = 0.5 + 0.5 * n.x / (zoom * width);\n \n float facing = (DIST * cos(theta) - 1.0)\n / sqrt(1.0 + DIST * DIST - 2.0 * DIST * cos(theta)) ;\n float light = mix(1.0, clamp(facing, 0.0, 1.0), shading);\n\n \n float v = 0.5 * (theta / phi + 1.0) + ((downward != 0) ? roll : -roll);\n float len = 0.5 * blur * peak;\n float split = chroma * peak;\n float jitter = hash(uv * 1000.0);\n vec3 color = vec3(0.0);\n vec3 weight = vec3(0.0);\n float alpha = 0.0;\n for (int i = 0; i < SAMPLES; i++) {\n float t = (float(i) + jitter) / float(SAMPLES) - 0.5;\n vec4 img = strip(x, v + t * len);\n \n vec3 w = vec3(max(1.0 - 4.0 * split * t, 0.0), 1.0, max(1.0 + 4.0 * split * t, 0.0));\n color += img.rgb * img.a * w;\n weight += img.a * w;\n alpha += img.a;\n }\n color = color / max(weight, vec3(1e-5));\n return vec4(color * light, alpha / float(SAMPLES));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DefocusBlur":"// DefocusBlur — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DefocusBlur.glsl\n// Author: Sergey Kosarevsky\n// License: MIT\n// Description: A crossfade through an out-of-focus blur\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float blurSize; \n\nvec4 transition(vec2 uv) {\n float T = progress;\n float half_ = 0.5;\n float D = (T < half_) ? mix(0.0, blurSize, T / half_) : mix(blurSize, 0.0, (T - half_) / half_);\n vec4 C0 = getFromColor(uv);\n vec4 C1 = getToColor(uv);\n C0 += getFromColor(vec2(-0.326, -0.406) * D + uv);\n C1 += getToColor(vec2(-0.326, -0.406) * D + uv);\n C0 += getFromColor(vec2(-0.840, -0.074) * D + uv);\n C1 += getToColor(vec2(-0.840, -0.074) * D + uv);\n C0 += getFromColor(vec2(-0.696, 0.457) * D + uv);\n C1 += getToColor(vec2(-0.696, 0.457) * D + uv);\n C0 += getFromColor(vec2(-0.203, 0.621) * D + uv);\n C1 += getToColor(vec2(-0.203, 0.621) * D + uv);\n C0 += getFromColor(vec2( 0.962, -0.195) * D + uv);\n C1 += getToColor(vec2( 0.962, -0.195) * D + uv);\n C0 += getFromColor(vec2( 0.473, -0.480) * D + uv);\n C1 += getToColor(vec2( 0.473, -0.480) * D + uv);\n C0 += getFromColor(vec2( 0.519, 0.767) * D + uv);\n C1 += getToColor(vec2( 0.519, 0.767) * D + uv);\n C0 += getFromColor(vec2( 0.185, -0.893) * D + uv);\n C1 += getToColor(vec2( 0.185, -0.893) * D + uv);\n C0 += getFromColor(vec2( 0.507, 0.064) * D + uv);\n C1 += getToColor(vec2( 0.507, 0.064) * D + uv);\n C0 += getFromColor(vec2( 0.896, 0.412) * D + uv);\n C1 += getToColor(vec2( 0.896, 0.412) * D + uv);\n C0 += getFromColor(vec2(-0.322, -0.933) * D + uv);\n C1 += getToColor(vec2(-0.322, -0.933) * D + uv);\n C0 += getFromColor(vec2(-0.792, -0.598) * D + uv);\n C1 += getToColor(vec2(-0.792, -0.598) * D + uv);\n C0 /= 13.0;\n C1 /= 13.0;\n return mix(C0, C1, T);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DiamondWipe":"// DiamondWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DiamondWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A soft-edged diamond grows from the center to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \n\nuniform float smoothness; \n\nvec4 transition (vec2 uv) {\n \n vec2 d = abs(uv - center) * vec2(ratio, 1.0);\n \n vec2 far = max(center, 1.0 - center) * vec2(ratio, 1.0);\n float dist = (d.x + d.y) / (far.x + far.y);\n float s = max(smoothness, 0.001);\n float m = smoothstep(0.0, s, progress * (1.0 + s) - dist);\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Directional":"// Directional — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Directional.glsl\n// Author: Gaëtan Renaudeau\n// License: MIT\n// Description: The incoming image pushes the outgoing one out in a given direction\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nvec4 transition (vec2 uv) {\n vec2 p = uv + progress * sign(direction);\n vec2 f = fract(p);\n return mix(\n getToColor(f),\n getFromColor(f),\n step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DirectionalEased":"// DirectionalEased — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DirectionalEased.glsl\n// Author: Max Plotnikov\n// License: MIT\n// Description: Like Directional, with an eased movement\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nvec4 transition (vec2 uv) {\n float easing = sqrt((2.0 - progress) * progress);\n vec2 p = uv + easing * sign(direction);\n vec2 f = fract(p);\n return mix(\n getToColor(f),\n getFromColor(f),\n step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DirectionalScaled":"// DirectionalScaled — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DirectionalScaled.glsl\n// Author: Thibaut Foussard\n// License: MIT\n// Description: Like Directional, with both images scaled down while they slide\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \nuniform float scale; \n\nfloat parabola(float x) {\n float y = pow(sin(x * acos(-1.0)), 1.);\n return y;\n}\n\nvec4 transition (vec2 uv) {\n float easedProgress = pow(sin(progress * acos(-1.0) / 2.), 3.);\n vec2 p = uv + easedProgress * sign(direction);\n vec2 f = fract(p);\n \n float s = 1. - (1. - (1. / scale)) * parabola(progress);\n f = (f - 0.5) * s + 0.5;\n \n float mixer = step(0.0, p.y) * step(p.y, 1.0) * step(0.0, p.x) * step(p.x, 1.0);\n vec4 col = mix(getToColor(f), getFromColor(f), mixer);\n \n float border = step(0., f.x) * step(0., (1. - f.x)) * step(0., f.y) * step(0., 1. - f.y);\n col *= border;\n \n return col;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DirectionalWarp":"// DirectionalWarp — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DirectionalWarp.glsl\n// Author: pschroen\n// License: MIT\n// Description: A diagonal wipe with a warped, smeared edge\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float smoothness; \n\nuniform vec2 direction; \n\nconst vec2 center = vec2(0.5, 0.5);\n\nvec4 transition (vec2 uv) {\n vec2 v = normalize(direction);\n v /= abs(v.x) + abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float m = 1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d - 0.5 + progress * (1.0 + smoothness)));\n return mix(getFromColor((uv - 0.5) * (1.0 - m) + 0.5), getToColor((uv - 0.5) * m + 0.5), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DirectionalWipe":"// DirectionalWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DirectionalWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A soft-edged diagonal wipe\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float smoothness; \n \nconst vec2 center = vec2(0.5, 0.5);\n \nvec4 transition (vec2 uv) {\n vec2 v = normalize(direction);\n v /= abs(v.x)+abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float m =\n (1.0-step(progress, 0.0)) * \n (1.0 - smoothstep(-smoothness, 0.0, v.x * uv.x + v.y * uv.y - (d-0.5+progress*(1.+smoothness))));\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Disintegrate":"// Disintegrate — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Disintegrate.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image crumbles into fine dust from one side, its grains blown away by the wind and fading out, revealing the incoming image underneath\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float particleSize; \n\nuniform vec2 direction; \n\nuniform float spread; \n\nconst int NEAR = 17;\nconst int CANDIDATES = 35;\n\nconst float LIFE = 0.45;\n\nfloat hash12(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n float a = hash12(i);\n float b = hash12(i + vec2(1.0, 0.0));\n float c = hash12(i + vec2(0.0, 1.0));\n float d = hash12(i + vec2(1.0, 1.0));\n return 2.0 * mix(mix(a, b, f.x), mix(c, d, f.x), f.y) - 1.0;\n}\n\nfloat gust(float x) {\n float i = floor(x);\n float f = fract(x);\n f = f * f * (3.0 - 2.0 * f);\n return 2.0 * mix(hash12(vec2(i, 7.0)), hash12(vec2(i + 1.0, 7.0)), f) - 1.0;\n}\n\nfloat release(vec2 center, float h, float halfLength, float s) {\n float front = 1.0 - (center.x + halfLength) / (2.0 * halfLength) + 0.14 * noise(center * s * 6.0) + 0.08 * (h - 0.5);\n return clamp((front + 0.12) / 1.24, 0.0, 1.0) * (1.0 - LIFE);\n}\n\nvec4 transition(vec2 uv) {\n vec2 d = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n vec2 n = vec2(-d.y, d.x);\n \n vec2 fp = (uv - 0.5) * vec2(ratio, 1.0);\n float s = particleSize;\n vec2 g = vec2(dot(fp, d), dot(fp, n)) / s;\n float halfLength = 0.5 * (ratio * abs(d.x) + abs(d.y)) / s;\n \n float reach = min(spread * 0.45 / s, 60.0);\n float px = floor(g.x);\n\n \n vec2 own = floor(g);\n vec4 under = progress > release(own + 0.5, hash12(own), halfLength, s) ? getToColor(uv) : getFromColor(uv);\n vec2 grainUV = vec2(0.5);\n float cover = 0.0;\n for (int i = 0; i < CANDIDATES; i++) {\n \n float fi = float(i);\n float cx = px - fi;\n if (i >= NEAR + 9) {\n cx = floor(px / 4.0) * 4.0 - 4.0 * (fi - float(NEAR + 9) + 8.0);\n } else if (i >= NEAR) {\n cx = floor(px / 2.0) * 2.0 - 2.0 * (fi - float(NEAR) + 8.0);\n }\n \n \n float visible = mod(cx, 4.0) < 0.5 ? 63.0 : mod(cx, 2.0) < 0.5 ? 31.0 : 15.0;\n float drift = 0.3 * gust(cx * s * 4.0);\n \n \n vec2 cell = vec2(cx, floor(g.y - drift * (g.x - cx - 0.5)));\n vec2 center = cell + 0.5;\n vec2 cuv = (center.x * d + center.y * n) * s / vec2(ratio, 1.0) + 0.5;\n if (cuv.x < 0.0 || cuv.x > 1.0 || cuv.y < 0.0 || cuv.y > 1.0) continue;\n float h = hash12(cell);\n float t = (progress - release(center, h, halfLength, s)) / LIFE;\n if (t <= 0.0 || t >= 1.0) continue;\n float r2 = fract(h * 13.7);\n \n float travel = reach * (0.4 + 0.6 * r2) * t * (0.2 + 0.8 * t);\n \n float crumble = smoothstep(0.0, 0.25, t);\n vec2 pos = center + vec2(travel + (fract(h * 71.1) - 0.5) * 0.3 * crumble, drift * travel);\n vec2 local = abs(g - pos);\n float size = mix(0.5, 0.3 * (1.0 - 0.5 * t) * (0.6 + 0.4 * h), crumble);\n float feather = 0.001 + 0.12 * crumble;\n float a = (1.0 - smoothstep(size - feather, size, max(local.x, local.y))) * (1.0 - smoothstep(0.15, 1.0, t))\n * (1.0 - smoothstep(0.6 * visible, visible, travel));\n if (a > cover) {\n cover = a;\n grainUV = cuv;\n }\n }\n return mix(under, getFromColor(grainUV), cover);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DisplacementMap":"// DisplacementMap — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DisplacementMap.glsl\n// Author: Travis Fischer\n// License: MIT\n// Description: A crossfade in which a displacement map (an extra grayscale texture) warps both images\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform shader displacementMap;\nvec4 _texture_displacementMap(vec2 uv) { return vec4(unpremul(displacementMap.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nvec4 transition (vec2 uv) {\n float displacement = _texture_displacementMap( uv).r * strength;\n\n vec2 uvFrom = vec2(uv.x + progress * displacement, uv.y);\n vec2 uvTo = vec2(uv.x - (1.0 - progress) * displacement, uv.y);\n\n return mix(\n getFromColor(uvFrom),\n getToColor(uvTo),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DitherDissolve":"// DitherDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DitherDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image appears through a regular 8x8 ordered dither pattern, like a retro computer screen\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float dotSize; \n\nfloat bayer(vec2 c) {\n float v = 0.0;\n float scale = 16.0;\n for (int i = 0; i < 3; i++) {\n vec2 bit = mod(floor(c), 2.0);\n \n v += scale * (2.0 * abs(bit.x - bit.y) + bit.y);\n c *= 0.5;\n scale *= 0.25;\n }\n return (v + 0.5) / 64.0;\n}\n\nvec4 transition(vec2 uv) {\n vec2 cell = floor(uv * vec2(ratio, 1.0) / dotSize);\n return progress < bayer(cell) ? getFromColor(uv) : getToColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DoomMelt":"// DoomMelt — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DoomMelt.glsl\n// Author: Zeh Fernando\n// License: MIT\n// Description: The outgoing image melts down in uneven columns, like the Doom screen wipe\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int bars; \n\nuniform float amplitude; \n\nuniform float noise; \n\nuniform float frequency; \n\nuniform float dripScale; \n\nfloat rand(int num) {\n return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num) * 10.3) * cos(float(num)));\n}\n\nfloat wave(int num) {\n float fn = float(num) * frequency * 0.1 * float(bars);\n return cos(fn * 0.5) * cos(fn * 0.13) * sin((fn+10.0) * 0.3) / 2.0 + 0.5;\n}\n\nfloat drip(int num) {\n return sin(float(num) / float(bars - 1) * 3.141592) * dripScale;\n}\n\nfloat pos(int num) {\n return (noise == 0.0 ? wave(num) : mix(wave(num), rand(num), noise)) + (dripScale == 0.0 ? 0.0 : drip(num));\n}\n\nvec4 transition(vec2 uv) {\n int bar = int(uv.x * (float(bars)));\n float scale = 1.0 + pos(bar) * amplitude;\n float phase = progress * scale;\n float posY = uv.y / vec2(1.0).y;\n vec2 p;\n vec4 c;\n if (phase + posY < 1.0) {\n p = vec2(uv.x, uv.y + mix(0.0, vec2(1.0).y, phase)) / vec2(1.0).xy;\n c = getFromColor(p);\n } else {\n p = uv.xy / vec2(1.0).xy;\n c = getToColor(p);\n }\n\n \n return c;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Doorway":"// Doorway — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Doorway.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image opens like double doors as the incoming one comes forward, with a floor reflection\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float reflection; \n\nuniform float perspective; \nuniform float depth; \n\nconst vec4 black = vec4(0.0); \nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec2 project (vec2 p) {\n return p * vec2(1.0, -1.2) + vec2(0.0, -0.02);\n}\n\nvec4 bgColor (vec2 p, vec2 pto) {\n vec4 c = black;\n pto = project(pto);\n if (inBounds(pto)) {\n c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y));\n }\n return c;\n}\n\nvec4 transition (vec2 p) {\n vec2 pfr = vec2(-1.), pto = vec2(-1.);\n float middleSlit = 2.0 * abs(p.x-0.5) - progress;\n if (middleSlit > 0.0) {\n pfr = p + (p.x > 0.5 ? -1.0 : 1.0) * vec2(0.5*progress, 0.0);\n float d = 1.0/(1.0+perspective*progress*(1.0-middleSlit));\n pfr.y -= d/2.;\n pfr.y *= d;\n pfr.y += d/2.;\n }\n float size = mix(1.0, depth, 1.-progress);\n pto = (p + vec2(-0.5, -0.5)) * vec2(size, size) + vec2(0.5, 0.5);\n if (inBounds(pfr)) {\n return getFromColor(pfr);\n }\n else if (inBounds(pto)) {\n return getToColor(pto);\n }\n else {\n return bgColor(p, pto);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Dreamy":"// Dreamy — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Dreamy.glsl\n// Author: mikolalysenko\n// License: MIT\n// Description: A crossfade with a gentle wavy distortion\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec2 offset(float progress, float x, float theta) {\n float phase = progress*progress + progress + theta;\n float shifty = 0.03*progress*cos(10.0*(progress+x));\n return vec2(0, shifty);\n}\nvec4 transition(vec2 p) {\n return mix(getFromColor(p + offset(progress, p.x, 0.0)), getToColor(p + offset(1.0-progress, p.x, 3.14)), progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","DreamyZoom":"// DreamyZoom — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DreamyZoom.glsl\n// Author: Zeh Fernando\n// License: MIT\n// Description: Zooms and rotates into a bright flash, then out to the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float rotation; \n\nuniform float scale; \n\nvec4 transition(vec2 uv) {\n \n float phase = progress < 0.5 ? progress * 2.0 : (progress - 0.5) * 2.0;\n float angleOffset = progress < 0.5 ? mix(0.0, rotation * 0.03926990816987241548078304229099, phase) : mix(-rotation * 0.03926990816987241548078304229099, 0.0, phase);\n float newScale = progress < 0.5 ? mix(1.0, scale, phase) : mix(scale, 1.0, phase);\n \n vec2 center = vec2(0, 0);\n\n \n vec2 assumedCenter = vec2(0.5, 0.5);\n vec2 p = (uv.xy - vec2(0.5, 0.5)) / newScale * vec2(ratio, 1.0);\n\n \n float angle = atan(p.y, p.x) + angleOffset;\n float dist = distance(center, p);\n p.x = cos(angle) * dist / ratio + 0.5;\n p.y = sin(angle) * dist + 0.5;\n vec4 c = progress < 0.5 ? getFromColor(p) : getToColor(p);\n\n \n \n return vec4(c.rgb + (progress < 0.5 ? mix(0.0, 1.0, phase) : mix(1.0, 0.0, phase)), c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","EdgeGlow":"// EdgeGlow — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/EdgeGlow.glsl\n// Author: Woohyun Kim\n// License: MIT\n// Description: Both images fade through black with their edges glowing\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float edge_thickness; \nuniform float edge_brightness; \n\nvec3 detectEdgeColor(vec3[9] c) {\n \n \n \n \n \n vec3 dx = 2.0 * abs(c[7]-c[1]) + abs(c[2] - c[6]) + abs(c[8] - c[0]);\n\tvec3 dy = 2.0 * abs(c[3]-c[5]) + abs(c[6] - c[8]) + abs(c[0] - c[2]);\n float delta = length(0.25 * (dx + dy) * 0.5);\n\treturn clamp(edge_brightness * delta, 0.0, 1.0) * c[4];\n}\n\nvec4 getFromEdgeColor(vec2 uv) {\n\tvec3 c[9];\n\tfloat alpha = 0.0;\n\tfor (int i=0; i < 3; ++i) for (int j=0; j < 3; ++j)\n\t{\n\t vec4 color = getFromColor(uv + edge_thickness * vec2(i-1,j-1));\n c[3*i + j] = color.rgb;\n if (i == 1 && j == 1) alpha = color.a;\n\t}\n\treturn vec4(detectEdgeColor(c), alpha);\n}\n\nvec4 getToEdgeColor(vec2 uv) {\n\tvec3 c[9];\n\tfloat alpha = 0.0;\n\tfor (int i=0; i < 3; ++i) for (int j=0; j < 3; ++j)\n\t{\n\t vec4 color = getToColor(uv + edge_thickness * vec2(i-1,j-1));\n c[3*i + j] = color.rgb;\n if (i == 1 && j == 1) alpha = color.a;\n\t}\n\treturn vec4(detectEdgeColor(c), alpha);\n}\n\nvec4 transition (vec2 uv) {\n vec4 start = mix(getFromColor(uv), getFromEdgeColor(uv), clamp(2.0 * progress, 0.0, 1.0));\n vec4 end = mix(getToEdgeColor(uv), getToColor(uv), clamp(2.0 * (progress - 0.5), 0.0, 1.0));\n return mix(\n start,\n end,\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","EyeBlink":"// EyeBlink — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/EyeBlink.glsl\n// Author: gre\n// License: MIT\n// Description: Curved eyelids close from the top and bottom over the outgoing image, which blurs and dims, then open on the incoming image as it comes back into focus, as if the viewer blinked\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float blur; \n\nuniform float softness; \n\nuniform int blinks; \n\nuniform vec4 color; \n\nconst int TAPS = 16;\n\nconst float CURVE = 0.25;\n\nconst float MEET = 0.44;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat lidBlink(float t, float c, float wc, float wo, float hold) {\n return 1.0 - smoothstep(hold, t < c ? wc : wo, abs(t - c));\n}\n\nvec4 image(vec2 uv, bool incoming) {\n vec4 c = incoming ? getToColor(uv) : getFromColor(uv);\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 transition(vec2 uv) {\n bool two = blinks > 1;\n \n float cut = two ? 0.3 : 0.42;\n \n float closed = two\n ? max(lidBlink(progress, cut, 0.26, 0.26, 0.015), lidBlink(progress, 0.7, 0.14, 0.24, 0.01))\n : lidBlink(progress, cut, 0.36, 0.5, 0.02);\n bool incoming = progress >= cut;\n\n \n float soft = clamp(softness, 0.001, 0.3);\n float x = 2.0 * uv.x - 1.0;\n float rim = (1.0 - closed) * (1.31 + CURVE) - CURVE * x * x;\n \n float y = uv.y - MEET;\n float d = rim - max(y / (1.0 - MEET), -y / MEET);\n \n float s = 1.0 - smoothstep(0.0, soft, d);\n float lid = s * s;\n if (lid >= 1.0) return color;\n\n \n float f = progress < cut ? progress / cut : (1.0 - progress) / (1.0 - cut);\n f = clamp(f, 0.0, 1.0);\n f = max(f * (2.0 - f), closed) * blur;\n\n vec4 c;\n if (f <= 0.0) {\n c = incoming ? getToColor(uv) : getFromColor(uv);\n } else {\n \n float r = 0.025 * f;\n c = vec4(0.0);\n for (int i = 0; i < TAPS; i++) {\n float k = float(i) + 0.5;\n float a = 2.39996 * k;\n vec2 o = sqrt(k / float(TAPS)) * vec2(cos(a), sin(a)) * r;\n c += image(mirror(uv + o * vec2(1.0 / ratio, 1.0)), incoming);\n }\n c /= float(TAPS);\n c = c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n \n c.rgb *= 1.0 - 0.35 * f;\n }\n return mix(c, color, lid);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Fade":"// Fade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Fade.glsl\n// Author: gre\n// License: MIT\n// Description: A linear crossfade between the two images\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n return mix(\n getFromColor(uv),\n getToColor(uv),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FadeColor":"// FadeColor — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FadeColor.glsl\n// Author: gre\n// License: MIT\n// Description: A fade through a solid color, black by default\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 color; \n\nuniform float colorPhase; \nvec4 transition (vec2 uv) {\n return mix(\n mix(color, getFromColor(uv), smoothstep(1.0-colorPhase, 0.0, progress)),\n mix(color, getToColor(uv), smoothstep( colorPhase, 1.0, progress)),\n progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FadeGrayscale":"// FadeGrayscale — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FadeGrayscale.glsl\n// Author: gre\n// License: MIT\n// Description: A crossfade through grayscale\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float intensity; \n \nvec3 grayscale (vec3 color) {\n return vec3(0.2126*color.r + 0.7152*color.g + 0.0722*color.b);\n}\n \nvec4 transition (vec2 uv) {\n vec4 fc = getFromColor(uv);\n vec4 tc = getToColor(uv);\n return mix(\n mix(vec4(grayscale(fc.rgb), fc.a), fc, smoothstep(1.0-intensity, 0.0, progress)),\n mix(vec4(grayscale(tc.rgb), tc.a), tc, smoothstep( intensity, 1.0, progress)),\n progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FallOver":"// FallOver — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FallOver.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image falls over backward, hinged on its bottom edge, revealing the incoming one behind it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float perspective; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\n\nvec4 transition (vec2 uv) {\n \n float fall = progress * (0.25 + 0.75 * progress);\n float angle = 0.5 * PI * fall;\n float c = cos(angle), s = sin(angle);\n \n \n float dist = 1.0 / max(perspective, 0.01);\n vec3 eye = vec3(0.5 * ratio, 0.5 * c, -dist);\n vec3 dir = vec3(uv.x * ratio, uv.y, 0.0) - eye;\n \n float den = dir.z * c - dir.y * s;\n if (den > 0.0) {\n float t = (eye.y * s - eye.z * c) / den;\n vec3 hit = eye + t * dir;\n vec2 puv = vec2(hit.x / ratio, hit.y * c + hit.z * s);\n if (t > 0.0 && puv.y > 0.0 && puv.y <= 1.0 && puv.x >= 0.0 && puv.x <= 1.0) {\n vec4 col = getFromColor(puv);\n return vec4(col.rgb * (1.0 - shading * s), col.a);\n }\n }\n return getToColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FilmBurn":"// FilmBurn — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FilmBurn.glsl\n// Author: Anastasia Dunbar\n// License: MIT\n// Description: Glowing film-burn light leaks wash over the image and reveal the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float Seed; \nfloat sigmoid(float x, float a) {\n float b = pow(x*2.,a)/2.;\n if (x > .5) {\n b = 1.-pow(2.-(x*2.),a)/2.;\n }\n\treturn b;\n}\nfloat rand(float co){\n return fract(sin((co*24.9898)+Seed)*43758.5453);\n}\nfloat rand(vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\nfloat apow(float a,float b) { return pow(abs(a),b)*sign(b); }\nvec3 pow3(vec3 a,vec3 b) { return vec3(apow(a.r,b.r),apow(a.g,b.g),apow(a.b,b.b)); }\nfloat smooth_mix(float a,float b,float c) { return mix(a,b,sigmoid(c,2.)); }\nfloat random(vec2 co, float shft){\n co += 10.;\n return smooth_mix(fract(sin(dot(co.xy ,vec2(12.9898+(floor(shft)*.5),78.233+Seed))) * 43758.5453),fract(sin(dot(co.xy ,vec2(12.9898+(floor(shft+1.)*.5),78.233+Seed))) * 43758.5453),fract(shft));\n}\nfloat smooth_random(vec2 co, float shft) {\n\treturn smooth_mix(smooth_mix(random(floor(co),shft),random(floor(co+vec2(1.,0.)),shft),fract(co.x)),smooth_mix(random(floor(co+vec2(0.,1.)),shft),random(floor(co+vec2(1.,1.)),shft),fract(co.x)),fract(co.y));\n}\nvec4 blendedColor(vec2 p) {\n return mix(getFromColor(p), getToColor(p), sigmoid(progress,10.));\n}\n\nvec4 transition(vec2 p) {\n vec3 f = vec3(0.);\n for (float i = 0.; i < 13.; i++) {\n f += sin(((p.x*rand(i)*6.)+(progress*8.))+rand(i+1.43))*sin(((p.y*rand(i+4.4)*6.)+(progress*6.))+rand(i+2.4));\n f += 1.-clamp(length(p-vec2(smooth_random(vec2(progress*1.3),i+1.),smooth_random(vec2(progress*.5),i+6.25)))*mix(20.,70.,rand(i)),0.,1.);\n }\n f += 4.;\n f /= 11.;\n f = pow3(f*vec3(1.,0.7,0.6),vec3(1.,2.-sin(progress*3.14159265358979323),1.3));\n f *= sin(progress*3.14159265358979323);\n \n p -= .5;\n p *= 1.+(smooth_random(vec2(progress*5.),6.3)*sin(progress*3.14159265358979323)*.05);\n p += .5;\n \n vec4 blurred_image = vec4(0.);\n float bluramount = sin(progress*3.14159265358979323)*.03;\n\n for (float i = 0.; i < 50.; i++) { \n vec2 q = vec2(cos(degrees((i/50.)*360.)),sin(degrees((i/50.)*360.))) * (rand(vec2(i,p.x+p.y))+bluramount); \n vec2 uv2 = p+(q*bluramount);\n blurred_image += blendedColor(uv2);\n }\n blurred_image /= 50.;\n \n return blurred_image+vec4(f,0.);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FilmDissolve":"// FilmDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FilmDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: A cross-dissolve blended in linear light, as light adds up on film: the frame keeps its brightness all the way through and the highlights of each image shine through the other\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float overlap; \n\nuniform float smoothness; \n\nvec3 toLinear(vec3 c) {\n vec3 lo = c / 12.92;\n vec3 hi = pow((c + 0.055) / 1.055, vec3(2.4));\n return mix(lo, hi, vec3(greaterThan(c, vec3(0.04045))));\n}\n\nvec3 toSrgb(vec3 c) {\n vec3 lo = c * 12.92;\n vec3 hi = 1.055 * pow(c, vec3(1.0 / 2.4)) - 0.055;\n return mix(lo, hi, vec3(greaterThan(c, vec3(0.0031308))));\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n if (progress <= 0.0) return a;\n if (progress >= 1.0) return b;\n\n float t = mix(progress, smoothstep(0.0, 1.0, progress), smoothness);\n\n \n vec3 la = toLinear(clamp(a.rgb, 0.0, 1.0)) * a.a;\n vec3 lb = toLinear(clamp(b.rgb, 0.0, 1.0)) * b.a;\n vec3 base = mix(la, lb, t);\n float alpha = mix(a.a, b.a, t);\n\n \n \n float extra = overlap * min(t, 1.0 - t);\n vec3 excess = extra * (la + lb);\n vec3 room = max(vec3(alpha) - base, vec3(1e-5));\n vec3 color = base + room * (1.0 - exp(-excess / room));\n\n if (alpha <= 0.0) return vec4(0.0);\n return vec4(toSrgb(clamp(color / alpha, 0.0, 1.0)), alpha);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FilmStrip":"// FilmStrip — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FilmStrip.glsl\n// Author: gre\n// License: MIT\n// Description: The picture slips like film in a projector gate: it shrinks to show the sprocket holes, the strip runs down with motion blur and a slight weave, then the incoming frame lands in place\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int frames; \n\nuniform float shrink; \n\nuniform float blur; \n\nuniform float weave; \n\nuniform vec4 filmColor; \n\nuniform vec4 holeColor; \n\nconst float FRAME_LINE = 0.08;\n\nconst float HOLES = 4.0;\nconst int SAMPLES = 16;\n\nfloat dither(vec2 cell) {\n return fract(52.9829189 * fract(dot(cell, vec2(0.06711056, 0.00583715))));\n}\n\nvec4 film(float x, float y, float base, float n, float aa, float holeX, vec2 holeSize, float holes) {\n float pitch = 1.0 + FRAME_LINE;\n float jy = floor(y / pitch);\n float j = base + jy;\n float fy = y - jy * pitch;\n vec4 c = filmColor;\n if (x >= 0.0 && x <= 1.0 && fy <= 1.0) {\n vec2 q = vec2(x, fy);\n c = j < n ? getFromColor(q) : getToColor(q);\n }\n \n float inside = min(min(x, 1.0 - x) * ratio, min(fy, 1.0 - fy));\n c = mix(filmColor, c, clamp(inside / aa + 0.5, 0.0, 1.0));\n \n float hy = mod(y, pitch / HOLES) - 0.5 * pitch / HOLES;\n float hx = (abs(x - 0.5) - holeX) * ratio;\n vec2 dd = abs(vec2(hx, hy)) - holeSize + 0.3 * holeSize.x;\n float sd = length(max(dd, 0.0)) + min(max(dd.x, dd.y), 0.0) - 0.3 * holeSize.x;\n return mix(c, holeColor, clamp(0.5 - sd / aa, 0.0, 1.0) * holes);\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n float n = max(float(frames), 1.0);\n float pitch = 1.0 + FRAME_LINE;\n float p = progress;\n \n float env = smoothstep(0.0, 0.3, p) * (1.0 - smoothstep(0.7, 1.0, p));\n float k = 1.0 - shrink * env;\n \n float x0 = clamp((p - 0.15) / 0.7, 0.0, 1.0);\n float slip = x0 * x0 * x0 * (x0 * (x0 * 6.0 - 15.0) + 10.0);\n float speed = 30.0 * x0 * x0 * (1.0 - x0) * (1.0 - x0) / 0.7; \n \n float wob = weave * env;\n \n float dx = wob * smoothstep(0.0, 0.1, shrink) * (0.006 * sin(p * 47.0) + 0.004 * sin(p * 113.0 + 1.3));\n float dy = wob * 0.012 * sin(p * 71.0 + 0.4) * (1.0 - speed / 2.7);\n\n \n float frameSlip = slip * n;\n float base = floor(frameSlip);\n float x = (uv.x - 0.5) / k + 0.5 + dx;\n float y = (uv.y - 0.5) / k + 0.5 + dy + (frameSlip - base) * pitch;\n \n float aa = 0.002 * min(1.0, 10.0 * env) * min(1.0, 20.0 * shrink) + 1e-4;\n \n float margin = 0.5 * shrink / max(1.0 - shrink, 0.01);\n float holeX = 0.5 + 0.5 * margin;\n vec2 holeSize = vec2(0.28 * margin * ratio, 0.11 * pitch / HOLES);\n float holes = smoothstep(0.0, 0.02, margin);\n\n \n float len = blur * 0.06 * speed * n;\n vec4 color = vec4(0.0);\n if (len < 1e-5) {\n color = film(x, y, base, n, aa, holeX, holeSize, holes);\n } else {\n \n float jitter = dither(floor(uv * vec2(ratio, 1.0) * 540.0));\n for (int i = 0; i < SAMPLES; i++) {\n float t = (float(i) + jitter) / float(SAMPLES) - 0.5;\n vec4 c = film(x, y + t * len, base, n, aa, holeX, holeSize, holes);\n color += vec4(c.rgb * c.a, c.a);\n }\n color /= float(SAMPLES);\n color.rgb = color.a > 0.0 ? color.rgb / color.a : vec3(0.0);\n }\n \n color.rgb *= 1.0 - 0.08 * wob * (0.5 + 0.5 * sin(p * 157.0));\n return color;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Fisheye":"// Fisheye — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Fisheye.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image bulges toward the viewer through a strong fisheye lens, then the incoming one flattens back into place\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nvec4 transition(vec2 uv) {\n \n \n float h = smoothstep(0.0, 1.0, 1.0 - abs(2.0 * progress - 1.0));\n float k = 1.0 - pow(max(1.0 - strength, 0.01), h);\n \n vec2 aspect = vec2(ratio, 1.0);\n vec2 c = (uv - 0.5) * aspect;\n float r = length(c) / length(0.5 * aspect);\n \n \n vec2 q = 0.5 + (uv - 0.5) * (1.0 - k + k * r * r);\n return mix(getFromColor(q), getToColor(q), smoothstep(0.38, 0.62, progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FlameWipe":"// FlameWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FlameWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A wall of flames sweeps across the frame, scorching the outgoing image ahead of it and leaving the incoming image under a fading warm glow\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float height; \n\nuniform float scorch; \n\nuniform float glow; \n\nuniform vec3 color; \n\nconst float BAND = 0.45;\n\nconst float PAD = 0.3;\n\nconst float RAGGED = 0.05;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nfloat noise(vec2 v) {\n vec2 i = floor(v);\n vec2 f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash12(i), hash12(i + vec2(1.0, 0.0)), f.x),\n mix(hash12(i + vec2(0.0, 1.0)), hash12(i + vec2(1.0, 1.0)), f.x), f.y);\n}\n\nfloat fbm(vec2 v) {\n float sum = 0.0;\n float amp = 0.5;\n for (int i = 0; i < 4; i++) {\n sum += amp * noise(v);\n v = v * 2.03 + vec2(17.3, 9.1);\n amp *= 0.5;\n }\n return sum / 0.9375;\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec3 fire(float h) {\n vec3 c = mix(vec3(0.22, 0.01, 0.0), color * color * vec3(1.0, 0.6, 0.4), smoothstep(0.0, 0.3, h));\n c = mix(c, color, smoothstep(0.25, 0.55, h));\n c = mix(c, vec3(1.0, 0.8, 0.35), smoothstep(0.55, 0.8, h));\n return mix(c, vec3(1.0, 0.96, 0.82), smoothstep(0.8, 1.0, h));\n}\n\nfloat climbing(float s, float size) {\n return (0.42 + 0.56 * size) * 6.75 * s * (1.0 - s) * (1.0 - s);\n}\n\nvec4 transition(vec2 uv) {\n vec2 dir = length(direction) > 1e-5 ? normalize(direction) : vec2(1.0, 0.0);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n \n float rise = height * dir.y;\n \n float w = 0.05 + 0.35 * height;\n float reach = w * (1.75 + 0.6 * abs(dir.x));\n \n float extent = 0.5 * (abs(dir.x) * ratio + abs(dir.y)) + PAD;\n float e = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.3);\n \n float burn = smoothstep(0.0, 0.12, progress) * (1.0 - smoothstep(0.88, 1.0, progress));\n float scorchAmount = scorch * smoothstep(0.0, 0.2, progress);\n float glowAmount = glow * (1.0 - smoothstep(0.75, 1.0, progress));\n \n float t = progress * 5.0;\n\n float side = dot(q, vec2(-dir.y, dir.x));\n float front = mix(-extent, extent, e) + RAGGED * (2.0 * noise(vec2(side * 4.0, t * 0.4)) - 1.0);\n \n float k = dot(q, dir) - front;\n\n \n \n \n float billow = noise(vec2(q.x * 3.0 + 5.0, q.y * 2.5 - t * 1.6));\n float y = q.y * 3.0 - t * 1.4;\n float y2 = y + 0.5;\n float climb = max(climbing(fract(y), hash12(vec2(floor(y), 3.0))),\n climbing(fract(y2), hash12(vec2(floor(y2), 7.0))));\n billow = mix(billow, 0.4 * billow + climb, abs(dir.x));\n float lineWidth = w * (0.25 + 1.5 * billow);\n float line = 1.0 - smoothstep(0.0, lineWidth, abs(k));\n float tongue = 0.0;\n if (abs(rise) > 1e-4) {\n float s = k / rise;\n if (s >= 0.0) tongue = clamp(1.0 - s, 0.0, 1.0);\n }\n float heat = max(line, tongue) * burn;\n float near = 1.0 - smoothstep(0.0, BAND, abs(k));\n\n \n vec2 h = q * vec2(9.0, 5.0) + vec2(0.0, -t * 3.0);\n vec2 shimmer = (vec2(noise(h), noise(h + 31.7)) - 0.5) * 0.012 * min(near + heat, 1.0) * burn;\n vec4 a = getFromColor(mirror(uv + shimmer));\n vec4 b = getToColor(uv);\n\n \n float brown = k > 0.0 ? scorchAmount * near : 0.0;\n float lum = dot(a.rgb, vec3(0.299, 0.587, 0.114));\n a.rgb = mix(a.rgb, lum * vec3(0.9, 0.55, 0.28), brown) * (1.0 - 0.35 * brown) * (1.0 - 0.9 * brown * near * near);\n \n float g = k < 0.0 ? glowAmount * near : 0.0;\n b.rgb = b.rgb * mix(vec3(1.0), vec3(1.0, 0.6, 0.35), 0.7 * g) + color * 0.4 * g * g;\n\n \n if (k >= max(BAND, max(rise, reach))) return a.a > 0.0 ? a : vec4(0.0);\n if (-k >= max(BAND, max(-rise, reach))) return b.a > 0.0 ? b : vec4(0.0);\n\n \n float m = smoothstep(-0.5 * w, 0.5 * w, k);\n vec4 c = mix(vec4(b.rgb * b.a, b.a), vec4(a.rgb * a.a, a.a), m);\n if (c.a <= 0.0) return vec4(0.0);\n vec3 col = c.rgb / c.a;\n\n \n vec2 f = vec2(q.x * mix(10.0, 6.0, abs(dir.x)), q.y * mix(1.8, 3.2, abs(dir.x)) - t * 2.4);\n float sway = fbm(vec2(q.x * 2.5, q.y * 1.5 - t * 1.2));\n float n = fbm(f + vec2(1.5 * sway - 0.75, 0.0));\n n = clamp(1.7 * n - 0.35, 0.0, 1.0);\n \n float core = (1.0 - smoothstep(0.0, 0.35 * lineWidth, abs(k + 0.4 * w * (sway - 0.5)))) * burn * (1.0 - 0.5 * abs(dir.x));\n \n float root = rise > 0.0 ? clamp(-k / w, 0.0, 1.0) : rise < 0.0 ? clamp(k / w, 0.0, 1.0) : 0.0;\n root *= abs(dir.y);\n float flame = clamp(heat * 0.95 + 0.45 * core * (0.75 + 0.25 * n) - (1.0 - n) * 1.1 * (1.0 - 0.8 * root), 0.0, 1.0);\n\n \n \n \n float body = smoothstep(0.0, 0.08 + 0.5 * root, flame);\n col = col * (1.0 - 0.7 * body) + fire(flame) * (0.45 + 0.65 * flame) * body;\n col += color * 0.25 * heat * heat * (1.0 - body);\n return vec4(clamp(col, 0.0, 1.0), c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FlashFade":"// FlashFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FlashFade.glsl\n// Author: gre\n// License: MIT\n// Description: A crossfade that brightens toward a color in the middle\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec3 color ;\nvec4 transition (vec2 uv) {\n return mix(\n getFromColor(uv) + vec4(progress*color, 0.0),\n getToColor(uv) + vec4((1.0-progress)*color, 0.0),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FlowerWipe":"// FlowerWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FlowerWipe.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: A flower shape with several petals grows to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int segments; \n\nvec4 transition (vec2 uv) {\n \n float angle = atan(uv.y - 0.5, uv.x - 0.5) - 0.5 * 3.14159265359;\n float normalized = (angle + 1.5 * 3.14159265359) * (2.0 * 3.14159265359);\n \n float radius = (cos(float(segments) * angle) + 4.0) / 4.0;\n float difference = length(uv - vec2(0.5, 0.5));\n \n if (difference > radius * progress)\n return getFromColor(uv);\n else\n return getToColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FlyEye":"// FlyEye — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FlyEye.glsl\n// Author: gre\n// License: MIT\n// Description: The image breaks into a fly's-eye grid of lenses with color separation\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float size; \nuniform float zoom; \nuniform float colorSeparation; \n\nvec4 transition(vec2 p) {\n float inv = 1. - progress;\n vec2 disp = size*vec2(cos(zoom*p.x), sin(zoom*p.y));\n vec4 texTo = getToColor(p + inv*disp);\n vec4 fromCenter = getFromColor(p + progress*disp);\n vec4 texFrom = vec4(\n getFromColor(p + progress*disp*(1.0 - colorSeparation)).r,\n fromCenter.g,\n getFromColor(p + progress*disp*(1.0 + colorSeparation)).b,\n fromCenter.a);\n return texTo*progress + texFrom*inv;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Fold":"// Fold — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Fold.glsl\n// Author: nwoeanhinnogaehr\n// License: MIT\n// Description: The incoming image unfolds from the left while the outgoing one folds away to the right\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n \n if (progress == 0.0 || uv.x > progress) return getFromColor((uv - vec2(progress, 0.0)) / vec2(1.0 - progress, 1.0));\n return getToColor(uv / vec2(progress, 1.0));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Gallery":"// Gallery — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Gallery.glsl\n// Author: gre\n// License: MIT\n// Description: The camera pulls back from the outgoing image to show it as a slide hanging in a row on a wall in perspective, the row glides along as each slide turns away from the center, and the camera moves back in on the incoming slide until it fills the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float direction; \n\nuniform float tilt; \n\nuniform float gap; \n\nuniform float zoom; \n\nuniform float reflection; \n\nuniform vec4 background; \n\nconst float FOCAL = 1.6; \nconst float MAX_ANGLE = 1.4; \nconst float NEIGHBOUR = 0.3; \nconst float AA = 0.002; \n\nvec4 premultiply(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nfloat offset(float k, float camQ, float spacing) {\n return clamp((k * spacing - camQ) / spacing, -1.0, 1.0);\n}\n\nvec4 slideHit(vec3 o, vec3 d, float k, float s, float camQ, float spacing, float aa) {\n \n float a = -s * MAX_ANGLE * tilt * offset(k, camQ, spacing);\n vec3 c = vec3(s * k * spacing, 0.0, 0.0);\n vec3 tg = vec3(cos(a), 0.0, sin(a)); \n vec3 n = vec3(-tg.z, 0.0, tg.x);\n float dn = dot(d, n);\n if (abs(dn) < 1e-5) return vec4(0.0, 0.0, -1.0, 0.0);\n float t = dot(c - o, n) / dn;\n vec3 q = o + d * t - c;\n float lx = dot(q, tg) + 0.5 * ratio;\n float ly = q.y + 0.5;\n \n float jx = abs(t * (tg.x - dot(d, tg) * n.x / dn));\n float ex = min(lx, ratio - lx) / max(jx, 1e-6);\n float ey = min(ly, 1.0 - ly) / max(t, 1e-6);\n float cov = t > 0.0 ? clamp(0.5 + min(ex, ey) / aa, 0.0, 1.0) : 0.0;\n return vec4(lx / ratio, ly, t, cov);\n}\n\nvec4 slideColor(vec4 h, float k, float camQ, float spacing, float refl, vec4 bg) {\n if (h.w <= 0.0) return vec4(0.0);\n vec2 st = clamp(h.xy, 0.0, 1.0);\n vec4 c = premultiply(k < 0.5 ? getFromColor(st) : getToColor(st));\n \n c.rgb *= 1.0 - 0.3 * tilt * abs(offset(k, camQ, spacing));\n if (k < -0.5 || k > 1.5) c = mix(bg, c, NEIGHBOUR);\n \n float f = refl > 0.0 ? refl * (1.0 - smoothstep(0.0, 0.6, st.y)) : 1.0;\n return c * (h.w * f);\n}\n\nfloat sceneCover(vec3 o, vec3 d, float s, float camQ, float spacing, float aa) {\n float kc = floor(s * (o.x + d.x * o.z / -d.z) / spacing + 0.5);\n float w0 = slideHit(o, d, kc - 1.0, s, camQ, spacing, aa).w;\n float w1 = slideHit(o, d, kc, s, camQ, spacing, aa).w;\n float w2 = slideHit(o, d, kc + 1.0, s, camQ, spacing, aa).w;\n return 1.0 - (1.0 - w0) * (1.0 - w1) * (1.0 - w2);\n}\n\nvec4 scene(vec3 o, vec3 d, float s, float camQ, float spacing, float aa, float refl, vec4 bg) {\n \n float wallQ = s * (o.x + d.x * o.z / -d.z);\n float kc = floor(wallQ / spacing + 0.5);\n vec4 h0 = slideHit(o, d, kc - 1.0, s, camQ, spacing, aa);\n vec4 h1 = slideHit(o, d, kc, s, camQ, spacing, aa);\n vec4 h2 = slideHit(o, d, kc + 1.0, s, camQ, spacing, aa);\n vec4 c0 = slideColor(h0, kc - 1.0, camQ, spacing, refl, bg);\n vec4 c1 = slideColor(h1, kc, camQ, spacing, refl, bg);\n vec4 c2 = slideColor(h2, kc + 1.0, camQ, spacing, refl, bg);\n float t0 = h0.w > 0.0 ? h0.z : 1e6;\n float t1 = h1.w > 0.0 ? h1.z : 1e6;\n float t2 = h2.w > 0.0 ? h2.z : 1e6;\n \n vec4 tc;\n float tt;\n if (t0 < t1) { tc = c0; c0 = c1; c1 = tc; tt = t0; t0 = t1; t1 = tt; }\n if (t1 < t2) { tc = c1; c1 = c2; c2 = tc; tt = t1; t1 = t2; t2 = tt; }\n if (t0 < t1) { tc = c0; c0 = c1; c1 = tc; }\n vec4 col = c0;\n col = c1 + col * (1.0 - c1.a);\n col = c2 + col * (1.0 - c2.a);\n return col;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n float s = direction < 0.0 ? -1.0 : 1.0;\n float spacing = ratio * (1.0 + gap);\n \n float back = smoothstep(0.0, 0.42, p) * (1.0 - smoothstep(0.58, 1.0, p));\n float m = clamp((p - 0.18) / 0.64, 0.0, 1.0);\n float glide = m * m * m * (m * (m * 6.0 - 15.0) + 10.0);\n float camQ = spacing * glide;\n vec3 o = vec3(s * camQ, 0.0, FOCAL * (1.0 + zoom * back));\n vec3 d = vec3((uv - 0.5) * vec2(ratio, 1.0), -FOCAL);\n float amount = min(1.0, 40.0 * back);\n float aa = max(AA * amount, 1e-6);\n vec4 bg = premultiply(background);\n\n vec4 col = scene(o, d, s, camQ, spacing, aa, 0.0, bg);\n if (col.a < 1.0) {\n vec4 under = bg;\n \n if (d.y < 0.0 && reflection > 0.0) {\n vec4 r = scene(vec3(o.x, -1.0 - o.y, o.z), vec3(d.x, -d.y, d.z), s, camQ, spacing, aa, reflection, bg);\n under = r + bg * (1.0 - r.a);\n }\n \n \n col += under * (mix(1.0, amount, sceneCover(o, d, s, camQ, spacing, aa)) * (1.0 - col.a));\n }\n return col.a > 0.0 ? vec4(col.rgb / col.a, col.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GlitchBands":"// GlitchBands — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlitchBands.glsl\n// Author: Yoni Maltsman @friendlyspinach\n// License: MIT\n// Description: A crossfade with glitchy horizontal bands and color shifts\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float ampx; \n\nuniform float ampy; \n\nvec4 transition (vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n float r = from.r;\n float g = from.g;\n float b = from.b;\n float sphere = r*r + g*g + b*b - 1.0; \n float spiralX = cos(sphere - uv.x/(progress + .01));\n float spiralY = sin(sphere - uv.y/(progress+.01));\n vec2 st = uv;\n st.x = fract(ampx*st.x*spiralX); \n st.y = fract(ampy*st.y*spiralY);\n vec2 diff = uv - st;\n from = getFromColor(uv + progress*diff);\n return mix(from, to, progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GlitchDisplace":"// GlitchDisplace — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlitchDisplace.glsl\n// Author: Matt DesLauriers\n// License: MIT\n// Description: Blocks of the image are displaced in a glitch that flashes into the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat random(vec2 co)\n{\n float a = 12.9898;\n float b = 78.233;\n float c = 43758.5453;\n float dt= dot(co.xy ,vec2(a,b));\n float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\nfloat voronoi( in vec2 x ) {\n vec2 p = floor( x );\n vec2 f = fract( x );\n float res = 8.0;\n for( float j=-1.; j<=1.; j++ )\n for( float i=-1.; i<=1.; i++ ) {\n vec2 b = vec2( i, j );\n vec2 r = b - f + random( p + b );\n float d = dot( r, r );\n res = min( res, d );\n }\n return sqrt( res );\n}\n\nvec2 displace(vec4 tex, vec2 texCoord, float dotDepth, float textureDepth, float strength) {\n float b = voronoi(.003 * texCoord + 2.0);\n float g = voronoi(0.2 * texCoord);\n float r = voronoi(texCoord - 1.0);\n vec4 dt = tex * 1.0;\n vec4 dis = dt * dotDepth + 1.0 - tex * textureDepth;\n\n dis.x = dis.x - 1.0 + textureDepth*dotDepth;\n dis.y = dis.y - 1.0 + textureDepth*dotDepth;\n dis.x *= strength;\n dis.y *= strength;\n vec2 res_uv = texCoord ;\n res_uv.x = res_uv.x + dis.x - 0.0;\n res_uv.y = res_uv.y + dis.y;\n return res_uv;\n}\n\nfloat ease1(float t) {\n return t == 0.0 || t == 1.0\n ? t\n : t < 0.5\n ? +0.5 * pow(2.0, (20.0 * t) - 10.0)\n : -0.5 * pow(2.0, 10.0 - (t * 20.0)) + 1.0;\n}\nfloat ease2(float t) {\n return t == 1.0 ? t : 1.0 - pow(2.0, -10.0 * t);\n}\n\nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy;\n vec4 color1 = getFromColor(p);\n vec4 color2 = getToColor(p);\n vec2 disp = displace(color1, p, 0.33, 0.7, 1.0-ease1(progress));\n vec2 disp2 = displace(color2, p, 0.33, 0.5, ease2(progress));\n vec4 dColor1 = getToColor(disp);\n vec4 dColor2 = getFromColor(disp2);\n float val = ease1(progress);\n vec3 gray = vec3(dot(min(dColor2, dColor1).rgb, vec3(0.299, 0.587, 0.114)));\n dColor2 = vec4(gray * 2.0, dColor2.a);\n color1 = mix(color1, dColor2, smoothstep(0.0, 0.5, progress));\n color2 = mix(color2, dColor1, smoothstep(1.0, 0.5, progress));\n return mix(color1, color2, val);\n \n\n \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GlitchFlicker":"// GlitchFlicker — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlitchFlicker.glsl\n// Author: bread\n// License: MIT\n// Description: A flickering glitch with RGB offset, ghosting and scanlines that flashes back to the outgoing image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float frameRate; \nuniform float rgbOffset; \nuniform float blockAmount; \nuniform float ghostAmount; \nuniform float redCyan; \nuniform float scanline; \n\nfloat sat(float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nfloat hash12(vec2 p) {\n p = fract(p * vec2(443.8975, 397.2973));\n p += dot(p, p.yx + 19.19);\n return fract(p.x * p.y);\n}\n\nvec2 safeUv(vec2 uv) {\n return clamp(uv, vec2(0.001), vec2(0.999));\n}\n\nfloat frameReveal(float f) {\n if (f < 0.5) return 0.00;\n if (f < 1.5) return 0.28;\n if (f < 2.5) return 0.43;\n if (f < 3.5) return 0.46;\n if (f < 4.5) return 0.38;\n if (f < 5.5) return 0.48;\n if (f < 6.5) return 0.26;\n if (f < 7.5) return 0.10;\n if (f < 8.5) return 0.00;\n if (f < 9.5) return 0.00;\n if (f < 10.5) return 0.30;\n if (f < 11.5) return 0.58;\n if (f < 12.5) return 1.00;\n if (f < 13.5) return 0.70;\n if (f < 14.5) return 0.42;\n if (f < 15.5) return 0.55;\n if (f < 16.5) return 0.72;\n if (f < 17.5) return 0.88;\n if (f < 18.5) return 0.34;\n if (f < 19.5) return 0.48;\n if (f < 20.5) return 0.56;\n if (f < 21.5) return 0.76;\n if (f < 22.5) return 0.93;\n return 1.00;\n}\n\nfloat frameGlitch(float f) {\n if (f < 0.5) return 0.00;\n if (f < 6.5) return 0.92;\n if (f < 10.5) return 0.38;\n if (f < 11.5) return 0.78;\n if (f < 12.5) return 0.12;\n if (f < 17.5) return 0.74;\n if (f < 22.5) return 0.88;\n if (f < 23.5) return 0.28;\n return 0.00;\n}\n\nvec4 chromaFrom(vec2 uv, float amt) {\n vec2 o = vec2(amt, 0.0);\n vec4 center = getFromColor(safeUv(uv));\n return vec4(\n getFromColor(safeUv(uv + o)).r,\n center.g,\n getFromColor(safeUv(uv - o)).b,\n center.a\n );\n}\n\nvec4 chromaTo(vec2 uv, float amt) {\n vec2 o = vec2(amt, 0.0);\n vec4 center = getToColor(safeUv(uv));\n return vec4(\n getToColor(safeUv(uv - o)).r,\n center.g,\n getToColor(safeUv(uv + o)).b,\n center.a\n );\n}\n\nfloat blockMask(vec2 uv, float f) {\n vec2 big = floor(uv * vec2(4.0, 2.0));\n vec2 small = floor(uv * vec2(8.0, 4.0));\n\n float wide = step(0.48, hash12(vec2(big.x, f * 1.37)));\n float chunks = step(0.56, hash12(small + vec2(f * 2.11, f * 0.73)));\n\n float verticalCut = smoothstep(\n -0.035,\n 0.035,\n uv.x - mix(0.18, 0.78, hash12(vec2(f, 4.7)))\n );\n\n return sat(mix(wide, chunks, 0.38) * 0.72 + verticalCut * 0.28);\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n float f = floor(progress * frameRate);\n float reveal = frameReveal(f);\n float glitch = frameGlitch(f);\n\n float rnd = hash12(vec2(f, 9.13));\n vec2 jitter = vec2(\n (rnd - 0.5) * 0.042,\n (hash12(vec2(f, 2.71)) - 0.5) * 0.010\n ) * glitch;\n\n vec2 fromUv = safeUv(uv + jitter);\n vec2 toUv = safeUv(uv - jitter * 0.55);\n\n float block = blockMask(uv, f);\n float localReveal = sat(\n reveal +\n (block - 0.5) * blockAmount * glitch +\n (hash12(vec2(f, floor(uv.y * 9.0))) - 0.5) * 0.18 * glitch\n );\n\n localReveal = smoothstep(0.22, 0.78, localReveal);\n\n vec4 oldClip = chromaFrom(fromUv, rgbOffset * glitch);\n vec4 newClip = chromaTo(toUv, rgbOffset * glitch);\n\n vec4 color = mix(oldClip, newClip, localReveal);\n\n float leftWash = (1.0 - smoothstep(0.10, 0.78, uv.x)) * glitch;\n float cyanWash = smoothstep(0.08, 0.62, uv.x) * (1.0 - smoothstep(0.86, 1.0, uv.x)) * glitch;\n\n vec3 redGhost = oldClip.rgb * vec3(1.34, 0.42, 0.38);\n vec3 cyanGhost = newClip.rgb * vec3(0.48, 1.12, 1.24);\n\n color.rgb = mix(color.rgb, redGhost, leftWash * redCyan * 0.42);\n color.rgb = mix(color.rgb, cyanGhost, cyanWash * redCyan * 0.30);\n\n \n \n float oldReturn = glitch * (1.0 - smoothstep(0.94, 1.0, reveal));\n oldReturn *= 0.18 + 0.52 * (1.0 - abs(localReveal - 0.5) * 2.0);\n color.rgb = mix(color.rgb, oldClip.rgb, oldReturn * ghostAmount);\n\n float lines = sin((uv.y + f * 0.017) * 1080.0);\n color.rgb += lines * scanline * glitch;\n\n float exposurePulse = (hash12(vec2(f, 12.4)) - 0.35) * 0.10 * glitch;\n color.rgb += exposurePulse;\n\n return vec4(sat(color.r), sat(color.g), sat(color.b), color.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GlitchMemories":"// GlitchMemories — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlitchMemories.glsl\n// Author: Gunnar Roth\n// License: MIT\n// Description: A crossfade with glitchy, color-shifted blocks\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 p) {\n vec2 block = floor(p.xy / vec2(16));\n vec2 uv_noise = block / vec2(64);\n uv_noise += floor(vec2(progress) * vec2(1200.0, 3500.0)) / vec2(64);\n vec2 dist = progress > 0.0 ? (fract(uv_noise) - 0.5) * 0.3 *(1.0 -progress) : vec2(0.0);\n vec2 red = p + dist * 0.2;\n vec2 green = p + dist * .3;\n vec2 blue = p + dist * .5;\n\n vec4 center = mix(getFromColor(green), getToColor(green), progress);\n return vec4(mix(getFromColor(red), getToColor(red), progress).r, center.g, mix(getFromColor(blue), getToColor(blue), progress).b, center.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GlowDissolve":"// GlowDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlowDissolve.glsl\n// Author: hjm1fb\n// License: MIT\n// Description: The incoming image spreads over the outgoing one with a hot, glowing edge\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float uLineWidth; \n\nuniform vec3 uSpreadClr; \n\nuniform vec3 uHotClr; \nuniform float uPow; \nuniform float uIntensity; \n\nvec2 hash(vec2 p) \n{\n p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));\n return -1.0 + 2.0 * fract(sin(p) * 43758.5453123);\n}\n\nfloat noise(in vec2 p) {\n const float K1 = 0.366025404; \n const float K2 = 0.211324865; \n\n vec2 i = floor(p + (p.x + p.y) * K1);\n vec2 a = p - i + (i.x + i.y) * K2;\n float m = step(a.y, a.x);\n vec2 o = vec2(m, 1.0 - m);\n vec2 b = a - o + K2;\n vec2 c = a - 1.0 + 2.0 * K2;\n vec3 h = max(0.5 - vec3(dot(a, a), dot(b, b), dot(c, c)), 0.0);\n vec3 n = h * h * h * h * vec3(dot(a, hash(i + 0.0)), dot(b, hash(i + o)), dot(c, hash(i + 1.0)));\n return dot(n, vec3(70.0));\n}\n\nvec4 transition(vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n vec4 outColor;\n float burn;\n burn = 0.5 + 0.5 * (0.299 * from.r + 0.587 * from.g + 0.114 * from.b);\n\n float show = burn - progress;\n if (show < 0.001) {\n outColor = to;\n } else {\n float factor = 1.0 - smoothstep(0.0, uLineWidth, show);\n vec3 burnColor = mix(uSpreadClr, uHotClr, factor);\n burnColor = pow(burnColor, vec3(uPow)) * uIntensity;\n vec3 finalRGB = mix(from.rgb, burnColor, factor * step(0.0001, progress));\n outColor = vec4(finalRGB, from.a); \n }\n return outColor;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GooeyWipe":"// GooeyWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GooeyWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Soft, glossy blobs of liquid pop up over the outgoing image, swell and melt into each other, revealing the incoming image until they cover the whole frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float blobs; \n\nuniform float smoothness; \n\nuniform vec4 highlight; \n\nuniform vec4 shadow; \n\nfloat hash (vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nvec2 fold (vec2 p) {\n return 1.0 - abs(1.0 - mod(p, 2.0));\n}\n\nvec3 blob (vec2 cell, float rStart, float rEnd) {\n vec2 c = cell + 0.5 + 0.7 * (vec2(hash(cell + 0.5), hash(cell + 41.3)) - 0.5);\n float t0 = 0.02 + 0.43 * hash(cell + 17.9); \n float s = clamp((progress - t0) / (1.0 - t0), 0.0, 1.0);\n \n float pop = clamp((progress - t0) / 0.12, 0.0, 1.0);\n pop = 1.0 - (1.0 - pop) * (1.0 - pop) * (1.0 - pop);\n float r = mix(rStart, 0.18, pop) + (rEnd - 0.18) * s * sqrt(s);\n r += 0.05 * sin(pop * 9.0) * (1.0 - s) * pop;\n return vec3(r, c);\n}\n\nvec4 transition (vec2 uv) {\n float n = max(1.0, floor(blobs + 0.5));\n float cellSize = max(ratio, 1.0) / n;\n vec2 q = vec2(uv.x * ratio, uv.y) / cellSize; \n vec2 base = floor(q);\n float k = 0.02 + 0.25 * smoothness; \n float w = 0.16; \n \n \n float rStart = -(0.03 + 4.0 * k);\n float rEnd = 0.85 * sqrt(2.0) + w + 0.05;\n \n \n float m = 1e3; \n float sum = 0.0;\n vec2 grad = vec2(0.0);\n float rNear = 0.0; \n for (int j = -3; j <= 3; j++) {\n for (int i = -3; i <= 3; i++) {\n vec3 b = blob(base + vec2(float(i), float(j)), rStart, rEnd);\n vec2 dq = q - b.yz;\n float l = length(dq);\n float dist = l - b.x;\n vec2 g = dq / max(l, 1e-4);\n if (dist < m) {\n float scale = exp((dist - m) / k);\n sum = sum * scale + 1.0;\n grad = grad * scale + g;\n m = dist;\n rNear = b.x;\n } else {\n float wt = exp((m - dist) / k);\n sum += wt;\n grad += wt * g;\n }\n }\n }\n float d = m - k * log(sum); \n grad /= sum;\n float aa = 0.012 * n / 5.0;\n float inside = 1.0 - smoothstep(-aa, aa, d);\n \n float h = clamp(-d / w, 0.0, 1.0);\n float settle = 1.0 - smoothstep(0.45, 0.85, progress);\n float tilt = (1.0 - h) * (1.0 - h) * settle;\n vec3 nrm = normalize(vec3(grad * tilt * 3.0, 1.0));\n vec3 halfway = normalize(vec3(-0.35, 0.45, 1.0) + vec3(0.0, 0.0, 1.0));\n float spec = pow(max(dot(nrm, halfway), 0.0), 200.0) * settle;\n \n float shade = 1.0 - tilt * (0.25 + 0.3 * clamp(dot(grad, vec2(0.6, -0.8)) + 0.3, 0.0, 1.0));\n vec4 to = getToColor(fold(uv - grad * tilt * 0.01 * cellSize / vec2(ratio, 1.0)));\n float t2 = tilt * tilt;\n float gloss = 0.3 * t2 * t2; \n to.rgb = mix(to.rgb * shade, highlight.rgb, clamp(spec + gloss, 0.0, 1.0) * highlight.a);\n vec4 from = getFromColor(uv);\n float sh = shadow.a * (1.0 - smoothstep(0.0, 0.15, d + 0.03)) * smoothstep(0.0, 0.3, rNear);\n from.rgb = mix(from.rgb, shadow.rgb, sh);\n return mix(from, to, inside);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GridFlip":"// GridFlip — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GridFlip.glsl\n// Author: TimDonselaar\n// License: MIT\n// Description: The image splits into a grid of tiles that flip one by one to the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 size; \nuniform float pause; \nuniform float dividerWidth; \n\nuniform vec4 bgcolor; \nuniform float randomness; \n \nfloat rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nfloat getDelta(vec2 p) {\n vec2 rectanglePos = floor(vec2(size) * p);\n vec2 rectangleSize = vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y);\n float top = rectangleSize.y * (rectanglePos.y + 1.0);\n float bottom = rectangleSize.y * rectanglePos.y;\n float left = rectangleSize.x * rectanglePos.x;\n float right = rectangleSize.x * (rectanglePos.x + 1.0);\n float minX = min(abs(p.x - left), abs(p.x - right));\n float minY = min(abs(p.y - top), abs(p.y - bottom));\n return min(minX, minY);\n}\n\nfloat getDividerSize() {\n vec2 rectangleSize = vec2(1.0 / vec2(size).x, 1.0 / vec2(size).y);\n return min(rectangleSize.x, rectangleSize.y) * dividerWidth;\n}\n\nvec4 transition(vec2 p) {\n if(progress < pause) {\n float currentProg = progress / pause;\n float a = 1.0;\n if(getDelta(p) < getDividerSize()) {\n a = 1.0 - currentProg;\n }\n return mix(bgcolor, getFromColor(p), a);\n }\n else if(progress < 1.0 - pause){\n if(getDelta(p) < getDividerSize()) {\n return bgcolor;\n } else {\n float currentProg = (progress - pause) / (1.0 - pause * 2.0);\n vec2 q = p;\n vec2 rectanglePos = floor(vec2(size) * q);\n \n float r = rand(rectanglePos) - randomness;\n float cp = smoothstep(0.0, 1.0 - r, currentProg);\n \n float rectangleSize = 1.0 / vec2(size).x;\n float delta = rectanglePos.x * rectangleSize;\n float offset = rectangleSize / 2.0 + delta;\n \n p.x = (p.x - offset)/abs(cp - 0.5)*0.5 + offset;\n vec4 a = getFromColor(p);\n vec4 b = getToColor(p);\n \n float s = step(abs(vec2(size).x * (q.x - delta) - 0.5), abs(cp - 0.5));\n return mix(bgcolor, mix(b, a, step(cp, 0.5)), s);\n }\n }\n else {\n float currentProg = (progress - 1.0 + pause) / pause;\n float a = 1.0;\n if(getDelta(p) < getDividerSize()) {\n a = currentProg;\n }\n return mix(bgcolor, getToColor(p), a);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Halftone":"// Halftone — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Halftone.glsl\n// Author: gre\n// License: MIT\n// Description: The image breaks into printed halftone dots whose size follows its shades, the dots reshape into the incoming image, then merge back into it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float dots; \n\nuniform float angle; \n\nuniform vec4 paper; \n\nfloat dotRadius(vec4 c) {\n float shade = 1.0 - dot(c.rgb, vec3(0.299, 0.587, 0.114));\n return mix(0.1, 0.74, sqrt(clamp(shade, 0.0, 1.0))) * c.a;\n}\n\nvec4 transition(vec2 uv) {\n \n float h = smoothstep(0.0, 0.3, progress) * (1.0 - smoothstep(0.7, 1.0, progress));\n float t = (progress - 0.3) / 0.4;\n \n float a = radians(angle);\n mat2 rot = mat2(cos(a), sin(a), -sin(a), cos(a));\n vec2 scale = vec2(ratio, 1.0) * dots / min(ratio, 1.0);\n vec2 g = rot * ((uv - 0.5) * scale);\n vec2 base = floor(g - 0.5) + 0.5;\n vec4 pixel = progress < 0.5 ? getFromColor(uv) : getToColor(uv);\n \n float best = 1e3;\n vec4 ink = pixel;\n for (int i = 0; i < 4; i++) {\n vec2 center = base + vec2(mod(float(i), 2.0), floor(float(i) / 2.0));\n vec2 cuv = (center * rot) / scale + 0.5; \n vec4 cf = getFromColor(cuv);\n vec4 ct = getToColor(cuv);\n float m = smoothstep(0.0, 1.0, clamp(2.5 * t - 1.5 * cuv.x, 0.0, 1.0));\n \n float r = mix(0.78, mix(dotRadius(cf), dotRadius(ct), m), h);\n float sd = length(g - center) - r;\n if (sd < best) {\n best = sd;\n ink = mix(pixel, mix(cf, ct, m), h);\n }\n }\n return mix(paper, ink, 1.0 - smoothstep(-0.06, 0.06, best));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","HeartWipe":"// HeartWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HeartWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A heart shape grows from the center to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat inHeart (vec2 p, vec2 center, float size) {\n if (size==0.0) return 0.0;\n vec2 o = (p-center)/(1.6*size);\n float a = o.x*o.x+o.y*o.y-0.3;\n return step(a*a*a, o.x*o.x*o.y*o.y*o.y);\n}\nvec4 transition (vec2 uv) {\n return mix(\n getFromColor(uv),\n getToColor(uv),\n inHeart(uv, vec2(0.5, 0.4), progress)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","HeatHaze":"// HeatHaze — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HeatHaze.glsl\n// Author: gre\n// License: MIT\n// Description: Shimmering heat waves rise through the frame, strongest at the bottom, making the outgoing image wobble like the air over hot asphalt; the incoming image shows through the haze and settles as it calms\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nuniform float scale; \n\nuniform float speed; \n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nfloat vnoise(vec2 v) {\n vec2 i = floor(v);\n vec2 f = fract(v);\n f = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash12(i), hash12(i + vec2(1.0, 0.0)), f.x),\n mix(hash12(i + vec2(0.0, 1.0)), hash12(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nfloat fbm(vec2 v) {\n float sum = 0.0;\n float amp = 0.5;\n for (int i = 0; i < 4; i++) {\n sum += amp * vnoise(v);\n v = mat2(1.6, 1.2, -1.2, 1.6) * v + 5.3;\n amp *= 0.5;\n }\n return (sum / 0.9375 - 0.5) * 3.0;\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n const float PI = 3.141592653589793;\n float p = progress;\n \n float amount = sin(PI * p);\n \n float t = p * speed;\n \n vec2 q = vec2(uv.x * ratio, uv.y * 2.5) * scale;\n q.y -= t * scale;\n \n vec2 w = vec2(fbm(q * 0.35 + vec2(0.0, t)), fbm(q * 0.35 + vec2(7.1, -t)));\n q += 1.5 * w;\n vec2 offset = vec2(fbm(q), 0.5 * fbm(q + vec2(3.7, 1.9)));\n \n float ground = mix(1.0, 0.3, uv.y);\n offset *= strength * amount * ground * vec2(1.0 / ratio, 1.0);\n\n vec2 d = mirror(uv + offset);\n \n float m = smoothstep(0.3, 0.7, p);\n if (m <= 0.0) return getFromColor(d);\n if (m >= 1.0) return getToColor(d);\n vec4 a = getFromColor(d);\n vec4 b = getToColor(d);\n \n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Hexagonalize":"// Hexagonalize — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Hexagonalize.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: Both images turn into hexagons, crossfade, then sharpen again\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int steps; \n\nuniform float horizontalHexagons; \n\nstruct Hexagon {\n float q;\n float r;\n float s;\n};\n\nHexagon createHexagon(float q, float r){\n Hexagon hex;\n hex.q = q;\n hex.r = r;\n hex.s = -q - r;\n return hex;\n}\n\nHexagon roundHexagon(Hexagon hex){\n \n float q = floor(hex.q + 0.5);\n float r = floor(hex.r + 0.5);\n float s = floor(hex.s + 0.5);\n\n float deltaQ = abs(q - hex.q);\n float deltaR = abs(r - hex.r);\n float deltaS = abs(s - hex.s);\n\n if (deltaQ > deltaR && deltaQ > deltaS)\n q = -r - s;\n else if (deltaR > deltaS)\n r = -q - s;\n else\n s = -q - r;\n\n return createHexagon(q, r);\n}\n\nHexagon hexagonFromPoint(vec2 point, float size) {\n \n point.y /= ratio;\n point = (point - 0.5) / size;\n \n float q = (sqrt(3.0) / 3.0) * point.x + (-1.0 / 3.0) * point.y;\n float r = 0.0 * point.x + 2.0 / 3.0 * point.y;\n\n Hexagon hex = createHexagon(q, r);\n return roundHexagon(hex);\n \n}\n\nvec2 pointFromHexagon(Hexagon hex, float size) {\n \n float x = (sqrt(3.0) * hex.q + (sqrt(3.0) / 2.0) * hex.r) * size + 0.5;\n float y = (0.0 * hex.q + (3.0 / 2.0) * hex.r) * size + 0.5;\n \n return vec2(x, y * ratio);\n}\n\nvec4 transition (vec2 uv) {\n \n float dist = 2.0 * min(progress, 1.0 - progress);\n dist = steps > 0 ? ceil(dist * float(steps)) / float(steps) : dist;\n \n float size = (sqrt(3.0) / 3.0) * dist / horizontalHexagons;\n \n vec2 point = dist > 0.0 ? pointFromHexagon(hexagonFromPoint(uv, size), size) : uv;\n\n return mix(getFromColor(point), getToColor(point), progress);\n \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Hologram":"// Hologram — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Hologram.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image turns into a flickering hologram (blue by default) with scanlines and jittering rows, breaks up, and the hologram resolves into the incoming image in full color\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec3 tint; \n\nuniform vec4 background; \n\nuniform float scanlines; \n\nuniform float jitter; \n\nuniform float flicker; \n\nconst float PI = 3.14159265;\n\nconst float STEPS = 32.0;\n\nfloat hash(vec2 p) {\n p = fract(p * vec2(443.897, 441.423));\n p += dot(p, p.yx + 19.19);\n return fract((p.x + p.y) * p.x);\n}\n\nfloat luma(vec3 c) {\n return dot(c, vec3(0.299, 0.587, 0.114));\n}\n\nvec4 premultiplied(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 source(vec2 uv, float m) {\n return m > 0.5 ? getToColor(uv) : getFromColor(uv);\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n float p = progress;\n \n float h = smoothstep(0.0, 0.3, p) * (1.0 - smoothstep(0.7, 1.0, p));\n float b = smoothstep(0.0, 1.0, 1.0 - abs(p - 0.5) / 0.22);\n float f = floor(p * STEPS);\n\n \n float band = floor(uv.y * 36.0);\n float jump = step(1.0 - (0.2 + 0.6 * b) * h, hash(vec2(band, f)));\n float offset = (hash(vec2(band, f + 0.37)) - 0.5) * 2.0 * jitter * jump * (0.3 + 0.7 * b);\n offset += sin(uv.y * 23.0 + f * 1.7) * 0.0015 * h;\n vec2 q = uv + vec2(offset, 0.0);\n\n \n float m = step(hash(vec2(floor(uv.y * 24.0), 7.0)), (p - 0.35) / 0.3);\n\n \n \n vec4 c = source(clamp(q, 0.0, 1.0), m);\n vec2 dx = vec2(0.003 + 0.01 * b, 0.0);\n float l = luma(c.rgb);\n vec4 cr = source(clamp(q + dx, 0.0, 1.0), m);\n vec4 cb = source(clamp(q - dx, 0.0, 1.0), m);\n float lr = luma(cr.rgb) * cr.a;\n float lb = luma(cb.rgb) * cb.a;\n vec3 g = smoothstep(0.05, 0.9, vec3(lr, l, lb));\n \n vec3 holo = tint * (0.06 + 1.25 * g) + 0.45 * g * g * g;\n \n float roll = fract(uv.y + 2.0 * p);\n holo += tint * 0.35 * smoothstep(0.85, 1.0, roll) * (1.0 - smoothstep(0.98, 1.0, roll));\n holo = clamp(holo, 0.0, 1.0);\n \n float inside = step(0.0, q.x) * step(q.x, 1.0);\n\n \n float lines = 0.5 + 0.5 * sin((uv.y * scanlines - p * 6.0) * 2.0 * PI);\n float vis = mix(1.0, 0.15 + 0.85 * lines, h);\n vis *= 1.0 - flicker * (0.25 + 0.75 * b) * hash(vec2(f, 3.1)) * h;\n float gap = step(hash(vec2(floor(uv.y * 90.0), f + 0.71)), flicker * 0.45 * b);\n vis *= 1.0 - gap;\n vec4 layer = vec4(holo, c.a * vis * inside);\n \n \n vec4 plain = premultiplied(source(uv, m));\n vec4 back = premultiplied(vec4(background.rgb, background.a * max(plain.a, layer.a)));\n vec4 holoColor = premultiplied(layer) + back * (1.0 - layer.a);\n\n \n vec4 o = mix(plain, holoColor, h);\n return o.a > 0.0 ? vec4(o.rgb / o.a, o.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Honeycomb":"// Honeycomb — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Honeycomb.glsl\n// Author: gre\n// License: MIT\n// Description: The image splits into hexagons that spin and shrink away in a wave from the center, uncovering the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float size; \n\nfloat hexDist(vec2 p) {\n p = abs(p);\n return max(p.x, dot(p, vec2(0.5, 0.8660254)));\n}\n\nmat2 rotation(float a) {\n return mat2(cos(a), sin(a), -sin(a), cos(a));\n}\n\nfloat hexMask(vec2 local, float s, float a, float e) {\n float r = (0.52 + e) * s;\n return 1.0 - smoothstep(r - e, r, hexDist(rotation(-a) * local));\n}\n\nvec2 hexUv(vec2 uv, vec2 local, vec2 cellToUv, float s, float a) {\n return uv + cellToUv * (rotation(-a) * local / max(s, 0.001) - local);\n}\n\nvec4 transition(vec2 uv) {\n \n vec2 toCells = vec2(ratio, 1.0) * size / min(ratio, 1.0);\n vec2 p = (uv - 0.5) * toCells;\n const vec2 grid = vec2(1.0, 1.7320508);\n vec2 a = (floor(p / grid) + 0.5) * grid;\n vec2 b = (floor((p - 0.5 * grid) / grid) + 1.0) * grid;\n vec2 center = dot(p - a, p - a) < dot(p - b, p - b) ? a : b;\n vec2 local = p - center;\n\n \n float d = min(length(center / toCells * vec2(ratio, 1.0)) / (0.5 * length(vec2(ratio, 1.0))), 1.0);\n float t = clamp((progress - 0.6 * d) / 0.4, 0.0, 1.0);\n\n \n \n float s = 1.0 - smoothstep(0.1, 1.0, t);\n float turn = 1.8 * t * (2.0 - t);\n vec4 fromTile = getFromColor(hexUv(uv, local, 1.0 / toCells, s, turn));\n fromTile.rgb *= 1.0 - 0.3 * t;\n vec4 below = getToColor(uv);\n below.rgb *= 1.0 - 0.5 * hexMask(local - vec2(0.06, -0.08) * s, s, turn, 0.2);\n return mix(below, fromTile, hexMask(local, s, turn, 0.03));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","HorizontalClose":"// HorizontalClose — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HorizontalClose.glsl\n// Author: martiniti\n// License: MIT\n// Description: The incoming image closes in from the top and bottom edges toward the middle\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n\n float s = 2.0 - abs((uv.y - 0.5) / (progress - 1.0)) - 2.0 * progress;\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n smoothstep(0.5, 0.0, s)\n ); \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","HorizontalOpen":"// HorizontalOpen — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HorizontalOpen.glsl\n// Author: martiniti\n// License: MIT\n// Description: The incoming image opens from a line in the middle toward the top and bottom edges\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n \n float regress = 1.0 - progress;\n\n float s = 2.0 - abs((uv.y - 0.5) / (regress - 1.0)) - 2.0 * regress;\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n smoothstep(0.0, 0.5, s)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","HsvFade":"// HsvFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HsvFade.glsl\n// Author: nwoeanhinnogaehr\n// License: MIT\n// Description: A crossfade through the HSV color space that cycles through hues\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec3 hsv2rgb(vec3 c) {\n const vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\nvec3 rgb2hsv(vec3 c) {\n const vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + 0.001)), d / (q.x + 0.001), q.x);\n}\n\nvec4 transition(vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n vec3 m = mix(rgb2hsv(from.rgb), rgb2hsv(to.rgb), progress);\n return vec4(hsv2rgb(m), mix(from.a, to.a, progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","InkBleed":"// InkBleed — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/InkBleed.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image spreads over the outgoing one like drops of ink in water, blooming from a few points with curling, wispy edges and a darker rim, until it fills the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float drops; \n\nuniform float tendrils; \n\nuniform float rim; \n\nuniform float seed; \n\nfloat hash (vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat vnoise (vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x),\n mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nfloat fbm (vec2 p) {\n float v = 0.0;\n float a = 0.5;\n for (int i = 0; i < 4; i++) {\n v += a * vnoise(p);\n p = mat2(1.6, 1.2, -1.2, 1.6) * p + 7.3;\n a *= 0.5;\n }\n return v / 0.9375;\n}\n\nvec2 fold (vec2 p) {\n return 1.0 - abs(1.0 - mod(p, 2.0));\n}\n\nvec4 transition (vec2 uv) {\n float p = progress;\n vec2 q = vec2(uv.x * ratio, uv.y);\n \n vec2 o = vec2(seed * 3.1, seed * 1.7);\n vec2 sq = q * 2.2 + o;\n vec2 w1 = vec2(fbm(sq + vec2(0.0, 0.6 * p)), fbm(sq + vec2(5.2, 1.3) - vec2(0.5 * p, 0.0)));\n vec2 w2 = vec2(fbm(sq + 3.0 * w1 + vec2(1.7, 9.2)), fbm(sq + 3.0 * w1 + vec2(8.3, 2.8)));\n float swirl = fbm(sq * 0.8 + 2.5 * w2) - 0.5; \n vec2 flow = w2 - 0.5;\n float amp = 0.05 + 0.35 * tendrils;\n float n = clamp(floor(drops + 0.5), 1.0, 8.0);\n float rimW = 0.1;\n float feather = 0.05; \n float margin = 1.2 * amp + rimW + 0.08; \n float f = -1e3; \n float fs = -1e3; \n for (int i = 0; i < 8; i++) {\n float fi = float(i);\n if (fi < n) {\n vec2 hs = vec2(fi * 7.13 + seed, fi * 3.71 - seed);\n vec2 c = vec2(mix(0.15, 0.85, hash(hs)) * ratio, mix(0.15, 0.85, hash(hs + 19.7)));\n float start = 0.2 * fi / n;\n float s = clamp((p - start) / (1.0 - start), 0.0, 1.0);\n \n vec2 m = max(c, vec2(ratio, 1.0) - c);\n float far = length(m) + margin;\n float s3 = s * s * s;\n float r = (far + 0.02) * s * (0.35 + 0.65 * s3 * s3) - 0.02;\n \n float reach = amp * min(1.0, max(r, 0.0) * 5.0);\n float g = r - length(q - c + 1.3 * reach * flow) + reach * 0.9 * swirl;\n f = max(f, g);\n fs = max(fs, g - 0.15 * (1.0 - min(1.0, s * 12.0)));\n }\n }\n float aa = 0.003;\n float inside = smoothstep(-aa, aa, f);\n \n float wisp = 1.0 - smoothstep(0.0, 0.08, abs(fbm(sq * 2.0 + 5.0 * w2) - 0.5));\n float soft = smoothstep(-feather, 0.0, fs) * (0.35 + 0.4 * wisp);\n float haze = 0.35 * wisp * (1.0 - smoothstep(0.0, 0.1, -fs));\n float cover = max(inside, max(soft, haze));\n \n float edge = 1.0 - smoothstep(0.0, rimW, f);\n vec4 to = getToColor(fold(uv - 0.015 * edge * flow / vec2(ratio, 1.0)));\n to.rgb = mix(to.rgb, to.rgb * to.rgb * 0.7, rim * edge);\n return mix(getFromColor(uv), to, cover);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","InvertedPageCurl":"// InvertedPageCurl — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/InvertedPageCurl.glsl\n// Author: Hewlett-Packard\n// License: BSD 3 Clause\n// Description: The outgoing image curls away like a page, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst float MIN_AMOUNT = -0.16;\nconst float MAX_AMOUNT = 1.5;\n\nconst float PI = 3.141592653589793;\n\nconst float scale = 512.0;\nconst float sharpness = 3.0;\n\nconst float cylinderRadius = 1.0 / PI / 2.0;\n\nfloat amount;\nfloat cylinderCenter;\nfloat cylinderAngle;\n\nvec3 hitPoint(float hitAngle, float yc, vec3 point, mat3 rrotation)\n{\n float hitPoint = hitAngle / (2.0 * PI);\n point.y = hitPoint;\n return rrotation * point;\n}\n\nvec4 antiAlias(vec4 color1, vec4 color2, float distanc)\n{\n distanc *= scale;\n if (distanc < 0.0) return color2;\n if (distanc > 2.0) return color1;\n float dd = pow(1.0 - distanc / 2.0, sharpness);\n return ((color2 - color1) * dd) + color1;\n}\n\nfloat distanceToEdge(vec3 point)\n{\n float dx = abs(point.x > 0.5 ? 1.0 - point.x : point.x);\n float dy = abs(point.y > 0.5 ? 1.0 - point.y : point.y);\n if (point.x < 0.0) dx = -point.x;\n if (point.x > 1.0) dx = point.x - 1.0;\n if (point.y < 0.0) dy = -point.y;\n if (point.y > 1.0) dy = point.y - 1.0;\n if ((point.x < 0.0 || point.x > 1.0) && (point.y < 0.0 || point.y > 1.0)) return sqrt(dx * dx + dy * dy);\n return min(dx, dy);\n}\n\nvec4 seeThrough(float yc, vec2 p, mat3 rotation, mat3 rrotation)\n{\n float hitAngle = PI - (acos(clamp(yc / cylinderRadius, -1.0, 1.0)) - cylinderAngle);\n vec3 point = hitPoint(hitAngle, yc, rotation * vec3(p, 1.0), rrotation);\n if (yc <= 0.0 && (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0))\n {\n return getToColor(p);\n }\n\n if (yc > 0.0) return getFromColor(p);\n\n vec4 color = getFromColor(point.xy);\n vec4 tcolor = vec4(0.0);\n\n return antiAlias(color, tcolor, distanceToEdge(point));\n}\n\nvec4 seeThroughWithShadow(float yc, vec2 p, vec3 point, mat3 rotation, mat3 rrotation)\n{\n float shadow = distanceToEdge(point) * 30.0;\n shadow = (1.0 - shadow) / 3.0;\n\n if (shadow < 0.0) shadow = 0.0; else shadow *= amount;\n\n vec4 shadowColor = seeThrough(yc, p, rotation, rrotation);\n shadowColor.r -= shadow;\n shadowColor.g -= shadow;\n shadowColor.b -= shadow;\n\n return shadowColor;\n}\n\nvec4 backside(float yc, vec3 point)\n{\n vec4 color = getFromColor(point.xy);\n float gray = (color.r + color.b + color.g) / 15.0;\n gray += (8.0 / 10.0) * (pow(max(0.0, 1.0 - abs(yc / cylinderRadius)), 2.0 / 10.0) / 2.0 + (5.0 / 10.0));\n color.rgb = vec3(gray);\n return color;\n}\n\nvec4 behindSurface(vec2 p, float yc, vec3 point, mat3 rrotation)\n{\n float safeAmount = amount >= 0.0 ? max(amount, 1e-4) : min(amount, -1e-4);\n float shado = (1.0 - ((-cylinderRadius - yc) / safeAmount * 7.0)) / 6.0;\n shado *= 1.0 - abs(point.x - 0.5);\n\n yc = (-cylinderRadius - cylinderRadius - yc);\n\n float hitAngle = (acos(clamp(yc / cylinderRadius, -1.0, 1.0)) + cylinderAngle) - PI;\n point = hitPoint(hitAngle, yc, point, rrotation);\n\n if (yc < 0.0 && point.x >= 0.0 && point.y >= 0.0 && point.x <= 1.0 && point.y <= 1.0 && (hitAngle < PI || amount > 0.5))\n {\n float dx = point.x - 0.5;\n float dy = point.y - 0.5;\n shado = 1.0 - (sqrt(dx * dx + dy * dy) / (71.0 / 100.0));\n float nyc = -yc / cylinderRadius;\n shado *= nyc * nyc * nyc;\n shado *= 0.5;\n }\n else\n {\n shado = 0.0;\n }\n vec4 to = getToColor(p);\n return vec4(to.rgb - shado, to.a);\n}\n\nvec4 transition(vec2 p) {\n amount = progress * (MAX_AMOUNT - MIN_AMOUNT) + MIN_AMOUNT;\n cylinderCenter = amount;\n cylinderAngle = 2.0 * PI * amount;\n\n const float angle = 100.0 * PI / 180.0;\n float c = cos(-angle);\n float s = sin(-angle);\n\n mat3 rotation = mat3( c, s, 0,\n -s, c, 0,\n -0.801, 0.8900, 1\n );\n c = cos(angle);\n s = sin(angle);\n\n mat3 rrotation = mat3(\tc, s, 0,\n -s, c, 0,\n 0.98500, 0.985, 1\n );\n\n vec3 point = rotation * vec3(p, 1.0);\n\n float yc = point.y - cylinderCenter;\n\n if (yc < -cylinderRadius)\n {\n \n return behindSurface(p,yc, point, rrotation);\n }\n\n if (yc > cylinderRadius)\n {\n \n return getFromColor(p);\n }\n\n float hitAngle = (acos(clamp(yc / cylinderRadius, -1.0, 1.0)) + cylinderAngle) - PI;\n\n float hitAngleMod = mod(hitAngle, 2.0 * PI);\n if ((hitAngleMod > PI && amount < 0.5) || (hitAngleMod > PI/2.0 && amount < 0.0))\n {\n return seeThrough(yc, p, rotation, rrotation);\n }\n\n point = hitPoint(hitAngle, yc, point, rrotation);\n\n if (point.x < 0.0 || point.y < 0.0 || point.x > 1.0 || point.y > 1.0)\n {\n return seeThroughWithShadow(yc, p, point, rotation, rrotation);\n }\n\n vec4 color = backside(yc, point);\n\n vec4 otherColor;\n if (yc < 0.0)\n {\n float dx2 = point.x - 0.5;\n float dy2 = point.y - 0.5;\n float shado = 1.0 - (sqrt(dx2 * dx2 + dy2 * dy2) / 0.71);\n float nyc2 = -yc / cylinderRadius;\n shado *= nyc2 * nyc2 * nyc2;\n shado *= 0.5;\n otherColor = vec4(0.0, 0.0, 0.0, shado * getToColor(p).a); \n }\n else\n {\n otherColor = getFromColor(p);\n }\n\n color = antiAlias(color, otherColor, cylinderRadius - abs(yc));\n\n vec4 cl = seeThroughWithShadow(yc, p, point, rotation, rrotation);\n float dist = distanceToEdge(point);\n\n return antiAlias(color, cl, dist);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Kaleidoscope":"// Kaleidoscope — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Kaleidoscope.glsl\n// Author: nwoeanhinnogaehr\n// License: MIT\n// Description: A crossfade through a spinning kaleidoscope\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float speed; \nuniform float angle; \nuniform float power; \n\nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy;\n vec2 q = p;\n float t = pow(progress, power)*speed;\n p = p -0.5;\n for (int i = 0; i < 7; i++) {\n p = vec2(sin(t)*p.x + cos(t)*p.y, sin(t)*p.y - cos(t)*p.x);\n t += angle;\n p = abs(mod(p, 2.0) - 1.0);\n }\n abs(mod(p, 1.0));\n return mix(\n mix(getFromColor(q), getToColor(q), progress),\n mix(getFromColor(p), getToColor(p), progress), 1.0 - 2.0*abs(progress - 0.5));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LeafWipe":"// LeafWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LeafWipe.glsl\n// Author: @Flexi23\n// License: MIT\n// Description: A leaf shape grows from the center to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n if(progress == 0.0){\n return getFromColor(uv);\n }\n vec2 leaf_uv = (uv - vec2(0.5))/10./pow(progress,3.5);\n\tleaf_uv.y += 0.35;\n\tfloat r = 0.18;\n\tfloat o = atan(leaf_uv.y, leaf_uv.x);\n return mix(getFromColor(uv), getToColor(uv), 1.-step(1. - length(leaf_uv)+r*(1.+sin(o))*(1.+0.9 * cos(8.*o))*(1.+0.1*cos(24.*o))*(0.9+0.05*cos(200.*o)), 1.));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LeftRight":"// LeftRight — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LeftRight.glsl\n// Author: zhmy\n// License: MIT\n// Description: The outgoing image shrinks away to the left while the incoming one slides in from the right\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst vec4 black = vec4(0.0); \nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n vec2 spfr,spto = vec2(-1.);\n\n float size = mix(1.0, 3.0, progress*0.2);\n spto = (uv + vec2(-0.5,-0.5))*vec2(size,size)+vec2(0.5,0.5);\n spfr = (uv - vec2(1.-progress, 0.0));\n if(inBounds(spfr)){\n return getToColor(spfr);\n }else if(inBounds(spto)){\n return getFromColor(spto) * (1.0 - progress);\n } else{\n return black;\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LensFlare":"// LensFlare — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LensFlare.glsl\n// Author: gre\n// License: MIT\n// Description: A bright light sweeps across the frame and flares the lens: a long thin horizontal streak, a glowing core and a trail of colored ghost reflections; at its peak the incoming image spreads out from the light under its glare\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float angle; \n\nuniform float height; \n\nuniform float intensity; \n\nuniform vec3 color; \n\nconst int BLOOM_TAPS = 12;\nconst int GHOSTS = 6;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 premultiplied(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 frame(vec2 st, float m) {\n if (m <= 0.0) return premultiplied(getFromColor(st));\n if (m >= 1.0) return premultiplied(getToColor(st));\n return mix(premultiplied(getFromColor(st)), premultiplied(getToColor(st)), m);\n}\n\nvec3 highlight(vec4 c) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n return c.rgb * smoothstep(0.55, 0.95, lum);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n if (p <= 0.0) return getFromColor(uv);\n if (p >= 1.0) return getToColor(uv);\n\n \n float env = 4.0 * p * (1.0 - p);\n float peak = pow(env, 24.0);\n \n vec2 aspect = vec2(ratio, 1.0);\n vec2 q = (uv - 0.5) * aspect;\n float r = radians(angle);\n vec2 dir = vec2(cos(r), -sin(r));\n vec2 normal = vec2(-dir.y, dir.x);\n \n float t = p - 0.5;\n float travel = 0.5 * (abs(dir.x) * ratio + abs(dir.y)) + 0.3;\n float along = travel * (2.0 * t) * (0.55 + 1.8 * t * t);\n vec2 src = dir * along + normal * height;\n\n vec2 d = q - src;\n float dist = length(d);\n float k = intensity * env;\n\n \n \n float cut = mix(0.2, 0.06, clamp(intensity, 0.0, 1.0));\n float s = clamp((p - 0.5 + cut) / (2.0 * cut), 0.0, 1.0);\n float soft = 0.3;\n float reach = 0.5 * length(aspect) + length(src) + soft;\n float front = s * (reach + soft);\n float m = smoothstep(front, front - soft, dist);\n vec4 base = frame(uv, m);\n\n \n float ax = abs(d.x);\n float ay = abs(d.y);\n float thin = exp(-ay * 140.0) * exp(-ax * 0.7);\n float wide = exp(-ay * 30.0) * exp(-ax * 1.6);\n vec3 tint = color;\n vec3 streak = (thin * mix(vec3(1.0), tint, smoothstep(0.0, 0.3, ax)) + 0.5 * wide * tint) * 3.0;\n\n \n vec3 core = vec3(1.0, 0.97, 0.92) * exp(-dist * dist * 600.0) * 3.0 + mix(vec3(1.0), tint, 0.5) * exp(-dist * 7.0) * 0.6;\n\n \n vec3 ghosts = vec3(0.0);\n for (int i = 0; i < GHOSTS; i++) {\n float fi = float(i);\n float f = -0.45 + 0.42 * fi + 0.08 * sin(fi * 2.3);\n vec2 g = -src * f;\n float size = 0.025 + 0.06 * fract(fi * 0.618 + 0.2);\n float gd = length(q - g) / size;\n \n float disc = smoothstep(1.0, 0.8, gd) * (0.35 + 0.65 * smoothstep(0.4, 0.95, gd));\n vec3 hue = mix(tint, vec3(1.0, 0.65, 0.35), fract(fi * 0.53));\n hue = mix(hue, vec3(0.5, 1.0, 0.6), step(4.5, fi) * 0.6);\n ghosts += disc * hue * 0.45;\n }\n\n \n vec3 bloom = vec3(0.0);\n if (peak > 1e-3) {\n float radius = 0.06 * env;\n for (int i = 0; i < BLOOM_TAPS; i++) {\n float fi = float(i);\n float a = fi * 2.39996;\n float rr = radius * sqrt((fi + 0.5) / float(BLOOM_TAPS));\n vec2 o = vec2(cos(a), sin(a)) * rr / aspect;\n bloom += highlight(frame(mirror(uv + o), m));\n }\n bloom /= float(BLOOM_TAPS);\n }\n\n \n vec3 glare = mix(vec3(1.0), tint, 0.5) * peak * (0.45 + 2.2 * exp(-dist * 3.0));\n\n vec3 light = k * (streak + core + ghosts) + intensity * (bloom * 2.5 * peak + glare);\n light = 1.0 - exp(-light);\n\n \n vec3 c = base.rgb + light * base.a - base.rgb * light;\n if (base.a <= 0.0) return vec4(0.0);\n return vec4(clamp(c / base.a, 0.0, 1.0), base.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LightRays":"// LightRays — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LightRays.glsl\n// Author: gre\n// License: MIT\n// Description: Shafts of light burst from the highlights of the outgoing image and stream outward from a slowly drifting center; at their peak the incoming image takes over and its own rays shrink back into its highlights\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \n\nuniform float drift; \n\nuniform float reach; \n\nuniform float threshold; \n\nuniform float intensity; \n\nuniform vec3 tint; \n\nconst int TAPS = 20;\n\nconst float SHAFTS = 23.0;\nconst float PI = 3.141592653589793;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nfloat shaftNoise(float t, float n, float seed) {\n float x = t * n;\n float i = floor(x);\n float f = x - i;\n float a = hash12(vec2(mod(i, n), seed));\n float b = hash12(vec2(mod(i + 1.0, n), seed));\n return mix(a, b, f * f * (3.0 - 2.0 * f));\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec3 glow(vec4 c, float knee) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n return c.rgb * c.a * smoothstep(knee, knee + 0.2, lum);\n}\n\nvec3 light(vec2 st, float knee, float m) {\n if (m <= 0.0) return glow(getFromColor(st), knee);\n if (m >= 1.0) return glow(getToColor(st), knee);\n return mix(glow(getFromColor(st), knee), glow(getToColor(st), knee), m);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float amount = p < 0.5 ? smoothstep(0.0, 0.5, p) : 1.0 - smoothstep(0.5, 1.0, p);\n float peak = amount * amount * amount;\n float m = smoothstep(0.46, 0.54, p);\n vec4 fromColor = getFromColor(uv);\n vec4 toColor = getToColor(uv);\n if (amount <= 0.0) return m < 0.5 ? fromColor : toColor;\n\n \n vec2 origin = center + vec2(drift * (p - 0.5), 0.0);\n float len = reach * amount;\n \n float knee = mix(threshold, 0.75 * threshold, peak);\n \n \n float jitter = hash12(floor(uv * vec2(ratio, 1.0) * 997.0));\n\n \n vec3 rays = vec3(0.0);\n float total = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float s = (float(i) + jitter) / float(TAPS);\n float w = exp(-2.0 * s);\n \n vec3 hue = mix(vec3(1.0), tint, smoothstep(0.0, 0.6, s));\n rays += w * hue * light(mirror(mix(uv, origin, s * len)), knee, m);\n total += w;\n }\n \n vec2 d = (uv - origin) * vec2(ratio, 1.0);\n \n float turn = length(d) > 1e-6 ? atan(d.y, d.x) / (2.0 * PI) + 0.5 : 0.0;\n float shafts = 0.6 * shaftNoise(fract(turn + 0.03 * p), SHAFTS, 1.0) + 0.4 * shaftNoise(fract(turn - 0.05 * p), 2.0 * SHAFTS + 1.0, 7.0);\n \n rays *= mix(1.0, mix(0.2, 1.6, smoothstep(0.15, 0.85, shafts)), smoothstep(0.0, 0.3, length(d)));\n rays *= intensity * amount * (1.0 + 3.0 * peak) / total;\n \n rays = 0.9 * (1.0 - exp(-rays));\n\n \n \n vec4 c = mix(vec4(fromColor.rgb * fromColor.a, fromColor.a), vec4(toColor.rgb * toColor.a, toColor.a), m);\n if (c.a <= 0.0) return vec4(0.0);\n vec3 base = min(c.rgb / c.a * (1.0 + 0.2 * peak), 1.0);\n return vec4(base + rays - base * rays, c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LightStreaks":"// LightStreaks — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LightStreaks.glsl\n// Author: gre\n// License: MIT\n// Description: The highlights of the outgoing image flare into long horizontal (or vertical) lens streaks while it smears with motion blur; at the peak the incoming image takes over and its streaks shrink back into its highlights as it sharpens\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float reach; \n\nuniform float threshold; \n\nuniform float intensity; \n\nuniform vec3 tint; \n\nuniform float blur; \n\nuniform int vertical; \n\nconst int BLUR_TAPS = 6;\n\nconst int STREAK_TAPS = 11;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 frame(vec2 st, float m) {\n if (m <= 0.0) return getFromColor(st);\n if (m >= 1.0) return getToColor(st);\n return mix(getFromColor(st), getToColor(st), m);\n}\n\nvec3 glow(vec4 c, float knee) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n return c.rgb * c.a * smoothstep(knee, knee + 0.2, lum);\n}\n\nvec4 light(vec2 st, float m, bool incoming) {\n if (m <= 0.0) return getFromColor(st);\n if (m >= 1.0) return getToColor(st);\n return incoming ? getToColor(st) : getFromColor(st);\n}\n\nfloat lightWeight(float m, bool incoming) {\n if (m <= 0.0 || m >= 1.0) return 1.0;\n return incoming ? 2.0 * m : 2.0 * (1.0 - m);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float amount = p < 0.5 ? smoothstep(0.0, 0.5, p) : pow(2.0 - 2.0 * p, 3.0);\n float peak = amount * amount * amount;\n float m = smoothstep(0.44, 0.56, p);\n vec2 axis = (vertical != 0) ? vec2(0.0, 1.0) : vec2(1.0, 0.0);\n \n \n float jitter = hash12(floor(uv * vec2(ratio, 1.0) * 997.0)) - 0.5;\n\n \n float smear = blur * amount;\n vec3 base = vec3(0.0);\n float alpha = 0.0;\n float total = 0.0;\n for (int i = 0; i < BLUR_TAPS; i++) {\n float t = (float(i) + 0.5 + jitter) / float(BLUR_TAPS) - 0.5;\n float w = 1.0 - abs(t);\n total += w;\n bool incoming = mod(float(i), 2.0) > 0.5;\n w *= lightWeight(m, incoming);\n vec4 c = light(mirror(uv + axis * t * smear), m, incoming);\n base += w * c.rgb * c.a;\n alpha += w * c.a;\n }\n base /= total;\n alpha /= total;\n\n \n float falloff = 0.25 * reach * amount;\n float knee = mix(threshold, 0.8 * threshold, peak);\n vec3 streak = glow(frame(uv, m), knee);\n float weights = 1.0;\n for (int k = 1; k <= STREAK_TAPS; k++) {\n \n float d = exp(0.14 * (float(k) + 0.8 * jitter)) - 1.0;\n float span = 0.14 * (d + 1.0);\n \n vec3 hue = mix(vec3(1.0), tint, smoothstep(0.0, 0.8, d));\n hue *= exp(-d * vec3(0.6, 0.2, -0.15));\n float w = exp(-d) * span * 4.0;\n bool incoming = mod(float(k), 2.0) > 0.5;\n vec4 ahead = light(mirror(uv + axis * d * falloff), m, incoming);\n vec4 behind = light(mirror(uv - axis * d * falloff), m, !incoming);\n streak += w * hue * (glow(ahead, knee) * lightWeight(m, incoming) + glow(behind, knee) * lightWeight(m, !incoming));\n weights += 2.0 * w;\n }\n streak *= intensity * amount * (0.6 + 2.4 * peak) * 2.0 / weights;\n \n streak = 0.85 * (1.0 - exp(-streak));\n\n \n base = min(base * (1.0 + 0.2 * peak), vec3(alpha));\n vec3 color = base + streak - base * streak;\n float a = alpha + max(streak.r, max(streak.g, streak.b)) * (1.0 - alpha);\n return vec4(clamp(color / max(a, 1e-5), 0.0, 1.0), a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LightWipe":"// LightWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LightWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A band of intense light sweeps across the frame like a glint on glass, blooming the highlights of both images, and leaves the incoming image behind it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float width; \n\nuniform float intensity; \n\nuniform vec3 color; \n\nconst int TAPS = 12;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat ease(float t) {\n return 0.5 * (t + t * t * (3.0 - 2.0 * t));\n}\n\nvec4 frame(vec2 st, float m) {\n return mix(getFromColor(st), getToColor(st), m);\n}\n\nvec3 highlight(vec4 c) {\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n return c.rgb * c.a * smoothstep(0.45, 1.0, lum);\n}\n\nvec4 transition(vec2 uv) {\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n \n float e = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n float w = max(width, 0.001);\n float s = 0.35 * w;\n \n float margin = s + 2.0 * w;\n float pos = -e - margin + 2.0 * (e + margin) * ease(progress);\n \n float d = dot(p, dir) - pos;\n float m = 1.0 - smoothstep(-s, s, d);\n\n \n float env = smoothstep(0.0, 0.2, progress) * (1.0 - smoothstep(0.8, 1.0, progress));\n \n float core = exp(-d * d / (w * w));\n float g = (d + 2.2 * w) / (0.3 * w);\n float glint = 0.45 * exp(-g * g);\n float halo = 0.35 * exp(-abs(d) / (5.0 * w));\n float band = (core + glint + halo) * env * intensity;\n \n float glow = (core + glint) * env * intensity;\n\n vec4 c = frame(uv, m);\n\n \n vec3 bloom = vec3(0.0);\n \n float spread = min(3.0 * w, 0.12);\n for (int i = 0; i < TAPS; i++) {\n float t = (float(i) + 0.5) / float(TAPS) * 2.0 - 1.0;\n vec2 st = mirror((p + dir * (t * spread)) / vec2(ratio, 1.0) + 0.5);\n \n float dq = dot((st - 0.5) * vec2(ratio, 1.0), dir) - pos;\n bloom += (1.0 - abs(t)) * highlight(frame(st, 1.0 - smoothstep(-s, s, dq)));\n }\n \n bloom /= 0.5 * float(TAPS);\n\n \n vec3 hue = mix(color, vec3(1.0), core * core);\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n \n vec3 light = hue * band * (0.3 + 0.9 * lum) + hue * bloom * glow * 4.0 + hue * core * env * intensity * 1.6;\n vec3 rgb = 1.0 - (1.0 - c.rgb) * exp(-light);\n \n return vec4(rgb, c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LinearBlur":"// LinearBlur — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LinearBlur.glsl\n// Author: gre\n// License: MIT\n// Description: A crossfade through a blur\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float intensity; \nconst int passes = 6;\n\nvec4 transition(vec2 uv) {\n vec4 c1 = vec4(0.0);\n vec4 c2 = vec4(0.0);\n\n float disp = intensity*(0.5-distance(0.5, progress));\n for (int xi=0; xi<passes; xi++)\n {\n float x = float(xi) / float(passes) - 0.5;\n for (int yi=0; yi<passes; yi++)\n {\n float y = float(yi) / float(passes) - 0.5;\n vec2 v = vec2(x,y);\n float d = disp;\n c1 += getFromColor( uv + d*v);\n c2 += getToColor( uv + d*v);\n }\n }\n c1 /= float(passes*passes);\n c2 /= float(passes*passes);\n return mix(c1, c2, progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LiquidFill":"// LiquidFill — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LiquidFill.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image rises over the outgoing one like liquid filling a glass, its surface sloshing in waves, lit by a bright meniscus line, bending the image just below it, with a few bubbles rising through it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float amplitude; \n\nuniform float waves; \n\nuniform vec4 highlight; \n\nuniform float refraction; \n\nuniform float bubbles; \n\nconst float PI = 3.141592653589793;\n\nconst float AA = 0.0015;\n\nconst float LINE = 0.006;\n\nconst float CELL = 0.08;\n\nfloat hash (vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat surface (float x, float t) {\n float k = PI * max(waves, 0.01);\n return 0.6 * sin(k * x + 0.5 * PI) * cos(2.0 * PI * 1.3 * t)\n + 0.4 * sin(1.7 * k * x - 9.0 * t + 1.3);\n}\n\nvec4 transition (vec2 uv) {\n vec4 a = getFromColor(uv);\n if (progress <= 0.0) return a;\n if (progress >= 1.0) return getToColor(uv);\n\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(0.0, 1.0);\n vec2 across = vec2(-dir.y, dir.x);\n \n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n \n float e = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n float w = 0.5 * (abs(dir.y) * ratio + abs(dir.x));\n float d = dot(p, dir);\n float x = dot(p, across);\n float t = progress;\n \n float stir = sin(PI * t);\n float amp = max(amplitude, 0.0) * (0.35 + 0.65 * stir);\n \n float margin = max(amplitude, 0.0) + 2.0 * LINE + AA;\n float mean = mix(-e - margin, e + margin, mix(t, t * t * (3.0 - 2.0 * t), 0.5));\n float level = mean + amp * surface(x / w, t);\n \n float depth = level - d;\n float m = smoothstep(-AA, AA, depth);\n\n \n float bend = refraction * stir * exp(-max(depth, 0.0) / 0.06);\n vec2 offset = bend * (dir * sin(18.0 * x - 7.0 * t) + across * cos(13.0 * x + 5.0 * t));\n vec4 b = getToColor(clamp(uv + offset / vec2(ratio, 1.0), 0.0, 1.0));\n\n \n float glow = 0.0;\n float rise = mean + 0.5 * t;\n vec2 bq = vec2(x, d - rise) / CELL;\n vec2 cell = floor(bq);\n float hs = hash(cell + 7.1);\n float r = (0.12 + 0.18 * hash(cell + 3.7)) * stir;\n float px = AA / CELL;\n if (hs < bubbles * 0.6 && r > px) {\n \n vec2 c = cell + 0.5 + (0.42 - r - px) * (vec2(hash(cell + 1.3), hash(cell + 9.4)) * 2.0 - 1.0);\n \n c.x += 0.08 * sin(6.0 * t + 6.28 * hs);\n float dist = length(bq - c);\n \n float rim = smoothstep(0.7 * r - px, 0.7 * r + px, dist) * (1.0 - smoothstep(r - px, r + px, dist));\n float glint = 1.0 - smoothstep(0.25 * r - px, 0.25 * r + px, length(bq - c - 0.45 * r * vec2(-0.7, 0.7)));\n \n glow = max(rim * 0.6, glint) * smoothstep(0.0, 0.05, depth) * stir;\n }\n \n float line = 1.0 - smoothstep(LINE - AA, LINE + AA, abs(depth - LINE));\n line += 0.35 * stir * exp(-max(depth, 0.0) / 0.03) * m;\n float light = highlight.a * clamp(max(line, glow), 0.0, 1.0) * (0.4 + 0.6 * stir);\n b.rgb = mix(b.rgb, highlight.rgb, light);\n\n \n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LissajousTiles":"// LissajousTiles — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LissajousTiles.glsl\n// Author: Boundless <info@boundless-beta.com>\n// License: MIT\n// Description: The image breaks into a grid of tiles that swirl along Lissajous curves, in a Scanimate style, and flip one by one to the incoming image before settling back\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float speed; \n\nuniform vec2 freq; \n\nuniform float offset; \n\nuniform float zoom; \n\nuniform float fade; \n\nconst vec2 grid = vec2(10.,10.); \nconst float TAU = 6.283185307;\n\nvec4 transition (vec2 uv) {\n \n float p = 1.-pow(1.-smoothstep(0.,1.,1.-abs(1.-2.*progress)),3.); \n \n for (float jBig = grid.y-1.; jBig >= 0.; jBig--) {\n for (float iBig = grid.x-1.; iBig >= 0.; iBig--) {\n float i = iBig/grid.x;\n float j = jBig/grid.y;\n float k = i/grid.y+j; \n vec2 uv0 = uv + vec2(i,j) - 0.5 + 0.5/grid + vec2(cos(k*TAU*freq.x+progress*6.*speed),sin(k*TAU*freq.y+progress*6.*(1.+offset)*speed))*zoom/2.;\n uv0 = mix(uv, uv0, p);\n if (uv0.x >= i && uv0.x < i+1./grid.x && uv0.y >= j && uv0.y < j+1./grid.y) { \n float tileMix = clamp(progress*((1.+fade)*2.*progress)-fade+k*fade, 0., 1.);\n return mix(getFromColor(uv0), getToColor(uv0), tileMix);\n }\n }\n }\n return vec4(0.); \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LumaWipe":"// LumaWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LumaWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A wipe that follows the brightness of a grayscale mask (the luma texture)\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform shader luma;\nvec4 _texture_luma(vec2 uv) { return vec4(unpremul(luma.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n return mix(\n getToColor(uv),\n getFromColor(uv),\n step(progress, _texture_luma( uv).r)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LuminanceMelt":"// LuminanceMelt — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LuminanceMelt.glsl\n// Author: 0gust1\n// License: MIT\n// Description: The outgoing image melts away in noisy vertical streaks, depending on its brightness\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int direction; \n\nuniform float l_threshold; \n\nuniform int above; \n\nfloat rand(vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec2 mod289(vec2 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec3 permute(vec3 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nfloat snoise(vec2 v)\n {\n const vec4 C = vec4(0.211324865405187, \n 0.366025403784439, \n -0.577350269189626, \n 0.024390243902439); \n\n vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n vec2 i1;\n \n \n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n \n \n \n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n\n i = mod289(i); \n vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n\t\t+ i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\n m = m*m ;\n m = m*m ;\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\nfloat luminance(vec4 color){\n \n return color.r*0.299+color.g*0.587+color.b*0.114;\n}\n\nvec4 transition(vec2 uv) {\n vec2 center = vec2(1.0, (direction != 0));\n vec2 p = uv.xy / vec2(1.0).xy;\n if (progress == 0.0) {\n return getFromColor(p);\n } else if (progress == 1.0) {\n return getToColor(p);\n } else {\n float x = progress;\n float dist = distance(center, p)- progress*exp(snoise(vec2(p.x, 0.0)));\n float r = x - rand(vec2(p.x, 0.1));\n float m;\n if((above != 0)){\n m = dist <= r && luminance(getFromColor(p))>l_threshold ? 1.0 : (progress*progress*progress);\n }\n else{\n m = dist <= r && luminance(getFromColor(p))<l_threshold ? 1.0 : (progress*progress*progress); \n }\n return mix(getFromColor(p), getToColor(p), m); \n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Morph":"// Morph — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Morph.glsl\n// Author: paniq\n// License: MIT\n// Description: A crossfade in which each image is displaced by the other's colors, like a morph\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nvec4 transition(vec2 p) {\n vec4 ca = getFromColor(p);\n vec4 cb = getToColor(p);\n \n vec2 oa = (((ca.rg+ca.b)*0.5)*2.0-1.0);\n vec2 ob = (((cb.rg+cb.b)*0.5)*2.0-1.0);\n vec2 oc = mix(oa,ob,0.5)*strength;\n \n float w0 = progress;\n float w1 = 1.0-w0;\n return mix(getFromColor(p+oc*w0), getToColor(p-oc*w1), progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Mosaic":"// Mosaic — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Mosaic.glsl\n// Author: Xaychru\n// License: MIT\n// Description: The view pans across a mosaic of rotated tiles from both images and settles on the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int endx; \nuniform int endy; \n\nfloat Rand(vec2 v) {\n return fract(sin(dot(v.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\nvec2 Rotate(vec2 v, float a) {\n mat2 rm = mat2(cos(a), -sin(a),\n sin(a), cos(a));\n return rm*v;\n}\nfloat CosInterpolation(float x) {\n return -cos(x*3.14159265358979323)/2.+.5;\n}\nvec4 transition(vec2 uv) {\n vec2 p = uv.xy / vec2(1.0).xy - .5;\n vec2 rp = p;\n float rpr = (progress*2.-1.);\n float z = -(rpr*rpr*2.) + 3.;\n float az = abs(z);\n rp *= az;\n rp += mix(vec2(.5, .5), vec2(float(endx) + .5, float(endy) + .5), CosInterpolation(progress)*CosInterpolation(progress));\n vec2 mrp = mod(rp, 1.);\n vec2 crp = rp;\n bool onEnd = int(floor(crp.x))==endx&&int(floor(crp.y))==endy;\n if(!onEnd) {\n float ang = float(int(Rand(floor(crp))*4.))*.5*3.14159265358979323;\n mrp = vec2(.5) + Rotate(mrp-vec2(.5), ang);\n }\n if(onEnd || Rand(floor(crp))>.5) {\n return getToColor(mrp);\n } else {\n return getFromColor(mrp);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","MosaicBlend":"// MosaicBlend — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MosaicBlend.glsl\n// Author: Sergey Kosarevsky\n// License: MIT\n// Description: Both images break into large blocks that blend, then sharpen into the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float pixelSize; \n\nvec4 transition(vec2 uv) {\n float T = progress;\n float half_ = 0.5;\n float size = (T < half_) ? mix(1.0, pixelSize, T / half_) : mix(pixelSize, 1.0, (T - half_) / half_);\n float D = size * 0.005;\n \n vec2 UV = (uv - 0.5) / D;\n vec2 coord = clamp(D * (ceil(UV - 0.5)) + 0.5, 0.0, 1.0);\n vec4 C0 = getFromColor(coord);\n vec4 C1 = getToColor(coord);\n return mix(C0, C1, T);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","MosaicFade":"// MosaicFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MosaicFade.glsl\n// Author: YueDev\n// License: MIT\n// Description: Both images break into mosaic blocks that blend, then sharpen into the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float mosaicNum;\n\nvec2 getMosaicUV(vec2 uv) {\n float mosaicWidth = 2.0 / mosaicNum * min(progress, 1.0 - progress);\n float mX = floor(uv.x / mosaicWidth) + 0.5;\n float mY = floor(uv.y / mosaicWidth) + 0.5;\n return vec2(mX * mosaicWidth, mY * mosaicWidth);\n}\n\nvec4 transition (vec2 uv) {\n vec2 mosaicUV = min(progress, 1.0 - progress) == 0.0 ? uv : getMosaicUV(uv);\n return mix(getFromColor(mosaicUV), getToColor(mosaicUV), progress * progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","MultiplyBlend":"// MultiplyBlend — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MultiplyBlend.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: A crossfade through the multiplied blend of both images\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 blend(vec4 a, vec4 b) {\n return a * b;\n}\n\nvec4 transition (vec2 uv) {\n \n vec4 blended = blend(getFromColor(uv), getToColor(uv));\n \n if (progress < 0.5)\n return mix(getFromColor(uv), blended, 2.0 * progress);\n else\n return mix(blended, getToColor(uv), 2.0 * progress - 1.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","NoiseDissolve":"// NoiseDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/NoiseDissolve.glsl\n// Author: towrabbit\n// License: MIT\n// Description: The incoming image appears pixel by pixel in random noise\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat random (vec2 st) {\n return fract(sin(dot(st.xy,vec2(12.9898,78.233)))*43758.5453123);\n}\nvec4 transition (vec2 uv) {\n vec4 leftSide = getFromColor(uv);\n vec4 rightSide = getToColor(uv);\n float uvz = floor(random(uv)+progress);\n return mix(leftSide,rightSide,uvz);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Overexposure":"// Overexposure — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Overexposure.glsl\n// Author: Ben Zhang\n// License: MIT\n// Description: A crossfade through a washed-out, overexposed white\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \nconst float PI = 3.141592653589793;\n\nvec4 transition (vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n\n \n float from_m = 1.0 - progress + sin(PI * progress) * strength;\n float to_m = progress + sin(PI * progress) * strength;\n \n return vec4(\n from.r * from.a * from_m + to.r * to.a * to_m,\n from.g * from.a * from_m + to.g * to.a * to_m,\n from.b * from.a * from_m + to.b * to.a * to_m,\n mix(from.a, to.a, progress)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PaperTear":"// PaperTear — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PaperTear.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image tears in two along a ragged line, and the halves are pulled apart to reveal the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float roughness; \n\nuniform float tilt; \n\nuniform float rim; \n\nuniform vec4 paper; \n\nuniform vec4 shadow; \n\nfloat tri (float x) {\n return abs(fract(x) - 0.5) - 0.25;\n}\n\nfloat meander (float y) {\n return 0.5 * ratio + roughness * (0.5 * sin(y * 4.7 + 1.3) + 0.25 * sin(y * 11.3 + 4.1));\n}\n\nfloat tear (float y) {\n return meander(y) + roughness * (0.1 * sin(y * 29.0 + 0.7) + 0.35 * tri(y * 19.0 + sin(y * 7.0)) + 0.12 * tri(y * 47.0 + 0.6 * sin(y * 13.0)));\n}\n\nfloat fibers (float y, float seed) {\n return rim * (0.7 + 0.3 * sin(y * 37.0 + seed) + 0.4 * tri(y * 83.0 + seed));\n}\n\nvec2 unfold (vec2 q, float away, float lean) {\n return vec2(q.x + away + lean * q.y, q.y);\n}\n\nvec4 torn (vec4 bg, vec4 col, float e, float limit, float aa) {\n vec4 c = vec4(mix(col.rgb, paper.rgb, clamp(0.5 + e / aa, 0.0, 1.0) * paper.a), col.a);\n return mix(bg, c, clamp(0.5 - (e - limit) / aa, 0.0, 1.0));\n}\n\nvec4 transition (vec2 uv) {\n float p = progress;\n float away = p * p * (0.5 * ratio + 0.1 + roughness + 2.0 * rim); \n float lean = tilt * p * (2.0 - p);\n float fiber = smoothstep(0.0, 0.15, p); \n float aa = 0.002 * fiber + 1e-6;\n vec2 q = vec2(uv.x * ratio, uv.y);\n vec2 l = unfold(q, away, lean);\n vec2 r = unfold(vec2(ratio - q.x, q.y), away, lean);\n float el = l.x - tear(l.y); \n float er = r.x - (ratio - tear(r.y)); \n \n vec2 sq = q - vec2(0.01, 0.0);\n float dl = unfold(sq, away, lean).x - meander(sq.y);\n float dr = unfold(vec2(ratio - sq.x, sq.y), away, lean).x - (ratio - meander(sq.y));\n vec4 to = getToColor(uv);\n float sh = shadow.a * (1.0 - smoothstep(-0.02, 0.08, min(dl, dr)));\n vec4 c = vec4(mix(to.rgb, shadow.rgb, sh), to.a);\n \n if (r.x >= 0.0) {\n c = torn(c, getFromColor(vec2(1.0 - r.x / ratio, r.y)), er, fibers(r.y, 2.0) * 1.5 * fiber, aa);\n }\n if (l.x >= 0.0) {\n c = torn(c, getFromColor(vec2(l.x / ratio, l.y)), el, fibers(l.y, 0.0) * fiber, aa);\n }\n return c;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PerlinDissolve":"// PerlinDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PerlinDissolve.glsl\n// Author: Rich Harris\n// License: MIT\n// Description: The incoming image appears through blobs of Perlin noise\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float scale; \n\nuniform float smoothness; \n\nuniform float seed; \n\nfloat random(vec2 co)\n{\n float a = seed;\n float b = 78.233;\n float c = 43758.5453;\n float dt= dot(co.xy ,vec2(a,b));\n float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\n\nfloat noise (in vec2 st) {\n vec2 i = floor(st);\n vec2 f = fract(st);\n\n \n float a = random(i);\n float b = random(i + vec2(1.0, 0.0));\n float c = random(i + vec2(0.0, 1.0));\n float d = random(i + vec2(1.0, 1.0));\n\n \n\n \n vec2 u = f*f*(3.0-2.0*f);\n \n\n \n return mix(a, b, u.x) +\n (c - a)* u.y * (1.0 - u.x) +\n (d - b) * u.x * u.y;\n}\n\nvec4 transition (vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n float n = noise(uv * scale);\n\n float p = mix(-smoothness, 1.0 + smoothness, progress);\n float lower = p - smoothness;\n float higher = p + smoothness;\n\n float q = smoothstep(lower, higher, n);\n\n return mix(\n from,\n to,\n 1.0 - q\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PhotoDevelop":"// PhotoDevelop — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PhotoDevelop.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image washes out to a blank cream card, then the incoming image develops on it like an instant photo: shadows first, faint and tinted, then its contrast and colors come up and it settles\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 card; \n\nuniform float wash; \n\nuniform float tint; \n\nvec3 saturation(vec3 c, float s) {\n float lum = dot(c, vec3(0.2126, 0.7152, 0.0722));\n return mix(vec3(lum), c, s);\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n float p = progress;\n if (p <= 0.0) return a;\n if (p >= 1.0) return b;\n\n \n float split = mix(0.1, 0.7, clamp(wash, 0.0, 1.0));\n float cardAlpha = card.a * mix(a.a, b.a, smoothstep(0.6 * split, split + 0.1, p));\n vec3 cardColor = card.rgb * cardAlpha;\n\n \n float w = smoothstep(0.0, split, p);\n float fromLum = dot(a.rgb, vec3(0.2126, 0.7152, 0.0722));\n float wl = clamp(w * (1.0 + 0.5 * fromLum), 0.0, 1.0);\n vec3 washed = mix(a.rgb, mix(vec3(fromLum), a.rgb, 0.4), w) * a.a;\n vec3 outgoing = mix(washed, cardColor, wl);\n float outAlpha = mix(a.a, cardAlpha, wl);\n\n \n float x = clamp((p - split) / max(1.0 - split, 1e-3), 0.0, 1.0);\n float d = 1.0 - pow(1.0 - x, 1.5);\n float lum = dot(b.rgb, vec3(0.2126, 0.7152, 0.0722));\n \n float dev = clamp((d - 0.45 * lum) / 0.55, 0.0, 1.0);\n dev = dev * dev * (3.0 - 2.0 * dev);\n \n float early = 1.0 - smoothstep(0.2, 0.95, d);\n vec3 tinted = saturation(b.rgb, smoothstep(0.3, 1.0, d));\n tinted = mix(vec3(0.6), tinted, mix(0.55, 1.0, d));\n vec3 tone = mix(vec3(-0.2, 0.06, 0.1), vec3(0.12, -0.1, 0.06), smoothstep(0.15, 0.6, lum));\n tinted += tone * tint * early;\n vec3 incoming = mix(cardColor, clamp(tinted, 0.0, 1.0) * b.a, dev);\n float inAlpha = mix(cardAlpha, b.a, dev);\n\n vec3 color = p < split ? outgoing : incoming;\n float alpha = p < split ? outAlpha : inAlpha;\n if (alpha <= 0.0) return vec4(0.0);\n return vec4(clamp(color / alpha, 0.0, 1.0), alpha);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Pinwheel":"// Pinwheel — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Pinwheel.glsl\n// Author: Mr Speaker\n// License: MIT\n// Description: A spinning pinwheel reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float speed; \n\nvec4 transition(vec2 uv) {\n \n vec2 p = uv.xy / vec2(1.0).xy;\n \n float circPos = atan(p.y - 0.5, p.x - 0.5) + progress * speed;\n float modPos = mod(circPos, 3.1415 / 4.);\n float signed = sign(progress - modPos);\n \n return mix(getToColor(p), getFromColor(p), step(signed, 0.5));\n \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PixelStretch":"// PixelStretch — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PixelStretch.glsl\n// Author: gre\n// License: MIT\n// Description: A line sweeps across the frame and drags the outgoing image's pixels behind it as long streaks, which shorten as it goes and reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float stretch; \n\nuniform float chroma; \n\nuniform float softness; \n\nuniform float jitter; \n\nfloat hash(float n) {\n n = fract(n * 0.1031);\n n *= n + 33.33;\n n *= n + n;\n return fract(n);\n}\n\nfloat smax(float x, float y, float k) {\n float h = max(k - abs(x - y), 0.0) / k;\n return max(x, y) + h * h * k * 0.25;\n}\n\nvec2 at(vec2 uv, float s0, float s, vec2 d, float ext) {\n return clamp(uv + d * (s - s0) * ext, 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n vec2 d = normalize(direction + vec2(1e-6, 0.0));\n \n float ext = abs(d.x) + abs(d.y);\n float s = 0.5 + dot(uv - 0.5, d) / ext;\n \n vec2 n = vec2(-d.y, d.x);\n float t = dot((uv - 0.5) * vec2(ratio, 1.0), n);\n float row = floor(t * 540.0);\n float clump = floor(t * 60.0);\n float rnd = 0.6 * hash(row + 17.0) + 0.4 * hash(clump + 311.0);\n\n float p = progress;\n float k = softness + 1e-4;\n \n \n float margin = k + 0.002;\n float a = mix(-margin, 1.0 + margin, mix(p, p * p * (3.0 - 2.0 * p), 0.5));\n\n \n \n float h = clamp(4.0 * a * (1.0 - a), 0.0, 1.0);\n float len = stretch * h * (1.0 - 0.6 * jitter * rnd);\n float split = 0.02 * chroma * h;\n\n \n vec4 fr = getFromColor(at(uv, s, smax(s, a + split, k), d, ext));\n vec4 fg = getFromColor(at(uv, s, smax(s, a, k), d, ext));\n vec4 fb = getFromColor(at(uv, s, smax(s, a - split, k), d, ext));\n vec4 streak = vec4(fr.r, fg.g, fb.b, fg.a);\n \n float behind = step(s, a);\n streak.rgb *= 1.0 + 0.06 * jitter * h * (hash(row * 3.0 + 5.0) - 0.5) * behind;\n\n \n float w = smoothstep(len - k, len + k, a - s);\n return mix(streak, getToColor(uv), w);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Pixelize":"// Pixelize — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Pixelize.glsl\n// Author: gre\n// License: MIT\n// Description: Both images pixelate, crossfade, then sharpen again\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 squaresMin; \n\nuniform int steps; \n\nvec4 transition(vec2 uv) {\n float d = min(progress, 1.0 - progress);\n float dist = steps>0 ? ceil(d * float(steps)) / float(steps) : d;\n vec2 squareSize = 2.0 * dist / vec2(squaresMin);\n vec2 p = dist>0.0 ? (floor(uv / squareSize) + 0.5) * squareSize : uv;\n return mix(getFromColor(p), getToColor(p), progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PlasmaDissolve":"// PlasmaDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PlasmaDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: A flowing plasma of sine waves, as in the old demos, draws moving bands through which the incoming image spreads like tendrils, with a glowing edge\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float scale; \n\nuniform float smoothness; \n\nuniform float flow; \n\nuniform vec3 edgeColor; \n\nuniform float edgeStrength; \n\nconst float PI = 3.14159265;\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n if (progress <= 0.0) return a;\n if (progress >= 1.0) return b;\n\n \n vec2 p = (uv - 0.5) * vec2(ratio, 1.0) * max(scale, 0.0) * 2.0 * PI;\n \n \n float t = clamp(flow, 0.0, 1.0) * progress * 0.5;\n \n float v = sin(p.x * 0.6 + t)\n + sin(p.y * 0.8 - t * 0.8)\n + sin((p.x * 0.5 + p.y * 0.7) * 0.7 + t * 0.6)\n + sin(length(p - vec2(0.15, -0.1) * max(scale, 0.0) * 2.0 * PI) * 0.9 - t * 1.2);\n \n v = abs(fract(v * 0.25 + 0.5) * 2.0 - 1.0);\n\n \n float s = max(smoothness, 0.001);\n float threshold = mix(-s, 1.0 + s, progress);\n \n float m = 1.0 - smoothstep(threshold - s, threshold + s, v);\n\n \n vec4 col = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n if (col.a <= 0.0) return vec4(0.0);\n \n float glow = 4.0 * m * (1.0 - m) * max(edgeStrength, 0.0);\n return vec4(col.rgb / col.a + edgeColor * glow, col.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PlusWipe":"// PlusWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PlusWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A plus-shaped cross grows from the center and widens its arms until the incoming image fills the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float smoothness; \n\nuniform int reverse; \n\nfloat boxDist (vec2 p, vec2 halfSize) {\n vec2 d = abs(p) - halfSize;\n return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);\n}\n\nfloat plus (vec2 q, float t, float s) {\n vec2 frame = vec2(0.5 * ratio, 0.5);\n float k = min(frame.x, frame.y);\n \n \n vec2 halfWidth = k * t + (frame - k) * t * t;\n \n float halfLength = 3.0 * max(frame.x, frame.y) * t;\n float d = min(boxDist(q, vec2(halfLength, halfWidth.y)), boxDist(q, vec2(halfWidth.x, halfLength)));\n \n \n return 1.0 - smoothstep(0.0, s, d + s * (1.0 - t));\n}\n\nvec4 transition (vec2 uv) {\n \n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float s = max(smoothness, 0.001);\n float m = (reverse != 0) ? 1.0 - plus(q, 1.0 - progress, s) : plus(q, progress, s);\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PolkaDotsCurtain":"// PolkaDotsCurtain — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PolkaDotsCurtain.glsl\n// Author: bobylito\n// License: MIT\n// Description: The incoming image appears through growing polka dots\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst float SQRT_2 = 1.414213562373;\n\nuniform float dots; \nuniform vec2 center; \n\nvec4 transition(vec2 uv) {\n bool nextImage = distance(fract(uv * dots), vec2(0.5, 0.5)) < ( progress / distance(uv, center));\n return nextImage ? getToColor(uv) : getFromColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PopIn":"// PopIn — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PopIn.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image pops in as a rounded card over the outgoing one, with an elastic overshoot: too big, a bit small, then it settles into the full frame as its corners square off\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \n\nuniform float bounce; \n\nuniform float corner; \n\nuniform float shadow; \n\nconst float PI = 3.141592653589793;\n\nfloat roundedBox(vec2 p, vec2 b, float r) {\n vec2 q = abs(p) - b + r;\n return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - r;\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n \n float easeOut = 1.0 - (1.0 - t) * (1.0 - t) * (1.0 - t);\n float spring = 1.0 - exp(-1.5 * t) * cos(2.5 * PI * t) * (1.0 - t);\n float s = mix(easeOut, spring, bounce);\n\n \n vec2 asp = vec2(ratio, 1.0);\n float side = min(ratio, 1.0);\n vec2 cardCenter = center + (0.5 - center) * s;\n vec2 halfSize = 0.5 * s * asp;\n float r = corner * s * side * (1.0 - t);\n float aa = 0.002;\n \n float d = roundedBox((uv - cardCenter) * asp, halfSize, r) - aa;\n float cover = clamp(0.5 - d / aa, 0.0, 1.0) * smoothstep(0.0, 0.08, t);\n\n \n float k = min(s, 1.0) * side;\n float blur = 0.05 * k + 1e-4;\n vec2 offset = vec2(0.0, -0.03 * k);\n float ds = roundedBox((uv - cardCenter - offset) * asp, halfSize, r);\n float shade = shadow * (1.0 - smoothstep(-blur, blur, ds)) * smoothstep(0.0, 0.15, t);\n\n vec4 a = getFromColor(uv);\n \n a.rgb *= 1.0 - shade;\n \n vec4 b = getToColor(clamp((uv - center) / max(s, 1e-4) + center, 0.0, 1.0));\n \n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), cover);\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PowerKaleido":"// PowerKaleido — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PowerKaleido.glsl\n// Author: Boundless\n// License: MIT\n// Description: The image folds into an animated kaleidoscope before revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst float rad = 120.; \nconst float deg = rad / 180. * 3.14159265358979;\nuniform float scale; \nuniform float z; \nuniform float speed; \nvec2 refl(vec2 p,vec2 o,vec2 n)\n{\n\treturn 2.0*o+2.0*n*dot(p-o,n)-p;\n}\n\nvec2 rot(vec2 p, vec2 o, float a)\n{\n float s = sin(a);\n float c = cos(a);\n\treturn o + mat2(c, -s, s, c) * (p - o);\n}\n\nvec4 mainImage(vec2 uv)\n{\n float dist = scale / 10.;\n vec2 uv0 = uv;\n\tuv -= 0.5;\n uv.x *= ratio;\n uv *= z;\n uv = rot(uv, vec2(0.0), progress*speed);\n \n\tfloat theta = progress*6.+3.14159265358979/.5;\n\tfor(int iter = 0; iter < 10; iter++) {\n for(float i = 0.; i < 2. * 3.14159265358979; i+=deg) {\n\t float ts = sign(asin(cos(i))) == 1.0 ? 1.0 : 0.0;\n if(((ts == 1.0) && (uv.y-dist*cos(i) > tan(i)*(uv.x+dist*+sin(i)))) || ((ts == 0.0) && (uv.y-dist*cos(i) < tan(i)*(uv.x+dist*+sin(i))))) {\n uv = refl(vec2(uv.x+sin(i)*dist*2.,uv.y-cos(i)*dist*2.), vec2(0.,0.), vec2(cos(i),sin(i)));\n }\n }\n }\n uv += 0.5;\n uv = rot(uv, vec2(0.5), progress*-speed);\n uv -= 0.5;\n uv.x /= ratio;\n uv += 0.5;\n uv = 2.*abs(uv/2.-floor(uv/2.+0.5));\n vec2 uvMix = mix(uv,uv0,cos(progress*3.14159265358979*2.)/2.+0.5);\n vec4 color = mix(getFromColor(uvMix),getToColor(uvMix),cos((progress-1.)*3.14159265358979)/2.+0.5);\n\treturn color;\n \n}\nvec4 transition (vec2 uv) {\n vec4 color = mainImage(uv);\n return color;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Prisms":"// Prisms — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Prisms.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is cut into 3D prisms that turn in a cascade, like a rotating billboard, from the outgoing image on one face to the incoming one on the next\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int slats; \n\nuniform float stagger; \n\nuniform float perspective; \n\nuniform float shading; \n\nuniform int horizontal; \n\nuniform vec4 backColor; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.002;\n\nvec4 transition (vec2 uv) {\n float n = float(slats);\n \n float a = (horizontal != 0) ? uv.y : uv.x;\n float b = (horizontal != 0) ? uv.x : uv.y;\n \n float hw = 0.5 / n * ((horizontal != 0) ? 1.0 : ratio);\n float k = min(perspective * hw, 0.5);\n float bScale = (horizontal != 0) ? ratio : 1.0;\n \n vec4 near1 = vec4(0.0), near2 = vec4(0.0);\n float cover1 = 0.0, cover2 = 0.0;\n float z1 = -2.0, z2 = -2.0;\n for (int d = -1; d <= 1; d++) {\n float i = floor(a * n) + float(d);\n if (i < 0.0 || i > n - 1.0) continue;\n \n float order = ((horizontal != 0) ? n - 1.0 - i : i) / (n - 1.0);\n float t = clamp((progress - stagger * order) / (1.0 - stagger), 0.0, 1.0);\n t = mix(t, t * t * (3.0 - 2.0 * t), 0.7);\n float c = cos(0.5 * PI * t);\n float s = sin(0.5 * PI * t);\n \n float edge = EDGE * min(1.0, 20.0 * s * c) + 1e-6;\n \n float x = 2.0 * (a * n - i) - 1.0;\n for (int f = 0; f < 2; f++) {\n \n float cf = f == 0 ? c : s;\n if (cf < 1e-4) continue;\n \n float u = f == 0 ? (x + s) / c : (x - c) / s;\n float z = f == 0 ? u * s + c : s - u * c;\n if (abs(u) > 1.0 || z <= z2) continue;\n \n float scale = 1.0 - k * (z - 1.0);\n float y = (b - 0.5) * scale + 0.5;\n if (y < 0.0 || y > 1.0) continue;\n \n float outer = f == 0 ? 1.0 + u : 1.0 - u;\n float cover = clamp(outer * hw * cf / edge, 0.0, 1.0)\n * clamp(min(y, 1.0 - y) * bScale / scale / edge, 0.0, 1.0);\n float sa = (i + 0.5 + 0.5 * u) / n;\n vec2 p = (horizontal != 0) ? vec2(y, sa) : vec2(sa, y);\n vec4 img = f == 0 ? getFromColor(p) : getToColor(p);\n \n float lambert = clamp(f == 0 ? c - 0.6 * s : s + 0.6 * c, 0.0, 1.0);\n vec4 color = vec4(img.rgb * mix(1.0 - shading, 1.0, lambert), img.a);\n if (z > z1) {\n near2 = near1; cover2 = cover1; z2 = z1;\n near1 = color; cover1 = cover; z1 = z;\n } else {\n near2 = color; cover2 = cover; z2 = z;\n }\n }\n }\n return mix(mix(backColor, near2, cover2), near1, cover1);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Puzzle":"// Puzzle — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Puzzle.glsl\n// Author: gre\n// License: MIT\n// Description: The image is cut into jigsaw puzzle pieces that lift one after another and fall away, revealing the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float pieces; \n\nuniform float shadow; \n\nfloat hash(vec2 c) {\n vec2 p = fract(c * vec2(0.1031, 0.1030));\n p += dot(p, p.yx + 33.33);\n return fract((p.x + p.y) * p.x);\n}\n\nfloat boxDist(vec2 p, vec2 halfSize) {\n vec2 q = abs(p) - halfSize;\n return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0);\n}\n\nfloat pieceDist(vec2 p, vec2 c, vec2 grid, float aspect) {\n vec2 halfSize = vec2(0.5 * aspect, 0.5);\n float d = boxDist(p, halfSize);\n float tabs = 1e3;\n for (int e = 0; e < 4; e++) {\n \n vec2 dir = e == 0 ? vec2(1.0, 0.0) : e == 1 ? vec2(-1.0, 0.0) : e == 2 ? vec2(0.0, 1.0) : vec2(0.0, -1.0);\n vec2 key = c + min(dir, 0.0);\n vec2 next = c + dir;\n if (next.x >= 0.0 && next.y >= 0.0 && next.x < grid.x && next.y < grid.y) {\n float h = hash(key + (e < 2 ? vec2(0.0) : vec2(71.0, 37.0)));\n \n bool tab = (h < 0.5) == (dir.x + dir.y > 0.0);\n vec2 out1 = dir * (tab ? 1.0 : -1.0);\n vec2 along = vec2(abs(dir.y), abs(dir.x));\n vec2 edge = dir * halfSize + along * (fract(h * 2.0) - 0.5) * 0.16;\n float k = min(\n length(p - edge - out1 * 0.15) - 0.125,\n boxDist(p - edge - out1 * 0.06, abs(dir) * 0.08 + along * 0.085));\n if (tab) tabs = min(tabs, k);\n else d = max(d, -k);\n }\n }\n return min(d, tabs);\n}\n\nvec4 transition(vec2 uv) {\n \n float rows = ratio < 1.0 ? floor(pieces / ratio + 0.5) : pieces;\n float cols = ratio < 1.0 ? pieces : floor(pieces * ratio + 0.5);\n vec2 grid = vec2(cols, rows);\n float aspect = ratio * rows / cols;\n vec2 g = uv * grid;\n vec2 cell = floor(g);\n\n const float aa = 0.01; \n float boardSum = 0.0;\n float allSum = 0.0;\n \n float prio1 = -1.0, prio2 = -1.0, cov1 = 0.0, cov2 = 0.0, shade1 = 1.0, shade2 = 1.0;\n vec2 uv1 = uv, uv2 = uv;\n float shadowAll = 0.0;\n float seam = 1.0;\n for (int i = 0; i < 9; i++) {\n vec2 c = cell + vec2(mod(float(i), 3.0), floor(float(i) / 3.0)) - 1.0;\n if (c.x < 0.0 || c.y < 0.0 || c.x >= cols || c.y >= rows) continue;\n vec2 center = c + 0.5;\n vec2 local = (g - center) * vec2(aspect, 1.0);\n float h = hash(c + vec2(13.0, 7.0));\n \n float diag = (c.x / max(cols - 1.0, 1.0) + (rows - 1.0 - c.y) / max(rows - 1.0, 1.0)) * 0.5;\n float delay = (diag + 1.2 * (h - 0.5) * diag * (1.0 - diag)) * 0.6;\n float t = clamp((progress - delay) / 0.4, 0.0, 1.0);\n\n \n float d0 = pieceDist(local, c, grid, aspect);\n float w = 1.0 - smoothstep(-aa, aa, d0);\n allSum += w;\n if (t <= 0.0) {\n boardSum += w;\n seam = min(seam, abs(d0));\n continue;\n }\n \n float lift = smoothstep(0.0, 0.25, t);\n float fall = clamp((t - 0.2) / 0.8, 0.0, 1.0);\n fall *= fall;\n float s = max(1.0 - fall, 0.001);\n float a = (h - 0.5) * 3.0 * fall;\n vec2 off = vec2(0.0, -1.2 * fall);\n mat2 rot = mat2(cos(a), -sin(a), sin(a), cos(a));\n vec2 pl = rot * (local - off) / s;\n float dp = pieceDist(pl, c, grid, aspect);\n float cov = (1.0 - smoothstep(-aa, aa, dp * s)) * min(s * 20.0, 1.0); \n \n float shade = (1.0 - 0.5 * fall) * (1.0 - 0.3 * lift * (1.0 - smoothstep(0.0, 0.035, -dp)));\n vec2 puv = (center + pl / vec2(aspect, 1.0)) / grid;\n \n vec2 sl = rot * (local - off - vec2(0.08, -0.1) * lift) / s;\n float sh = (1.0 - smoothstep(-0.05, 0.12, pieceDist(sl, c, grid, aspect) * s)) * lift * (1.0 - fall) * shadow;\n \n shadowAll = max(shadowAll, max(sh, w * lift * (1.0 - smoothstep(0.2, 0.5, t)) * shadow));\n float prio = delay;\n if (cov > 0.0 && prio > prio1) {\n prio2 = prio1; cov2 = cov1; uv2 = uv1; shade2 = shade1;\n prio1 = prio; cov1 = cov; uv1 = puv; shade1 = shade;\n } else if (cov > 0.0 && prio > prio2) {\n prio2 = prio; cov2 = cov; uv2 = puv; shade2 = shade;\n }\n }\n vec4 base = mix(getToColor(uv), getFromColor(uv), boardSum / max(allSum, 0.001));\n \n base.rgb *= (1.0 - shadowAll) * (1.0 - 0.4 * smoothstep(0.0, 0.1, progress) * (1.0 - smoothstep(0.0, 0.015, seam)));\n vec4 p2 = getFromColor(uv2);\n p2.rgb *= shade2;\n vec4 p1 = getFromColor(uv1);\n p1.rgb *= shade1;\n return mix(mix(base, p2, cov2), p1, cov1);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RadialWipe":"// RadialWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RadialWipe.glsl\n// Author: Xaychru\n// License: MIT\n// Description: A radial wipe that sweeps around the center like a clock hand\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float smoothness; \n\nconst float PI = 3.141592653589;\n\nvec4 transition(vec2 p) {\n vec2 rp = p*2.-1.;\n return mix(\n getToColor(p),\n getFromColor(p),\n smoothstep(0., smoothness, atan(rp.y,rp.x) - (progress-.5) * PI * 2.5)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RandomSquares":"// RandomSquares — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RandomSquares.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image appears in random squares\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 size; \n\nuniform float smoothness; \n \nfloat rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec4 transition(vec2 p) {\n float r = rand(floor(vec2(size) * p));\n float m = smoothstep(0.0, -smoothness, r - (progress * (1.0 + smoothness)));\n return mix(getFromColor(p), getToColor(p), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RectangleCover":"// RectangleCover — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RectangleCover.glsl\n// Author: martiniti\n// License: MIT\n// Description: A rectangle grows from the center to cover the outgoing image, then shrinks to reveal the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 bgcolor; \n\nvec4 transition(vec2 p) {\n float s = pow(2.0 * abs(progress - 0.5), 3.0);\n \n vec2 sq = p.xy / vec2(1.0).xy;\n \n \n vec2 bl = step(vec2(abs(1. - 2.*progress)), sq + .25);\n float dist = bl.x * bl.y;\n\n \n vec2 tr = step(vec2(abs(1. - 2.*progress)), 1.25-sq);\n dist *= 1. * tr.x * tr.y;\n \n return mix(\n progress < 0.5 ? getFromColor(p) : getToColor(p),\n bgcolor,\n step(s, dist)\n );\n \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RectangleIris":"// RectangleIris — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RectangleIris.glsl\n// Author: martiniti\n// License: MIT\n// Description: The outgoing image shrinks into a small rectangle over a background color, then the incoming one grows from it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 bgcolor; \n\nvec4 transition(vec2 uv) {\n \n float s = pow(2.0 * abs(progress - 0.5), 3.0);\n \n vec2 q = uv.xy / vec2(1.0).xy;\n \n \n vec2 bl = step(vec2(1.0 - 2.0*abs(progress - 0.5)), q + 0.25);\n \n \n vec2 tr = step(vec2(1.0 - 2.0*abs(progress - 0.5)), 1.25 - q);\n \n float dist = length(1.0 - bl.x * bl.y * tr.x * tr.y);\n \n return mix(\n progress < 0.5 ? getFromColor(uv) : getToColor(uv),\n bgcolor,\n step(s, dist)\n );\n \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Refraction":"// Refraction — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Refraction.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is seen through flowing liquid glass that bends the outgoing image more and more, with rainbow fringes, flares up as the incoming image takes over, then calms down and clears\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \n\nuniform float scale; \n\nuniform float dispersion; \n\nuniform float brightness; \n\nconst int TAPS = 7;\n\nfloat surface(vec2 q, float t) {\n q += 0.45 * vec2(sin(1.3 * q.y + 0.9 * t), sin(1.1 * q.x - 1.2 * t));\n float h = sin(q.x + 0.6 * t) * sin(1.2 * q.y - 0.8 * t);\n h += 0.5 * sin(dot(q, vec2(1.6, -1.2)) + 1.4 * t);\n h += 0.3 * sin(dot(q, vec2(-1.1, 2.9)) - 1.9 * t + 1.7 * sin(0.9 * q.x));\n h += 0.15 * sin(dot(q, vec2(4.3, 3.1)) + 2.6 * t);\n return h;\n}\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec3 spectrum(float w) {\n vec3 c = vec3(\n 1.0 - smoothstep(0.0, 0.55, w) + 0.35 * smoothstep(0.75, 1.0, w),\n 1.0 - abs(2.0 * w - 1.0) * 1.2,\n smoothstep(0.45, 1.0, w)\n );\n return clamp(c, 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float h = 1.0 - abs(2.0 * p - 1.0);\n float amount = h * h * (2.0 - h);\n\n \n vec2 q = (uv - 0.5) * vec2(ratio, 1.0) * scale;\n float t = 3.0 * p;\n float e = 0.01;\n vec2 slope = vec2(\n surface(q + vec2(e, 0.0), t) - surface(q - vec2(e, 0.0), t),\n surface(q + vec2(0.0, e), t) - surface(q - vec2(0.0, e), t)\n ) / (2.0 * e);\n vec2 offset = slope * strength * amount / scale;\n \n \n float wave = clamp(0.5 * surface(q, t), -1.0, 1.0);\n float m = smoothstep(-0.015, 0.015, p - 0.5 + 0.1 * wave);\n\n \n vec3 color = vec3(0.0);\n vec3 weights = vec3(0.0);\n float alpha = 0.0;\n \n float jitter = hash12(uv * vec2(ratio, 1.0) * 1000.0) - 0.5;\n for (int i = 0; i < TAPS; i++) {\n float w = float(i) / float(TAPS - 1);\n float wj = (float(i) + jitter) / float(TAPS - 1);\n vec2 st = mirror(uv + offset * (1.0 + dispersion * (wj - 0.5) * 1.6));\n vec4 c = mix(getFromColor(st), getToColor(st), m);\n vec3 s = spectrum(w);\n color += s * c.rgb * c.a;\n weights += s;\n alpha += c.a;\n }\n alpha /= float(TAPS);\n color = color / weights / max(alpha, 1e-5);\n\n \n float flare = 2.0 * brightness * pow(h, 8.0);\n color = color * (1.0 + flare) / (1.0 + flare * color);\n color += 0.1 * flare * dot(color, vec3(0.3333));\n return vec4(clamp(color, 0.0, 1.0), alpha);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Revolve":"// Revolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Revolve.glsl\n// Author: bread\n// License: MIT\n// Description: The outgoing image swirls and zooms with motion blur into the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \nuniform float direction; \nuniform float maxRotation; \nuniform float peakZoom; \nuniform float swirl; \nuniform float barrel; \nuniform float motionBlur; \nuniform float switchStart; \nuniform float switchEnd; \nuniform float shadow; \n\nfloat sat(float x) {\n return clamp(x, 0.0, 1.0);\n}\n\nfloat ease(float x) {\n x = sat(x);\n return x * x * (3.0 - 2.0 * x);\n}\n\nfloat revolveEnvelope(float t) {\n float rise = ease((t - 0.10) / 0.33);\n float fall = 1.0 - ease((t - 0.43) / 0.29);\n return rise * fall;\n}\n\nvec2 rotate2(vec2 p, float a) {\n float s = sin(a);\n float c = cos(a);\n return vec2(c * p.x - s * p.y, s * p.x + c * p.y);\n}\n\nvec2 warpUv(vec2 uv, float t) {\n float e = revolveEnvelope(t);\n\n vec2 p = uv - center;\n p.x *= ratio;\n\n float r = length(p);\n float edgeSpin = maxRotation * e;\n float coreSpin = swirl * e * pow(1.0 - sat(r / 0.96), 1.55);\n float visibleAngle = direction * (edgeSpin + coreSpin);\n\n p = rotate2(p, -visibleAngle);\n\n float sc = 1.0 + (peakZoom - 1.0) * pow(e, 0.85);\n p /= sc;\n\n float rr = length(p);\n p *= 1.0 + barrel * e * rr * rr * 2.8;\n\n p.x /= ratio;\n return clamp(p + center, vec2(0.001), vec2(0.999));\n}\n\nvec4 sampleRevolve(vec2 uv, float t) {\n vec2 p = warpUv(uv, t);\n float reveal = smoothstep(switchStart, switchEnd, t);\n return mix(getFromColor(p), getToColor(p), reveal);\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n float e = revolveEnvelope(progress);\n float span = 0.060 * motionBlur * e;\n\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n for (int i = -8; i <= 8; i++) {\n float x = float(i) / 8.0;\n float w = 1.0 - abs(x);\n w = w * w + 0.01;\n\n float t = sat(progress + x * span);\n color += sampleRevolve(uv, t) * w;\n total += w;\n }\n\n color /= total;\n\n vec2 q = uv - vec2(0.5);\n q.x *= ratio;\n float vignette = 1.0 - shadow * e * smoothstep(0.35, 0.95, length(q));\n color.rgb *= vignette;\n\n return color;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RingsWipe":"// RingsWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RingsWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Concentric rings ripple out from the center and, one after another, each sweeps around like a clock hand in the opposite direction of its neighbors to reveal the incoming image, or fills across its width, with optional colored borders between the rings\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int count; \n\nuniform vec2 center; \n\nuniform float stagger; \n\nuniform int radial; \n\nuniform float borderWidth; \n\nuniform vec4 borderColor; \n\nuniform float smoothness; \n\nconst float PI = 3.141592653589793;\n\nconst float AA = 0.0015;\n\nfloat ringProgress(float i, float k, float d, float t) {\n return clamp((t - i * k * d) / d, 0.0, 1.0);\n}\n\nfloat ringMask(float i, float lp, float w, float rad, float a, float s) {\n bool odd = mod(i, 2.0) > 0.5;\n if ((radial != 0)) {\n \n \n \n float e = s / w;\n float f = mix(-e, 1.0 + e, lp);\n float x = clamp((rad - i * w) / w, 0.0, 1.0);\n float dist = (odd ? f - (1.0 - x) : f - x) * w;\n return smoothstep(-s, s, dist);\n }\n \n \n \n \n float aa = odd ? 1.0 - a : a;\n float arc = 2.0 * PI * max(rad, s);\n float e = s / arc;\n float lo = mix(e, -e, lp);\n float hi = mix(-e, 1.0 + e, lp);\n float dist = max(min(aa - lo, hi - aa), min(aa - 1.0 - lo, hi - aa + 1.0));\n return smoothstep(-s, s, dist * arc);\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n if (progress <= 0.0) return a;\n if (progress >= 1.0) return b;\n\n float n = float(count < 1 ? 1 : count);\n \n vec2 p = (uv - center) * vec2(ratio, 1.0);\n \n vec2 far = max(center, 1.0 - center) * vec2(ratio, 1.0);\n float R = length(far) + AA;\n float w = R / n;\n float rad = length(p);\n float turn = rad > 0.0 ? fract(atan(p.x, p.y) / (2.0 * PI)) : 0.0;\n float s = max(min(smoothness, 0.25 * w), AA);\n float t = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.35);\n float k = clamp(stagger, 0.0, 1.0);\n float d = 1.0 / (1.0 + k * (n - 1.0));\n\n \n float j = floor(rad / w + 0.5);\n float inner = clamp(j - 1.0, 0.0, n - 1.0);\n float outer = clamp(j, 0.0, n - 1.0);\n float li = ringProgress(inner, k, d, t);\n float lo = ringProgress(outer, k, d, t);\n float m = mix(\n ringMask(inner, li, w, rad, turn, s),\n ringMask(outer, lo, w, rad, turn, s),\n smoothstep(-AA, AA, rad - j * w)\n );\n\n \n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n\n \n \n if (borderWidth > 0.0 && j >= 1.0 && j <= n - 1.0) {\n float on = min(1.0, 4.0 * li * (1.0 - lo));\n \n float hw = min(0.5 * borderWidth, 0.5 * w - AA);\n float line = (1.0 - smoothstep(hw - AA, hw + AA, abs(rad - j * w)))\n * min(1.0, borderWidth / (2.0 * AA));\n float o = borderColor.a * line * on;\n c = vec4(borderColor.rgb * o, o) + c * (1.0 - o);\n }\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Ripple":"// Ripple — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Ripple.glsl\n// Author: gre\n// License: MIT\n// Description: Ripples spread from the center while crossfading\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float amplitude; \n\nuniform float speed; \n\nvec4 transition (vec2 uv) {\n vec2 dir = uv - vec2(.5);\n float dist = length(dir);\n vec2 offset = dir * (sin(progress * dist * amplitude - progress * speed) + .5) / 30. * progress;\n return mix(\n getFromColor(uv + offset),\n getToColor(uv),\n smoothstep(0.2, 1.0, progress)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Rolls":"// Rolls — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Rolls.glsl\n// Author: Mark Craig\n// License: MIT\n// Description: The outgoing image rolls away around a corner, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int type; \n\nuniform int RotDown; \n\nvec4 transition(vec2 uv)\n{\nfloat theta, c1, s1;\nvec2 iResolution = vec2(ratio, 1.0);\nvec2 uvi;\n\nif (type == 0) { theta = ((RotDown != 0) ? 3.14159265358979323846 : -3.14159265358979323846) / 2.0 * progress; uvi.x = 1.0 - uv.x; uvi.y = uv.y; }\nelse if (type == 1) { theta = ((RotDown != 0) ? 3.14159265358979323846 : -3.14159265358979323846) / 2.0 * progress; uvi = uv; }\nelse if (type == 2) { theta = ((RotDown != 0) ? -3.14159265358979323846 : 3.14159265358979323846) / 2.0 * progress; uvi.x = uv.x; uvi.y = 1.0 - uv.y; }\nelse if (type == 3) { theta = ((RotDown != 0) ? -3.14159265358979323846 : 3.14159265358979323846) / 2.0 * progress; uvi = 1.0 - uv; }\nc1 = cos(theta); s1 = sin(theta);\nvec2 uv2;\nuv2.x = (uvi.x * iResolution.x * c1 - uvi.y * iResolution.y * s1);\nuv2.y = (uvi.x * iResolution.x * s1 + uvi.y * iResolution.y * c1);\nif ((uv2.x >= 0.0) && (uv2.x <= iResolution.x) && (uv2.y >= 0.0) && (uv2.y <= iResolution.y))\n\t{\n\tuv2 /= iResolution;\n\tif (type == 0) { uv2.x = 1.0 - uv2.x; }\n\telse if (type == 2) { uv2.y = 1.0 - uv2.y; }\n\telse if (type == 3) { uv2 = 1.0 - uv2; }\n\treturn(getFromColor(uv2));\n\t}\nreturn(getToColor(uv));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RotateFade":"// RotateFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RotateFade.glsl\n// Author: haiyoucuv\n// License: MIT\n// Description: The images spin around the center while crossfading\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec2 rotate2D(in vec2 uv, in float angle){\n \n return uv * mat2(cos(angle), -sin(angle), sin(angle), cos(angle));\n}\nvec4 transition (vec2 uv) {\n \n vec2 p = fract(rotate2D(uv - 0.5, progress * 3.1415926 * 2.0) + 0.5);\n\n return mix(\n getFromColor(p),\n getToColor(p),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RotateScaleFade":"// RotateScaleFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RotateScaleFade.glsl\n// Author: Fernando Kuteken\n// License: MIT\n// Description: The outgoing image spins and zooms while fading to the incoming one, over a background color\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 center; \n\nuniform float rotations; \n\nuniform float scale; \n\nuniform vec4 backColor; \n\nvec4 transition (vec2 uv) {\n \n vec2 difference = uv - center;\n vec2 dir = normalize(difference);\n float dist = length(difference);\n \n float angle = 2.0 * 3.14159265359 * rotations * progress;\n \n float c = cos(angle);\n float s = sin(angle);\n \n float currentScale = mix(scale, 1.0, 2.0 * abs(progress - 0.5));\n \n vec2 rotatedDir = vec2(dir.x * c - dir.y * s, dir.x * s + dir.y * c);\n vec2 rotatedUv = center + rotatedDir * dist / currentScale;\n \n if (rotatedUv.x < 0.0 || rotatedUv.x > 1.0 ||\n rotatedUv.y < 0.0 || rotatedUv.y > 1.0)\n return backColor;\n \n return mix(getFromColor(rotatedUv), getToColor(rotatedUv), progress);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","RotateScaleVanish":"// RotateScaleVanish — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RotateScaleVanish.glsl\n// Author: Mark Craig\n// License: MIT\n// Description: The outgoing image spins and shrinks away over the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int FadeInSecond; \n\nuniform int ReverseEffect; \n\nuniform int ReverseRotation; \n\nvec4 transition(vec2 uv)\n{\nvec2 iResolution = vec2(ratio, 1.0);\nfloat t = (ReverseEffect != 0) ? 1.0 - progress : progress;\nfloat theta = (ReverseRotation != 0) ? 6.283185307179586476925286766559 * t : -6.283185307179586476925286766559 * t;\nfloat c1 = cos(theta);\nfloat s1 = sin(theta);\nfloat rad = max(0.00001, 1.0 - t);\nfloat xc1 = (uv.x - 0.5) * iResolution.x;\nfloat yc1 = (uv.y - 0.5) * iResolution.y;\nfloat xc2 = (xc1 * c1 - yc1 * s1) / rad;\nfloat yc2 = (xc1 * s1 + yc1 * c1) / rad;\nvec2 uv2 = vec2(xc2 + iResolution.x / 2.0, yc2 + iResolution.y / 2.0);\nvec4 col3;\nvec4 ColorTo = (ReverseEffect != 0) ? getFromColor(uv) : getToColor(uv);\nif ((uv2.x >= 0.0) && (uv2.x <= iResolution.x) && (uv2.y >= 0.0) && (uv2.y <= iResolution.y))\n\t{\n\tuv2 /= iResolution;\n\tcol3 = (ReverseEffect != 0) ? getToColor(uv2) : getFromColor(uv2);\n\t}\nelse { col3 = (FadeInSecond != 0) ? vec4(0.0) : ColorTo; } \nreturn((1.0 - t) * col3 + t * ColorTo); \n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SawtoothWipe":"// SawtoothWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SawtoothWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A wipe whose edge is a row of sharp, regular triangular teeth sweeps across the frame, or two toothed edges that start interlocked part from the middle like jaws opening\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform int teeth; \n\nuniform float depth; \n\nuniform int jaws; \n\nuniform float smoothness; \n\nconst float AA = 0.0015;\n\nfloat zigzag(vec2 q, float w, float h) {\n \n float x = abs(fract(q.x / w) - 0.5) * w;\n vec2 a = vec2(0.0, -0.5 * h);\n vec2 ab = vec2(0.5 * w, h);\n vec2 aq = vec2(x, q.y) - a;\n float d = length(aq - ab * clamp(dot(aq, ab) / dot(ab, ab), 0.0, 1.0));\n return q.y > h * (2.0 * x / w - 0.5) ? d : -d;\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n if (progress <= 0.0) return a;\n if (progress >= 1.0) return b;\n\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n \n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n \n float e = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n float w = 0.5 * (abs(dir.y) * ratio + abs(dir.x));\n float period = 2.0 * w / float(teeth < 1 ? 1 : teeth);\n \n \n vec2 q = vec2(dot(p, vec2(-dir.y, dir.x)) + w + 0.5 * period, dot(p, dir));\n float h = max(depth, 0.0) * period;\n \n float s = max(min(smoothness, 0.25 * period), AA);\n float t = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.35);\n\n float d;\n if ((jaws != 0)) {\n \n \n \n float overlap = s * sqrt(1.0 + 4.0 * h * h / (period * period));\n float o = mix(-overlap, e + 0.5 * h + s, t);\n d = max(zigzag(q - vec2(0.0, o), period, h), -zigzag(q + vec2(0.0, o), period, h));\n } else {\n \n float c = mix(-e - 0.5 * h - s, e + 0.5 * h + s, t);\n d = zigzag(q - vec2(0.0, c), period, h);\n }\n \n float m = 1.0 - smoothstep(-s, s, d);\n\n \n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ScaleIn":"// ScaleIn — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ScaleIn.glsl\n// Author: haiyoucuv\n// License: MIT\n// Description: The incoming image scales in from the center while fading in\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 scale(in vec2 uv){\n uv = 0.5 + (uv - 0.5) * progress;\n return getToColor(uv);\n}\n\nvec4 transition (vec2 uv) {\n return mix(\n getFromColor(uv),\n scale(uv),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Shatter":"// Shatter — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Shatter.glsl\n// Author: lbl\n// License: MIT\n// Description: The outgoing image shatters into fragments that fly away\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat random(vec2 par) {\n return fract(sin(dot(par.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvec2 random2(vec2 par) {\n float rand = random(par);\n return vec2(rand, random(par + rand));\n}\n\nvec4 transition (vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n const float duration = 8.0;\n float time = progress * duration;\n vec2 point[10];\n for (int i = 0; i < 10; i++) {\n point[i] = random2(vec2(float(i)));\n }\n\n vec4 col = getToColor(uv);\n\n for (int i = 0; i < 10; i++) {\n vec2 dir = normalize(random2(vec2(float(i), float(i) + 11.)));\n float v = (1.0 + random(dir) * 0.5) * 0.2;\n vec2 ofst = dir * clamp(time - 0.5, 0.0, duration) * v;\n vec2 U = uv - ofst;\n\n if (U.x < 0.0 || U.x > 1.0 || U.y < 0.0 || U.y > 1.0) continue;\n\n float dist_i = distance(U, point[i]);\n bool closest = true;\n for (int j = 0; j < 10; j++) {\n if (distance(U, point[j]) < dist_i) {\n closest = false;\n break;\n }\n }\n\n if (closest) {\n col = getFromColor(U);\n break;\n }\n }\n return col;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Shred":"// Shred — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Shred.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is cut into paper strips that drop away at uneven speeds, tilting as they fall, revealing the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int strips; \n\nuniform float stagger; \n\nuniform float tilt; \n\nuniform float shadow; \n\nfloat hash (float n) {\n n = fract(n * 0.1031);\n n *= n + 33.33;\n n *= n + n;\n return fract(n);\n}\n\nvec4 transition (vec2 uv) {\n float n = float(strips);\n float w = ratio / n; \n vec2 q = vec2(uv.x * ratio, uv.y);\n vec4 color = getToColor(uv);\n float cover = -1.0;\n float shade = 0.0;\n \n float maxTilt = min(tilt, 2.0 * w);\n for (int d = -3; d <= 3; d++) {\n float i = floor(uv.x * n) + float(d);\n if (i < 0.0 || i > n - 1.0) continue;\n \n float delay = stagger * max(0.0, 1.25 * hash(i + 1.0) - 0.25);\n float speed = 1.0 + 0.5 * hash(i + 71.0);\n float t = clamp((progress - delay) / (1.0 - delay), 0.0, 1.0);\n \n float fall = (0.4 * t + 0.6 * t * t) * (1.0 + w * (0.5 + tilt)) * speed;\n float angle = maxTilt * (2.0 * hash(i + 37.0) - 1.0) * t;\n \n float lift = min(1.0, 8.0 * t);\n float gap = 0.06 * w * lift;\n \n vec2 v = q - vec2((i + 0.5) * w, 0.5 - fall);\n float ca = cos(angle), sa = sin(angle);\n vec2 l = vec2(ca * v.x + sa * v.y, ca * v.y - sa * v.x);\n vec2 edge = vec2(0.5 * w - gap, 0.5) - abs(l);\n \n vec2 so = abs(l - lift * vec2(0.15 * w, -0.25 * w)) - vec2(0.5 * w - gap, 0.5);\n shade = max(shade, lift * (1.0 - smoothstep(0.0, 0.5 * w, max(so.x, so.y))));\n if (min(edge.x, edge.y) >= 0.0 && fall > cover) {\n vec2 p = vec2((i + 0.5) * w + l.x, 0.5 + l.y);\n vec4 img = getFromColor(vec2(p.x / ratio, p.y));\n \n float cut = lift * (1.0 - smoothstep(0.0, 0.25 * w, edge.x));\n color = vec4(img.rgb * (1.0 - 0.5 * shadow * cut), img.a);\n cover = fall;\n }\n }\n if (cover < 0.0) {\n color = vec4(color.rgb * (1.0 - 0.6 * shadow * shade), color.a);\n }\n return color;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SimpleFlip":"// SimpleFlip — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SimpleFlip.glsl\n// Author: nwoeanhinnogaehr\n// License: MIT\n// Description: The outgoing image flips around the vertical axis into the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n vec2 q = uv;\n uv.x = (uv.x - 0.5) / abs(progress - 0.5) * 0.5 + 0.5;\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n \n return mix(a, b, step(0.5, progress)) * step(abs(q.x - 0.5), abs(progress - 0.5));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SimpleZoom":"// SimpleZoom — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SimpleZoom.glsl\n// Author: 0gust1\n// License: MIT\n// Description: Zooms into the outgoing image, then fades to the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float zoom_quickness; \nvec2 zoom(vec2 uv, float amount) {\n return 0.5 + ((uv - 0.5) * (1.0-amount));\t\n}\n\nvec4 transition (vec2 uv) {\n float nQuick = clamp(zoom_quickness,0.2,1.0);\n return mix(\n getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))),\n getToColor(uv),\n smoothstep(nQuick-0.2, 1.0, progress)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SimpleZoomOut":"// SimpleZoomOut — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SimpleZoomOut.glsl\n// Author: Tianshuo\n// License: MIT\n// Description: The incoming image zooms out into place while fading in\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float zoom_quickness; \n\nuniform int fade; \nvec2 zoom(vec2 uv, float amount) {\n return 0.5 + ((uv - 0.5) * (1.0-amount));\t\n}\n\nvec4 transition (vec2 uv) {\n float nQuick = clamp(zoom_quickness,0.2,1.0);\n return mix(\n getFromColor(uv),\n getToColor(zoom(uv,1.-smoothstep(1.-nQuick, 1., progress))),\n (fade != 0)?smoothstep(1.0-nQuick, 1., progress):(progress<1.0-nQuick?0.0:1.0)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SlideAwayRight":"// SlideAwayRight — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SlideAwayRight.glsl\n// Author: lizhongjian\n// License: MIT\n// Description: The outgoing image slides to the right, uncovering a crossfade to the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n vec2 newUV = uv;\n newUV.x -= progress;\n if(uv.x >= progress)\n {\n return getFromColor(newUV);\n }\n\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n progress\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Slides":"// Slides — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Slides.glsl\n// Author: Mark Craig\n// License: MIT\n// Description: The outgoing image slides out, or the incoming one slides in, toward an edge, a corner or the center\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int type; \n\nuniform int In; \n\nvec4 transition(vec2 uv)\n{\nvec2 uv0 = uv;\nfloat rad = (In != 0) ? progress : 1.0 - progress;\nfloat xc1, yc1;\n\nif (type == 0) { xc1 = .5 - rad / 2.0; yc1 = 0.0; }\nelse if (type == 1) { xc1 = 1.0 - rad; yc1 = .5 - rad / 2.0; }\nelse if (type == 2) { xc1 = .5 - rad / 2.0; yc1 = 1.0 - rad; }\nelse if (type == 3) { xc1 = 0.0; yc1 = .5 - rad / 2.0; }\nelse if (type == 4) { xc1 = 1.0 - rad; yc1 = 0.0; }\nelse if (type == 5) { xc1 = 1.0 - rad; yc1 = 1.0 - rad; }\nelse if (type == 6) { xc1 = 0.0; yc1 = 1.0 - rad; }\nelse if (type == 7) { xc1 = 0.0; yc1 = 0.0; }\nelse if (type == 8) { xc1 = .5 - rad / 2.0; yc1 = .5 - rad / 2.0; }\nuv.y = 1.0 - uv.y;\nvec2 uv2;\nif ((uv.x >= xc1) && (uv.x <= xc1 + rad) && (uv.y >= yc1) && (uv.y <= yc1 + rad))\n\t{\n\tuv2 = vec2((uv.x - xc1) / rad, 1.0 - (uv.y - yc1) / rad);\n\treturn((In != 0) ? getToColor(uv2) : getFromColor(uv2));\n\t}\nreturn((In != 0) ? getFromColor(uv0) : getToColor(uv0));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SmokeDissolve":"// SmokeDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SmokeDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: Billowing smoke drifts in across the outgoing image, with lit tops, darker folds and wispy edges, and thickens until it covers the frame; as it thins out and drifts away, the incoming image shows through\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float scale; \n\nuniform float spread; \n\nuniform float softness; \n\nuniform vec4 color; \n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nfloat vnoise(vec2 v) {\n vec2 i = floor(v);\n vec2 f = fract(v);\n f = f * f * (3.0 - 2.0 * f);\n return mix(\n mix(hash12(i), hash12(i + vec2(1.0, 0.0)), f.x),\n mix(hash12(i + vec2(0.0, 1.0)), hash12(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nfloat fbm(vec2 v) {\n float sum = 0.0;\n float amp = 0.5;\n for (int i = 0; i < 4; i++) {\n sum += amp * vnoise(v);\n v = mat2(1.6, 1.2, -1.2, 1.6) * v + 5.3;\n amp *= 0.5;\n }\n return sum / 0.9375;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 pos = (uv - 0.5) * vec2(ratio, 1.0);\n\n \n float len = length(direction);\n vec2 dir = len > 1e-4 ? direction / len : vec2(0.0);\n float ext = 0.5 * (abs(dir.x) * ratio + abs(dir.y)) + 1e-4;\n float along = len > 1e-4 ? 0.5 + 0.5 * dot(pos, dir) / ext : 0.5;\n\n \n \n float arrive = (p / 0.45) * (1.0 + spread) - spread * along;\n float leave = ((p - 0.55) / 0.45) * (1.0 + spread) - spread * along;\n float body = smoothstep(0.0, 1.0, arrive) * (1.0 - smoothstep(0.0, 1.0, leave));\n \n float m = smoothstep(0.48, 0.52, p);\n \n if (body <= 0.0) return m < 0.5 ? getFromColor(uv) : getToColor(uv);\n\n \n vec2 q = (pos - direction * (p - 0.5)) * scale;\n vec2 churn = vec2(0.5 * p, -0.35 * p);\n vec2 warp = vec2(fbm(q + vec2(3.1, 1.7) + churn), fbm(q + vec2(8.3, 2.8) - churn));\n vec2 w = q + 1.1 * (warp - 0.5);\n float n = fbm(w);\n \n \n float lit = 0.53 * (vnoise(w) - vnoise(w + vec2(0.0, 0.2)));\n \n float wisp = vnoise(w * 3.3 - 2.0 * churn) - 0.5;\n\n \n float edge = 2.0 * body - (1.0 - smoothstep(0.1, 0.6, n)) + 1.6 * body * (1.0 - body) * wisp;\n float d = smoothstep(0.0, softness, edge) * mix(0.5, 1.0, smoothstep(0.2, 0.9, body));\n\n \n vec4 base;\n if (m <= 0.0) base = getFromColor(uv);\n else if (m >= 1.0) base = getToColor(uv);\n else {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n base = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n base = base.a > 0.0 ? vec4(base.rgb / base.a, base.a) : vec4(0.0);\n }\n if (d <= 0.0) return base;\n\n \n float shade = 0.92 + 1.3 * lit;\n shade *= mix(0.76, 1.04, smoothstep(0.25, 0.75, n));\n shade = mix(1.0, shade, 0.3 + 0.7 * d);\n vec3 smoke = clamp(color.rgb * shade, 0.0, 1.0);\n\n \n return mix(base, vec4(smoke, color.a), d);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SnakeBlockWipe":"// SnakeBlockWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SnakeBlockWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Blocks switch to the incoming image one at a time, row after row from the top (or column after column from the left), each line running the opposite way to the one before, like a snake winding across the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 grid; \n\nuniform int vertical; \n\nuniform float smoothness; \n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n if (progress <= 0.0) return a;\n if (progress >= 1.0) return b;\n\n vec2 g = max(vec2(grid), 1.0);\n \n vec2 cell = min(floor(vec2(uv.x, 1.0 - uv.y) * g), g - 1.0);\n \n float lines = (vertical != 0) ? g.x : g.y;\n float len = (vertical != 0) ? g.y : g.x;\n float line = (vertical != 0) ? cell.x : cell.y;\n float pos = (vertical != 0) ? cell.y : cell.x;\n \n if (mod(line, 2.0) > 0.5) pos = len - 1.0 - pos;\n float order = line * len + pos;\n\n \n float n = lines * len;\n float w = max(smoothness, 0.001);\n float m = clamp((progress * (n - 1.0 + w) - order) / w, 0.0, 1.0);\n\n \n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Snapshot":"// Snapshot — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Snapshot.glsl\n// Author: gre\n// License: MIT\n// Description: A camera flash freezes the outgoing image into a printed photo with a white border, which shrinks, tilts and drops out of the frame, revealing the incoming image behind it\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float tilt; \n\nuniform float border; \n\nuniform float flash; \n\nuniform float shadow; \n\nuniform vec4 borderColor; \n\nconst float SHRINK = 0.24; \nconst float RADIUS = 0.008; \nconst float AA = 0.0015; \n\nfloat roundedBox(vec2 q, vec2 b, float r) {\n vec2 d = abs(q) - b + r;\n return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0) - r;\n}\n\nvec4 premultiply(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 asp = vec2(ratio, 1.0);\n vec2 q = (uv - 0.5) * asp;\n vec2 halfImage = 0.5 * asp;\n vec2 halfCard = halfImage + border;\n\n \n float k = smoothstep(0.05, 0.4, p);\n float t = clamp((p - 0.3) / 0.7, 0.0, 1.0);\n float fall = t * t;\n float s = 1.0 - SHRINK * k;\n float a = -tilt * (0.12 * k + 0.88 * fall);\n \n float bound = (abs(sin(tilt)) * halfCard.x + abs(cos(tilt)) * halfCard.y) * (1.0 - SHRINK);\n \n float lift = 0.035 * k * (1.0 - fall);\n vec2 center = vec2(0.08 * fall, lift - (0.5 + bound + 0.1) * fall);\n\n float rad = RADIUS * k;\n\n float ca = cos(a), sa = sin(a);\n mat2 unrotate = mat2(ca, -sa, sa, ca);\n\n \n vec4 col = getToColor(uv);\n float sh = shadow * k;\n if (sh > 0.0) {\n vec2 rs = unrotate * (q - center - vec2(0.012, -0.022) * k) / s;\n float ds = roundedBox(rs, halfCard, rad) * s;\n float blur = 0.035 * s;\n col.rgb *= 1.0 - sh * (1.0 - smoothstep(-blur, blur, ds));\n }\n col = premultiply(col);\n\n \n vec2 r = unrotate * (q - center) / s;\n float dCard = roundedBox(r, halfCard, rad) * s;\n float dImage = roundedBox(r, halfImage, 0.0) * s;\n \n float cardCover = clamp(1.5 - dCard / AA, 0.0, 1.0);\n float imageCover = clamp(1.5 - dImage / AA, 0.0, 1.0);\n \n vec4 photo = premultiply(getFromColor(clamp(r / asp + 0.5, 0.0, 1.0)));\n vec4 paper = premultiply(borderColor);\n vec4 card = mix(paper + col * (1.0 - paper.a), photo, imageCover);\n col = mix(col, card, cardCover);\n if (col.a <= 0.0) return vec4(0.0);\n col.rgb /= col.a;\n\n \n float f = flash * smoothstep(0.0, 0.05, p) * (1.0 - smoothstep(0.05, 0.3, p));\n col.rgb = 1.0 - (1.0 - col.rgb) * (1.0 - f);\n return col;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Sphere":"// Sphere — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Sphere.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image wraps itself onto a shaded ball that shrinks and rolls away, revealing the incoming image under its shadow\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float size; \n\nuniform float shading; \n\nuniform float shadow; \n\nconst float PI = 3.14159265;\n\nconst float AA = 0.0015;\n\nconst vec3 LIGHT = vec3(-0.5, 0.6, 1.0) / 1.2689;\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n vec4 b = getToColor(uv);\n if (progress >= 1.0) return b;\n\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n vec2 side = vec2(-dir.y, dir.x);\n \n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n float shorter = min(ratio, 1.0);\n float r0 = clamp(size, 0.1, 0.5) * shorter;\n\n \n \n float w = clamp(progress / 0.45, 0.0, 1.0);\n w = 1.0 - (1.0 - w) * (1.0 - w);\n float away = smoothstep(0.3, 1.0, progress);\n away *= away;\n float wrapped = r0 / max(w, 1e-4);\n float radius = wrapped * mix(1.0, 0.5, away);\n \n \n float tight = mix(1.0, min(1.0, 0.48 * shorter / (PI * r0)), w * w);\n float paper = radius * tight;\n \n float e = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n \n float full = e + 1.1 * r0 + 2.0 * AA;\n float travel = away * full;\n vec2 center = dir * travel;\n \n float angle = -2.0 * full * log(1.0 - 0.5 * away) / wrapped;\n\n vec2 d = p - center;\n float r = length(d);\n\n \n vec2 sd = d - vec2(0.25, -0.3) * radius * w;\n float sh = shadow * w * (1.0 - smoothstep(0.6 * radius, 1.4 * radius, length(sd)));\n vec4 bg = vec4(b.rgb * b.a * (1.0 - sh), b.a);\n\n vec4 ball = vec4(0.0);\n float cover = 1.0 - smoothstep(radius - AA, radius + AA, r);\n if (cover > 0.0) {\n \n vec2 nd = d / radius;\n vec3 n = vec3(nd, sqrt(max(1.0 - dot(nd, nd), 0.0)));\n \n float u = dot(n.xy, dir);\n float s = dot(n.xy, side);\n float cu = cos(angle), su = sin(angle);\n vec3 q = vec3(u * cu - n.z * su, s, u * su + n.z * cu);\n \n float lq = length(q.xy);\n float arc = atan(lq, q.z) * paper;\n vec2 img = lq > 0.0 ? (q.x * dir + q.y * side) / lq * arc : vec2(0.0);\n vec2 iuv = img / vec2(ratio, 1.0) + 0.5;\n \n vec2 edge = min(iuv, 1.0 - iuv) * vec2(ratio, 1.0);\n float inside = cover * smoothstep(-AA, AA, min(edge.x, edge.y));\n if (inside > 0.0) {\n vec4 c = getFromColor(clamp(iuv, 0.0, 1.0));\n float diff = max(dot(n, LIGHT), 0.0);\n float spec = pow(max(reflect(-LIGHT, n).z, 0.0), 24.0);\n float k = shading * w;\n vec3 lit = c.rgb * mix(1.0, 0.25 + 0.85 * diff, k) + 0.35 * k * spec;\n ball = vec4(clamp(lit, 0.0, 1.0) * c.a, c.a) * inside;\n }\n }\n\n \n vec4 c = ball + bg * (1.0 - ball.a);\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SpiralBlockWipe":"// SpiralBlockWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SpiralBlockWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Square blocks switch to the incoming image one after another along a rectangular spiral, from the border inward or from the center outward\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 grid; \n\nuniform int inward; \n\nuniform int clockwise; \n\nuniform float smoothness; \n\nfloat spiralIndex(vec2 c, vec2 n) {\n \n float k = min(min(c.x, c.y), min(n.x - 1.0 - c.x, n.y - 1.0 - c.y));\n \n vec2 s = n - 2.0 * k;\n vec2 l = c - k;\n \n float before = n.x * n.y - s.x * s.y;\n float along;\n if (l.y == 0.0) along = l.x; \n else if (l.x == s.x - 1.0) along = s.x - 1.0 + l.y; \n else if (l.y == s.y - 1.0) along = 2.0 * s.x + s.y - 3.0 - l.x; \n else along = 2.0 * (s.x - 1.0) + 2.0 * (s.y - 1.0) - l.y; \n return before + along;\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n vec2 n = max(vec2(grid), vec2(1.0));\n \n vec2 c = min(floor(vec2(uv.x, 1.0 - uv.y) * n), n - 1.0);\n \n \n if ((clockwise != 0) != (inward != 0)) {\n c = c.yx;\n n = n.yx;\n }\n float count = n.x * n.y;\n float i = spiralIndex(c, n);\n if (!(inward != 0)) i = count - 1.0 - i;\n\n \n \n float w = max(smoothness, 0.0) * count;\n float o = max(0.5 * (1.0 - w), 0.0);\n float x = progress * (count - 1.0 + 2.0 * o + w) - i - o;\n float m = w > 0.0 ? smoothstep(0.0, w, x) : step(0.0, x);\n\n if (m <= 0.0) return getFromColor(uv);\n if (m >= 1.0) return getToColor(uv);\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n \n vec4 col = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n return col.a > 0.0 ? vec4(col.rgb / col.a, col.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SpiralWipe":"// SpiralWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SpiralWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A spiral arm winds out from the center and widens to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float turns; \n\nuniform float smoothness; \n\nuniform int clockwise; \n\nfloat arm (float s, float d) {\n \n float end = -0.5 + (turns + 0.5) / 0.6;\n float tip = mix(-0.5, end, progress);\n s = max(s, -0.5);\n float width = sqrt(clamp((tip - s) / max(end - s, 0.001), 0.0, 1.0));\n \n float e = smoothness + 0.005 * turns;\n return smoothstep(0.0, e, width * (0.5 + e) - d);\n}\n\nvec4 transition (vec2 uv) {\n \n vec2 q = (uv - 0.5) * vec2(ratio, 1.0) / (0.5 * length(vec2(ratio, 1.0)));\n \n float a = dot(q, q) < 1e-12 ? 0.0 : atan(q.x, q.y) / (2.0 * 3.141592653589793);\n a = fract((clockwise != 0) ? a : -a);\n \n float w = length(q) * turns - a;\n float n = floor(w);\n float f = w - n;\n \n float m = max(arm(n + a, abs(f - 0.5)), max(arm(n + 1.0 + a, 1.5 - f), arm(n - 1.0 + a, f + 0.5)));\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplatterWipe":"// SplatterWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplatterWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Splats of paint land one after another, each popping in with a spiky outline, flung droplets and a few drips running down, revealing the incoming image until they cover the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float splats; \n\nuniform float spikiness; \n\nuniform float droplets; \n\nuniform float drips; \n\nuniform float rim; \n\nuniform float seed; \n\nconst float PI = 3.141592653589793;\n\nconst float SPIKES = 14.0;\n\nconst float REACH = 1.25;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nfloat turnNoise(float t, float n, vec2 key) {\n float x = t * n;\n float i = floor(x);\n float f = x - i;\n float a = hash12(key + vec2(mod(i, n), 61.0));\n float b = hash12(key + vec2(mod(i + 1.0, n), 61.0));\n return mix(a, b, f * f * (3.0 - 2.0 * f));\n}\n\nfloat smax(float a, float b, float k) {\n float h = max(k - abs(a - b), 0.0) / k;\n return max(a, b) + h * h * k * 0.25;\n}\n\nfloat splat(vec2 q, vec2 cell, vec2 key) {\n float t0 = 0.01 + 0.6 * hash12(key + vec2(3.0, 0.0)); \n if (progress <= t0) return -1.0;\n vec2 c = cell + 0.5 + 0.3 * (vec2(hash12(key + vec2(5.0, 1.0)), hash12(key + vec2(9.0, 2.0))) - 0.5);\n vec2 d = q - c;\n float l = length(d);\n \n if (l > REACH + 0.1) return -1.0;\n \n float pop = clamp((progress - t0) / 0.08, 0.0, 1.0);\n pop = 1.0 - (1.0 - pop) * (1.0 - pop) * (1.0 - pop);\n float x = clamp((progress - t0) / (0.96 - t0), 0.0, 1.0);\n float grow = x * x * x;\n float r0 = 0.42 + 0.2 * hash12(key + vec2(11.0, 3.0));\n \n float rc = mix(r0 * pop, 1.03, grow);\n\n float a = l > 1e-5 ? atan(d.y, d.x) / (2.0 * PI) + 0.5 : 0.0;\n \n float lumps = mix(0.3, 0.06, grow) * (turnNoise(a, 5.0, key) - 0.5) + mix(0.18, 0.06, grow) * (turnNoise(a, 19.0, key + 3.0) - 0.5);\n float f = rc * (1.0 + lumps) - l;\n\n \n \n float s = floor(a * SPIKES);\n float spike = -1.0;\n for (int k = -1; k <= 1; k++) {\n float sl = s + float(k);\n vec2 sk = key + vec2(mod(sl, SPIKES), 17.0);\n float h = hash12(sk);\n float w0 = (0.022 + 0.03 * hash12(sk + 1.5)) * pop;\n float len = max(min(spikiness * (0.06 + 0.6 * h * h) * pop, REACH - 1.2 * w0 - rc), 0.0);\n if (len > 0.0) {\n \n float w = w0 * min(len / 0.06, 1.0);\n float ang = (sl + 0.5 + 0.4 * (hash12(sk + 0.5) - 0.5)) / SPIKES * 2.0 * PI - PI;\n vec2 dir = vec2(cos(ang), sin(ang));\n float along = dot(d, dir);\n float across = abs(d.x * dir.y - d.y * dir.x);\n float u = clamp((along - rc) / len, 0.0, 1.0);\n float ray = min(w * (1.0 - 0.7 * u) - across, rc + len - along);\n if (h > 0.5) ray = max(ray, w * 1.2 - length(d - dir * (rc + len)));\n spike = max(spike, ray);\n }\n }\n f = smax(f, spike, 0.08);\n\n \n for (int j = 0; j < 5; j++) {\n vec2 dk = key + vec2(float(j), 29.0);\n float hr = hash12(dk + 0.5);\n float rad = (0.015 + 0.05 * hr * hr) * clamp(droplets * 5.0 - float(j), 0.0, 1.0) * pop;\n if (rad > 0.0) {\n float da = 2.0 * PI * hash12(dk);\n float dist = min(r0 + 0.08 + 0.5 * hash12(dk + 1.5), REACH - rad) * mix(0.5, 1.0, pop);\n f = max(f, rad - length(d - dist * vec2(cos(da), sin(da))));\n }\n }\n\n \n if (drips > 0.0) {\n float run = clamp((progress - t0 - 0.03) / 0.45, 0.0, 1.0);\n run = run * (2.0 - run);\n for (int j = 0; j < 2; j++) {\n vec2 dk = key + vec2(float(j), 43.0);\n float xo = (hash12(dk) - 0.5) * r0;\n float dw = (0.03 + 0.02 * hash12(dk + 0.5)) * pop;\n float top = sqrt(r0 * r0 - xo * xo) * pop;\n float bottom = min(top + drips * (0.25 + 0.75 * hash12(dk + 1.5)) * run, sqrt(REACH * REACH - xo * xo) - 1.6 * dw);\n float dx = abs(d.x - xo);\n float drip = min(dw - dx, min(d.y + bottom, -d.y));\n float tip = dw * 1.4 - length(vec2(dx, d.y + bottom + 0.2 * dw));\n f = smax(f, max(drip, tip), 0.05);\n }\n }\n return f;\n}\n\nvec4 transition(vec2 uv) {\n float n = max(1.0, floor(splats + 0.5));\n float cellSize = max(ratio, 1.0) / n;\n vec2 q = vec2(uv.x * ratio, uv.y) / cellSize; \n vec2 base = floor(q);\n vec2 sd = seed * vec2(7.0, 13.0);\n float f = -1.0;\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n vec2 cell = base + vec2(float(i), float(j));\n f = max(f, splat(q, cell, cell + sd));\n }\n }\n float aa = 0.0025 / cellSize; \n float inside = smoothstep(-aa, aa, f);\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n \n float e = clamp(f / 0.045, 0.0, 1.0);\n float amount = rim * (1.0 - smoothstep(0.75, 1.0, progress));\n float dark = (1.0 - e) * (1.0 - e) * 0.6;\n float gloss = smoothstep(0.2, 0.4, e) * (1.0 - smoothstep(0.4, 0.7, e)) * 0.3;\n to.rgb = mix(to.rgb * (1.0 - dark * amount), vec3(1.0), gloss * amount * to.a);\n return mix(from, to, inside);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideInHorizontal":"// SplitSlideInHorizontal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideInHorizontal.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The incoming image slides in as two halves moving horizontally in opposite directions\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (reverse != 0) ? -1.0 : 1.0;\n vec2 toP = (uv.y > 0.5) ?\n vec2((uv.x - (progress * modifier)) + modifier, uv.y) :\n vec2((uv.x + (progress * modifier)) - modifier, uv.y);\n\n vec2 fromP = uv;\n\n return inBounds(toP) ? getToColor(toP) : getFromColor(fromP);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideInOutHorizontal":"// SplitSlideInOutHorizontal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideInOutHorizontal.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The halves of both images slide horizontally in opposite directions, out and in at once\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (uv.y > 0.5 ? 1.0 : -1.0) * ((reverse != 0) ? -1.0 : 1.0) ;\n vec2 fromP = vec2(uv.x + (progress * modifier), uv.y);\n vec2 toP = vec2((uv.x + (progress * modifier)) - modifier, uv.y);\n\n return inBounds(fromP) ? getFromColor(fromP) : getToColor(toP);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideInOutVertical":"// SplitSlideInOutVertical — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideInOutVertical.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The halves of both images slide vertically in opposite directions, out and in at once\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (uv.x > 0.5 ? 1.0 : -1.0) * ((reverse != 0) ? -1.0 : 1.0) ;\n vec2 fromP = vec2(uv.x, uv.y + (progress * modifier));\n vec2 toP = vec2(uv.x, (uv.y + (progress * modifier)) - modifier);\n\n return inBounds(fromP) ? getFromColor(fromP) : getToColor(toP);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideInVertical":"// SplitSlideInVertical — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideInVertical.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The incoming image slides in as two halves moving vertically in opposite directions\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (reverse != 0) ? -1.0 : 1.0;\n vec2 p = (uv.x > 0.5) ?\n vec2(uv.x, (uv.y - (progress * modifier)) + modifier) :\n vec2(uv.x, (uv.y + (progress * modifier)) - modifier);\n\n return inBounds(p) ? getToColor(p) : getFromColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideOutHorizontal":"// SplitSlideOutHorizontal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideOutHorizontal.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The outgoing image slides out as two halves moving horizontally in opposite directions\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (uv.y > 0.5 ? 1.0 : -1.0) * ((reverse != 0) ? -1.0 : 1.0) ;\n vec2 p = vec2(uv.x + (progress * modifier), uv.y);\n\n return inBounds(p) ? getFromColor(p) : getToColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SplitSlideOutVertical":"// SplitSlideOutVertical — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitSlideOutVertical.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: The outgoing image slides out as two halves moving vertically in opposite directions\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int reverse; \n\nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n float modifier = (uv.x > 0.5 ? 1.0 : -1.0) * ((reverse != 0) ? -1.0 : 1.0) ;\n vec2 p = vec2(uv.x, uv.y + (progress * modifier));\n\n return inBounds(p) ? getFromColor(p) : getToColor(uv);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SquaresWipe":"// SquaresWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SquaresWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Squares grow along a diagonal sweep to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 squares;\n\nuniform vec2 direction;\n\nuniform float smoothness; \n\nconst vec2 center = vec2(0.5, 0.5);\nvec4 transition (vec2 p) {\n vec2 v = normalize(direction);\n v /= abs(v.x)+abs(v.y);\n float d = v.x * center.x + v.y * center.y;\n float offset = smoothness;\n float pr = smoothstep(-offset, 0.0, v.x * p.x + v.y * p.y - (d-0.5+progress*(1.+offset)));\n vec2 squarep = fract(p*vec2(squares));\n vec2 squaremin = vec2(pr/2.0);\n vec2 squaremax = vec2(1.0 - pr/2.0);\n float a = (1.0 - step(progress, 0.0)) * step(squaremin.x, squarep.x) * step(squaremin.y, squarep.y) * step(squarep.x, squaremax.x) * step(squarep.y, squaremax.y);\n return mix(getFromColor(p), getToColor(p), a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Squeeze":"// Squeeze — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Squeeze.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is squeezed into a line with color separation, revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float colorSeparation; \n \nvec4 transition (vec2 uv) {\n float y = 0.5 + (uv.y-0.5) / (1.0-progress);\n if (y < 0.0 || y > 1.0) {\n return getToColor(uv);\n }\n else {\n vec2 fp = vec2(uv.x, y);\n vec2 off = progress * vec2(0.0, colorSeparation);\n vec4 c = getFromColor(fp);\n vec4 cn = getFromColor(fp - off);\n vec4 cp = getFromColor(fp + off);\n return vec4(cn.r, c.g, cp.b, c.a);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StarWipe":"// StarWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StarWipe.glsl\n// Author: Ben Lucas\n// License: MIT\n// Description: A growing star reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float border_thickness;\nuniform float star_rotation;\n\nuniform vec4 border_color; \n\nuniform vec2 star_center;\n\nvec2 rotate(vec2 v, float theta) {\n float cosTheta = cos(theta);\n float sinTheta = sin(theta);\n\n return vec2(\n cosTheta * v.x - sinTheta * v.y,\n sinTheta * v.x + cosTheta * v.y\n );\n}\n\nbool inStar(vec2 uv, vec2 center, float radius){\n vec2 uv_centered = uv - center;\n uv_centered = rotate(uv_centered, star_rotation * 1.2566370614359172);\n float theta = atan(uv_centered.y, uv_centered.x) + 3.141592653589793;\n\n vec2 uv_rotated = rotate(uv_centered, -1.2566370614359172 * (floor(theta / 1.2566370614359172) + 0.5));\n\n float slope = 0.3;\n if(uv_rotated.y > 0.0){\n return (radius + uv_rotated.x * slope > uv_rotated.y);\n } else {\n return (-radius - uv_rotated.x * slope < uv_rotated.y);\n }\n}\n\nvec4 transition (vec2 uv) {\n float progressScaled = (2.0 * border_thickness + 1.0) * progress - border_thickness;\n if(inStar(uv, star_center, progressScaled)){\n return getToColor(uv);\n } else if(inStar(uv, star_center, progressScaled+border_thickness)){\n return border_color;\n } else {\n return getFromColor(uv);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StaticFade":"// StaticFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StaticFade.glsl\n// Author: Ben Lucas\n// License: MIT\n// Description: Cuts to the incoming image halfway, hidden behind a burst of TV static\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float n_noise_pixels ; \nuniform float static_luminosity ; \n\nfloat rnd (vec2 st) {\n return fract(sin(dot(st.xy,\n vec2(10.5302340293,70.23492931)))*\n 12345.5453123);\n}\n\nvec4 staticNoise (vec2 st, float offset, float luminosity, float alpha) {\n float staticR = luminosity * rnd(st * vec2(offset * 2.0, offset * 3.0));\n float staticG = luminosity * rnd(st * vec2(offset * 3.0, offset * 5.0));\n float staticB = luminosity * rnd(st * vec2(offset * 5.0, offset * 7.0));\n return vec4(staticR, staticG, staticB, alpha);\n}\n\nfloat staticIntensity(float t)\n{\n float transitionProgress = abs(2.0*(t-0.5));\n float transformedThreshold =1.2*(1.0 - transitionProgress)-0.1;\n return min(1.0, transformedThreshold);\n}\n \nvec4 transition (vec2 uv) {\n\n float baseMix = step(0.5, progress);\n vec4 transitionMix = mix(\n getFromColor(uv),\n getToColor(uv),\n baseMix\n );\n \n vec2 uvStatic = floor(uv * n_noise_pixels)/n_noise_pixels;\n \n vec4 staticColor = staticNoise(uvStatic, progress, static_luminosity, transitionMix.a); \n\n float staticThresh = staticIntensity(progress);\n float staticMix = step(rnd(uvStatic), staticThresh);\n\n return mix(transitionMix, staticColor, staticMix);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StaticWipe":"// StaticWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StaticWipe.glsl\n// Author: Ben Lucas\n// License: MIT\n// Description: A wipe from top to bottom with a band of TV static at its edge\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat rnd (vec2 st) {\n return fract(sin(dot(st.xy,\n vec2(10,70)))*\n 12345.5453123);\n}\n\nuniform int u_transitionUpToDown; \n\nuniform float u_max_static_span; \n\nvec4 transition (vec2 uv) {\n \n\n float span = u_max_static_span*pow(sin(3.14159265359*progress),0.5);\n \n float transitionEdge = (u_transitionUpToDown != 0) ? 1.0-uv.y : uv.y;\n float mixRatio = 1.0 - step(progress, transitionEdge);\n\n vec4 transitionMix = mix(\n getFromColor(uv),\n getToColor(uv),\n mixRatio\n );\n \n float noiseEnvelope = smoothstep(progress-span, progress, transitionEdge) * (1.0 - smoothstep(progress, progress + span, transitionEdge));\n vec4 noise = vec4(vec3(rnd(uv*(1.0+progress))), transitionMix.a); \n \n\n return mix(transitionMix, noise, noiseEnvelope);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StereoViewer":"// StereoViewer — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StereoViewer.glsl\n// Author: Ted Schundler\n// License: BSD 2 Clause\n// Description: Both images shrink into rounded cards that swap, like a stereo viewer toy\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float zoom; \n\nuniform float corner_radius; \n\nconst vec4 black = vec4(0.0); \nconst vec2 c00 = vec2(0.0, 0.0); \nconst vec2 c01 = vec2(0.0, 1.0);\nconst vec2 c11 = vec2(1.0, 1.0);\nconst vec2 c10 = vec2(1.0, 0.0);\n\nbool in_corner(vec2 p, vec2 corner, vec2 radius) {\n \n vec2 axis = (c11 - corner) - corner;\n\n \n \n p = p - (corner + axis * radius);\n p *= axis / radius;\n return (p.x > 0.0 && p.y > -1.0) || (p.y > 0.0 && p.x > -1.0) || dot(p, p) < 1.0;\n}\n\nbool test_rounded_mask(vec2 p, vec2 corner_size) {\n return\n in_corner(p, c00, corner_size) &&\n in_corner(p, c01, corner_size) &&\n in_corner(p, c10, corner_size) &&\n in_corner(p, c11, corner_size);\n}\n\nvec4 screen(vec4 a, vec4 b) {\n return 1.0 - (1.0 - a) * (1.0 -b);\n}\n\nvec4 unscreen(vec4 c) {\n return 1.0 - sqrt(1.0 - c);\n}\n\nvec4 sample_with_corners_from(vec2 p, vec2 corner_size) {\n p = (p - 0.5) / zoom + 0.5;\n if (!test_rounded_mask(p, corner_size)) {\n return black;\n }\n return unscreen(getFromColor(p));\n}\n\nvec4 sample_with_corners_to(vec2 p, vec2 corner_size) {\n p = (p - 0.5) / zoom + 0.5;\n if (!test_rounded_mask(p, corner_size)) {\n return black;\n }\n return unscreen(getToColor(p));\n}\n\nvec4 simple_sample_with_corners_from(vec2 p, vec2 corner_size, float zoom_amt) {\n p = (p - 0.5) / (1.0 - zoom_amt + zoom * zoom_amt) + 0.5;\n if (!test_rounded_mask(p, corner_size)) {\n return black;\n }\n return getFromColor(p);\n}\n\nvec4 simple_sample_with_corners_to(vec2 p, vec2 corner_size, float zoom_amt) {\n p = (p - 0.5) / (1.0 - zoom_amt + zoom * zoom_amt) + 0.5;\n if (!test_rounded_mask(p, corner_size)) {\n return black;\n }\n return getToColor(p);\n}\n\nmat3 rotate2d(float angle, float ratio) {\n float s = sin(angle);\n float c = cos(angle);\n return mat3(\n c, s ,0.0,\n -s, c, 0.0,\n 0.0, 0.0, 1.0);\n}\n\nmat3 translate2d(float x, float y) {\n return mat3(\n 1.0, 0.0, 0,\n 0.0, 1.0, 0,\n -x, -y, 1.0);\n}\n\nmat3 scale2d(float x, float y) {\n return mat3(\n x, 0.0, 0,\n 0.0, y, 0,\n 0, 0, 1.0);\n}\n\nvec4 get_cross_rotated(vec3 p3, float angle, vec2 corner_size, float ratio) {\n angle = angle * angle; \n angle /= 2.4; \n\n mat3 center_and_scale = translate2d(-0.5, -0.5) * scale2d(1.0, ratio);\n mat3 unscale_and_uncenter = scale2d(1.0, 1.0/ratio) * translate2d(0.5,0.5);\n mat3 slide_left = translate2d(-2.0,0.0);\n mat3 slide_right = translate2d(2.0,0.0);\n mat3 rotate = rotate2d(angle, ratio);\n\n mat3 op_a = center_and_scale * slide_right * rotate * slide_left * unscale_and_uncenter;\n mat3 op_b = center_and_scale * slide_left * rotate * slide_right * unscale_and_uncenter;\n\n vec4 a = sample_with_corners_from((op_a * p3).xy, corner_size);\n vec4 b = sample_with_corners_from((op_b * p3).xy, corner_size);\n\n return screen(a, b);\n}\n\nvec4 get_cross_masked(vec3 p3, float angle, vec2 corner_size, float ratio) {\n angle = 1.0 - angle;\n angle = angle * angle; \n angle /= 2.4;\n\n vec4 img;\n\n mat3 center_and_scale = translate2d(-0.5, -0.5) * scale2d(1.0, ratio);\n mat3 unscale_and_uncenter = scale2d(1.0 / zoom, 1.0 / (zoom * ratio)) * translate2d(0.5,0.5);\n mat3 slide_left = translate2d(-2.0,0.0);\n mat3 slide_right = translate2d(2.0,0.0);\n mat3 rotate = rotate2d(angle, ratio);\n\n mat3 op_a = center_and_scale * slide_right * rotate * slide_left * unscale_and_uncenter;\n mat3 op_b = center_and_scale * slide_left * rotate * slide_right * unscale_and_uncenter;\n\n bool mask_a = test_rounded_mask((op_a * p3).xy, corner_size);\n bool mask_b = test_rounded_mask((op_b * p3).xy, corner_size);\n\n if (mask_a || mask_b) {\n img = sample_with_corners_to(p3.xy, corner_size);\n return screen(mask_a ? img : black, mask_b ? img : black);\n } else {\n return black;\n }\n}\n\nvec4 transition(vec2 uv) {\n float a;\n vec2 p=uv.xy/vec2(1.0).xy;\n vec3 p3 = vec3(p.xy, 1.0); \n\n \n vec2 corner_size = vec2(corner_radius / ratio, corner_radius);\n\n if (progress <= 0.0) {\n \n return getFromColor(p);\n } else if (progress < 0.1) {\n \n a = progress / 0.1;\n return simple_sample_with_corners_from(p, corner_size * a, a);\n } else if (progress < 0.48) {\n \n a = (progress - 0.1)/0.38;\n return get_cross_rotated(p3, a, corner_size, ratio);\n } else if (progress < 0.9) {\n \n \n return get_cross_masked(p3, (progress - 0.52)/0.38, corner_size, ratio);\n } else if (progress < 1.0) {\n \n a = (1.0 - progress) / 0.1;\n return simple_sample_with_corners_to(p, corner_size * a, a);\n } else {\n \n return getToColor(p);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StretchSlide":"// StretchSlide — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StretchSlide.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image stretches out long as it shoots away to one side, pulling in the incoming one squashed behind it, which overshoots and springs back to its shape\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float stretch; \n\nuniform float bounce; \n\nconst float PI = 3.14159265;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n float dl = length(direction);\n vec2 d = dl > 1e-6 ? direction / dl : vec2(-1.0, 0.0);\n vec2 n = vec2(-d.y, d.x);\n \n float ext = abs(d.x) + abs(d.y);\n vec2 q = uv - 0.5;\n float s = 0.5 + dot(q, d) / ext;\n float t = progress;\n\n \n float land = mix(1.0, 0.5, bounce);\n float m = 3.0 * bounce; \n float x = clamp(t / land, 0.0, 1.0);\n float e = x * x * (3.0 - 2.0 * x) + m * x * x * (x - 1.0);\n \n float w = 2.5 * PI;\n float u = clamp((t - land) / max(1.0 - land, 1e-4), 0.0, 1.0);\n float osc = m * (1.0 - land) / (land * w) * exp(-u) * sin(w * u) * (1.0 - u) * (1.0 - u);\n \n \n float len = e + max(osc, 0.0);\n float bulge = 1.0 - e + 3.0 * max(-osc, 0.0);\n\n \n float g = 1.0 + 0.6 * stretch * bulge;\n vec2 pt = q + d * (s / max(len, 1e-4) - s) * ext;\n pt -= n * dot(pt, n) * (1.0 - 1.0 / g);\n vec4 b = getToColor(mirror(pt + 0.5));\n\n \n \n float l = 1.0 + 4.0 * stretch * e;\n float k = clamp(1.6 * stretch * e, 0.0, 0.8);\n float y = max(s - e, 0.0) / l;\n \n float v = 2.0 * y / ((1.0 + k) + sqrt((1.0 + k) * (1.0 + k) - 4.0 * k * y));\n vec4 a = getFromColor(mirror(q + d * (v - s) * ext + 0.5));\n\n \n return (s < len || t >= land) ? b : a;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","StripDatamoshGlitch":"// StripDatamoshGlitch — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StripDatamoshGlitch.glsl\n// Author: bread\n// License: MIT\n// Description: A datamosh glitch: torn strips, chroma shifts and scan noise drag the outgoing image into the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float strength; \nuniform float horizontalBars; \nuniform float verticalSlits; \nuniform float tear; \nuniform float chroma; \nuniform float residue; \nuniform float noiseAmount; \nuniform float scanAmount; \nuniform float flashAmount; \n\nconst float PI = 3.141592653589793;\n\nfloat hash(float n) {\n return fract(sin(n) * 43758.5453123);\n}\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat sat(float v) {\n return clamp(v, 0.0, 1.0);\n}\n\nfloat burst() {\n return pow(max(0.0, sin(progress * PI)), 0.42) * strength;\n}\n\nvec2 safeUv(vec2 uv) {\n return clamp(uv, vec2(0.0), vec2(1.0));\n}\n\nfloat stripeY(vec2 uv, float density, float seed, float minWidth, float maxWidth) {\n float y = uv.y * density + seed * 0.137;\n float id = floor(y);\n float f = fract(y);\n float c = hash(vec2(id, seed));\n float w = mix(minWidth, maxWidth, hash(vec2(id + 9.17, seed + 2.31)));\n return 1.0 - smoothstep(w, w + 0.018, abs(f - c));\n}\n\nfloat stripeX(vec2 uv, float density, float seed, float minWidth, float maxWidth) {\n float x = uv.x * density + seed * 0.091;\n float id = floor(x);\n float f = fract(x);\n float c = hash(vec2(id, seed + 41.0));\n float w = mix(minWidth, maxWidth, hash(vec2(id + 4.7, seed + 8.9)));\n return 1.0 - smoothstep(w, w + 0.012, abs(f - c));\n}\n\nfloat brokenGate(vec2 uv, float row, float rnd, float frame) {\n float segs = mix(1.0, 9.0, hash(vec2(row, frame + 44.0)));\n float seg = floor(uv.x * segs);\n return step(0.16, hash(vec2(seg, row + frame * 3.0 + rnd)));\n}\n\nfloat horizontalMask(vec2 uv, float frame) {\n float r1 = floor((uv.y + hash(frame) * 0.031) * horizontalBars * 0.38);\n float r2 = floor((uv.y + hash(frame + 2.0) * 0.013) * horizontalBars);\n float r3 = floor((uv.y + hash(frame + 7.0) * 0.006) * horizontalBars * 3.4);\n\n float thick = stripeY(uv, horizontalBars * 0.38, frame + 1.0, 0.035, 0.22);\n float mid = stripeY(uv, horizontalBars, frame + 4.0, 0.014, 0.11);\n float hair = stripeY(uv, horizontalBars * 3.4, frame + 9.0, 0.004, 0.035);\n\n thick *= step(0.42, hash(vec2(r1, frame + 10.0)));\n mid *= step(0.48, hash(vec2(r2, frame + 20.0)));\n hair *= step(0.62, hash(vec2(r3, frame + 30.0)));\n\n thick *= brokenGate(uv, r1, hash(vec2(r1, frame)), frame);\n mid *= brokenGate(uv, r2, hash(vec2(r2, frame)), frame + 3.0);\n\n return sat(max(thick, max(mid, hair)));\n}\n\nfloat verticalMask(vec2 uv, float frame) {\n float col = floor((uv.x + hash(frame + 12.0) * 0.017) * verticalSlits);\n float slit = stripeX(uv, verticalSlits, frame + 13.0, 0.01, 0.075);\n slit *= step(0.66, hash(vec2(col, frame + 19.0)));\n return sat(slit);\n}\n\nvec4 chromaFrom(vec2 uv, vec2 s) {\n uv = safeUv(uv);\n vec4 center = getFromColor(uv);\n return vec4(\n getFromColor(safeUv(uv + s)).r,\n center.g,\n getFromColor(safeUv(uv - s)).b,\n center.a\n );\n}\n\nvec4 chromaTo(vec2 uv, vec2 s) {\n uv = safeUv(uv);\n vec4 center = getToColor(uv);\n return vec4(\n getToColor(safeUv(uv - s)).r,\n center.g,\n getToColor(safeUv(uv + s)).b,\n center.a\n );\n}\n\nvec2 distortUv(vec2 uv, float dir, float b, float h, float v, float frame) {\n float row = floor(uv.y * horizontalBars);\n float col = floor(uv.x * verticalSlits);\n\n float rowRnd = hash(vec2(row, frame));\n float colRnd = hash(vec2(col, frame + 27.0));\n\n float xTear = (rowRnd - 0.5) * 2.0 * tear * b * h;\n xTear += sin(uv.y * 120.0 + progress * 95.0) * 0.006 * b;\n\n float yDrag = (colRnd - 0.5) * 0.13 * b * v;\n float micro = (hash(vec2(row, col + frame)) - 0.5) * 0.018 * b * max(h, v);\n\n return uv + vec2(xTear * dir + micro, yDrag);\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n float b = burst();\n float frame = floor(progress * 30.0);\n\n float h = horizontalMask(uv, frame);\n float v = verticalMask(uv, frame);\n float glitch = sat(max(h, v * 0.75));\n\n float row = floor(uv.y * horizontalBars);\n float rowRnd = hash(vec2(row, frame + 5.0));\n\n float bandDelay = (rowRnd - 0.5) * 0.30 * h;\n float reveal = smoothstep(0.18, 0.84, progress + bandDelay);\n\n vec2 split = vec2(chroma * b * (1.0 + 1.7 * glitch), chroma * 0.22 * b * v);\n\n vec2 fromUv = distortUv(uv, 1.0, b, h, v, frame);\n vec2 toUv = distortUv(uv, -1.0, b, h, v, frame);\n\n vec4 color = mix(\n chromaFrom(fromUv, split),\n chromaTo(toUv, split),\n reveal\n );\n\n \n vec2 smearUv = uv;\n smearUv.x += (rowRnd - 0.5) * 0.46 * b * h;\n smearUv.y += (hash(vec2(row, frame + 31.0)) - 0.5) * 0.045 * b * h;\n\n float sliceReveal = smoothstep(0.28, 0.78, progress + (rowRnd - 0.5) * 0.22);\n vec4 sliceColor = mix(\n chromaFrom(smearUv, split * 1.65),\n chromaTo(smearUv - vec2((rowRnd - 0.5) * 0.18 * b, 0.0), split * 1.65),\n sliceReveal\n );\n\n color = mix(color, sliceColor, h * b * residue);\n\n \n float hairLine = stripeY(uv, 190.0, frame + 55.0, 0.002, 0.012);\n hairLine *= step(0.70, hash(vec2(floor(uv.y * 190.0), frame + 56.0)));\n color.rgb += vec3(0.72, 0.90, 1.0) * hairLine * b * 0.28;\n\n float scan = 0.5 + 0.5 * sin(uv.y * 980.0 + progress * 130.0);\n color.rgb *= 1.0 - scanAmount * b * scan;\n\n vec2 nCell = floor(uv * vec2(360.0 * ratio, 210.0));\n float n = hash(nCell + vec2(frame * 7.0, frame * 13.0));\n color.rgb += (n - 0.5) * noiseAmount * b * (0.55 + glitch);\n\n \n float luma = dot(color.rgb, vec3(0.299, 0.587, 0.114));\n color.rgb = mix(color.rgb, vec3(luma), 0.18 * b * glitch);\n\n float strobe = step(0.78, hash(vec2(frame, 3.14))) * pow(b, 1.65);\n color.rgb += vec3(strobe * flashAmount);\n\n return vec4(clamp(color.rgb, vec3(0.0), vec3(1.0)), color.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Swap":"// Swap — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Swap.glsl\n// Author: gre\n// License: MIT\n// Description: The two images swap places in 3D, with a floor reflection\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float reflection; \n\nuniform float perspective; \nuniform float depth; \n \nconst vec4 black = vec4(0.0); \nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n \nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n \nvec2 project (vec2 p) {\n return p * vec2(1.0, -1.2) + vec2(0.0, -0.02);\n}\n \nvec4 bgColor (vec2 p, vec2 pfr, vec2 pto) {\n vec4 c = black;\n pfr = project(pfr);\n if (inBounds(pfr)) {\n c += mix(black, getFromColor(pfr), reflection * mix(1.0, 0.0, pfr.y));\n }\n pto = project(pto);\n if (inBounds(pto)) {\n c += mix(black, getToColor(pto), reflection * mix(1.0, 0.0, pto.y));\n }\n return c;\n}\n \nvec4 transition(vec2 p) {\n vec2 pfr, pto = vec2(-1.);\n \n float size = mix(1.0, depth, progress);\n float persp = perspective * progress;\n pfr = (p + vec2(-0.0, -0.5)) * vec2(size/(1.0-perspective*progress), size/(1.0-size*persp*p.x)) + vec2(0.0, 0.5);\n \n size = mix(1.0, depth, 1.-progress);\n persp = perspective * (1.-progress);\n pto = (p + vec2(-1.0, -0.5)) * vec2(size/(1.0-perspective*(1.0-progress)), size/(1.0-size*persp*(0.5-p.x))) + vec2(1.0, 0.5);\n\n if (progress < 0.5) {\n if (inBounds(pfr)) {\n return getFromColor(pfr);\n }\n if (inBounds(pto)) {\n return getToColor(pto);\n } \n }\n if (inBounds(pto)) {\n return getToColor(pto);\n }\n if (inBounds(pfr)) {\n return getFromColor(pfr);\n }\n return bgColor(p, pfr, pto);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Swirl":"// Swirl — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Swirl.glsl\n// Author: Sergey Kosarevsky\n// License: MIT\n// Description: Both images swirl around the center while crossfading\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 UV)\n{\n\tfloat Radius = 1.0;\n\n\tfloat T = progress;\n\n\tUV -= vec2( 0.5, 0.5 );\n\n\tfloat Dist = length(UV);\n\n\tif ( Dist < Radius )\n\t{\n\t\tfloat Percent = (Radius - Dist) / Radius;\n\t\tfloat A = ( T <= 0.5 ) ? mix( 0.0, 1.0, T/0.5 ) : mix( 1.0, 0.0, (T-0.5)/0.5 );\n\t\tfloat Theta = Percent * Percent * A * 8.0 * 3.14159;\n\t\tfloat S = sin( Theta );\n\t\tfloat C = cos( Theta );\n\t\tUV = vec2( dot(UV, vec2(C, -S)), dot(UV, vec2(S, C)) );\n\t}\n\tUV += vec2( 0.5, 0.5 );\n\n\tvec4 C0 = getFromColor(UV);\n\tvec4 C1 = getToColor(UV);\n\n\treturn mix( C0, C1, T );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TangentMotionBlur":"// TangentMotionBlur — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TangentMotionBlur.glsl\n// Author: chenkai\n// License: MIT\n// Description: The outgoing image is flung away along a curve with motion blur\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n \n\nvec4 motionBlurFrom(vec2 _st, vec2 speed) {\n vec2 texCoord = _st.xy / vec2(1.0).xy;\n \n vec3 color = vec3(0.0);\n float alpha = 0.0;\n float total = 0.0;\n float offset = rand(_st);\n for (float t = 0.0; t <= 20.0; t++) {\n float percent = (t + offset) / 20.0;\n float weight = 4.0 * (percent - percent * percent);\n vec2 newuv = texCoord + speed * percent;\n newuv = fract(newuv);\n vec4 c = getFromColor(newuv);\n color += c.rgb * c.a * weight;\n alpha += c.a * weight;\n total += weight;\n }\n return vec4(color / max(alpha, 1e-5), alpha / total);\n}\n\nvec4 motionBlurTo(vec2 _st, vec2 speed) {\n vec2 texCoord = _st.xy / vec2(1.0).xy;\n vec3 color = vec3(0.0);\n float alpha = 0.0;\n float total = 0.0;\n float offset = rand(_st);\n for (float t = 0.0; t <= 20.0; t++) {\n float percent = (t + offset) / 20.0;\n float weight = 4.0 * (percent - percent * percent);\n vec2 newuv = texCoord + speed * percent;\n newuv = fract(newuv);\n vec4 c = getToColor(newuv);\n color += c.rgb * c.a * weight;\n alpha += c.a * weight;\n total += weight;\n }\n return vec4(color / max(alpha, 1e-5), alpha / total);\n}\n\nfloat A(float aA1, float aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\nfloat B(float aA1, float aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n}\nfloat C(float aA1) {\n return 3.0 * aA1;\n}\nfloat GetSlope(float aT, float aA1, float aA2) {\n return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\nfloat CalcBezier(float aT, float aA1, float aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n}\nfloat GetTForX(float aX, float mX1, float mX2) {\n \n float aGuessT = aX;\n for (int i = 0; i < 4; ++i) {\n float currentSlope = GetSlope(aGuessT, mX1, mX2);\n if (currentSlope == 0.0) return aGuessT;\n float currentX = CalcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n}\nfloat KeySpline(float aX, float mX1, float mY1, float mX2, float mY2) {\n if (mX1 == mY1 && mX2 == mY2) return aX; \n return CalcBezier(GetTForX(aX, mX1, mX2), mY1, mY2); \n}\n\nfloat normpdf(float x) {\n float d = x - .5;\n return exp(-20.*d*d);\n}\n\nvec2 rotateUv(vec2 uv, float angle, vec2 anchor, float zDirection) {\n uv = uv - anchor; \n float s = sin(angle);\n\tfloat c = cos(angle);\n\tmat2 m = mat2(c, -s, s, c);\n uv = m * uv;\n uv += anchor; \n return uv;\n}\n\nvec4 transition (vec2 uv) {\n \n vec2 myst = uv;\n float animationTime = progress; \n float easingTime = KeySpline(animationTime, .68,.01,.17,.98);\n float blur = normpdf(easingTime);\n float r = 0.;\n float rotation = 180./180.*3.14159;\n if (easingTime <= .5) {\n r = rotation * easingTime;\n } else {\n r = -rotation + rotation * easingTime;\n }\n\n \n vec2 mystCurrent = myst;\n mystCurrent.y *= 1./ratio;\n mystCurrent = rotateUv(mystCurrent, r, vec2(1., 0.), -1.);\n mystCurrent.y *= ratio;\n \n \n float timeInterval = 0.0167*2.0;\n if (easingTime <= .5) {\n r = rotation * (easingTime+timeInterval);\n } else {\n r = -rotation + rotation * (easingTime+timeInterval);\n }\n \n \n vec2 mystNext = myst;\n mystNext.y *= 1./ratio;\n mystNext = rotateUv(mystNext, r, vec2(1., 0.), -1.);\n mystNext.y *= ratio;\n \n \n vec2 speed = (mystNext - mystCurrent) / timeInterval * blur * 0.5;\n if (easingTime <= .5) {\n return motionBlurFrom(mystCurrent, speed);\n } else {\n return motionBlurTo(mystCurrent, speed);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TilesWave":"// TilesWave — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TilesWave.glsl\n// Author: numb3r23\n// License: MIT\n// Description: The incoming image is revealed tile by tile in a diagonal wave\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform ivec2 tileCount; \nuniform int flipX; \nuniform int flipY; \n\nvec4 transition(vec2 uv) {\n vec2 tileSize = 1.0 / vec2(tileCount);\n vec2 posInTile = fract(uv * vec2(tileCount));\n vec2 tileNum = floor(uv * vec2(tileCount));\n float countTiles = float(tileCount.x * tileCount.y);\n\n \n float offset = (tileNum.y + tileNum.x * float(tileCount.y)) / countTiles;\n float timeOffset = clamp((progress - offset) * countTiles, 0.0, 0.5);\n float sinTime = 1.0 - abs(cos(fract(timeOffset) * 3.1415926));\n\n vec2 texC = posInTile;\n\n if (sinTime <= 0.5) {\n if ((flipX != 0)) {\n if (texC.x < sinTime || texC.x > 1.0 - sinTime)\n return getFromColor(uv);\n texC.x = texC.x < 0.5\n ? (texC.x - sinTime) * 0.5 / (0.5 - sinTime)\n : (texC.x - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;\n }\n if ((flipY != 0)) {\n if (texC.y < sinTime || texC.y > 1.0 - sinTime)\n return getFromColor(uv);\n texC.y = texC.y < 0.5\n ? (texC.y - sinTime) * 0.5 / (0.5 - sinTime)\n : (texC.y - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;\n }\n vec2 globalUV = tileNum * tileSize + texC * tileSize;\n return getFromColor(globalUV);\n } else {\n if ((flipX != 0)) {\n if (texC.x > sinTime || texC.x < 1.0 - sinTime)\n return getToColor(uv);\n texC.x = texC.x < 0.5\n ? (texC.x - sinTime) * 0.5 / (0.5 - sinTime)\n : (texC.x - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;\n texC.x = 1.0 - texC.x;\n }\n if ((flipY != 0)) {\n if (texC.y > sinTime || texC.y < 1.0 - sinTime)\n return getToColor(uv);\n texC.y = texC.y < 0.5\n ? (texC.y - sinTime) * 0.5 / (0.5 - sinTime)\n : (texC.y - 0.5) * 0.5 / (0.5 - sinTime) + 0.5;\n texC.y = 1.0 - texC.y;\n }\n vec2 globalUV = tileNum * tileSize + texC * tileSize;\n return getToColor(globalUV);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TopBottom":"// TopBottom — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TopBottom.glsl\n// Author: zhmy\n// License: MIT\n// Description: The outgoing image shrinks away upward while the incoming one slides in from the bottom\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nconst vec4 black = vec4(0.0); \nconst vec2 boundMin = vec2(0.0, 0.0);\nconst vec2 boundMax = vec2(1.0, 1.0);\n\nbool inBounds (vec2 p) {\n return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax));\n}\n\nvec4 transition (vec2 uv) {\n vec2 spfr,spto = vec2(-1.);\n float size = mix(1.0, 3.0, progress*0.2);\n spto = (uv + vec2(-0.5,-0.5))*vec2(size,size)+vec2(0.5,0.5);\n spfr = (uv + vec2(0.0, 1.0 - progress));\n if(inBounds(spfr)){\n return getToColor(spfr);\n } else if(inBounds(spto)){\n return getFromColor(spto) * (1.0 - progress);\n } else{\n return black;\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Tunnel":"// Tunnel — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Tunnel.glsl\n// Author: gre\n// License: MIT\n// Description: The camera flies down a tunnel lined with the outgoing image toward the incoming one, which opens at its far end and grows to fill the frame\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float speed; \n\nuniform float twist; \n\nvec2 rotate(vec2 v, float a) {\n float c = cos(a);\n float s = sin(a);\n return vec2(c * v.x - s * v.y, s * v.x + c * v.y);\n}\n\nvec4 transition(vec2 uv) {\n vec2 aspect = vec2(ratio, 1.0);\n vec2 c = (uv - 0.5) * aspect;\n float r = length(c);\n \n \n \n \n float R = length(0.5 * aspect);\n float far = 1.0 + speed;\n \n float e = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.7);\n float d = pow(far, 1.0 - e);\n float t = far - d; \n \n float k = r * d < R ? d / far : R / (R + t * r); \n float a = twist * min(t * r / R, t / d); \n vec4 walls = getFromColor(0.5 + rotate(c * k, a) / aspect);\n walls.rgb *= 0.4 + 0.6 * sqrt(k); \n \n float open = smoothstep(0.0, 0.6, progress);\n vec2 q = 0.5 + (uv - 0.5) * d / max(open, 1e-4);\n vec2 inside = step(0.0, q) * step(q, vec2(1.0));\n return mix(walls, getToColor(q), inside.x * inside.y * step(r * d, R));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TvLostSignal":"// TvLostSignal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TvLostSignal.glsl\n// Author: mernking (gitlab.com/Godswork)\n// License: MIT\n// Description: A crossfade with drifting tracking lines and tearing, like a TV losing its signal\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n}\n\nvec4 transition(vec2 uv) {\n\n float p = progress;\n float strength = sin(p * 3.14159265);\n\n vec2 tv = uv;\n\n vec4 fromColor = getFromColor(tv);\n vec4 toColor = getToColor(tv);\n\n vec4 color = mix(fromColor, toColor, p);\n\n \n float lineY = floor(tv.y * 120.0);\n\n float noise = hash(vec2(lineY, p * 20.0));\n\n float line = step(0.92, noise);\n\n \n float drift =\n sin(tv.y * 30.0 + p * 10.0)\n * 0.02\n * strength;\n\n vec4 shiftedFrom = getFromColor(tv + vec2(drift, 0.0));\n vec4 shiftedTo = getToColor(tv + vec2(drift, 0.0));\n\n vec4 lineColor = mix(shiftedFrom, shiftedTo, p);\n\n \n color = mix(color, lineColor, line * strength);\n\n \n float scan =\n sin(tv.y * 900.0) * 0.03;\n\n color.rgb -= scan * strength;\n\n return color;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TvRoll":"// TvRoll — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TvRoll.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image rolls faster and faster, like an old TV losing its vertical hold, then the roll slows down and locks on the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int rolls; \n\nuniform float barHeight; \n\nuniform vec4 barColor; \n\nvec4 picture(vec2 uv, float y, float m) {\n float period = 1.0 + barHeight;\n y = mod(y, period);\n if (y > 1.0) return barColor;\n vec2 q = vec2(uv.x, y);\n return mix(getFromColor(q), getToColor(q), m);\n}\n\nvec4 transition(vec2 uv) {\n float period = 1.0 + barHeight;\n \n float s = progress * progress * (3.0 - 2.0 * progress);\n float offset = period * fract(float(rolls) * s);\n float speed = 4.0 * progress * (1.0 - progress); \n float m = smoothstep(0.42, 0.58, progress); \n \n vec2 p = uv + vec2(0.004 * speed * sin(uv.y * 9.0 + progress * 30.0), 0.0);\n \n vec4 c = vec4(0.0);\n for (int i = 0; i < 5; i++) {\n c += picture(p, p.y + offset - 0.0015 * float(rolls) * speed * float(i), m);\n }\n c /= 5.0;\n \n float scan = 0.5 + 0.5 * sin(uv.y * 400.0);\n float flicker = 0.08 * (0.5 + 0.5 * sin(progress * 97.0));\n c.rgb *= 1.0 - speed * (0.08 * scan + flicker);\n return c;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TvStatic":"// TvStatic — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TvStatic.glsl\n// Author: Brandon Anzaldi\n// License: MIT\n// Description: Cuts to full-screen TV static, then to the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float offset; \n\nhighp float noise(vec2 co)\n{\n highp float a = 12.9898;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt= dot(co.xy * progress, vec2(a, b));\n highp float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\n\nvec4 transition(vec2 p) {\n if (progress < offset) {\n return getFromColor(p);\n } else if (progress > (1.0 - offset)) {\n return getToColor(p);\n } else {\n return vec4(vec3(noise(p)), max(getFromColor(p).a, getToColor(p).a)); \n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","TvTurnOff":"// TvTurnOff — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TvTurnOff.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image collapses into a glowing line and a dot, like an old TV turned off, then the incoming image powers on from the dot\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec4 color; \n\nuniform float glow; \n\nvec4 getColor(vec2 uv, bool isFrom) {\n return isFrom ? getFromColor(uv) : getToColor(uv);\n}\n\nvec4 screen(vec2 uv, float t, bool isFrom) {\n float collapse = smoothstep(0.0, 0.4, t); \n float shrink = smoothstep(0.3, 0.65, t); \n float fade = 0.4 * smoothstep(0.75, 1.0, t); \n float radius = 0.01 * (1.0 - fade);\n \n vec2 size = vec2(mix(0.5 * ratio, radius, shrink), mix(0.5, radius, collapse));\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n vec2 q = clamp(0.5 + 0.5 * p / size, 0.0, 1.0);\n vec4 c = getColor(q, isFrom);\n \n float white = smoothstep(0.4, 1.0, collapse);\n vec4 light = vec4(mix(min(c.rgb * (1.0 + 2.0 * collapse), 1.0), vec3(1.0), white), c.a);\n \n vec2 d = abs(p) - size;\n float dist = length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);\n float inside = clamp(1.0 - dist / 0.004, 0.0, 1.0);\n \n vec4 mid = getColor(vec2(0.5), isFrom);\n vec4 halo = vec4(mix(mix(mid.rgb, vec3(1.0), 0.7), vec3(1.0, 0.92, 0.8), shrink), mid.a);\n float h = 1.0 - exp(-2.0 * glow * white * exp(-max(dist, 0.0) / (0.02 + 0.04 * shrink)));\n vec4 col = mix(color, halo, h * (1.0 - fade));\n return mix(col, light, inside * (1.0 - fade));\n}\n\nvec4 transition(vec2 uv) {\n if (progress < 0.5) {\n return screen(uv, 2.0 * progress, true);\n }\n return screen(uv, 2.0 - 2.0 * progress, false);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","UndulatingBurnOut":"// UndulatingBurnOut — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/UndulatingBurnOut.glsl\n// Author: pthrasher\n// License: MIT\n// Description: A circle with a wavy edge burns out from the center to reveal the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float smoothness; \n\nuniform vec2 center; \n\nuniform vec4 color; \n\nconst float M_PI = 3.14159265358979323846;\n\nfloat quadraticInOut(float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n\nfloat getGradient(float r, float dist) {\n float d = r - dist;\n return mix(\n smoothstep(-smoothness, 0.0, r - dist * (1.0 + smoothness)),\n -1.0 - step(0.005, d),\n step(-0.005, d) * step(d, 0.01)\n );\n}\n\nfloat getWave(vec2 p){\n vec2 _p = p - center; \n float rads = atan(_p.y, _p.x);\n float degs = degrees(rads) + 180.0;\n vec2 range = vec2(0.0, M_PI * 30.0);\n vec2 domain = vec2(0.0, 360.0);\n float ratio = (M_PI * 30.0) / 360.0;\n degs = degs * ratio;\n float x = progress;\n float magnitude = mix(0.02, 0.09, smoothstep(0.0, 1.0, x));\n float offset = mix(40.0, 30.0, smoothstep(0.0, 1.0, x));\n float ease_degs = quadraticInOut(sin(degs));\n float deg_wave_pos = (ease_degs * magnitude) * sin(x * offset);\n \n \n \n return x - max(smoothness, 0.01) * (1.0 - smoothstep(0.0, 0.1, x)) + deg_wave_pos;\n}\n\nvec4 transition(vec2 p) {\n float dist = distance(center, p);\n float m = getGradient(getWave(p), dist);\n vec4 cfrom = getFromColor(p);\n vec4 cto = getToColor(p);\n return mix(mix(cfrom, cto, m), mix(cfrom, color, 0.75), step(m, -2.0));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","VerticalClose":"// VerticalClose — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/VerticalClose.glsl\n// Author: martiniti\n// License: MIT\n// Description: The incoming image closes in from the left and right edges toward the middle\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n\n float s = 2.0 - abs((uv.x - 0.5) / (progress - 1.0)) - 2.0 * progress;\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n smoothstep(0.5, 0.0, s)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","VerticalOpen":"// VerticalOpen — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/VerticalOpen.glsl\n// Author: martiniti\n// License: MIT\n// Description: The incoming image opens from a line in the middle toward the left and right edges\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n\n float regress = 1.0 - progress;\n float s = 2.0 - abs((uv.x - 0.5) / (regress - 1.0)) - 2.0 * regress;\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n smoothstep(0.0, 0.5, s)\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","VhsTracking":"// VhsTracking — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/VhsTracking.glsl\n// Author: gre\n// License: MIT\n// Description: Tape-tracking bands of white snow roll down the frame, tearing the lines around them, with smeared color, wobbling lines, a jittering strip at the bottom and a dropout flash, as the incoming image is recorded over the outgoing one under the densest band\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int bands; \n\nuniform float noise; \n\nuniform float bleed; \n\nuniform float wobble; \n\nconst float LINES = 220.0; \nconst float FRAMES = 40.0; \nconst float BAND = 0.11; \nconst float STRIP = 0.06; \nconst int TAPS = 6;\n\nfloat hash12(vec2 v) {\n vec3 v3 = fract(vec3(v.xyx) * 0.1031);\n v3 += dot(v3, v3.yzx + 33.33);\n return fract((v3.x + v3.y) * v3.z);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 tape(vec2 p, bool fresh) {\n p = mirror(p);\n vec4 c = fresh ? getToColor(p) : getFromColor(p);\n return vec4(c.rgb * c.a, c.a);\n}\n\nfloat luma(vec3 c) {\n return dot(c, vec3(0.299, 0.587, 0.114));\n}\n\nfloat bandDensity(float y, float c, float w, float jitter) {\n float d = abs(y - c) / w + 0.35 * jitter;\n return 1.0 - smoothstep(0.0, 1.0, d);\n}\n\nvec4 transition(vec2 uv) {\n \n float h = clamp(2.5 * (1.0 - abs(2.0 * progress - 1.0)), 0.0, 1.0);\n float env = h * h * (3.0 - 2.0 * h);\n \n float f = clamp(1.0 - abs(progress - 0.5) / 0.04, 0.0, 1.0);\n float flash = f * f * (3.0 - 2.0 * f);\n\n float frame = floor(progress * FRAMES);\n float line = floor(uv.y * LINES);\n float jitter = hash12(vec2(line, frame + 7.0)) - 0.5;\n\n \n float c0 = mix(1.0 + 1.2 * BAND, -1.2 * BAND, progress);\n \n bool fresh = uv.y > c0 + 0.8 * BAND * jitter;\n float dens = bandDensity(uv.y, c0, BAND, jitter);\n float tear = 1.0 - smoothstep(0.0, 1.0, abs(uv.y - c0) / (2.5 * BAND));\n \n for (int i = 1; i < 4; i++) {\n if (i < bands) {\n float k = float(i);\n float w = BAND * (0.35 + 0.2 * hash12(vec2(k, 3.0)));\n float speed = 1.3 + 0.9 * k;\n float cy = -w + (1.0 + 2.0 * w) * fract(hash12(vec2(k, 5.0)) - speed * progress);\n dens = max(dens, 0.6 * bandDensity(uv.y, cy, w, jitter));\n tear = max(tear, 0.5 * (1.0 - smoothstep(0.0, 1.0, abs(uv.y - cy) / (2.5 * w))));\n }\n }\n dens *= env;\n tear *= env;\n\n \n float rowTear = hash12(vec2(floor(uv.y * LINES * 0.5), frame + 31.0)) - 0.5;\n float dx = wobble * env * (0.006 * sin(uv.y * 7.0 + progress * 23.0) + 0.004 * jitter);\n dx += (0.3 + 0.7 * noise) * tear * 0.18 * rowTear;\n \n float strip = env * (1.0 - smoothstep(0.0, STRIP, uv.y));\n dx += strip * (0.03 + 0.06 * (1.0 - uv.y / STRIP)) * (0.6 + 0.8 * hash12(vec2(frame, 41.0)));\n vec2 q = vec2(uv.x + dx, uv.y);\n\n vec4 c = tape(q, fresh);\n if (c.a <= 0.0) return vec4(0.0);\n \n float len = bleed * (0.02 + 0.05 * dens) * env;\n vec4 avg = c;\n if (len > 0.0) {\n avg = vec4(0.0);\n for (int i = 0; i < TAPS; i++) {\n float u = (float(i) + 0.5) / float(TAPS);\n avg += tape(q - vec2(len * (0.4 + u), 0.0), fresh);\n }\n avg /= float(TAPS);\n }\n vec3 chroma = (avg.rgb - luma(avg.rgb)) / max(avg.a, 1e-5);\n vec3 rgb = luma(c.rgb) + chroma * c.a; \n \n rgb = mix(rgb, vec3(luma(rgb)), 0.6 * dens);\n\n \n \n vec2 cell = vec2(floor(uv.x * LINES * 0.3 * ratio + 40.0 * jitter), line);\n float n = hash12(cell + frame * vec2(37.0, 17.0));\n float amount = clamp(noise * max(1.3 * dens, 0.8 * strip) + 0.35 * flash, 0.0, 1.0);\n float snow = amount > 0.0 ? smoothstep(1.0 - amount, 1.0 - 0.6 * amount, n) : 0.0;\n snow *= 0.55 + 0.45 * hash12(cell.yx + frame);\n \n float g = hash12(vec2(floor(uv.x * LINES * ratio), line) + frame * vec2(13.0, 29.0));\n snow = max(snow, amount > 0.0 ? 0.7 * smoothstep(1.0 - 0.4 * amount, 1.0, g) : 0.0);\n \n float dark = g < 0.1 * amount ? 1.0 : 0.0;\n \n float group = floor(uv.y * LINES / 3.0);\n float drop = step(1.0 - 0.15 * flash, hash12(vec2(group, floor(uv.x * 6.0 + 5.0 * hash12(vec2(group, frame))) + frame * 7.0)));\n rgb *= 1.0 - 0.5 * dark;\n rgb += (clamp(snow + drop + 0.12 * flash, 0.0, 1.0)) * (c.a - rgb);\n\n return vec4(clamp(rgb / c.a, 0.0, 1.0), c.a);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Vortex":"// Vortex — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Vortex.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image breaks into hundreds of small squares that a tornado carries away along a spiral around the center, from the eye outward, uncovering the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int grid; \n\nuniform vec2 center; \n\nuniform float spin; \n\nuniform float randomness; \n\nconst int GROUPS = 24;\nconst float DURATION = 0.25;\n\nconst float AA = 0.0015;\nconst float TAU = 6.2831853;\n\nfloat hash(vec2 n) {\n return fract(sin(dot(n, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nint groupOf(vec2 n, float h, vec2 c, float maxR) {\n \n float r = min(length((n + 0.5) * h - c) / (0.85 * maxR), 1.0);\n float key = clamp(mix(r * sqrt(r), hash(n), clamp(randomness, 0.0, 1.0)), 0.0, 0.9999);\n return int(floor(key * float(GROUPS)));\n}\n\nfloat flight(int g) {\n float delay = float(g) / float(GROUPS) * (1.0 - DURATION);\n return clamp((progress - delay) / DURATION, 0.0, 1.0);\n}\n\nvec4 premultiplied(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n \n vec2 aspect = vec2(ratio, 1.0);\n vec2 p = uv * aspect;\n vec2 c = center * aspect;\n float maxR = max(max(length(c), length(c - vec2(ratio, 0.0))), max(length(c - vec2(0.0, 1.0)), length(c - aspect)));\n float h = 1.0 / float(grid < 1 ? 1 : grid);\n \n float reach = 0.7 * maxR;\n\n \n vec2 n0 = floor(p / h);\n vec4 col = flight(groupOf(n0, h, c, maxR)) <= 0.0 ? premultiplied(getFromColor(uv)) : premultiplied(getToColor(uv));\n\n \n for (int k = 0; k < GROUPS; k++) {\n int g = GROUPS - 1 - k;\n float s = flight(g);\n if (s <= 0.0 || s >= 1.0) continue;\n float e = s * s;\n \n \n float angle = spin * TAU * e * 2.0 / (1.0 + 6.0 * float(g) / float(GROUPS));\n float push = reach * e * s;\n \n float size = (1.0 + 0.35 * sin(3.1415927 * s)) * (1.0 - s * s * s);\n float ca = cos(angle);\n float sa = sin(angle);\n mat2 rot = mat2(ca, sa, -sa, ca);\n \n vec2 u = (p - c) * rot;\n float ru = length(u);\n vec2 guess = c + (ru > 0.0 ? u / ru : vec2(0.0)) * max(ru - push, 0.0);\n vec2 ng = floor(guess / h);\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n vec2 n = ng + vec2(float(i), float(j));\n if (groupOf(n, h, c, maxR) != g) continue;\n vec2 home = (n + 0.5) * h;\n vec2 rel = home - c;\n float rr = length(rel);\n vec2 dir = rr > 0.0 ? rel / rr : vec2(0.0);\n vec2 pos = c + rot * (dir * (rr + push));\n \n float tumble = angle + (hash(n + 17.0) - 0.5) * 3.0 * e * sign(spin);\n float ct = cos(tumble);\n float st = sin(tumble);\n vec2 d = ((p - pos) * mat2(ct, st, -st, ct)) / max(size, 1e-4);\n float edge = 0.5 * h - max(abs(d.x), abs(d.y));\n float cov = clamp(edge * size / (2.0 * AA) + 0.5, 0.0, 1.0);\n vec2 src = home + d;\n if (cov <= 0.0 || src.x < 0.0 || src.y < 0.0 || src.x > ratio || src.y > 1.0) continue;\n vec4 piece = premultiplied(getFromColor(src / aspect)) * cov;\n col = piece + col * (1.0 - piece.a);\n }\n }\n }\n return col.a > 0.0 ? vec4(col.rgb / col.a, col.a) : vec4(0.0);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WaterDrop":"// WaterDrop — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WaterDrop.glsl\n// Author: Paweł Płóciennik\n// License: MIT\n// Description: Ripples spread from the center like a drop falling into water, crossfading to the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float amplitude; \n\nuniform float speed; \n\nvec4 transition(vec2 p) {\n vec2 dir = p - vec2(.5);\n float dist = length(dir);\n\n if (dist > progress) {\n return mix(getFromColor( p), getToColor( p), progress);\n } else {\n vec2 offset = dir * sin(dist * amplitude - progress * speed);\n return mix(getFromColor( p + offset), getToColor( p), progress);\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WedgeWipe":"// WedgeWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WedgeWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Two hands sweep away from each other around the center, opening a widening wedge that reveals the incoming image\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float angle; \n\nuniform float smoothness; \n\nuniform vec2 center; \n\nvec4 transition (vec2 uv) {\n \n if (progress >= 1.0) return getToColor(uv);\n \n vec2 q = (uv - center) * vec2(ratio, 1.0);\n float a = radians(angle);\n \n vec2 p = vec2(abs(q.x * cos(a) - q.y * sin(a)), q.x * sin(a) + q.y * cos(a));\n \n float spread = 3.141592653589793 * progress;\n vec2 hand = vec2(sin(spread), cos(spread));\n \n float l = length(p);\n float d = length(p - hand * clamp(dot(p, hand), 0.0, l)) * sign(hand.y * p.x - hand.x * p.y);\n \n \n float s = max(smoothness, 0.001);\n float m = 1.0 - smoothstep(0.0, s, d + s * (1.0 - progress));\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WhipPan":"// WhipPan — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WhipPan.glsl\n// Author: gre\n// License: MIT\n// Description: A fast camera pan that streaks both images with motion blur, the incoming one arriving from the opposite side\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform vec2 direction; \n\nuniform float blur; \n\nconst int SAMPLES = 24;\n\nvec4 strip(vec2 q, vec2 d) {\n vec2 qt = q + d;\n \n if (dot(q - 0.5, -d) < 0.5 * dot(d, d)) {\n return getFromColor(clamp(q, 0.0, 1.0));\n }\n return getToColor(clamp(qt, 0.0, 1.0));\n}\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvec4 transition(vec2 uv) {\n vec2 d = sign(direction);\n \n float p = progress;\n float h = 1.0 - abs(2.0 * p - 1.0); \n \n float e = 0.5 * h * (0.1 + 0.9 * h * h);\n float pos = p < 0.5 ? e : 1.0 - e;\n float len = blur * h * (0.1 + 2.7 * h * h) / 2.8; \n\n vec2 q = uv - d * pos;\n \n float jitter = rand(uv);\n vec3 color = vec3(0.0);\n float alpha = 0.0;\n for (int i = 0; i < SAMPLES; i++) {\n float t = (float(i) + jitter) / float(SAMPLES) - 0.5;\n vec4 c = strip(q + d * t * len, d);\n color += c.rgb * c.a;\n alpha += c.a;\n }\n return vec4(color / max(alpha, 1e-5), alpha / float(SAMPLES));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WhipSpin":"// WhipSpin — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WhipSpin.glsl\n// Author: gre\n// License: MIT\n// Description: The camera rolls faster and faster around the center of the frame, streaking the outgoing image in a spin blur, then the incoming one takes over mid-spin and slows to a stop\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float turns; \n\nuniform float blur; \n\nuniform float chroma; \n\nuniform float zoom; \n\nconst float PI = 3.141592653589793;\nconst int SAMPLES = 24;\n\nfloat hash(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nvec2 mirror(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nfloat rollAngle(float t) {\n float halfTurn = PI * turns;\n if (t < 0.5) {\n float x = 2.0 * t;\n return halfTurn * x * x * x;\n }\n float x = 2.0 - 2.0 * t;\n return -halfTurn * x * x * x;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n float h = 1.0 - abs(2.0 * p - 1.0); \n \n float shutter = blur * 0.1 * h;\n float scale = 1.0 + zoom * h * h * h;\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float jitter = hash(uv * vec2(ratio, 1.0) * 731.0);\n vec3 color = vec3(0.0);\n vec3 weight = vec3(0.0);\n float alpha = 0.0;\n for (int i = 0; i < SAMPLES; i++) {\n float s = (float(i) + jitter) / float(SAMPLES) - 0.5;\n float t = clamp(p + s * shutter, 0.0, 1.0);\n float a = rollAngle(t);\n float c = cos(a), sn = sin(a);\n vec2 r = vec2(c * q.x + sn * q.y, -sn * q.x + c * q.y) / scale;\n vec2 suv = mirror(r / vec2(ratio, 1.0) + 0.5);\n vec4 col = t < 0.5 ? getFromColor(suv) : getToColor(suv);\n \n vec3 w = max(vec3(1.0 - 4.0 * chroma * s, 1.0, 1.0 + 4.0 * chroma * s), 0.0);\n color += col.rgb * col.a * w;\n weight += col.a * w;\n alpha += col.a;\n }\n return vec4(color / max(weight, vec3(1e-5)), alpha / float(SAMPLES));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WhipTilt":"// WhipTilt — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WhipTilt.glsl\n// Author: gre\n// License: MIT\n// Description: The camera tilts fast from the outgoing image to the incoming one, set edge to edge at an angle above it, streaking both in perspective with a vertical motion blur\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform int down; \n\nuniform float blur; \n\nuniform float chroma; \n\nuniform float perspective; \n\nconst float PI = 3.141592653589793;\nconst int SAMPLES = 24;\n\nfloat hash(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nvec2 mirror(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nfloat tilt(float t) {\n float h = 1.0 - abs(2.0 * t - 1.0);\n float e = 0.5 * h * h * h * h;\n return t < 0.5 ? e : 1.0 - e;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n float h = 1.0 - abs(2.0 * p - 1.0); \n \n float shutter = blur * 0.25 * h * h;\n \n \n float halfFov = mix(15.0, 45.0, perspective) * PI / 180.0;\n float dist = 0.5 / tan(halfFov);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n if ((down != 0)) q.y = -q.y;\n float jitter = hash(uv * vec2(ratio, 1.0) * 731.0);\n vec3 color = vec3(0.0);\n vec3 weight = vec3(0.0);\n float alpha = 0.0;\n for (int i = 0; i < SAMPLES; i++) {\n float s = (float(i) + jitter) / float(SAMPLES) - 0.5;\n float t = clamp(p + s * shutter, 0.0, 1.0);\n float a = 2.0 * halfFov * tilt(t);\n \n vec2 r = q * cos(halfFov) / cos(halfFov - a);\n \n float c0 = cos(a), s0 = sin(a);\n vec2 d0 = vec2(r.y * c0 + dist * s0, dist * c0 - r.y * s0);\n float b = a - 2.0 * halfFov;\n float c1 = cos(b), s1 = sin(b);\n vec2 d1 = vec2(r.y * c1 + dist * s1, dist * c1 - r.y * s1);\n \n bool incoming = d1.y > d0.y;\n vec2 d = incoming ? d1 : d0;\n vec2 hit = dist / d.y * vec2(r.x, d.x);\n if ((down != 0)) hit.y = -hit.y;\n vec2 suv = mirror(hit / vec2(ratio, 1.0) + 0.5);\n vec4 col = incoming ? getToColor(suv) : getFromColor(suv);\n \n vec3 w = max(vec3(1.0 - 4.0 * chroma * s, 1.0, 1.0 + 4.0 * chroma * s), 0.0);\n color += col.rgb * col.a * w;\n weight += col.a * w;\n alpha += col.a;\n }\n return vec4(color / max(weight, vec3(1e-5)), alpha / float(SAMPLES));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Wind":"// Wind — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Wind.glsl\n// Author: gre\n// License: MIT\n// Description: A ragged left-to-right wipe, as if the image was blown away by the wind\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float size; \n\nuniform int reversed; \n\nfloat rand (vec2 co) {\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec4 transition (vec2 uv) {\n float x = (reversed != 0) ? 1. - uv.x : uv.x;\n float r = rand(vec2(0, uv.y));\n float m = smoothstep(0.0, -size, x*(1.0-size) + size*r - (progress * (1.0 + size)));\n return mix(\n getFromColor(uv),\n getToColor(uv),\n m\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WindowBlinds":"// WindowBlinds — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WindowBlinds.glsl\n// Author: Fabien Benetou\n// License: MIT\n// Description: A crossfade through horizontal window blinds\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition (vec2 uv) {\n float t = progress;\n \n if (mod(floor(uv.y*100.*progress),2.)==0.)\n t*=2.-.5;\n \n return mix(\n getFromColor(uv),\n getToColor(uv),\n mix(t, progress, smoothstep(0.8, 1.0, progress))\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WindowSlices":"// WindowSlices — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WindowSlices.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image appears through vertical slices that widen\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float count; \n\nuniform float smoothness; \n\nvec4 transition (vec2 p) {\n float pr = smoothstep(-smoothness, 0.0, p.x - progress * (1.0 + smoothness));\n float s = step(pr, fract(count * p.x));\n return mix(getFromColor(p), getToColor(p), s);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WipeDown":"// WipeDown — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeDown.glsl\n// Author: Jake Nelson\n// License: MIT\n// Description: A hard-edged wipe from top to bottom\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4 b=getToColor(p);\n return mix(a, b, step(1.0-p.y,progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WipeLeft":"// WipeLeft — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeLeft.glsl\n// Author: Jake Nelson\n// License: MIT\n// Description: A hard-edged wipe from right to left\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4 b=getToColor(p);\n return mix(a, b, step(1.0-p.x,progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WipeRight":"// WipeRight — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeRight.glsl\n// Author: Jake Nelson\n// License: MIT\n// Description: A hard-edged wipe from left to right\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4 b=getToColor(p);\n return mix(a, b, step(0.0+p.x,progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WipeUp":"// WipeUp — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WipeUp.glsl\n// Author: Jake Nelson\n// License: MIT\n// Description: A hard-edged wipe from bottom to top\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec4 transition(vec2 uv) {\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 a=getFromColor(p);\n vec4 b=getToColor(p);\n return mix(a, b, step(0.0+p.y,progress));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ZoomInCircles":"// ZoomInCircles — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ZoomInCircles.glsl\n// Author: dycm8009\n// License: MIT\n// Description: Concentric rings of the outgoing image zoom at different speeds before revealing the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec2 zoom(vec2 uv, float amount) {\n return 0.5 + ((uv - 0.5) * amount);\t\n}\n\nvec4 transition(vec2 uv) {\n vec2 ratio2 = vec2(1.0, 1.0 / ratio);\n \n \n \n vec2 r = 2.0 * ((vec2(uv.xy) - 0.5) * ratio2);\n float pro = progress / 0.8;\n float z = pro * 0.2;\n float t = 0.0;\n if (pro > 1.0) {\n z = 0.2 + (pro - 1.0) * 5.;\n t = clamp((progress - 0.8) / 0.07, 0.0, 1.0);\n }\n if (length(r) < 0.5+z) {\n \n }\n else if (length(r) < 0.8+z*1.5) {\n uv = zoom(uv, 1.0 - 0.15 * pro);\n t = t * 0.5;\n }\n else if (length(r) < 1.2+z*2.5) {\n uv = zoom(uv, 1.0 - 0.2 * pro);\n t = t * 0.2;\n }\n else {\n uv = zoom(uv, 1.0 - 0.25 * pro);\n }\n return mix(getFromColor(uv), getToColor(uv), t);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ZoomInOut":"// ZoomInOut — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ZoomInOut.glsl\n// Author: OllyOllyOlly\n// License: MIT\n// Description: Zooms into the outgoing image until it blurs into a flat color, then out to the incoming one\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nvec2 zoom(vec2 uv, float amount) {\n return 0.5 + ((uv - 0.5) * (1.0 - amount));\n}\n\nvec4 transition (vec2 uv) {\n float zoomFrom = smoothstep(0.0, 1.0, progress * 2.0);\n float zoomTo = smoothstep(0.0, 1.0, (1.0 - progress) * 2.0);\n float crossfade = smoothstep(0.4, 0.6, progress);\n return mix(\n getFromColor(zoom(uv, zoomFrom)),\n getToColor(zoom(uv, zoomTo)),\n crossfade\n );\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ZoomWipeLeft":"// ZoomWipeLeft — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ZoomWipeLeft.glsl\n// Author: Handk\n// License: MIT\n// Description: Zooms into the outgoing image, then the incoming one wipes in from right to left\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float zoom_quickness; \nvec2 zoom(vec2 uv, float amount) {\n if(amount<0.5)\n return 0.5 + ((uv - 0.5) * (1.0-amount));\n else\n return 0.5 + ((uv - 0.5) * (amount));\n \n}\n\nvec4 transition (vec2 uv) {\n float nQuick = clamp(zoom_quickness,0.0,0.5);\n if(progress<0.5){\n vec4 c= mix(\n getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))),\n getToColor(uv),\n step(0.5, progress)\n );\n \n return c;\n }\n else{\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 d=getFromColor(p);\n vec4 e=getToColor(p);\n vec4 f= mix(d, e, step(1.0-p.x,(progress-0.5)*2.0));\n \n return f;\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ZoomWipeRight":"// ZoomWipeRight — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ZoomWipeRight.glsl\n// Author: Handk\n// License: MIT\n// Description: Zooms into the outgoing image, then the incoming one wipes in from left to right\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\nvec4 getToColor(vec2 uv) { return vec4(unpremul(_to.eval(vec2(uv.x, 1.0 - uv.y) * _resolution))); }\n\nuniform float zoom_quickness; \nvec2 zoom(vec2 uv, float amount) {\n if(amount<0.5)\n return 0.5 + ((uv - 0.5) * (1.0-amount));\n else\n return 0.5 + ((uv - 0.5) * (amount));\n \n}\n\nvec4 transition (vec2 uv) {\n float nQuick = clamp(zoom_quickness,0.0,0.5);\n if(progress<0.5){\n vec4 c= mix(\n getFromColor(zoom(uv, smoothstep(0.0, nQuick, progress))),\n getToColor(uv),\n step(0.5, progress)\n );\n \n return c;\n }\n else{\n vec2 p=uv.xy/vec2(1.0).xy;\n vec4 d=getFromColor(p);\n vec4 e=getToColor(p);\n vec4 f= mix(d, e, step(0.0+p.x,(progress-0.5)*2.0));\n \n return f;\n }\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n"};