gl-transitions 3.3.0 → 3.4.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 (1157) hide show
  1. package/CHANGELOG.md +240 -0
  2. package/README.md +1 -0
  3. package/compatibility.json +2241 -446
  4. package/gl-transitions.js +1 -1
  5. package/gl-transitions.json +1 -1
  6. package/glsl3/Accordion.glsl +1 -10
  7. package/glsl3/ApertureWipe.glsl +0 -2
  8. package/glsl3/ArrowWipe.glsl +0 -7
  9. package/glsl3/Ascii.glsl +1 -12
  10. package/glsl3/BandWipe.glsl +0 -7
  11. package/glsl3/BeadUp.glsl +96 -0
  12. package/glsl3/BillowWipe.glsl +93 -0
  13. package/glsl3/Bite.glsl +167 -0
  14. package/glsl3/BlockCover.glsl +1 -4
  15. package/glsl3/BlockSlide.glsl +1 -11
  16. package/glsl3/BloomDissolve.glsl +0 -9
  17. package/glsl3/Blossom.glsl +110 -0
  18. package/glsl3/BokehDissolve.glsl +1 -8
  19. package/glsl3/BookFlip.glsl +1 -13
  20. package/glsl3/Bottleneck.glsl +41 -0
  21. package/glsl3/Bounce.glsl +1 -1
  22. package/glsl3/BowTieHorizontal.glsl +1 -8
  23. package/glsl3/BrickCollapse.glsl +140 -0
  24. package/glsl3/BrushWipe.glsl +5 -6
  25. package/glsl3/BurnThrough.glsl +2 -3
  26. package/glsl3/ButterflyFlight.glsl +69 -0
  27. package/glsl3/ButterflyWaveScrawler.glsl +0 -3
  28. package/glsl3/CameraShake.glsl +2 -7
  29. package/glsl3/CardDeal.glsl +0 -21
  30. package/glsl3/CardSwipe.glsl +2 -9
  31. package/glsl3/CellDissolve.glsl +0 -7
  32. package/glsl3/CircleBurst.glsl +1 -9
  33. package/glsl3/CircleIris.glsl +1 -0
  34. package/glsl3/CirclePacking.glsl +106 -0
  35. package/glsl3/Cleave.glsl +80 -0
  36. package/glsl3/Clothesline.glsl +6 -27
  37. package/glsl3/CloudDive.glsl +72 -0
  38. package/glsl3/CodeRain.glsl +0 -12
  39. package/glsl3/CoinSettle.glsl +80 -0
  40. package/glsl3/ColorPanelWipe.glsl +2 -9
  41. package/glsl3/Comb.glsl +0 -1
  42. package/glsl3/ComicPanels.glsl +0 -16
  43. package/glsl3/Condensation.glsl +154 -0
  44. package/glsl3/CorePunch.glsl +152 -0
  45. package/glsl3/CornerPin.glsl +75 -0
  46. package/glsl3/Crankshaft.glsl +98 -0
  47. package/glsl3/Craze.glsl +123 -0
  48. package/glsl3/CrossZoom.glsl +1 -1
  49. package/glsl3/Crumple.glsl +1 -11
  50. package/glsl3/Cube.glsl +1 -9
  51. package/glsl3/CurtainRise.glsl +0 -9
  52. package/glsl3/Curtains.glsl +3 -6
  53. package/glsl3/CurvedWipe.glsl +0 -3
  54. package/glsl3/CylinderRoll.glsl +2 -10
  55. package/glsl3/Cymatics.glsl +83 -0
  56. package/glsl3/DamBreak.glsl +103 -0
  57. package/glsl3/Deinterleave.glsl +81 -0
  58. package/glsl3/DiamondWipe.glsl +0 -1
  59. package/glsl3/DiffuseDissolve.glsl +44 -0
  60. package/glsl3/DirectionalScaled.glsl +1 -0
  61. package/glsl3/DiscCascade.glsl +74 -0
  62. package/glsl3/Disintegrate.glsl +1 -9
  63. package/glsl3/DominoFall.glsl +1 -12
  64. package/glsl3/Donut.glsl +135 -0
  65. package/glsl3/DoomMelt.glsl +1 -5
  66. package/glsl3/Doorway.glsl +1 -9
  67. package/glsl3/Drape.glsl +1 -15
  68. package/glsl3/DreamyZoom.glsl +2 -10
  69. package/glsl3/DropHop.glsl +107 -0
  70. package/glsl3/DuotoneFade.glsl +1 -3
  71. package/glsl3/EchoSlide.glsl +0 -7
  72. package/glsl3/EqualizerWipe.glsl +103 -0
  73. package/glsl3/EyeBlink.glsl +0 -7
  74. package/glsl3/FacetedGlass.glsl +0 -17
  75. package/glsl3/Faint.glsl +69 -0
  76. package/glsl3/FallOver.glsl +0 -2
  77. package/glsl3/FalseReflection.glsl +61 -0
  78. package/glsl3/FieldReversal.glsl +114 -0
  79. package/glsl3/FilmBurn.glsl +1 -0
  80. package/glsl3/FilmDissolve.glsl +0 -4
  81. package/glsl3/FilmLeader.glsl +185 -0
  82. package/glsl3/FilmStrip.glsl +1 -12
  83. package/glsl3/Fisheye.glsl +1 -0
  84. package/glsl3/FlameWipe.glsl +1 -22
  85. package/glsl3/FlowDissolve.glsl +85 -0
  86. package/glsl3/Flutter.glsl +107 -0
  87. package/glsl3/FrostWipe.glsl +3 -18
  88. package/glsl3/Funnel.glsl +0 -7
  89. package/glsl3/FurShake.glsl +112 -0
  90. package/glsl3/Gallery.glsl +3 -9
  91. package/glsl3/Gape.glsl +67 -0
  92. package/glsl3/GeometricCollage.glsl +0 -10
  93. package/glsl3/GlassRelief.glsl +75 -0
  94. package/glsl3/GlintDissolve.glsl +1 -10
  95. package/glsl3/GlitchDisplace.glsl +0 -3
  96. package/glsl3/GlitchFlicker.glsl +5 -6
  97. package/glsl3/GlitchMemories.glsl +1 -1
  98. package/glsl3/GlitterDissolve.glsl +0 -15
  99. package/glsl3/Globe.glsl +98 -0
  100. package/glsl3/GlowDissolve.glsl +2 -1
  101. package/glsl3/GoldenSpiral.glsl +84 -0
  102. package/glsl3/GooeyWipe.glsl +3 -6
  103. package/glsl3/GravityLens.glsl +0 -5
  104. package/glsl3/GridFlip.glsl +1 -15
  105. package/glsl3/Halftone.glsl +1 -3
  106. package/glsl3/HeartWipe.glsl +0 -2
  107. package/glsl3/HeatHaze.glsl +1 -10
  108. package/glsl3/HerringboneFold.glsl +85 -0
  109. package/glsl3/HingedSquares.glsl +0 -9
  110. package/glsl3/Hologram.glsl +1 -18
  111. package/glsl3/HoneyDrip.glsl +119 -0
  112. package/glsl3/Honeycomb.glsl +0 -4
  113. package/glsl3/HorizontalClose.glsl +1 -0
  114. package/glsl3/HorizontalHold.glsl +0 -5
  115. package/glsl3/HyperbolicMosaic.glsl +91 -0
  116. package/glsl3/Inchworm.glsl +110 -0
  117. package/glsl3/InkBleed.glsl +2 -6
  118. package/glsl3/InsetWipe.glsl +1 -4
  119. package/glsl3/InsideCube.glsl +0 -10
  120. package/glsl3/InterlaceWipe.glsl +60 -0
  121. package/glsl3/InvertedPageCurl.glsl +2 -5
  122. package/glsl3/IrisFold.glsl +61 -0
  123. package/glsl3/KeyholeWipe.glsl +0 -7
  124. package/glsl3/Kite.glsl +125 -0
  125. package/glsl3/Knead.glsl +125 -0
  126. package/glsl3/LayoutGrid.glsl +0 -13
  127. package/glsl3/LeafWipe.glsl +2 -4
  128. package/glsl3/LedWall.glsl +0 -14
  129. package/glsl3/LensFlare.glsl +0 -13
  130. package/glsl3/LensPush.glsl +76 -0
  131. package/glsl3/LensWipe.glsl +74 -0
  132. package/glsl3/LichtenbergBurn.glsl +88 -0
  133. package/glsl3/LightRays.glsl +2 -12
  134. package/glsl3/LightStreaks.glsl +0 -8
  135. package/glsl3/LightWipe.glsl +1 -13
  136. package/glsl3/LightningFlash.glsl +1 -14
  137. package/glsl3/LightningRift.glsl +91 -0
  138. package/glsl3/LineFeed.glsl +39 -0
  139. package/glsl3/LiquidFill.glsl +0 -13
  140. package/glsl3/LissajousTiles.glsl +3 -4
  141. package/glsl3/LuminanceMelt.glsl +1 -23
  142. package/glsl3/MarblingDissolve.glsl +80 -0
  143. package/glsl3/MicroBrickCascade.glsl +88 -0
  144. package/glsl3/MoireWipe.glsl +0 -9
  145. package/glsl3/Nightfall.glsl +61 -0
  146. package/glsl3/NoiseDissolve.glsl +1 -1
  147. package/glsl3/OutlineCrumble.glsl +105 -0
  148. package/glsl3/OutlineFill.glsl +61 -0
  149. package/glsl3/OutlineTear.glsl +93 -0
  150. package/glsl3/Overexposure.glsl +0 -1
  151. package/glsl3/PaintBucket.glsl +65 -0
  152. package/glsl3/PaintDissolve.glsl +175 -0
  153. package/glsl3/PaperFold.glsl +1 -12
  154. package/glsl3/PaperLayers.glsl +136 -0
  155. package/glsl3/PaperPlane.glsl +166 -0
  156. package/glsl3/PaperTear.glsl +1 -5
  157. package/glsl3/ParallaxPush.glsl +84 -0
  158. package/glsl3/Perforate.glsl +82 -0
  159. package/glsl3/PerlinDissolve.glsl +0 -6
  160. package/glsl3/PhotoDevelop.glsl +1 -6
  161. package/glsl3/PinchLift.glsl +114 -0
  162. package/glsl3/Pinwheel.glsl +2 -1
  163. package/glsl3/PixelStretch.glsl +1 -3
  164. package/glsl3/Pixelize.glsl +0 -2
  165. package/glsl3/PlasmaDissolve.glsl +0 -5
  166. package/glsl3/PlusWipe.glsl +0 -2
  167. package/glsl3/PointCharges.glsl +79 -0
  168. package/glsl3/PopIn.glsl +1 -4
  169. package/glsl3/PosterPaste.glsl +200 -0
  170. package/glsl3/PowerKaleido.glsl +0 -1
  171. package/glsl3/PrimaryLights.glsl +62 -0
  172. package/glsl3/Prisms.glsl +0 -4
  173. package/glsl3/ProjectorThrow.glsl +0 -9
  174. package/glsl3/Pupil.glsl +169 -0
  175. package/glsl3/Puzzle.glsl +1 -8
  176. package/glsl3/PuzzleCube.glsl +0 -10
  177. package/glsl3/QuadTurn.glsl +182 -0
  178. package/glsl3/QuadtreeBlocks.glsl +95 -0
  179. package/glsl3/RadialWipe.glsl +1 -1
  180. package/glsl3/RainPuddle.glsl +81 -0
  181. package/glsl3/Reassemble.glsl +0 -7
  182. package/glsl3/RectangleCover.glsl +0 -2
  183. package/glsl3/RectangleIris.glsl +0 -2
  184. package/glsl3/ReededGlass.glsl +66 -0
  185. package/glsl3/Reflow.glsl +55 -0
  186. package/glsl3/Refraction.glsl +0 -8
  187. package/glsl3/Revolve.glsl +1 -4
  188. package/glsl3/RibbonTwist.glsl +0 -4
  189. package/glsl3/RingSpin.glsl +0 -3
  190. package/glsl3/RingsWipe.glsl +0 -4
  191. package/glsl3/Ripple.glsl +1 -0
  192. package/glsl3/RotateScaleFade.glsl +1 -0
  193. package/glsl3/RotateScaleVanish.glsl +1 -1
  194. package/glsl3/Runway.glsl +92 -0
  195. package/glsl3/SandDrift.glsl +102 -0
  196. package/glsl3/SawtoothWipe.glsl +0 -4
  197. package/glsl3/ScreenPrintWipe.glsl +152 -0
  198. package/glsl3/SequinStroke.glsl +158 -0
  199. package/glsl3/Shatter.glsl +0 -14
  200. package/glsl3/Shockwave.glsl +0 -13
  201. package/glsl3/ShoreWash.glsl +1 -18
  202. package/glsl3/Shred.glsl +0 -6
  203. package/glsl3/ShutterWipe.glsl +0 -8
  204. package/glsl3/SimpleZoomOut.glsl +1 -0
  205. package/glsl3/SketchDissolve.glsl +0 -8
  206. package/glsl3/SkyLanterns.glsl +123 -0
  207. package/glsl3/SlashSplit.glsl +86 -0
  208. package/glsl3/SlideProjector.glsl +125 -0
  209. package/glsl3/SlitStretch.glsl +71 -0
  210. package/glsl3/SlitThread.glsl +91 -0
  211. package/glsl3/SlotReels.glsl +0 -13
  212. package/glsl3/SmokeDissolve.glsl +1 -6
  213. package/glsl3/SnakeBlockWipe.glsl +0 -5
  214. package/glsl3/Snap.glsl +92 -0
  215. package/glsl3/Snapshot.glsl +2 -8
  216. package/glsl3/Snowflake.glsl +119 -0
  217. package/glsl3/Soak.glsl +105 -0
  218. package/glsl3/SoapDrop.glsl +108 -0
  219. package/glsl3/SoapFilm.glsl +71 -0
  220. package/glsl3/SourceSink.glsl +62 -0
  221. package/glsl3/SpeedLines.glsl +93 -0
  222. package/glsl3/Sphere.glsl +0 -9
  223. package/glsl3/SpinningTop.glsl +173 -0
  224. package/glsl3/SpiralBlockWipe.glsl +0 -6
  225. package/glsl3/SpiralLines.glsl +66 -0
  226. package/glsl3/SplatterWipe.glsl +1 -8
  227. package/glsl3/SplitFlap.glsl +1 -5
  228. package/glsl3/SpotlightWipe.glsl +1 -4
  229. package/glsl3/SquaresWipe.glsl +1 -0
  230. package/glsl3/Steamroll.glsl +43 -0
  231. package/glsl3/StereoViewer.glsl +5 -24
  232. package/glsl3/StickySplit.glsl +105 -0
  233. package/glsl3/StopMotion.glsl +4 -10
  234. package/glsl3/Stratify.glsl +74 -0
  235. package/glsl3/StretchSlide.glsl +0 -5
  236. package/glsl3/StripDatamoshGlitch.glsl +0 -6
  237. package/glsl3/StrobeToss.glsl +78 -0
  238. package/glsl3/Subdivide.glsl +113 -0
  239. package/glsl3/Swap.glsl +0 -1
  240. package/glsl3/Swim.glsl +131 -0
  241. package/glsl3/Swirl.glsl +0 -5
  242. package/glsl3/Tableau.glsl +90 -0
  243. package/glsl3/TangentMotionBlur.glsl +5 -14
  244. package/glsl3/TileBlast.glsl +182 -0
  245. package/glsl3/TileConveyor.glsl +144 -0
  246. package/glsl3/TileRings.glsl +147 -0
  247. package/glsl3/TileShuffle.glsl +221 -0
  248. package/glsl3/TriangleFlip.glsl +181 -0
  249. package/glsl3/TruchetWipe.glsl +0 -9
  250. package/glsl3/Tumble.glsl +0 -10
  251. package/glsl3/Tunnel.glsl +0 -2
  252. package/glsl3/TvLostSignal.glsl +0 -4
  253. package/glsl3/TvRoll.glsl +0 -3
  254. package/glsl3/TvStatic.glsl +0 -1
  255. package/glsl3/TvTurnOff.glsl +1 -2
  256. package/glsl3/Umbrella.glsl +119 -0
  257. package/glsl3/Unbox.glsl +198 -0
  258. package/glsl3/UndulatingBurnOut.glsl +1 -1
  259. package/glsl3/Unstack.glsl +141 -0
  260. package/glsl3/Unstir.glsl +61 -0
  261. package/glsl3/Vaporize.glsl +0 -10
  262. package/glsl3/VerticalClose.glsl +1 -0
  263. package/glsl3/VhsTracking.glsl +5 -15
  264. package/glsl3/ViscousFingers.glsl +116 -0
  265. package/glsl3/Vortex.glsl +3 -12
  266. package/glsl3/WarpSpeed.glsl +0 -14
  267. package/glsl3/WaterDrop.glsl +0 -10
  268. package/glsl3/WatercolorDissolve.glsl +166 -0
  269. package/glsl3/WaterfallWipe.glsl +139 -0
  270. package/glsl3/WaveWipe.glsl +0 -15
  271. package/glsl3/WedgeWipe.glsl +2 -4
  272. package/glsl3/WhipPan.glsl +0 -1
  273. package/glsl3/WhipSpin.glsl +0 -2
  274. package/glsl3/WhipTilt.glsl +0 -2
  275. package/glsl3/Whirlwind.glsl +63 -0
  276. package/glsl3/Whittle.glsl +110 -0
  277. package/glsl3/Wormhole.glsl +101 -0
  278. package/glsl3/Wrench.glsl +256 -0
  279. package/glsl3/XorWipe.glsl +41 -0
  280. package/glsl3/ZoomInCircles.glsl +0 -4
  281. package/glsl3/ZoomWipeLeft.glsl +1 -0
  282. package/glsl3/ZoomWipeRight.glsl +1 -0
  283. package/index.d.ts +6 -0
  284. package/index.js +1 -1
  285. package/layouts.json +4286 -799
  286. package/llms-full.txt +2492 -470
  287. package/llms.txt +350 -238
  288. package/msl/BandWipe.metal +160 -176
  289. package/msl/BeadUp.metal +483 -0
  290. package/msl/BillowWipe.metal +329 -0
  291. package/msl/Bite.metal +733 -0
  292. package/msl/BlockSlide.metal +239 -255
  293. package/msl/Blossom.metal +670 -0
  294. package/msl/Bottleneck.metal +192 -0
  295. package/msl/BowTieHorizontal.metal +78 -87
  296. package/msl/BrickCollapse.metal +607 -0
  297. package/msl/BurnThrough.metal +97 -110
  298. package/msl/ButterflyFlight.metal +371 -0
  299. package/msl/ButterflyWaveScrawler.metal +74 -90
  300. package/msl/CardDeal.metal +304 -320
  301. package/msl/CellDissolve.metal +142 -152
  302. package/msl/CirclePacking.metal +470 -0
  303. package/msl/Cleave.metal +310 -0
  304. package/msl/CloudDive.metal +345 -0
  305. package/msl/CoinSettle.metal +347 -0
  306. package/msl/ComicPanels.metal +312 -328
  307. package/msl/Condensation.metal +778 -0
  308. package/msl/CorePunch.metal +914 -0
  309. package/msl/CornerPin.metal +492 -0
  310. package/msl/Crankshaft.metal +550 -0
  311. package/msl/Craze.metal +706 -0
  312. package/msl/Crumple.metal +339 -352
  313. package/msl/Cymatics.metal +317 -0
  314. package/msl/DamBreak.metal +461 -0
  315. package/msl/Deinterleave.metal +390 -0
  316. package/msl/DiffuseDissolve.metal +193 -0
  317. package/msl/DiscCascade.metal +329 -0
  318. package/msl/DominoFall.metal +47 -48
  319. package/msl/Donut.metal +652 -0
  320. package/msl/DropHop.metal +501 -0
  321. package/msl/EqualizerWipe.metal +438 -0
  322. package/msl/FacetedGlass.metal +291 -307
  323. package/msl/Faint.metal +367 -0
  324. package/msl/FalseReflection.metal +293 -0
  325. package/msl/FieldReversal.metal +539 -0
  326. package/msl/FilmDissolve.metal +45 -55
  327. package/msl/FilmLeader.metal +814 -0
  328. package/msl/FilmStrip.metal +155 -171
  329. package/msl/FlowDissolve.metal +399 -0
  330. package/msl/Flutter.metal +513 -0
  331. package/msl/FurShake.metal +481 -0
  332. package/msl/Gape.metal +337 -0
  333. package/msl/GlassRelief.metal +330 -0
  334. package/msl/GlitchFlicker.metal +321 -332
  335. package/msl/GlitchMemories.metal +45 -52
  336. package/msl/GlitterDissolve.metal +173 -189
  337. package/msl/Globe.metal +477 -0
  338. package/msl/GoldenSpiral.metal +344 -0
  339. package/msl/HeatHaze.metal +121 -137
  340. package/msl/HerringboneFold.metal +413 -0
  341. package/msl/HingedSquares.metal +235 -251
  342. package/msl/Hologram.metal +181 -197
  343. package/msl/HoneyDrip.metal +652 -0
  344. package/msl/HyperbolicMosaic.metal +408 -0
  345. package/msl/Inchworm.metal +579 -0
  346. package/msl/InsetWipe.metal +81 -91
  347. package/msl/InterlaceWipe.metal +238 -0
  348. package/msl/InvertedPageCurl.metal +1 -1
  349. package/msl/IrisFold.metal +281 -0
  350. package/msl/Kite.metal +772 -0
  351. package/msl/Knead.metal +678 -0
  352. package/msl/LayoutGrid.metal +237 -253
  353. package/msl/LeafWipe.metal +34 -42
  354. package/msl/LensFlare.metal +193 -209
  355. package/msl/LensPush.metal +312 -0
  356. package/msl/LensWipe.metal +295 -0
  357. package/msl/LightningRift.metal +602 -0
  358. package/msl/LineFeed.metal +212 -0
  359. package/msl/LiquidFill.metal +198 -211
  360. package/msl/LuminanceMelt.metal +108 -126
  361. package/msl/MarblingDissolve.metal +327 -0
  362. package/msl/MicroBrickCascade.metal +240 -0
  363. package/msl/MoireWipe.metal +95 -105
  364. package/msl/Nightfall.metal +302 -0
  365. package/msl/NoiseDissolve.metal +29 -29
  366. package/msl/OutlineCrumble.metal +692 -0
  367. package/msl/OutlineFill.metal +285 -0
  368. package/msl/OutlineTear.metal +437 -0
  369. package/msl/PaintBucket.metal +323 -0
  370. package/msl/PaintDissolve.metal +1151 -0
  371. package/msl/PaperLayers.metal +518 -0
  372. package/msl/PaperPlane.metal +1045 -0
  373. package/msl/ParallaxPush.metal +312 -0
  374. package/msl/Perforate.metal +468 -0
  375. package/msl/PhotoDevelop.metal +89 -99
  376. package/msl/PinchLift.metal +494 -0
  377. package/msl/Pinwheel.metal +32 -32
  378. package/msl/PlasmaDissolve.metal +54 -64
  379. package/msl/PointCharges.metal +399 -0
  380. package/msl/PosterPaste.metal +952 -0
  381. package/msl/PrimaryLights.metal +347 -0
  382. package/msl/ProjectorThrow.metal +108 -124
  383. package/msl/Pupil.metal +784 -0
  384. package/msl/Puzzle.metal +154 -150
  385. package/msl/QuadTurn.metal +1048 -0
  386. package/msl/QuadtreeBlocks.metal +493 -0
  387. package/msl/RadialWipe.metal +27 -25
  388. package/msl/RainPuddle.metal +397 -0
  389. package/msl/ReededGlass.metal +314 -0
  390. package/msl/Reflow.metal +306 -0
  391. package/msl/Revolve.metal +61 -77
  392. package/msl/RingsWipe.metal +153 -163
  393. package/msl/Runway.metal +476 -0
  394. package/msl/SandDrift.metal +497 -0
  395. package/msl/SawtoothWipe.metal +114 -124
  396. package/msl/ScreenPrintWipe.metal +577 -0
  397. package/msl/SequinStroke.metal +819 -0
  398. package/msl/Shatter.metal +562 -578
  399. package/msl/Shockwave.metal +123 -139
  400. package/msl/SkyLanterns.metal +606 -0
  401. package/msl/SlashSplit.metal +372 -0
  402. package/msl/SlideProjector.metal +536 -0
  403. package/msl/SlitStretch.metal +338 -0
  404. package/msl/SlitThread.metal +508 -0
  405. package/msl/SnakeBlockWipe.metal +73 -83
  406. package/msl/Snap.metal +521 -0
  407. package/msl/Snowflake.metal +663 -0
  408. package/msl/Soak.metal +500 -0
  409. package/msl/SoapDrop.metal +463 -0
  410. package/msl/SoapFilm.metal +360 -0
  411. package/msl/SourceSink.metal +355 -0
  412. package/msl/SpeedLines.metal +401 -0
  413. package/msl/Sphere.metal +193 -206
  414. package/msl/SpinningTop.metal +800 -0
  415. package/msl/SpiralBlockWipe.metal +119 -135
  416. package/msl/SpiralLines.metal +356 -0
  417. package/msl/Steamroll.metal +219 -0
  418. package/msl/StereoViewer.metal +73 -91
  419. package/msl/StickySplit.metal +490 -0
  420. package/msl/Stratify.metal +392 -0
  421. package/msl/StripDatamoshGlitch.metal +216 -232
  422. package/msl/StrobeToss.metal +408 -0
  423. package/msl/Subdivide.metal +566 -0
  424. package/msl/Swim.metal +687 -0
  425. package/msl/Tableau.metal +381 -0
  426. package/msl/TangentMotionBlur.metal +294 -294
  427. package/msl/TileBlast.metal +913 -0
  428. package/msl/TileConveyor.metal +718 -0
  429. package/msl/TileRings.metal +809 -0
  430. package/msl/TileShuffle.metal +1182 -0
  431. package/msl/TriangleFlip.metal +752 -0
  432. package/msl/TruchetWipe.metal +127 -143
  433. package/msl/Umbrella.metal +574 -0
  434. package/msl/Unbox.metal +1094 -0
  435. package/msl/Unstack.metal +630 -0
  436. package/msl/Unstir.metal +322 -0
  437. package/msl/VhsTracking.metal +299 -288
  438. package/msl/ViscousFingers.metal +567 -0
  439. package/msl/Vortex.metal +326 -316
  440. package/msl/WaterDrop.metal +181 -197
  441. package/msl/WatercolorDissolve.metal +791 -0
  442. package/msl/WaterfallWipe.metal +592 -0
  443. package/msl/WaveWipe.metal +343 -359
  444. package/msl/WedgeWipe.metal +59 -67
  445. package/msl/Whirlwind.metal +275 -0
  446. package/msl/Whittle.metal +554 -0
  447. package/msl/Wormhole.metal +505 -0
  448. package/msl/Wrench.metal +1361 -0
  449. package/msl/XorWipe.metal +238 -0
  450. package/package.json +1 -1
  451. package/skills/gl-transitions/SKILL.md +4 -2
  452. package/skills/gl-transitions/references/catalog.md +374 -112
  453. package/skills/gl-transitions/references/native.md +1 -1
  454. package/skills/gl-transitions/references/webgl.md +1 -1
  455. package/sksl/Accordion.sksl +0 -7
  456. package/sksl/ApertureWipe.sksl +0 -2
  457. package/sksl/ArrowWipe.sksl +0 -7
  458. package/sksl/Ascii.sksl +0 -7
  459. package/sksl/BandWipe.sksl +0 -6
  460. package/sksl/BeadUp.sksl +108 -0
  461. package/sksl/BillowWipe.sksl +104 -0
  462. package/sksl/Bite.sksl +177 -0
  463. package/sksl/BlockCover.sksl +0 -2
  464. package/sksl/BlockSlide.sksl +0 -9
  465. package/sksl/BloomDissolve.sksl +0 -7
  466. package/sksl/Blossom.sksl +121 -0
  467. package/sksl/BokehDissolve.sksl +0 -6
  468. package/sksl/BookFlip.sksl +0 -12
  469. package/sksl/Bottleneck.sksl +54 -0
  470. package/sksl/Bounce.sksl +1 -1
  471. package/sksl/BowTieHorizontal.sksl +1 -8
  472. package/sksl/BrickCollapse.sksl +152 -0
  473. package/sksl/BrushWipe.sksl +5 -5
  474. package/sksl/BurnThrough.sksl +2 -3
  475. package/sksl/ButterflyFlight.sksl +80 -0
  476. package/sksl/ButterflyWaveScrawler.sksl +0 -3
  477. package/sksl/CameraShake.sksl +1 -6
  478. package/sksl/CardDeal.sksl +0 -19
  479. package/sksl/CardSwipe.sksl +2 -8
  480. package/sksl/CellDissolve.sksl +0 -6
  481. package/sksl/CircleBurst.sksl +0 -4
  482. package/sksl/CirclePacking.sksl +119 -0
  483. package/sksl/Cleave.sksl +93 -0
  484. package/sksl/Clothesline.sksl +6 -18
  485. package/sksl/CloudDive.sksl +84 -0
  486. package/sksl/CodeRain.sksl +0 -11
  487. package/sksl/CoinSettle.sksl +93 -0
  488. package/sksl/ColorPanelWipe.sksl +0 -6
  489. package/sksl/Comb.sksl +0 -1
  490. package/sksl/ComicPanels.sksl +0 -11
  491. package/sksl/Condensation.sksl +161 -0
  492. package/sksl/CorePunch.sksl +162 -0
  493. package/sksl/CornerPin.sksl +85 -0
  494. package/sksl/Crankshaft.sksl +109 -0
  495. package/sksl/Craze.sksl +135 -0
  496. package/sksl/CrossZoom.sksl +0 -1
  497. package/sksl/Crumple.sksl +0 -9
  498. package/sksl/Cube.sksl +0 -9
  499. package/sksl/CurtainRise.sksl +0 -9
  500. package/sksl/Curtains.sksl +3 -6
  501. package/sksl/CurvedWipe.sksl +0 -3
  502. package/sksl/CylinderRoll.sksl +1 -8
  503. package/sksl/Cymatics.sksl +96 -0
  504. package/sksl/DamBreak.sksl +115 -0
  505. package/sksl/Deinterleave.sksl +93 -0
  506. package/sksl/DiamondWipe.sksl +0 -1
  507. package/sksl/DiffuseDissolve.sksl +55 -0
  508. package/sksl/DiscCascade.sksl +87 -0
  509. package/sksl/Disintegrate.sksl +0 -6
  510. package/sksl/DominoFall.sksl +1 -11
  511. package/sksl/Donut.sksl +146 -0
  512. package/sksl/DoomMelt.sksl +0 -1
  513. package/sksl/Doorway.sksl +0 -7
  514. package/sksl/Drape.sksl +1 -13
  515. package/sksl/DreamyZoom.sksl +0 -4
  516. package/sksl/DropHop.sksl +119 -0
  517. package/sksl/DuotoneFade.sksl +0 -3
  518. package/sksl/EchoSlide.sksl +0 -4
  519. package/sksl/EqualizerWipe.sksl +113 -0
  520. package/sksl/EyeBlink.sksl +0 -7
  521. package/sksl/FacetedGlass.sksl +0 -15
  522. package/sksl/Faint.sksl +81 -0
  523. package/sksl/FallOver.sksl +0 -2
  524. package/sksl/FalseReflection.sksl +74 -0
  525. package/sksl/FieldReversal.sksl +126 -0
  526. package/sksl/FilmDissolve.sksl +0 -3
  527. package/sksl/FilmLeader.sksl +192 -0
  528. package/sksl/FilmStrip.sksl +0 -10
  529. package/sksl/FlameWipe.sksl +0 -18
  530. package/sksl/FlowDissolve.sksl +97 -0
  531. package/sksl/Flutter.sksl +118 -0
  532. package/sksl/FrostWipe.sksl +3 -15
  533. package/sksl/Funnel.sksl +0 -6
  534. package/sksl/FurShake.sksl +124 -0
  535. package/sksl/Gallery.sksl +3 -9
  536. package/sksl/Gape.sksl +78 -0
  537. package/sksl/GeometricCollage.sksl +0 -6
  538. package/sksl/GlassRelief.sksl +88 -0
  539. package/sksl/GlintDissolve.sksl +0 -9
  540. package/sksl/GlitchDisplace.sksl +0 -3
  541. package/sksl/GlitchFlicker.sksl +4 -5
  542. package/sksl/GlitchMemories.sksl +1 -1
  543. package/sksl/GlitterDissolve.sksl +0 -10
  544. package/sksl/Globe.sksl +109 -0
  545. package/sksl/GlowDissolve.sksl +1 -1
  546. package/sksl/GoldenSpiral.sksl +97 -0
  547. package/sksl/GooeyWipe.sksl +3 -6
  548. package/sksl/GravityLens.sksl +0 -5
  549. package/sksl/GridFlip.sksl +0 -10
  550. package/sksl/Halftone.sksl +1 -3
  551. package/sksl/HeartWipe.sksl +0 -1
  552. package/sksl/HeatHaze.sksl +0 -9
  553. package/sksl/HerringboneFold.sksl +94 -0
  554. package/sksl/HingedSquares.sksl +0 -7
  555. package/sksl/Hologram.sksl +0 -15
  556. package/sksl/HoneyDrip.sksl +130 -0
  557. package/sksl/Honeycomb.sksl +0 -3
  558. package/sksl/HorizontalHold.sksl +0 -5
  559. package/sksl/HyperbolicMosaic.sksl +103 -0
  560. package/sksl/Inchworm.sksl +123 -0
  561. package/sksl/InkBleed.sksl +2 -6
  562. package/sksl/InsetWipe.sksl +0 -3
  563. package/sksl/InsideCube.sksl +0 -9
  564. package/sksl/InterlaceWipe.sksl +72 -0
  565. package/sksl/InvertedPageCurl.sksl +2 -4
  566. package/sksl/IrisFold.sksl +74 -0
  567. package/sksl/KeyholeWipe.sksl +0 -6
  568. package/sksl/Kite.sksl +138 -0
  569. package/sksl/Knead.sksl +133 -0
  570. package/sksl/LayoutGrid.sksl +0 -12
  571. package/sksl/LeafWipe.sksl +1 -4
  572. package/sksl/LedWall.sksl +0 -11
  573. package/sksl/LensFlare.sksl +0 -10
  574. package/sksl/LensPush.sksl +89 -0
  575. package/sksl/LensWipe.sksl +87 -0
  576. package/sksl/LichtenbergBurn.sksl +100 -0
  577. package/sksl/LightRays.sksl +0 -8
  578. package/sksl/LightStreaks.sksl +0 -5
  579. package/sksl/LightWipe.sksl +0 -9
  580. package/sksl/LightningFlash.sksl +0 -13
  581. package/sksl/LightningRift.sksl +103 -0
  582. package/sksl/LineFeed.sksl +52 -0
  583. package/sksl/LiquidFill.sksl +0 -13
  584. package/sksl/LissajousTiles.sksl +3 -3
  585. package/sksl/LuminanceMelt.sksl +1 -11
  586. package/sksl/MarblingDissolve.sksl +88 -0
  587. package/sksl/MicroBrickCascade.sksl +101 -0
  588. package/sksl/MoireWipe.sksl +0 -9
  589. package/sksl/Nightfall.sksl +74 -0
  590. package/sksl/NoiseDissolve.sksl +1 -1
  591. package/sksl/OutlineCrumble.sksl +114 -0
  592. package/sksl/OutlineFill.sksl +74 -0
  593. package/sksl/OutlineTear.sksl +104 -0
  594. package/sksl/Overexposure.sksl +0 -1
  595. package/sksl/PaintBucket.sksl +77 -0
  596. package/sksl/PaintDissolve.sksl +175 -0
  597. package/sksl/PaperFold.sksl +0 -12
  598. package/sksl/PaperLayers.sksl +144 -0
  599. package/sksl/PaperPlane.sksl +176 -0
  600. package/sksl/PaperTear.sksl +0 -2
  601. package/sksl/ParallaxPush.sksl +96 -0
  602. package/sksl/Perforate.sksl +91 -0
  603. package/sksl/PerlinDissolve.sksl +0 -6
  604. package/sksl/PhotoDevelop.sksl +0 -6
  605. package/sksl/PinchLift.sksl +124 -0
  606. package/sksl/Pinwheel.sksl +2 -1
  607. package/sksl/PixelStretch.sksl +0 -3
  608. package/sksl/PlasmaDissolve.sksl +0 -5
  609. package/sksl/PlusWipe.sksl +0 -1
  610. package/sksl/PointCharges.sksl +92 -0
  611. package/sksl/PopIn.sksl +0 -3
  612. package/sksl/PosterPaste.sksl +205 -0
  613. package/sksl/PowerKaleido.sksl +0 -1
  614. package/sksl/PrimaryLights.sksl +74 -0
  615. package/sksl/Prisms.sksl +0 -4
  616. package/sksl/ProjectorThrow.sksl +0 -8
  617. package/sksl/Pupil.sksl +180 -0
  618. package/sksl/Puzzle.sksl +1 -8
  619. package/sksl/PuzzleCube.sksl +0 -8
  620. package/sksl/QuadTurn.sksl +191 -0
  621. package/sksl/QuadtreeBlocks.sksl +102 -0
  622. package/sksl/RadialWipe.sksl +1 -1
  623. package/sksl/RainPuddle.sksl +93 -0
  624. package/sksl/Reassemble.sksl +0 -6
  625. package/sksl/RectangleCover.sksl +0 -2
  626. package/sksl/RectangleIris.sksl +0 -2
  627. package/sksl/ReededGlass.sksl +79 -0
  628. package/sksl/Reflow.sksl +67 -0
  629. package/sksl/Refraction.sksl +0 -6
  630. package/sksl/Revolve.sksl +0 -3
  631. package/sksl/RibbonTwist.sksl +0 -4
  632. package/sksl/RingSpin.sksl +0 -2
  633. package/sksl/RingsWipe.sksl +0 -4
  634. package/sksl/RotateScaleVanish.sksl +1 -1
  635. package/sksl/Runway.sksl +102 -0
  636. package/sksl/SandDrift.sksl +112 -0
  637. package/sksl/SawtoothWipe.sksl +0 -3
  638. package/sksl/ScreenPrintWipe.sksl +163 -0
  639. package/sksl/SequinStroke.sksl +169 -0
  640. package/sksl/Shatter.sksl +0 -9
  641. package/sksl/Shockwave.sksl +0 -13
  642. package/sksl/ShoreWash.sksl +0 -17
  643. package/sksl/Shred.sksl +0 -5
  644. package/sksl/ShutterWipe.sksl +0 -8
  645. package/sksl/SketchDissolve.sksl +0 -8
  646. package/sksl/SkyLanterns.sksl +133 -0
  647. package/sksl/SlashSplit.sksl +94 -0
  648. package/sksl/SlideProjector.sksl +130 -0
  649. package/sksl/SlitStretch.sksl +84 -0
  650. package/sksl/SlitThread.sksl +104 -0
  651. package/sksl/SlotReels.sksl +0 -12
  652. package/sksl/SmokeDissolve.sksl +0 -6
  653. package/sksl/SnakeBlockWipe.sksl +0 -5
  654. package/sksl/Snap.sksl +102 -0
  655. package/sksl/Snapshot.sksl +2 -7
  656. package/sksl/Snowflake.sksl +128 -0
  657. package/sksl/Soak.sksl +118 -0
  658. package/sksl/SoapDrop.sksl +119 -0
  659. package/sksl/SoapFilm.sksl +82 -0
  660. package/sksl/SourceSink.sksl +73 -0
  661. package/sksl/SpeedLines.sksl +101 -0
  662. package/sksl/Sphere.sksl +0 -9
  663. package/sksl/SpinningTop.sksl +180 -0
  664. package/sksl/SpiralBlockWipe.sksl +0 -6
  665. package/sksl/SpiralLines.sksl +78 -0
  666. package/sksl/SplatterWipe.sksl +1 -7
  667. package/sksl/SplitFlap.sksl +0 -4
  668. package/sksl/SpotlightWipe.sksl +0 -4
  669. package/sksl/Steamroll.sksl +56 -0
  670. package/sksl/StereoViewer.sksl +5 -12
  671. package/sksl/StickySplit.sksl +118 -0
  672. package/sksl/StopMotion.sksl +3 -8
  673. package/sksl/Stratify.sksl +83 -0
  674. package/sksl/StretchSlide.sksl +0 -4
  675. package/sksl/StripDatamoshGlitch.sksl +0 -6
  676. package/sksl/StrobeToss.sksl +89 -0
  677. package/sksl/Subdivide.sksl +121 -0
  678. package/sksl/Swim.sksl +140 -0
  679. package/sksl/Swirl.sksl +0 -5
  680. package/sksl/Tableau.sksl +101 -0
  681. package/sksl/TangentMotionBlur.sksl +5 -11
  682. package/sksl/TileBlast.sksl +191 -0
  683. package/sksl/TileConveyor.sksl +156 -0
  684. package/sksl/TileRings.sksl +158 -0
  685. package/sksl/TileShuffle.sksl +220 -0
  686. package/sksl/TriangleFlip.sksl +191 -0
  687. package/sksl/TruchetWipe.sksl +0 -8
  688. package/sksl/Tumble.sksl +0 -8
  689. package/sksl/Tunnel.sksl +0 -2
  690. package/sksl/TvLostSignal.sksl +0 -4
  691. package/sksl/TvRoll.sksl +0 -3
  692. package/sksl/TvTurnOff.sksl +0 -2
  693. package/sksl/Umbrella.sksl +129 -0
  694. package/sksl/Unbox.sksl +205 -0
  695. package/sksl/UndulatingBurnOut.sksl +1 -1
  696. package/sksl/Unstack.sksl +154 -0
  697. package/sksl/Unstir.sksl +74 -0
  698. package/sksl/Vaporize.sksl +0 -10
  699. package/sksl/VhsTracking.sksl +4 -14
  700. package/sksl/ViscousFingers.sksl +126 -0
  701. package/sksl/Vortex.sksl +3 -11
  702. package/sksl/WarpSpeed.sksl +0 -14
  703. package/sksl/WaterDrop.sksl +0 -9
  704. package/sksl/WatercolorDissolve.sksl +176 -0
  705. package/sksl/WaterfallWipe.sksl +152 -0
  706. package/sksl/WaveWipe.sksl +0 -14
  707. package/sksl/WedgeWipe.sksl +2 -4
  708. package/sksl/WhipPan.sksl +0 -1
  709. package/sksl/WhipSpin.sksl +0 -1
  710. package/sksl/WhipTilt.sksl +0 -2
  711. package/sksl/Whirlwind.sksl +76 -0
  712. package/sksl/Whittle.sksl +120 -0
  713. package/sksl/Wormhole.sksl +112 -0
  714. package/sksl/Wrench.sksl +263 -0
  715. package/sksl/XorWipe.sksl +54 -0
  716. package/sksl/ZoomInCircles.sksl +0 -4
  717. package/sksl/index.js +1 -1
  718. package/transitions/Accordion.glsl +1 -10
  719. package/transitions/ApertureWipe.glsl +0 -2
  720. package/transitions/ArrowWipe.glsl +0 -7
  721. package/transitions/Ascii.glsl +1 -12
  722. package/transitions/BandWipe.glsl +0 -7
  723. package/transitions/BeadUp.glsl +95 -0
  724. package/transitions/BillowWipe.glsl +92 -0
  725. package/transitions/Bite.glsl +166 -0
  726. package/transitions/BlockCover.glsl +1 -4
  727. package/transitions/BlockSlide.glsl +1 -11
  728. package/transitions/BloomDissolve.glsl +0 -9
  729. package/transitions/Blossom.glsl +109 -0
  730. package/transitions/BokehDissolve.glsl +1 -8
  731. package/transitions/BookFlip.glsl +1 -13
  732. package/transitions/Bottleneck.glsl +40 -0
  733. package/transitions/Bounce.glsl +1 -1
  734. package/transitions/BowTieHorizontal.glsl +1 -8
  735. package/transitions/BrickCollapse.glsl +139 -0
  736. package/transitions/BrushWipe.glsl +5 -6
  737. package/transitions/BurnThrough.glsl +2 -3
  738. package/transitions/ButterflyFlight.glsl +68 -0
  739. package/transitions/ButterflyWaveScrawler.glsl +0 -3
  740. package/transitions/CameraShake.glsl +2 -7
  741. package/transitions/CardDeal.glsl +0 -21
  742. package/transitions/CardSwipe.glsl +2 -9
  743. package/transitions/CellDissolve.glsl +0 -7
  744. package/transitions/CircleBurst.glsl +1 -9
  745. package/transitions/CircleIris.glsl +1 -0
  746. package/transitions/CirclePacking.glsl +105 -0
  747. package/transitions/Cleave.glsl +79 -0
  748. package/transitions/Clothesline.glsl +6 -27
  749. package/transitions/CloudDive.glsl +71 -0
  750. package/transitions/CodeRain.glsl +0 -12
  751. package/transitions/CoinSettle.glsl +79 -0
  752. package/transitions/ColorPanelWipe.glsl +2 -9
  753. package/transitions/Comb.glsl +0 -1
  754. package/transitions/ComicPanels.glsl +0 -16
  755. package/transitions/Condensation.glsl +153 -0
  756. package/transitions/CorePunch.glsl +151 -0
  757. package/transitions/CornerPin.glsl +74 -0
  758. package/transitions/Crankshaft.glsl +97 -0
  759. package/transitions/Craze.glsl +122 -0
  760. package/transitions/CrossZoom.glsl +1 -1
  761. package/transitions/Crumple.glsl +1 -11
  762. package/transitions/Cube.glsl +1 -9
  763. package/transitions/CurtainRise.glsl +0 -9
  764. package/transitions/Curtains.glsl +3 -6
  765. package/transitions/CurvedWipe.glsl +0 -3
  766. package/transitions/CylinderRoll.glsl +2 -10
  767. package/transitions/Cymatics.glsl +82 -0
  768. package/transitions/DamBreak.glsl +102 -0
  769. package/transitions/Deinterleave.glsl +80 -0
  770. package/transitions/DiamondWipe.glsl +0 -1
  771. package/transitions/DiffuseDissolve.glsl +43 -0
  772. package/transitions/DirectionalScaled.glsl +1 -0
  773. package/transitions/DiscCascade.glsl +73 -0
  774. package/transitions/Disintegrate.glsl +1 -9
  775. package/transitions/DominoFall.glsl +1 -12
  776. package/transitions/Donut.glsl +134 -0
  777. package/transitions/DoomMelt.glsl +1 -5
  778. package/transitions/Doorway.glsl +1 -9
  779. package/transitions/Drape.glsl +1 -15
  780. package/transitions/DreamyZoom.glsl +2 -10
  781. package/transitions/DropHop.glsl +106 -0
  782. package/transitions/DuotoneFade.glsl +1 -3
  783. package/transitions/EchoSlide.glsl +0 -7
  784. package/transitions/EqualizerWipe.glsl +102 -0
  785. package/transitions/EyeBlink.glsl +0 -7
  786. package/transitions/FacetedGlass.glsl +0 -17
  787. package/transitions/Faint.glsl +68 -0
  788. package/transitions/FallOver.glsl +0 -2
  789. package/transitions/FalseReflection.glsl +60 -0
  790. package/transitions/FieldReversal.glsl +113 -0
  791. package/transitions/FilmBurn.glsl +1 -0
  792. package/transitions/FilmDissolve.glsl +0 -4
  793. package/transitions/FilmLeader.glsl +184 -0
  794. package/transitions/FilmStrip.glsl +1 -12
  795. package/transitions/Fisheye.glsl +1 -0
  796. package/transitions/FlameWipe.glsl +1 -22
  797. package/transitions/FlowDissolve.glsl +84 -0
  798. package/transitions/Flutter.glsl +106 -0
  799. package/transitions/FrostWipe.glsl +3 -18
  800. package/transitions/Funnel.glsl +0 -7
  801. package/transitions/FurShake.glsl +111 -0
  802. package/transitions/Gallery.glsl +3 -9
  803. package/transitions/Gape.glsl +66 -0
  804. package/transitions/GeometricCollage.glsl +0 -10
  805. package/transitions/GlassRelief.glsl +74 -0
  806. package/transitions/GlintDissolve.glsl +1 -10
  807. package/transitions/GlitchDisplace.glsl +0 -3
  808. package/transitions/GlitchFlicker.glsl +5 -6
  809. package/transitions/GlitchMemories.glsl +1 -1
  810. package/transitions/GlitterDissolve.glsl +0 -15
  811. package/transitions/Globe.glsl +97 -0
  812. package/transitions/GlowDissolve.glsl +2 -1
  813. package/transitions/GoldenSpiral.glsl +83 -0
  814. package/transitions/GooeyWipe.glsl +3 -6
  815. package/transitions/GravityLens.glsl +0 -5
  816. package/transitions/GridFlip.glsl +1 -15
  817. package/transitions/Halftone.glsl +1 -3
  818. package/transitions/HeartWipe.glsl +0 -2
  819. package/transitions/HeatHaze.glsl +1 -10
  820. package/transitions/HerringboneFold.glsl +84 -0
  821. package/transitions/HingedSquares.glsl +0 -9
  822. package/transitions/Hologram.glsl +1 -18
  823. package/transitions/HoneyDrip.glsl +118 -0
  824. package/transitions/Honeycomb.glsl +0 -4
  825. package/transitions/HorizontalClose.glsl +1 -0
  826. package/transitions/HorizontalHold.glsl +0 -5
  827. package/transitions/HyperbolicMosaic.glsl +90 -0
  828. package/transitions/Inchworm.glsl +109 -0
  829. package/transitions/InkBleed.glsl +2 -6
  830. package/transitions/InsetWipe.glsl +1 -4
  831. package/transitions/InsideCube.glsl +0 -10
  832. package/transitions/InterlaceWipe.glsl +59 -0
  833. package/transitions/InvertedPageCurl.glsl +2 -5
  834. package/transitions/IrisFold.glsl +60 -0
  835. package/transitions/KeyholeWipe.glsl +0 -7
  836. package/transitions/Kite.glsl +124 -0
  837. package/transitions/Knead.glsl +124 -0
  838. package/transitions/LayoutGrid.glsl +0 -13
  839. package/transitions/LeafWipe.glsl +2 -4
  840. package/transitions/LedWall.glsl +0 -14
  841. package/transitions/LensFlare.glsl +0 -13
  842. package/transitions/LensPush.glsl +75 -0
  843. package/transitions/LensWipe.glsl +73 -0
  844. package/transitions/LichtenbergBurn.glsl +87 -0
  845. package/transitions/LightRays.glsl +2 -12
  846. package/transitions/LightStreaks.glsl +0 -8
  847. package/transitions/LightWipe.glsl +1 -13
  848. package/transitions/LightningFlash.glsl +1 -14
  849. package/transitions/LightningRift.glsl +90 -0
  850. package/transitions/LineFeed.glsl +38 -0
  851. package/transitions/LiquidFill.glsl +0 -13
  852. package/transitions/LissajousTiles.glsl +3 -4
  853. package/transitions/LuminanceMelt.glsl +1 -23
  854. package/transitions/MarblingDissolve.glsl +79 -0
  855. package/transitions/MicroBrickCascade.glsl +87 -0
  856. package/transitions/MoireWipe.glsl +0 -9
  857. package/transitions/Nightfall.glsl +60 -0
  858. package/transitions/NoiseDissolve.glsl +1 -1
  859. package/transitions/OutlineCrumble.glsl +104 -0
  860. package/transitions/OutlineFill.glsl +60 -0
  861. package/transitions/OutlineTear.glsl +92 -0
  862. package/transitions/Overexposure.glsl +0 -1
  863. package/transitions/PaintBucket.glsl +64 -0
  864. package/transitions/PaintDissolve.glsl +174 -0
  865. package/transitions/PaperFold.glsl +1 -12
  866. package/transitions/PaperLayers.glsl +135 -0
  867. package/transitions/PaperPlane.glsl +165 -0
  868. package/transitions/PaperTear.glsl +1 -5
  869. package/transitions/ParallaxPush.glsl +83 -0
  870. package/transitions/Perforate.glsl +81 -0
  871. package/transitions/PerlinDissolve.glsl +0 -6
  872. package/transitions/PhotoDevelop.glsl +1 -6
  873. package/transitions/PinchLift.glsl +113 -0
  874. package/transitions/Pinwheel.glsl +2 -1
  875. package/transitions/PixelStretch.glsl +1 -3
  876. package/transitions/Pixelize.glsl +0 -2
  877. package/transitions/PlasmaDissolve.glsl +0 -5
  878. package/transitions/PlusWipe.glsl +0 -2
  879. package/transitions/PointCharges.glsl +78 -0
  880. package/transitions/PopIn.glsl +1 -4
  881. package/transitions/PosterPaste.glsl +199 -0
  882. package/transitions/PowerKaleido.glsl +0 -1
  883. package/transitions/PrimaryLights.glsl +61 -0
  884. package/transitions/Prisms.glsl +0 -4
  885. package/transitions/ProjectorThrow.glsl +0 -9
  886. package/transitions/Pupil.glsl +168 -0
  887. package/transitions/Puzzle.glsl +1 -8
  888. package/transitions/PuzzleCube.glsl +0 -10
  889. package/transitions/QuadTurn.glsl +181 -0
  890. package/transitions/QuadtreeBlocks.glsl +94 -0
  891. package/transitions/RadialWipe.glsl +1 -1
  892. package/transitions/RainPuddle.glsl +80 -0
  893. package/transitions/Reassemble.glsl +0 -7
  894. package/transitions/RectangleCover.glsl +0 -2
  895. package/transitions/RectangleIris.glsl +0 -2
  896. package/transitions/ReededGlass.glsl +65 -0
  897. package/transitions/Reflow.glsl +54 -0
  898. package/transitions/Refraction.glsl +0 -8
  899. package/transitions/Revolve.glsl +1 -4
  900. package/transitions/RibbonTwist.glsl +0 -4
  901. package/transitions/RingSpin.glsl +0 -3
  902. package/transitions/RingsWipe.glsl +0 -4
  903. package/transitions/Ripple.glsl +1 -0
  904. package/transitions/RotateScaleFade.glsl +1 -0
  905. package/transitions/RotateScaleVanish.glsl +1 -1
  906. package/transitions/Runway.glsl +91 -0
  907. package/transitions/SandDrift.glsl +101 -0
  908. package/transitions/SawtoothWipe.glsl +0 -4
  909. package/transitions/ScreenPrintWipe.glsl +151 -0
  910. package/transitions/SequinStroke.glsl +157 -0
  911. package/transitions/Shatter.glsl +0 -14
  912. package/transitions/Shockwave.glsl +0 -13
  913. package/transitions/ShoreWash.glsl +1 -18
  914. package/transitions/Shred.glsl +0 -6
  915. package/transitions/ShutterWipe.glsl +0 -8
  916. package/transitions/SimpleZoomOut.glsl +1 -0
  917. package/transitions/SketchDissolve.glsl +0 -8
  918. package/transitions/SkyLanterns.glsl +122 -0
  919. package/transitions/SlashSplit.glsl +85 -0
  920. package/transitions/SlideProjector.glsl +124 -0
  921. package/transitions/SlitStretch.glsl +70 -0
  922. package/transitions/SlitThread.glsl +90 -0
  923. package/transitions/SlotReels.glsl +0 -13
  924. package/transitions/SmokeDissolve.glsl +1 -6
  925. package/transitions/SnakeBlockWipe.glsl +0 -5
  926. package/transitions/Snap.glsl +91 -0
  927. package/transitions/Snapshot.glsl +2 -8
  928. package/transitions/Snowflake.glsl +118 -0
  929. package/transitions/Soak.glsl +104 -0
  930. package/transitions/SoapDrop.glsl +107 -0
  931. package/transitions/SoapFilm.glsl +70 -0
  932. package/transitions/SourceSink.glsl +61 -0
  933. package/transitions/SpeedLines.glsl +92 -0
  934. package/transitions/Sphere.glsl +0 -9
  935. package/transitions/SpinningTop.glsl +172 -0
  936. package/transitions/SpiralBlockWipe.glsl +0 -6
  937. package/transitions/SpiralLines.glsl +65 -0
  938. package/transitions/SplatterWipe.glsl +1 -8
  939. package/transitions/SplitFlap.glsl +1 -5
  940. package/transitions/SpotlightWipe.glsl +1 -4
  941. package/transitions/SquaresWipe.glsl +1 -0
  942. package/transitions/Steamroll.glsl +42 -0
  943. package/transitions/StereoViewer.glsl +5 -24
  944. package/transitions/StickySplit.glsl +104 -0
  945. package/transitions/StopMotion.glsl +4 -10
  946. package/transitions/Stratify.glsl +73 -0
  947. package/transitions/StretchSlide.glsl +0 -5
  948. package/transitions/StripDatamoshGlitch.glsl +0 -6
  949. package/transitions/StrobeToss.glsl +77 -0
  950. package/transitions/Subdivide.glsl +112 -0
  951. package/transitions/Swap.glsl +0 -1
  952. package/transitions/Swim.glsl +130 -0
  953. package/transitions/Swirl.glsl +0 -5
  954. package/transitions/Tableau.glsl +89 -0
  955. package/transitions/TangentMotionBlur.glsl +5 -14
  956. package/transitions/TileBlast.glsl +181 -0
  957. package/transitions/TileConveyor.glsl +143 -0
  958. package/transitions/TileRings.glsl +146 -0
  959. package/transitions/TileShuffle.glsl +220 -0
  960. package/transitions/TriangleFlip.glsl +180 -0
  961. package/transitions/TruchetWipe.glsl +0 -9
  962. package/transitions/Tumble.glsl +0 -10
  963. package/transitions/Tunnel.glsl +0 -2
  964. package/transitions/TvLostSignal.glsl +0 -4
  965. package/transitions/TvRoll.glsl +0 -3
  966. package/transitions/TvStatic.glsl +0 -1
  967. package/transitions/TvTurnOff.glsl +1 -2
  968. package/transitions/Umbrella.glsl +118 -0
  969. package/transitions/Unbox.glsl +197 -0
  970. package/transitions/UndulatingBurnOut.glsl +1 -1
  971. package/transitions/Unstack.glsl +140 -0
  972. package/transitions/Unstir.glsl +60 -0
  973. package/transitions/Vaporize.glsl +0 -10
  974. package/transitions/VerticalClose.glsl +1 -0
  975. package/transitions/VhsTracking.glsl +5 -15
  976. package/transitions/ViscousFingers.glsl +115 -0
  977. package/transitions/Vortex.glsl +3 -12
  978. package/transitions/WarpSpeed.glsl +0 -14
  979. package/transitions/WaterDrop.glsl +0 -10
  980. package/transitions/WatercolorDissolve.glsl +165 -0
  981. package/transitions/WaterfallWipe.glsl +138 -0
  982. package/transitions/WaveWipe.glsl +0 -15
  983. package/transitions/WedgeWipe.glsl +2 -4
  984. package/transitions/WhipPan.glsl +0 -1
  985. package/transitions/WhipSpin.glsl +0 -2
  986. package/transitions/WhipTilt.glsl +0 -2
  987. package/transitions/Whirlwind.glsl +62 -0
  988. package/transitions/Whittle.glsl +109 -0
  989. package/transitions/Wormhole.glsl +100 -0
  990. package/transitions/Wrench.glsl +255 -0
  991. package/transitions/XorWipe.glsl +40 -0
  992. package/transitions/ZoomInCircles.glsl +0 -4
  993. package/transitions/ZoomWipeLeft.glsl +1 -0
  994. package/transitions/ZoomWipeRight.glsl +1 -0
  995. package/wgsl/BandWipe.wgsl +152 -168
  996. package/wgsl/BeadUp.wgsl +439 -0
  997. package/wgsl/BillowWipe.wgsl +298 -0
  998. package/wgsl/Bite.wgsl +663 -0
  999. package/wgsl/BlockSlide.wgsl +231 -247
  1000. package/wgsl/Blossom.wgsl +616 -0
  1001. package/wgsl/Bottleneck.wgsl +162 -0
  1002. package/wgsl/BowTieHorizontal.wgsl +78 -87
  1003. package/wgsl/BrickCollapse.wgsl +554 -0
  1004. package/wgsl/BurnThrough.wgsl +97 -110
  1005. package/wgsl/ButterflyFlight.wgsl +330 -0
  1006. package/wgsl/ButterflyWaveScrawler.wgsl +66 -82
  1007. package/wgsl/CardDeal.wgsl +296 -312
  1008. package/wgsl/CellDissolve.wgsl +142 -152
  1009. package/wgsl/CirclePacking.wgsl +426 -0
  1010. package/wgsl/Cleave.wgsl +279 -0
  1011. package/wgsl/CloudDive.wgsl +303 -0
  1012. package/wgsl/CoinSettle.wgsl +314 -0
  1013. package/wgsl/ComicPanels.wgsl +312 -328
  1014. package/wgsl/Condensation.wgsl +705 -0
  1015. package/wgsl/CorePunch.wgsl +841 -0
  1016. package/wgsl/CornerPin.wgsl +448 -0
  1017. package/wgsl/Crankshaft.wgsl +483 -0
  1018. package/wgsl/Craze.wgsl +633 -0
  1019. package/wgsl/Crumple.wgsl +335 -348
  1020. package/wgsl/Cymatics.wgsl +286 -0
  1021. package/wgsl/DamBreak.wgsl +428 -0
  1022. package/wgsl/Deinterleave.wgsl +346 -0
  1023. package/wgsl/DiffuseDissolve.wgsl +162 -0
  1024. package/wgsl/DiscCascade.wgsl +293 -0
  1025. package/wgsl/DominoFall.wgsl +45 -46
  1026. package/wgsl/Donut.wgsl +558 -0
  1027. package/wgsl/DropHop.wgsl +456 -0
  1028. package/wgsl/EqualizerWipe.wgsl +397 -0
  1029. package/wgsl/FacetedGlass.wgsl +283 -299
  1030. package/wgsl/Faint.wgsl +320 -0
  1031. package/wgsl/FalseReflection.wgsl +261 -0
  1032. package/wgsl/FieldReversal.wgsl +486 -0
  1033. package/wgsl/FilmDissolve.wgsl +45 -55
  1034. package/wgsl/FilmLeader.wgsl +764 -0
  1035. package/wgsl/FilmStrip.wgsl +155 -171
  1036. package/wgsl/FlowDissolve.wgsl +349 -0
  1037. package/wgsl/Flutter.wgsl +454 -0
  1038. package/wgsl/FurShake.wgsl +439 -0
  1039. package/wgsl/Gape.wgsl +306 -0
  1040. package/wgsl/GlassRelief.wgsl +293 -0
  1041. package/wgsl/GlitchFlicker.wgsl +321 -332
  1042. package/wgsl/GlitchMemories.wgsl +45 -52
  1043. package/wgsl/GlitterDissolve.wgsl +173 -189
  1044. package/wgsl/Globe.wgsl +432 -0
  1045. package/wgsl/GoldenSpiral.wgsl +310 -0
  1046. package/wgsl/HeatHaze.wgsl +113 -129
  1047. package/wgsl/HerringboneFold.wgsl +372 -0
  1048. package/wgsl/HingedSquares.wgsl +227 -243
  1049. package/wgsl/Hologram.wgsl +181 -197
  1050. package/wgsl/HoneyDrip.wgsl +604 -0
  1051. package/wgsl/HyperbolicMosaic.wgsl +371 -0
  1052. package/wgsl/Inchworm.wgsl +525 -0
  1053. package/wgsl/InsetWipe.wgsl +81 -91
  1054. package/wgsl/InterlaceWipe.wgsl +205 -0
  1055. package/wgsl/InvertedPageCurl.wgsl +1 -1
  1056. package/wgsl/IrisFold.wgsl +248 -0
  1057. package/wgsl/Kite.wgsl +725 -0
  1058. package/wgsl/Knead.wgsl +599 -0
  1059. package/wgsl/LayoutGrid.wgsl +229 -245
  1060. package/wgsl/LeafWipe.wgsl +34 -42
  1061. package/wgsl/LensFlare.wgsl +193 -209
  1062. package/wgsl/LensPush.wgsl +270 -0
  1063. package/wgsl/LensWipe.wgsl +265 -0
  1064. package/wgsl/LichtenbergBurn.wgsl +480 -0
  1065. package/wgsl/LightningRift.wgsl +549 -0
  1066. package/wgsl/LineFeed.wgsl +184 -0
  1067. package/wgsl/LiquidFill.wgsl +194 -207
  1068. package/wgsl/LuminanceMelt.wgsl +100 -118
  1069. package/wgsl/MarblingDissolve.wgsl +287 -0
  1070. package/wgsl/MicroBrickCascade.wgsl +210 -0
  1071. package/wgsl/MoireWipe.wgsl +95 -105
  1072. package/wgsl/Nightfall.wgsl +270 -0
  1073. package/wgsl/NoiseDissolve.wgsl +29 -29
  1074. package/wgsl/OutlineCrumble.wgsl +612 -0
  1075. package/wgsl/OutlineFill.wgsl +246 -0
  1076. package/wgsl/OutlineTear.wgsl +379 -0
  1077. package/wgsl/PaintBucket.wgsl +275 -0
  1078. package/wgsl/PaintDissolve.wgsl +1081 -0
  1079. package/wgsl/PaperLayers.wgsl +468 -0
  1080. package/wgsl/PaperPlane.wgsl +949 -0
  1081. package/wgsl/ParallaxPush.wgsl +281 -0
  1082. package/wgsl/Perforate.wgsl +412 -0
  1083. package/wgsl/PhotoDevelop.wgsl +89 -99
  1084. package/wgsl/PinchLift.wgsl +454 -0
  1085. package/wgsl/Pinwheel.wgsl +32 -32
  1086. package/wgsl/PlasmaDissolve.wgsl +54 -64
  1087. package/wgsl/PointCharges.wgsl +359 -0
  1088. package/wgsl/PosterPaste.wgsl +879 -0
  1089. package/wgsl/PrimaryLights.wgsl +311 -0
  1090. package/wgsl/ProjectorThrow.wgsl +108 -124
  1091. package/wgsl/Pupil.wgsl +739 -0
  1092. package/wgsl/Puzzle.wgsl +154 -150
  1093. package/wgsl/QuadTurn.wgsl +961 -0
  1094. package/wgsl/QuadtreeBlocks.wgsl +441 -0
  1095. package/wgsl/RadialWipe.wgsl +27 -25
  1096. package/wgsl/RainPuddle.wgsl +358 -0
  1097. package/wgsl/ReededGlass.wgsl +277 -0
  1098. package/wgsl/Reflow.wgsl +267 -0
  1099. package/wgsl/Revolve.wgsl +61 -77
  1100. package/wgsl/RingsWipe.wgsl +153 -163
  1101. package/wgsl/Runway.wgsl +426 -0
  1102. package/wgsl/SandDrift.wgsl +439 -0
  1103. package/wgsl/SawtoothWipe.wgsl +114 -124
  1104. package/wgsl/ScreenPrintWipe.wgsl +534 -0
  1105. package/wgsl/SequinStroke.wgsl +728 -0
  1106. package/wgsl/Shatter.wgsl +554 -570
  1107. package/wgsl/Shockwave.wgsl +121 -137
  1108. package/wgsl/SkyLanterns.wgsl +559 -0
  1109. package/wgsl/SlashSplit.wgsl +332 -0
  1110. package/wgsl/SlideProjector.wgsl +482 -0
  1111. package/wgsl/SlitStretch.wgsl +310 -0
  1112. package/wgsl/SlitThread.wgsl +466 -0
  1113. package/wgsl/SnakeBlockWipe.wgsl +73 -83
  1114. package/wgsl/Snap.wgsl +465 -0
  1115. package/wgsl/Snowflake.wgsl +608 -0
  1116. package/wgsl/Soak.wgsl +459 -0
  1117. package/wgsl/SoapDrop.wgsl +419 -0
  1118. package/wgsl/SoapFilm.wgsl +318 -0
  1119. package/wgsl/SourceSink.wgsl +312 -0
  1120. package/wgsl/SpeedLines.wgsl +362 -0
  1121. package/wgsl/Sphere.wgsl +189 -202
  1122. package/wgsl/SpinningTop.wgsl +704 -0
  1123. package/wgsl/SpiralBlockWipe.wgsl +111 -127
  1124. package/wgsl/SpiralLines.wgsl +310 -0
  1125. package/wgsl/Steamroll.wgsl +190 -0
  1126. package/wgsl/StereoViewer.wgsl +73 -91
  1127. package/wgsl/StickySplit.wgsl +454 -0
  1128. package/wgsl/Stratify.wgsl +339 -0
  1129. package/wgsl/StripDatamoshGlitch.wgsl +216 -232
  1130. package/wgsl/StrobeToss.wgsl +356 -0
  1131. package/wgsl/Subdivide.wgsl +520 -0
  1132. package/wgsl/Swim.wgsl +619 -0
  1133. package/wgsl/Tableau.wgsl +345 -0
  1134. package/wgsl/TangentMotionBlur.wgsl +294 -294
  1135. package/wgsl/TileBlast.wgsl +850 -0
  1136. package/wgsl/TileConveyor.wgsl +658 -0
  1137. package/wgsl/TileRings.wgsl +750 -0
  1138. package/wgsl/TileShuffle.wgsl +1083 -0
  1139. package/wgsl/TriangleFlip.wgsl +692 -0
  1140. package/wgsl/TruchetWipe.wgsl +119 -135
  1141. package/wgsl/Umbrella.wgsl +533 -0
  1142. package/wgsl/Unbox.wgsl +1018 -0
  1143. package/wgsl/Unstack.wgsl +564 -0
  1144. package/wgsl/Unstir.wgsl +265 -0
  1145. package/wgsl/VhsTracking.wgsl +299 -288
  1146. package/wgsl/ViscousFingers.wgsl +506 -0
  1147. package/wgsl/Vortex.wgsl +318 -308
  1148. package/wgsl/WaterDrop.wgsl +173 -189
  1149. package/wgsl/WatercolorDissolve.wgsl +724 -0
  1150. package/wgsl/WaterfallWipe.wgsl +550 -0
  1151. package/wgsl/WaveWipe.wgsl +335 -351
  1152. package/wgsl/WedgeWipe.wgsl +55 -63
  1153. package/wgsl/Whirlwind.wgsl +241 -0
  1154. package/wgsl/Whittle.wgsl +484 -0
  1155. package/wgsl/Wormhole.wgsl +461 -0
  1156. package/wgsl/Wrench.wgsl +1288 -0
  1157. package/wgsl/XorWipe.wgsl +202 -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","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","BandWipe":"// BandWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BandWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Alternating bands wipe in from opposite sides together and interleave like fingers, while both images stay still\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 int vertical; \n\nuniform float smoothness; \n\nuniform float stagger; \n\nconst float AA = 0.0015;\n\nfloat bandMask(float i, float n, float a, float l, float s) {\n \n \n float k = (vertical != 0) ? i : n - 1.0 - i;\n float g = clamp(stagger, 0.0, 0.95);\n float t = clamp((progress - g * k / max(n - 1.0, 1.0)) / (1.0 - g), 0.0, 1.0);\n t = mix(t, t * t * (3.0 - 2.0 * t), 0.5);\n float x = mod(i, 2.0) > 0.5 ? l - a : a;\n \n float c = mix(-s, l + s, t);\n return 1.0 - smoothstep(c - s, c + s, x);\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 n = float(bands < 1 ? 1 : bands);\n \n float along = (vertical != 0) ? uv.y : uv.x * ratio;\n float across = (vertical != 0) ? uv.x : uv.y;\n float l = (vertical != 0) ? 1.0 : ratio;\n \n float aaAcross = (vertical != 0) ? AA / ratio : AA;\n float s = max(smoothness, AA);\n\n float f = across * n;\n float i = clamp(floor(f), 0.0, n - 1.0);\n float m = bandMask(i, n, along, l, s);\n\n \n \n float fr = f - i;\n float edge = min(fr, 1.0 - fr) / n;\n if (edge < aaAcross) {\n float j = clamp(fr < 0.5 ? i - 1.0 : i + 1.0, 0.0, n - 1.0);\n m = mix(bandMask(j, n, along, l, s), m, 0.5 + 0.5 * smoothstep(0.0, aaAcross, edge));\n }\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 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","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","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 right half of the outgoing image is a book page that turns over from right to left on the spine at the middle of the frame, curling near its free edge, its back bringing the left half of 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 perspective; \n\nuniform float shading; \n\nuniform float curl; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.0015;\n\nconst float CURL_PART = 0.45;\n\nconst vec2 LIGHT = vec2(-0.447214, 0.894427);\n\nfloat cross2(vec2 a, vec2 b) {\n return a.x * b.y - a.y * b.x;\n}\n\nfloat pageAngle() {\n float p = clamp(progress, 0.0, 1.0);\n return PI * p * (0.35 + p * (1.95 - 1.3 * p));\n}\n\nvec3 hitPage(vec2 eye, vec2 dir, float a, float k, float straight, vec2 c, float w) {\n vec3 best = vec3(-1.0, 0.0, 0.0);\n vec2 d = vec2(cos(a), sin(a));\n \n float den = cross2(d, dir);\n if (abs(den) > 1e-7) {\n float u = cross2(eye, dir) / den;\n float t = cross2(eye, d) / den;\n if (t > 0.0 && u >= 0.0 && u <= straight) best = vec3(t, u, a);\n }\n if (k != 0.0) {\n float r = 1.0 / k;\n vec2 oc = eye - c;\n float qa = dot(dir, dir);\n float qb = dot(oc, dir);\n float disc = qb * qb - qa * (dot(oc, oc) - r * r);\n if (disc >= 0.0) {\n float sq = sqrt(disc);\n for (int i = 0; i < 2; i++) {\n float t = (-qb + (i == 0 ? -sq : sq)) / qa;\n if (t > 0.0 && (best.x < 0.0 || t < best.x)) {\n \n vec2 v = (oc + t * dir) * k;\n float db = atan(v.x, -v.y) - a;\n db -= 2.0 * PI * floor((db + PI) / (2.0 * PI));\n float s = db / k;\n if (s >= 0.0 && s <= w - straight) best = vec3(t, straight + s, a + db);\n }\n }\n }\n }\n return best;\n}\n\nvec2 curlPoint(vec2 c, float k, float b) {\n return c + vec2(sin(b), -cos(b)) / k;\n}\n\nvec4 transition (vec2 uv) {\n float a = pageAngle();\n float lift = sin(a);\n \n float w = 0.5 * ratio;\n float x = uv.x * ratio - w;\n \n float dist = w * (1.0 + 1.5 / max(perspective, 0.01));\n vec2 eye = vec2(0.0, dist);\n vec2 dir = vec2(x, -dist);\n\n \n vec2 d = vec2(cos(a), sin(a));\n float k = -clamp(curl, 0.0, 1.0) * lift / (CURL_PART * w);\n if (abs(k) * CURL_PART * w <= 1e-4) k = 0.0;\n float straight = k != 0.0 ? (1.0 - CURL_PART) * w : w;\n vec2 c = straight * d + vec2(-d.y, d.x) / (k != 0.0 ? k : 1.0);\n vec2 bend = straight * d;\n vec2 middle = k != 0.0 ? curlPoint(c, k, a + 0.5 * k * (w - straight)) : bend;\n vec2 edge = k != 0.0 ? curlPoint(c, k, a + k * (w - straight)) : bend;\n\n \n float aa = EDGE * min(20.0 * lift, 1.0);\n vec4 img = vec4(0.0);\n float m = 0.0;\n vec3 hit = hitPage(eye, dir, a, k, straight, c, w);\n if (hit.x > 0.0) {\n float t = hit.x;\n float u = hit.y;\n float b = hit.z;\n vec2 pt = eye + t * dir;\n \n float y = clamp(0.5 + (uv.y - 0.5) * t, 0.0, 1.0);\n \n float edgeX = edge.x * dist / max(dist - edge.y, 1e-4);\n m = aa > 0.0 && u > (k != 0.0 ? straight : 0.5 * w) ? clamp(abs(x - edgeX) / aa, 0.0, 1.0) : 1.0;\n vec2 normal = vec2(-sin(b), cos(b));\n bool front = dot(normal, eye - pt) > 0.0;\n img = front\n ? getFromColor(vec2(clamp(w + u, w, ratio) / ratio, y))\n : getToColor(vec2(clamp(w - u, 0.0, w) / ratio, y));\n \n float diffuse = max(dot(front ? normal : -normal, LIGHT), 0.0) / LIGHT.y;\n float shade = mix(1.0, 0.25 + 0.75 * diffuse, shading);\n shade *= 1.0 - 0.35 * shading * lift * exp(-u / (0.04 * w));\n img.rgb *= shade;\n if (m >= 1.0) return img;\n }\n\n \n vec4 color = x < 0.0 ? getFromColor(uv) : getToColor(uv);\n \n vec2 toEdge = edge - vec2(x, 0.0);\n float cosEdge = toEdge.x / max(length(toEdge), 1e-6);\n float blocked = 0.5 * abs((x < 0.0 ? 1.0 : -1.0) - cosEdge);\n float shadow = blocked * blocked * (3.0 - 2.0 * blocked);\n \n float slope = -LIGHT.x / LIGHT.y;\n vec3 reach = vec3(bend.x, middle.x, edge.x) + slope * vec3(bend.y, middle.y, edge.y);\n float lo = min(0.0, min(reach.x, min(reach.y, reach.z)));\n float hi = max(0.0, max(reach.x, max(reach.y, reach.z)));\n float soft = max(0.25 * edge.y, 1e-5);\n shadow = max(0.5 * shadow, 0.85 * clamp(min(x - lo, hi - x) / soft + 0.5, 0.0, 1.0) * min(4.0 * lift, 1.0));\n color.rgb *= 1.0 - shading * shadow;\n return mix(color, img, 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","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: Two triangles grow from the top and bottom edges into a bow tie that reveals the incoming image, with an adjustable shape, and 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","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","CardDeal":"// CardDeal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CardDeal.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is dealt onto the frame like a hand of cards: tile after tile is flicked from below the frame, spinning through the air with a lifting shadow, and slides to a stop in its place until the picture is complete\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 deck; \n\nuniform float spin; \n\nuniform float shadow; \n\nconst float PI = 3.141592653589793;\nconst int MAX_CARDS = 36;\n\nconst float DEAL = 0.16;\n\nconst float TOUCH = 0.55;\n\nconst float THROW = 2.2;\n\nconst float SLIDE = 0.35;\n\nconst float LIFT = 0.45;\nconst float EYE = 2.4;\n\nconst float EDGE = 0.0015;\n\nfloat hash(float n) {\n vec2 p = fract(vec2(n) * vec2(0.1031, 0.1030));\n p += dot(p, p.yx + 33.33);\n return fract((p.x + p.y) * p.x);\n}\n\nvec2 gridSize() {\n return clamp(vec2(grid), 1.0, 6.0);\n}\n\nfloat cardTime(float j, float n) {\n \n float flight = 1.0 / (1.0 + (n - 1.0) * DEAL);\n return clamp((progress - j * DEAL * flight) / flight, 0.0, 1.0);\n}\n\nvec2 cardCell(float j, vec2 g) {\n float row = floor(j / g.x);\n return vec2(j - row * g.x, g.y - 1.0 - row);\n}\n\nfloat cardDist(vec2 q, vec2 size) {\n vec2 e = min(q, 1.0 - q) * size;\n return min(e.x, e.y);\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 g = gridSize();\n float n = g.x * g.y;\n vec2 asp = vec2(ratio, 1.0);\n vec2 size = asp / g;\n vec2 p = uv * asp;\n vec2 origin = deck * asp;\n float darkness = clamp(shadow, 0.0, 1.0);\n\n \n vec2 own = min(floor(uv * g), g - 1.0);\n float ownIndex = (g.y - 1.0 - own.y) * g.x + own.x;\n vec4 col = cardTime(ownIndex, n) >= 1.0 ? getToColor(uv) : getFromColor(uv);\n\n \n for (int i = 0; i < MAX_CARDS; i++) {\n float j = float(i);\n if (j >= n) break;\n float u = cardTime(j, n);\n if (u <= 0.0) break;\n if (u >= 1.0) continue;\n\n vec2 cell = cardCell(j, g);\n vec2 target = (cell + 0.5) * size;\n vec2 way = target - origin;\n float len = max(length(way), 1e-3);\n vec2 side = vec2(-way.y, way.x);\n float r1 = hash(j + 1.0);\n float r2 = hash(j + 60.0);\n float turn = r2 < 0.5 ? -1.0 : 1.0;\n \n float slide = min(SLIDE * size.y / len, 0.5);\n \n float a = min(u / TOUCH, 1.0);\n float s = clamp((u - TOUCH) / (1.0 - TOUCH), 0.0, 1.0);\n \n float v1 = 2.0 * slide * TOUCH / ((1.0 - TOUCH) * (1.0 - slide));\n float f = (3.0 - 2.0 * a) * a * a + THROW * (a * a * a - 2.0 * a * a + a) + v1 * (a * a * a - a * a);\n float e = u < TOUCH ? (1.0 - slide) * f : 1.0 - slide * (1.0 - s) * (1.0 - s);\n \n vec2 c = origin + way * e + side * turn * (0.05 + 0.05 * r1) * sin(PI * e);\n \n float h = LIFT * (0.7 + 0.3 * r1) * sin(PI * a) * (1.0 - 0.35 * a);\n float angle = turn * spin * (0.8 + 0.4 * r2) * 2.0 * PI * (1.0 - e);\n \n float tilt = 0.45 * sin(PI * a) * cos(angle * 0.5 + 6.0 * r1);\n \n float air = 1.0 - a * a;\n float fade = smoothstep(0.0, 0.05, u);\n\n \n vec2 sp = p - c - vec2(0.18, -0.3) * h - vec2(0.002, -0.003);\n float ca = cos(angle), sa = sin(angle);\n mat2 rot = mat2(ca, -sa, sa, ca);\n vec2 sq = rot * sp / size + 0.5;\n float soft = 0.006 + 0.08 * h;\n float sh = smoothstep(-soft, soft, cardDist(sq, size));\n \n float dark = mix(0.8 * (1.0 - s), 0.65 - 0.3 * h / LIFT, air);\n col.rgb *= 1.0 - fade * darkness * dark * sh;\n\n \n vec2 d = rot * (p - c) * (EYE - h) / EYE;\n float ct = cos(tilt), st = sin(tilt);\n \n float den = EYE * ct + d.y * st;\n float k = den > 1e-3 ? EYE * ct / den : 1e3;\n vec2 q = vec2(k * d.x, k * d.y * ct + EYE * (1.0 - k) * st) / size + 0.5;\n \n float edge = EDGE * (1.0 + 2.0 * air) * min(10.0 * (1.0 - s), 1.0);\n float m = fade * clamp(cardDist(q, size) / max(edge, 1e-6) + 0.5, 0.0, 1.0);\n if (m > 0.0) {\n vec4 face = getToColor((cell + clamp(q, 0.0, 1.0)) / g);\n \n float light = 1.0 + 0.6 * st * (0.6 - 0.4 * turn * sin(angle));\n \n float rim = 1.0 - smoothstep(0.0, 0.008, cardDist(q, size));\n face.rgb = mix(min(face.rgb * light, vec3(face.a)), vec3(face.a), 0.45 * air * rim);\n col = mix(col, face, m);\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","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","CircleBurst":"// CircleBurst — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CircleBurst.glsl\n// Author: gre\n// License: MIT\n// Description: Discs of three solid colors burst out of a point one after another, each covering the last, then a hole bursts open from the same point in the last one 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 vec4 color1; \n\nuniform vec4 color2; \n\nuniform vec4 color3; \n\nuniform float stagger; \n\nconst float AA = 0.0015;\n\nconst float SW = 0.03;\nconst float SO = 0.32;\n\nfloat phase(float s, float d) {\n return clamp((progress - s) / d, 0.0, 1.0);\n}\n\nfloat radius(float t, float R) {\n float u = 1.0 - t;\n return mix(-SW - AA, R, mix(t, 1.0 - u * u * u, 0.8));\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(abs(v), 2.0));\n}\n\nvec4 layer(vec4 p, vec4 c, float r, float x) {\n float k = smoothstep(r - AA, r + AA, x);\n float s = SO * c.a * k * (1.0 - smoothstep(0.0, SW, x - r));\n p = p * (1.0 - s) + vec4(0.0, 0.0, 0.0, s);\n k = c.a * (1.0 - k);\n return p * (1.0 - k) + vec4(c.rgb, 1.0) * k;\n}\n\nvec4 transition(vec2 uv) {\n vec2 asp = vec2(ratio, 1.0);\n float x = length((uv - center) * asp);\n \n float R = length(max(center, 1.0 - center) * asp) + SW + AA;\n float k = clamp(stagger, 0.0, 1.0);\n float d = 1.0 / (1.0 + 3.0 * k);\n\n \n float t = phase(0.0, d);\n vec4 a = getFromColor(mirror(center + (uv - center) / (1.0 + 0.06 * t * (2.0 - t))));\n vec4 p = vec4(a.rgb * a.a, a.a);\n p = layer(p, color1, radius(t, R), x);\n p = layer(p, color2, radius(phase(k * d, d), R), x);\n float r = radius(phase(2.0 * k * d, d), R);\n p = layer(p, color3, r, x);\n\n \n \n t = phase(3.0 * k * d, d);\n float h = radius(t, R);\n float u = 1.0 - t;\n vec4 b = getToColor(mirror(center + (uv - center) / (1.0 + 0.14 * u * u * (1.0 - 2.4 * t))));\n float s = SO * color3.a * clamp((r - h) / SW, 0.0, 1.0) * (1.0 - smoothstep(0.0, SW, h - x));\n vec4 q = vec4(b.rgb * b.a * (1.0 - s), b.a * (1.0 - s) + s);\n p = mix(p, q, 1.0 - smoothstep(h - AA, h + AA, x));\n return p.a > 0.0 ? vec4(p.rgb / p.a, p.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","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","Clothesline":"// Clothesline — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Clothesline.glsl\n// Author: gre\n// License: MIT\n// Description: The camera pulls back to show the outgoing image as a print hung by two clothespins on a line in front of a wall, the line is pulled sideways and carries it away while the incoming print slides in, both prints swinging and tilting like hanging paper, then the camera moves back in on the incoming print 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 sway; \n\nuniform float size; \n\nuniform vec4 background; \n\nuniform vec4 lineColor; \n\nuniform vec4 pinColor; \n\nconst float FOCAL = 2.0; \nconst float GAP = 0.35; \nconst float WALL = 0.14; \nconst float ROPE = 0.0055; \nconst vec2 PIN = vec2(0.021, 0.072); \nconst float PIN_Y = -0.01; \nconst float AA = 0.0015; \nconst vec3 LIGHT = vec3(-0.28, 0.48, 0.83); \nconst float PIN_X = 0.32; \nconst int STEPS = 32; \n\nconst float SLIDE_START = 0.1;\nconst float SLIDE_END = 0.86;\n\nvec4 premultiply(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nfloat slideTime(float p) {\n return clamp((p - SLIDE_START) / (SLIDE_END - SLIDE_START), 0.0, 1.0);\n}\n\nfloat slideAmount(float u) {\n return u * u * u * (u * (u * 6.0 - 15.0) + 10.0);\n}\n\nfloat slideAccel(float p) {\n float u = slideTime(p);\n float dur = SLIDE_END - SLIDE_START;\n return 60.0 * u * (1.0 - u) * (1.0 - 2.0 * u) / (dur * dur);\n}\n\nfloat swing(float p) {\n const float OMEGA = 10.0; \n const float DAMP = 0.28;\n const float STEP = 1.0 / float(STEPS);\n float x = 0.0;\n float v = 0.0;\n \n for (int i = 0; i < STEPS; i++) {\n float t0 = float(i) * STEP;\n float dt = clamp(p - t0, 0.0, STEP);\n float a = slideAccel(t0 + 0.5 * dt) - OMEGA * OMEGA * x - 2.0 * DAMP * OMEGA * v;\n v += a * dt;\n x += v * dt;\n }\n \n return x * (1.0 - smoothstep(0.7, 1.0, p));\n}\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\nvec3 printHit(vec3 o, vec3 d, float cx, float psi) {\n vec3 dn = vec3(0.0, -cos(psi), -sin(psi));\n vec3 n = vec3(0.0, sin(psi), -cos(psi));\n vec3 p0 = vec3(cx, 0.5, 0.0);\n float t = dot(p0 - o, n) / dot(d, n);\n vec3 q = o + d * t - p0;\n return vec3(q.x, dot(q, dn), t);\n}\n\nfloat bendShift(float v, float bend) {\n float h = clamp(v, 0.0, 1.0);\n return bend * h * (0.6 + 0.4 * h);\n}\n\nfloat paperDist(vec2 uv, float bend) {\n vec2 q = abs(vec2(uv.x - bendShift(uv.y, bend), uv.y - 0.5)) - vec2(0.5 * ratio, 0.5);\n return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0);\n}\n\nfloat pinDist(vec2 uv) {\n vec2 q = vec2(abs(uv.x) - PIN_X * ratio, uv.y - PIN_Y);\n return roundedBox(q, PIN, 0.012);\n}\n\nvec4 drawPrint(vec4 col, vec3 h, bool isFrom, float bend, float psi, float aa, float vis) {\n vec2 lp = h.xy;\n float d = paperDist(lp, bend);\n float cov = clamp(0.5 - d / (h.z * aa), 0.0, 1.0);\n if (cov > 0.0) {\n vec2 st = clamp(vec2((lp.x - bendShift(lp.y, bend)) / ratio + 0.5, 1.0 - lp.y), 0.0, 1.0);\n vec4 c = premultiply(isFrom ? getFromColor(st) : getToColor(st));\n \n float shade = 1.0 - 1.2 * abs(sin(psi)) * lp.y - 0.35 * abs(bend) * lp.y;\n float ps = pinDist(lp - vec2(0.006, 0.01));\n shade -= 0.35 * vis * (1.0 - smoothstep(-0.004, 0.012, ps));\n c.rgb *= clamp(shade, 0.0, 1.0);\n col = c * cov + col * (1.0 - c.a * cov);\n }\n return col;\n}\n\nvec4 drawPins(vec4 col, vec3 h, float aa, float vis) {\n vec2 lp = h.xy;\n float d = pinDist(lp);\n float cov = vis * clamp(0.5 - d / (h.z * aa), 0.0, 1.0);\n if (cov > 0.0) {\n \n float k = clamp((abs(lp.x) - PIN_X * ratio) / PIN.x, -1.0, 1.0);\n vec3 c = pinColor.rgb * (0.62 + 0.45 * sqrt(1.0 - k * k));\n float y = lp.y - PIN_Y;\n float spring = 1.0 - smoothstep(0.004, 0.007, abs(y + 0.02));\n c = mix(c, vec3(0.3, 0.31, 0.33) * (0.6 + 0.8 * sqrt(1.0 - k * k)), spring);\n \n c *= 1.0 - 0.3 * (1.0 - smoothstep(0.002, 0.005, abs(y - 0.012)));\n vec4 pc = premultiply(vec4(c, pinColor.a));\n col = pc * cov + col * (1.0 - pc.a * cov);\n }\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 sw = clamp(sway, 0.0, 1.0);\n\n \n float back = smoothstep(0.0, 0.3, p) * (1.0 - smoothstep(0.6, 1.0, p));\n float zoom = mix(1.0, clamp(size, 0.1, 1.0), back);\n float vis = smoothstep(0.0, 0.35, back);\n vec3 o = vec3(0.0, 0.05 * back, FOCAL / zoom);\n vec3 d = vec3((uv - 0.5) * vec2(ratio, 1.0), -FOCAL);\n float aa = max(AA * min(1.0, 40.0 * back), 1e-6);\n\n \n float u = slideTime(p);\n float m = slideAmount(u);\n float speed = 16.0 * u * u * (1.0 - u) * (1.0 - u);\n float spacing = ratio + GAP;\n float cFrom = -s * spacing * m;\n float cTo = s * spacing * (1.0 - m);\n \n float bend = s * 0.65 * sw * swing(p);\n float psi = 0.45 * sw * speed;\n\n vec3 hf = printHit(o, d, cFrom, psi);\n vec3 ht = printHit(o, d, cTo, psi);\n\n \n \n vec4 col = premultiply(background);\n float cover = max(\n clamp(0.5 - paperDist(hf.xy, bend) / (hf.z * aa), 0.0, 1.0),\n clamp(0.5 - paperDist(ht.xy, bend) / (ht.z * aa), 0.0, 1.0));\n col *= mix(1.0, back, cover);\n if (back > 0.0) {\n vec3 w = o + d * ((o.z + WALL) / FOCAL);\n vec3 sf = printHit(w, LIGHT, cFrom, psi);\n vec3 st = printHit(w, LIGHT, cTo, psi);\n float blur = 0.025;\n float sh = 1.0 - smoothstep(-blur, blur, min(paperDist(sf.xy, bend), paperDist(st.xy, bend)));\n sh = max(sh, 1.0 - smoothstep(-0.012, 0.02, min(pinDist(sf.xy), pinDist(st.xy))));\n float ry = w.y + LIGHT.y * (WALL / LIGHT.z) - (0.5 - 0.012);\n sh = max(sh, 0.8 * (1.0 - smoothstep(0.0, 0.012, abs(ry))));\n \n float fall = 0.1 * clamp(length(w.xy - vec2(-0.4 * ratio, 0.6)) / (1.2 * ratio + 0.6), 0.0, 1.0);\n col.rgb *= (1.0 - 0.42 * vis * sh) * (1.0 - fall * vis);\n }\n\n col = drawPrint(col, hf, true, bend, psi, aa, vis);\n col = drawPrint(col, ht, false, bend, psi, aa, vis);\n\n \n if (vis > 0.0) {\n float tl = (o.z - 0.004) / FOCAL;\n float ly = o.y + d.y * tl - (0.5 - 0.012);\n float lc = vis * clamp(0.5 - (abs(ly) - ROPE) / (tl * aa), 0.0, 1.0);\n if (lc > 0.0) {\n float k = clamp(ly / ROPE, -1.0, 1.0);\n \n float lx = o.x + d.x * tl + s * spacing * m;\n float strand = 0.88 + 0.12 * sin((lx + ly * 0.6) * 360.0);\n vec3 c = lineColor.rgb * (0.7 + 0.45 * sqrt(1.0 - k * k) + 0.15 * k) * strand;\n vec4 lcp = premultiply(vec4(c, lineColor.a));\n col = lcp * lc + col * (1.0 - lcp.a * lc);\n }\n col = drawPins(col, hf, aa, vis);\n col = drawPins(col, ht, aa, vis);\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","CodeRain":"// CodeRain — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CodeRain.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image darkens into a grid of flickering code characters tinted by its colors, then glowing streams of characters fall down the columns at their own speeds, each with a bright head and a fading tail, leaving the incoming image behind\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 float trail; \n\nuniform float tint; \n\nuniform vec4 glow; \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\nvec4 hash42(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * vec4(0.1031, 0.1030, 0.0973, 0.1099));\n p4 += dot(p4, p4.wzxy + 33.33);\n return fract((p4.xxyz + p4.yzzw) * p4.zywx);\n}\n\nvec4 band(vec4 d) {\n return 1.0 - smoothstep(0.3, 0.6, d);\n}\n\nfloat glyph(vec2 cell, float t, vec2 local) {\n vec2 b = local * vec2(6.0, 8.0) - 0.5;\n float x = b.x;\n float y = b.y;\n float d = 0.667 * y;\n \n float x04 = abs(x - 2.0) - 2.0;\n float y06 = abs(y - 3.0) - 3.0;\n float y03 = abs(y - 1.5) - 1.5;\n float y36 = abs(y - 4.5) - 1.5;\n vec2 seed = cell + t * vec2(37.0, 61.0);\n \n \n vec4 sa = band(abs(vec4(y, y - 3.0, y - 6.0, x - d))) * band(vec4(x04, x04, x04, y06));\n vec4 sb = band(abs(vec4(x, x, x - 4.0, x - 4.0))) * band(vec4(y03, y36, y03, y36));\n vec4 sc = band(abs(vec4(x - 2.0, x - 2.0, x + d - 4.0, y - 1.0))) * band(vec4(y03, y36, y06, abs(x - 2.0) - 1.0));\n float on = dot(step(0.68, hash42(seed)), sa);\n on += dot(step(0.68, hash42(seed + 41.0)), sb);\n on += dot(step(0.68, hash42(seed + 83.0)), sc);\n return min(on, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float h = max(cellSize, 0.005);\n vec2 dims = vec2(0.75 * h, h);\n \n vec2 fp = vec2(uv.x * ratio, 1.0 - uv.y);\n \n vec2 grid = fp / dims + vec2(0.389, 0.278);\n vec2 cell = floor(grid);\n vec2 local = grid - cell;\n float rc = hash12(cell + vec2(97.0, 131.0));\n\n \n float r1 = hash12(vec2(cell.x, 11.0));\n float r2 = hash12(vec2(cell.x, 23.0));\n float r3 = hash12(vec2(cell.x, 37.0));\n float T = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.5);\n float len = max(trail, 0.01) * (0.5 + r3);\n float u = clamp((T - 0.03 - 0.5 * r1) / (0.3 + 0.12 * r2), 0.0, 1.0);\n \n float head = mix(-0.2, 1.0 + h + len, u * (0.7 + 0.3 * u));\n \n float dy = head - (cell.y - 0.278) * h;\n\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n\n \n \n vec2 cuv = clamp(vec2((cell.x + 0.111) * dims.x / ratio, 1.0 - (cell.y + 0.222) * h), 0.0, 1.0);\n vec4 ca = getFromColor(cuv);\n float lum = dot(ca.rgb, vec3(0.299, 0.587, 0.114));\n vec3 hue = ca.rgb / max(max(ca.r, max(ca.g, ca.b)), 0.05);\n vec3 ink = mix(glow.rgb * glow.a, hue, tint) * (0.1 + 0.6 * lum);\n float near = smoothstep(-0.15, 0.0, dy);\n float dim = max(smoothstep(0.0, 0.3, T), near);\n float g = max(smoothstep(0.0, 0.2, T - 0.12 * rc), near);\n float passed = step(0.0, dy);\n \n float slow = mod(floor(T * 12.0 + rc * 7.0), 32.0);\n float fast = 32.0 + mod(floor(T * 40.0 + rc * 13.0), 32.0);\n float chr = glyph(cell, mix(slow, fast, passed), local);\n vec3 code = a.rgb * (1.0 - 0.8 * dim) + ink * chr * g;\n\n \n \n float fade = clamp(1.0 - dy / len, 0.0, 1.0);\n float shade = 1.0 - smoothstep(0.3 * len, len, dy);\n float hot = 1.0 - smoothstep(h, 3.0 * h, dy);\n vec3 col = mix(glow.rgb * 1.2, vec3(1.0), 0.8 * hot) * glow.a;\n vec3 stream = b.rgb * (1.0 - 0.8 * shade) + col * chr * (fade * (2.0 - fade) + hot * fade);\n\n \n float yy = (head - fp.y) / (1.5 * h);\n float halo = 1.6 * u * (1.0 - u) * exp(-yy * yy) * (1.0 - smoothstep(0.25, 0.5, abs(local.x - 0.5)));\n vec3 rgb = mix(code, stream, passed) + glow.rgb * glow.a * halo;\n \n return vec4(clamp(rgb, 0.0, 1.0), mix(a.a, mix(b.a, a.a, shade), passed));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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","ComicPanels":"// ComicPanels — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ComicPanels.glsl\n// Author: gre\n// License: MIT\n// Description: The frame splits into slanted comic-book panels with gutters and ink borders; one after another in reading order, each panel lifts off the page with a zoom kick and a drop shadow and punches over to the incoming image, then the gutters close up over the full 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 gutter; \n\nuniform vec4 gutterColor; \n\nuniform vec4 borderColor; \n\nuniform float seed; \n\nconst float PI = 3.141592653589793;\n\nconst float INK = 0.005;\n\nconst float EDGE = 0.0012;\n\nconst float PUNCH = 0.3;\n\nconst float START = 0.05;\nconst float END = 0.97;\n\nconst float SPIKES = 11.0;\n\nfloat hash(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 cols(float r) {\n float h = hash(vec2(r * 7.0 + 3.0, seed * 1.37 + 11.0));\n float n = h < 0.15 ? 1.0 : (h < 0.6 ? 2.0 : 3.0);\n \n if (r == 1.0) n = max(n, 2.0);\n if (ratio < 0.8) n = min(n, 2.0);\n return n;\n}\n\nfloat rowDist(float k, vec2 p) {\n if (k < 0.5) return p.y;\n if (k > 2.5) return p.y - 1.0;\n float y = (k + (hash(vec2(k * 5.0 + 1.0, seed * 1.37)) - 0.5) * 0.35) / 3.0;\n float s = (hash(vec2(k * 9.0 + 4.0, seed * 1.37 + 5.0)) - 0.5) * 0.24;\n return (p.y - y - s * (p.x / ratio - 0.5)) / sqrt(1.0 + s * s / (ratio * ratio));\n}\n\nfloat colDist(float r, float j, float n, vec2 p) {\n if (j < 0.5) return p.x;\n if (j > n - 0.5) return p.x - ratio;\n float x = (j + (hash(vec2(r * 3.0 + j * 13.0, seed * 1.37 + 2.0)) - 0.5) * 0.45) / n;\n float s = (hash(vec2(r * 11.0 + j * 5.0, seed * 1.37 + 7.0)) - 0.5) * 0.5;\n return (p.x - ratio * (x + s * (p.y - 0.5))) / sqrt(1.0 + ratio * ratio * s * s);\n}\n\nfloat panelDist(float r, float c, float n, vec2 p) {\n return min(min(rowDist(r, p), -rowDist(r + 1.0, p)), min(colDist(r, c, n, p), -colDist(r, c + 1.0, n, p)));\n}\n\nvec2 panelCenter(float r, float c, float n) {\n \n float y0 = rowDist(r, vec2(0.5 * ratio, 0.0)) + rowDist(r + 1.0, vec2(0.5 * ratio, 0.0));\n float y1 = rowDist(r, vec2(0.5 * ratio, 1.0)) + rowDist(r + 1.0, vec2(0.5 * ratio, 1.0));\n float y = y0 / (y0 - y1);\n float x0 = colDist(r, c, n, vec2(0.0, y)) + colDist(r, c + 1.0, n, vec2(0.0, y));\n float x1 = colDist(r, c, n, vec2(1.0, y)) + colDist(r, c + 1.0, n, vec2(1.0, y));\n return vec2(x0 / (x0 - x1), y);\n}\n\nfloat panelTime(float k, float total) {\n float t0 = START + (END - START - PUNCH) * k / max(total - 1.0, 1.0);\n return clamp((progress - t0) / PUNCH, 0.0, 1.0);\n}\n\nfloat lift(float t) {\n float u = 1.0 - (1.0 - t) * (1.0 - t);\n return sin(PI * u);\n}\n\nvec4 panelImage(vec2 p, vec2 center, float t) {\n float k = lift(t);\n \n vec2 q = center + (p - center) / (1.0 + 0.1 * k);\n vec2 uv = vec2(q.x / ratio, 1.0 - q.y);\n if (t <= 0.0) return getFromColor(uv);\n if (t >= 1.0) return getToColor(uv);\n vec2 v = p - center;\n float a = (atan(v.y, v.x + 1e-6) + PI) / (2.0 * PI) * SPIKES + center.x * 7.0;\n float i = floor(a);\n \n \n float spike = (1.0 - abs(2.0 * (a - i) - 1.0)) * (0.5 + 0.5 * hash(vec2(mod(i, SPIKES), center.y * 13.0 + seed)));\n \n float burst = 1.5 * max(1.0, ratio / 1.8) * smoothstep(0.06, 0.42, t);\n float d = length(v) - burst * (0.62 + 0.38 * spike);\n float w = 1.4 * INK;\n vec4 c = mix(getToColor(uv), borderColor, smoothstep(-w - EDGE, -w + EDGE, d));\n return mix(c, getFromColor(uv), smoothstep(-EDGE, EDGE, d));\n}\n\nvec4 drawPanel(vec4 color, vec4 img, float d, float g, float ink, float fade) {\n vec4 c = mix(borderColor, img, mix(1.0, smoothstep(g + ink - EDGE, g + ink + EDGE, d), fade));\n return mix(color, c, mix(1.0, smoothstep(g - EDGE, g + EDGE, d), fade));\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n vec2 p = vec2(uv.x * ratio, 1.0 - uv.y);\n\n \n float open = smoothstep(0.0, 0.14, progress) * (1.0 - smoothstep(0.8, 1.0, progress));\n float g = 0.5 * gutter * open;\n float ink = INK * open;\n \n float fade = clamp(open * 6.0, 0.0, 1.0);\n\n float n0 = cols(0.0);\n float n1 = cols(1.0);\n float n2 = cols(2.0);\n float total = n0 + n1 + n2;\n\n \n float r = rowDist(1.0, p) < 0.0 ? 0.0 : (rowDist(2.0, p) < 0.0 ? 1.0 : 2.0);\n float n = r == 0.0 ? n0 : (r == 1.0 ? n1 : n2);\n float c = colDist(r, 1.0, n, p) < 0.0 ? 0.0 : (colDist(r, 2.0, n, p) < 0.0 || n < 2.5 ? 1.0 : 2.0);\n c = min(c, n - 1.0);\n float first = r == 0.0 ? 0.0 : (r == 1.0 ? n0 : n0 + n1);\n float t = panelTime(first + c, total);\n\n vec4 color = gutterColor;\n if (t <= 0.0 || t >= 1.0) {\n color = drawPanel(color, panelImage(p, panelCenter(r, c, n), t), panelDist(r, c, n, p), g, ink, fade);\n }\n\n \n float spacing = (END - START - PUNCH) / max(total - 1.0, 1.0);\n \n float kFirst = floor((progress - START - PUNCH) / spacing - 0.01) + 1.0;\n for (int i = 0; i < 4; i++) {\n float pk = kFirst + float(i);\n if (pk < 0.0 || pk > total - 0.5) continue;\n float pt = panelTime(pk, total);\n if (pt <= 0.0 || pt >= 1.0) continue;\n float pr = pk < n0 ? 0.0 : (pk < n0 + n1 ? 1.0 : 2.0);\n float pn = pr == 0.0 ? n0 : (pr == 1.0 ? n1 : n2);\n float pc = pk - (pr == 0.0 ? 0.0 : (pr == 1.0 ? n0 : n0 + n1));\n float k = lift(pt);\n vec2 center = panelCenter(pr, pc, pn);\n float s = 1.0 + 0.08 * k;\n \n vec2 sq = center + (p - vec2(0.012, 0.018) * k - center) / s;\n float sd = panelDist(pr, pc, pn, sq) - g;\n color.rgb *= 1.0 - 0.4 * k * fade * smoothstep(-0.02, 0.01, sd);\n vec2 q = center + (p - center) / s;\n color = drawPanel(color, panelImage(q, center, pt), panelDist(pr, pc, pn, q), g, ink, 1.0);\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","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 box that turns a quarter turn in perspective, the outgoing face darkening as it turns away, above a reflective floor\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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; \n\nuniform float unzoom; \n\nuniform float reflection; \n\nuniform float floating; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.002;\n\nvec4 hitBox(vec3 eye, vec3 dir, float w, float c, float s) {\n vec2 pivot = vec2(0.5 * w);\n vec2 e = eye.xz - pivot;\n vec2 o = vec2(e.x * c + e.y * s, -e.x * s + e.y * c) + pivot;\n vec2 d = vec2(dir.x * c + dir.z * s, -dir.x * s + dir.z * c);\n \n vec2 inv = 1.0 / vec2(d.x < 0.0 ? min(d.x, -1e-6) : max(d.x, 1e-6), d.y < 0.0 ? min(d.y, -1e-6) : max(d.y, 1e-6));\n vec2 t0 = (vec2(0.0) - o) * inv;\n vec2 t1 = (vec2(w) - o) * inv;\n vec2 tn = min(t0, t1);\n vec2 tf = max(t0, t1);\n float tin = max(tn.x, tn.y);\n if (tin <= 0.0 || tin > min(tf.x, tf.y)) return vec4(-1.0);\n vec2 hit = o + tin * d;\n float y = eye.y + tin * dir.y;\n if (y < 0.0 || y > 1.0) return vec4(-1.0);\n \n if (tn.y >= tn.x) {\n if (d.y <= 0.0) return vec4(-1.0);\n return vec4(tin, hit.x / w, y, 0.0);\n }\n if (d.x <= 0.0) return vec4(-1.0);\n return vec4(tin, 1.0 - hit.y / w, y, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float w = ratio;\n \n float turn = progress * progress * (3.0 - 2.0 * progress);\n float a = 0.5 * PI * turn;\n float c = cos(a), s = sin(a);\n if (progress >= 1.0) { c = 0.0; s = 1.0; }\n \n float motion = sin(PI * clamp(progress, 0.0, 1.0));\n float zoom = 1.0 + max(unzoom, 0.0) * motion;\n\n \n float dist = 0.8 * max(w, 1.0) / clamp(persp, 0.01, 1.0);\n vec3 eye = vec3(0.5 * w, 0.5, -dist);\n vec2 sp = (uv - 0.5) * zoom + 0.5;\n vec3 dir = vec3(sp.x * w, sp.y, 0.0) - eye;\n\n \n float px = EDGE * zoom * min(10.0 * motion, 1.0);\n float shade0 = 1.0 - shading * (1.0 - c);\n float shade1 = 1.0 - shading * (1.0 - s);\n\n \n vec4 front = vec4(0.0);\n vec4 b = hitBox(eye, dir, w, c, s);\n if (b.x > 0.0) {\n vec4 img = b.w < 0.5 ? getFromColor(vec2(b.y, b.z)) : getToColor(vec2(b.y, b.z));\n float m = 1.0;\n if (px > 0.0) {\n \n float e = px * b.x;\n vec3 n = b.w < 0.5 ? vec3(s, 0.0, -c) : vec3(-c, 0.0, -s);\n float fore = max(abs(dot(n, normalize(dir))), 0.05);\n float edge = b.w < 0.5 ? 1.0 - b.y : b.y;\n m = clamp(min(b.z, 1.0 - b.z) / e, 0.0, 1.0)\n * clamp(edge * w * fore / e, 0.0, 1.0);\n }\n \n if (m >= 1.0 && img.a >= 1.0) {\n return vec4(img.rgb * (b.w < 0.5 ? shade0 : shade1), img.a);\n }\n front = vec4(img.rgb * (b.w < 0.5 ? shade0 : shade1) * img.a, img.a) * m;\n }\n\n \n vec4 ground = vec4(0.0);\n float h = 0.005 * max(floating, 0.0);\n if (dir.y < 0.0 && motion > 0.0) {\n float tf = -(eye.y + h) / dir.y;\n vec3 f = eye + tf * dir;\n \n vec3 meye = vec3(eye.x, -2.0 * h - eye.y, eye.z);\n vec3 mdir = vec3(dir.x, -dir.y, dir.z);\n vec4 r = hitBox(meye, mdir, w, c, s);\n if (r.x > 0.0) {\n vec4 img = r.w < 0.5 ? getFromColor(vec2(r.y, r.z)) : getToColor(vec2(r.y, r.z));\n float k = clamp(reflection, 0.0, 1.0) * (1.0 - r.z) * (1.0 - r.z);\n ground = vec4(img.rgb * (r.w < 0.5 ? shade0 : shade1) * img.a, img.a) * k;\n }\n \n vec2 q = f.xz - vec2(0.5 * w);\n vec2 l = vec2(q.x * c + q.y * s, -q.x * s + q.y * c);\n float soft = 0.03 + 1.5 * h;\n float sh = shading * 0.7 * exp(-length(max(abs(l) - vec2(0.5 * w), 0.0)) / soft);\n \n vec2 bl = l + vec2(0.5 * w);\n sh *= l.y < l.x\n ? getFromColor(vec2(clamp(bl.x / w, 0.0, 1.0), 0.0)).a\n : getToColor(vec2(clamp(1.0 - bl.y / w, 0.0, 1.0), 0.0)).a;\n ground = ground * (1.0 - sh) + vec4(0.0, 0.0, 0.0, sh);\n ground *= min(6.0 * motion, 1.0);\n }\n\n vec4 color = front + ground * (1.0 - front.a);\n return color.a > 0.0 ? vec4(color.rgb / color.a, color.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","CurtainRise":"// CurtainRise — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CurtainRise.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image rises like a theater festoon curtain: cords lift its hem into scalloped swags while the fabric gathers into shaded ruffles, and it is drawn up out of the frame over 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 swags; \n\nuniform float sag; \n\nuniform float ruffles; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\n\nvec4 transition (vec2 uv) {\n float p = progress;\n \n float f = 1.0 - (1.0 - p) * (1.0 - p) * (1.0 - p);\n \n float e = mix(p, p * p * (3.0 - 2.0 * p), 0.4);\n float s = sag * f;\n float lift = mix(-0.01, 1.0 + sag + 0.08, e);\n \n float n = max(1.0, floor(swags * sqrt(ratio / 1.78) + 0.5)); \n float u = fract(uv.x * n) * 2.0 - 1.0;\n float bump = 1.0 - u * u;\n float hem = lift - s * bump;\n float aa = 0.002 + 0.004 * f;\n float inside = smoothstep(hem - aa, hem + aa, uv.y);\n\n vec4 c = vec4(0.0);\n if (inside > 0.0) {\n \n float h = max(1.0 - max(hem, 0.0), 1e-4);\n float q = clamp((1.0 - uv.y) / h, 0.0, 1.0);\n \n \n float m = min(max(1.0, floor(ruffles + 0.5)), h / 0.02);\n float a = 2.0 * PI * m * q;\n \n float g = 0.85 * f * min(1.0, 0.3 + 5.0 * (1.0 - h)) * (0.6 + 0.4 * bump);\n float v = clamp(q + g * sin(a) / (2.0 * PI * m), 0.0, 1.0);\n \n float pull = 0.25 * f * q * q * sin(PI * u) / (PI * n);\n c = getFromColor(vec2(uv.x - pull, 1.0 - v));\n\n \n float slope = 2.5 * g * cos(a);\n float diffuse = (1.0 - 0.35 * slope) / sqrt(1.0 + slope * slope);\n float crease = 0.5 + 0.5 * sin(a);\n float light = mix(1.0, diffuse * (1.0 - 0.45 * crease * crease), shading * g);\n \n light += 0.18 * shading * g * smoothstep(0.4, 1.0, -cos(a));\n \n float depth = f * q * (0.3 + 0.7 * q);\n light *= 1.0 - shading * depth * (0.35 * u * u + 0.5 * exp(-(1.0 - abs(u)) * 14.0));\n \n light *= 1.0 - 0.35 * shading * f * exp(-(uv.y - hem) * 120.0);\n c.rgb *= light;\n if (inside >= 1.0) return c;\n }\n vec4 to = getToColor(uv);\n \n float below = max(hem - uv.y, 0.0);\n float shadow = 0.6 * shading * exp(-below * 22.0) * smoothstep(0.0, 0.05, lift) * (1.0 - smoothstep(1.0, 1.06, lift - s));\n to.rgb *= 1.0 - shadow;\n return mix(to, c, 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","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 straight wipe in any direction, diagonal and soft-edged by default; a smoothness of 0 gives a hard 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 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","DominoFall":"// DominoFall — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DominoFall.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is cut into standing slats that topple backward like dominoes in a chain reaction across the frame, each one leaning onto the next and knocking it over, until they all lie flat 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 int count; \n\nuniform int reverse; \n\nuniform float knock; \n\nuniform float lean; \n\nuniform float perspective; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.0015;\n\nfloat knockPart() {\n return clamp(knock, 0.05, 1.0);\n}\n\nfloat fallTime(float j, float n) {\n if (progress >= 1.0) return 1.0;\n float k = knockPart();\n \n float d = 1.0 / (1.0 + (n - 1.0) * k);\n return clamp((progress - j * k * d) / d, 0.0, 1.0);\n}\n\nfloat fallAngle(float t) {\n return 0.5 * PI * t * (0.2 + 0.8 * t);\n}\n\nvec4 slatPoint(float j, float n, float w, float xc, float y) {\n vec4 none = vec4(0.0, 0.0, -1.0, 0.0);\n if (j < 0.0 || j > n - 1.0) return none;\n float t = fallTime(j, n);\n if (t >= 1.0) return none;\n float a = fallAngle(t);\n float c = cos(a), s = sin(a);\n \n \n vec3 eye = vec3((j + 0.5) * w, 0.5 * c, -1.0 / max(perspective, 0.01));\n vec3 dir = vec3(xc, y, 0.0) - eye;\n \n float den = dir.z * c - dir.y * s;\n if (den <= 0.0) return none;\n float r = (eye.y * s - eye.z * c) / den;\n vec3 hit = eye + r * dir;\n float h = hit.y * c + hit.z * s;\n if (r <= 0.0 || h < 0.0) return none;\n \n float side = clamp(lean, 0.0, 1.0) * w * min(t / knockPart(), 1.0) * h;\n return vec4(hit.x - side - j * w, h, t, a);\n}\n\nvec4 drawSlat(vec4 color, float j, vec4 pt, vec4 front, float w) {\n float t = pt.z;\n if (t < 0.0) return color;\n float s = sin(pt.w);\n float d = min(pt.x, w - pt.x);\n float m;\n if (t <= 0.0) {\n \n m = d >= 0.0 && pt.y <= 1.0 ? 1.0 : 0.0;\n } else {\n \n float e = EDGE * min(10.0 * t, 1.0) * (1.0 + max(perspective, 0.0) * pt.y * s);\n m = clamp(d / e + 0.5, 0.0, 1.0) * clamp((1.0 - pt.y) * max(cos(pt.w), 0.05) / e + 0.5, 0.0, 1.0);\n }\n if (m <= 0.0) return color;\n float sx = (j * w + clamp(pt.x, 0.0, w)) / ratio;\n vec4 img = getFromColor(vec2((reverse != 0) ? 1.0 - sx : sx, min(pt.y, 1.0)));\n \n float shade = 1.0 - shading * s * (0.4 + 0.6 * pt.y);\n \n if (front.z >= 0.0 && front.z < t && front.x < 0.0) {\n float reach = clamp(1.0 - (front.y - 1.0) / 0.05, 0.0, 1.0);\n shade *= 1.0 - 0.6 * shading * exp(front.x / (0.15 * w)) * reach;\n }\n img.rgb *= shade;\n return mix(color, img, m);\n}\n\nvec4 transition (vec2 uv) {\n float n = float(count < 1 ? 1 : count);\n float w = ratio / n;\n \n float xc = ((reverse != 0) ? 1.0 - uv.x : uv.x) * ratio;\n float col = clamp(floor(xc / w), 0.0, n - 1.0);\n\n vec4 color = getToColor(uv);\n \n float t0 = fallTime(col, n);\n color.rgb *= 1.0 - 2.4 * shading * t0 * (1.0 - t0) * exp(-40.0 * uv.y);\n\n \n \n vec4 cur = slatPoint(col, n, w, xc, uv.y);\n color = drawSlat(color, col - 1.0, slatPoint(col - 1.0, n, w, xc, uv.y), cur, w);\n color = drawSlat(color, col, cur, slatPoint(col + 1.0, n, w, xc, uv.y), w);\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","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 swinging toward the viewer, as the incoming one comes forward from the dark room behind, 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; \n\nuniform float depth; \n\nconst float PI = 3.141592653589793;\n\nvec2 leafHit (float x, float w, float eye, float a) {\n float c = cos(a), s = sin(a);\n float t = (eye * c - 0.5 * w * s) / (s * (x - 0.5 * w) + eye * c);\n vec2 hit = vec2(0.5 * w + t * (x - 0.5 * w), eye * (t - 1.0));\n return vec2(t, hit.x * c - hit.y * s);\n}\n\nfloat project (vec2 p, float w, float eye) {\n return 0.5 * w + (p.x - 0.5 * w) * eye / (eye + p.y);\n}\n\nfloat easeInOut (float t) {\n return t < 0.5 ? 4.0 * t * t * t : 1.0 - 4.0 * (1.0 - t) * (1.0 - t) * (1.0 - t);\n}\n\nvec4 room (vec2 uv, float x, float edgeL, float edgeR, float close, float dolly) {\n float size = mix(max(depth, 1.0), 1.0, dolly);\n vec2 p = (uv - 0.5) * size + 0.5;\n \n float soft = 0.004 * (size - 1.0) + 1e-6;\n vec2 m = smoothstep(-soft, soft, p) * smoothstep(-soft, soft, 1.0 - p);\n vec4 c = getToColor(clamp(p, 0.0, 1.0)) * (m.x * m.y);\n if (p.y < 0.0) {\n vec2 r = vec2(p.x, -1.2 * p.y - 0.02);\n float f = reflection * (1.0 - r.y) * m.x * smoothstep(0.0, 0.01, r.y);\n c += getToColor(clamp(r, 0.0, 1.0)) * f * (1.0 - m.y);\n }\n \n \n float wl = 0.03 + 0.12 * close;\n float shadow = (1.0 - smoothstep(0.0, wl, x - edgeL)) + (1.0 - smoothstep(0.0, wl, edgeR - x));\n float light = (1.0 + 0.6 * close * close) * (1.0 - 0.7 * close * min(shadow, 1.0));\n return vec4(min(c.rgb * light, vec3(c.a)), c.a);\n}\n\nvec4 transition (vec2 uv) {\n float w = ratio;\n float x = uv.x * w;\n \n float eye = max(w, 1.0) * (0.5 + 0.2 / max(perspective, 0.01));\n \n float swing = progress * progress * (3.0 - 2.0 * progress);\n float a = min(atan(2.0 * eye / w) + 0.1, 0.5 * PI) * swing;\n float dolly = mix(easeInOut(progress), progress, 0.3);\n \n float hw = 0.5 * w;\n vec2 front = hw * vec2(cos(a), -sin(a));\n float thick = 0.02 * w * (1.0 - smoothstep(0.8, 1.0, swing));\n float edgeL = project(front, w, eye);\n float backL = project(front + thick * vec2(sin(a), cos(a)), w, eye);\n float close = 1.0 - swing;\n vec4 back = room(uv, x, backL, w - backL, close, dolly);\n \n bool left = x < hw;\n float lx = left ? x : w - x;\n vec2 hit = leafHit(lx, w, eye, a);\n float s = clamp(hit.y, 0.0, hw);\n \n float v = 0.5 + (uv.y - 0.5) * hit.x;\n vec4 leaf = getFromColor(clamp(vec2(left ? s / w : 1.0 - s / w, v), 0.0, 1.0));\n \n leaf.rgb *= 1.0 - 0.5 * (1.0 - cos(a)) - 0.25 * sin(a) * (s / hw);\n \n vec4 side = getFromColor(clamp(vec2(left ? 0.499 : 0.501, v), 0.0, 1.0));\n side.rgb = min(side.rgb * 1.5, vec3(side.a));\n \n float aa = 0.003 * min(1.0, 20.0 * min(a, close)) + 1e-6;\n vec4 c = mix(back, side, smoothstep(-aa, aa, backL - lx));\n return mix(c, leaf, smoothstep(-aa, aa, edgeL - lx));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Drape":"// Drape — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Drape.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image hangs like a sheet of fabric that is let go at the top: it collapses into soft, uneven folds that hide one another as the cloth bunches up and slides down 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 folds; \n\nuniform float depth; \n\nuniform float sway; \n\nuniform float shadow; \n\nconst float PI = 3.141592653589793;\nconst int STEPS = 24;\nconst float DEPTH = 0.8; \n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat hash11(float p) {\n p = fract(p * 0.1031);\n p *= p + 33.33;\n p *= p + p;\n return fract(p);\n}\n\nfloat noise1(float x) {\n float i = floor(x);\n float f = x - i;\n return mix(hash11(i), hash11(i + 1.0), f * f * (3.0 - 2.0 * f));\n}\n\nfloat topEdge(float x, vec4 m) {\n float c = 2.0 * x - 1.0;\n return m.y - 0.08 * m.x * (1.0 - c * c);\n}\n\nfloat sidePull(float sy, float gT) {\n return 0.035 * gT * (0.3 + 0.7 * clamp(sy, 0.0, 1.0));\n}\n\nvec4 cloth(vec2 p, vec4 m, float foldN) {\n float gT = m.x;\n float botY = m.z;\n float x = p.x - m.w;\n float top = topEdge(x, m);\n float sy = (p.y - botY) / max(top - botY, 1e-4); \n float pull = sidePull(sy, gT);\n float xc = (x - pull) / (1.0 - 2.0 * pull);\n \n float wander = (noise1(0.5 * foldN * xc + 2.5 * sy + 5.3) - 0.5) * 2.4 * (1.0 - sy);\n float ph = 2.0 * PI * (foldN * xc + 0.6 * noise1(0.7 * foldN * xc + 1.7)) + wander;\n float d = 0.15 + 0.85 * noise1(1.1 * foldN * xc + 1.4 * sy + 7.0);\n \n float amp = DEPTH * depth * gT * (0.3 + 0.7 * sy * sqrt(max(sy, 0.0))) / max(foldN, 2.0);\n \n float w = 0.6 / foldN;\n amp *= smoothstep(0.0, w, xc) * smoothstep(0.0, w, 1.0 - xc);\n float prof = 0.5 - 0.5 * cos(ph); \n \n float dt = (1.0 - sy) * (top - botY);\n float crease = exp(-30.0 * dt) * (0.5 + 0.5 * sin(80.0 * dt + 0.7 * ph));\n bool on = sy >= 0.0 && sy <= 1.0 && xc >= 0.0 && xc <= 1.0;\n return on ? vec4(amp * (d * prof + 0.15 * crease), xc, sy, ph) : vec4(-1.0);\n}\n\nvec4 transition (vec2 uv) {\n float t = progress;\n \n float topY = 1.0 - 1.06 * t * (0.35 + 0.65 * t);\n float botY = -0.75 * t * t * t;\n \n float f = 1.0 - (1.0 - t) * (1.0 - t) * (1.0 - t);\n float foldN = max(1.0, floor(folds * min(ratio, 1.0) + 0.5));\n float shiftX = sway * 0.035 * sin(2.0 * PI * t) * f;\n \n vec2 view = vec2(0.75 + 0.5 * sway * sin(PI * t) * f, -0.35);\n float zMax = 1.15 * DEPTH * depth * f / max(foldN, 2.0); \n vec4 m = vec4(f, topY, botY, shiftX);\n \n float zA = zMax; \n float zB = 0.0; \n bool found = false;\n float dA = 0.0;\n float dB = 0.0;\n bool onA = false; \n for (int i = 0; i < STEPS; i++) {\n if (!found) {\n float z = max(zMax * (1.0 - float(i) / float(STEPS - 1)), 0.0);\n vec4 s = cloth(uv - view * z, m, foldN);\n float dz = s.x - z;\n if (s.x >= 0.0 && dz >= 0.0) {\n found = true;\n zB = z;\n dB = dz;\n } else {\n zA = z;\n dA = dz;\n onA = s.x >= 0.0;\n }\n }\n }\n float zHit = zB;\n if (found && zA > zB) {\n if (onA) {\n \n zHit = mix(zA, zB, dA / (dA - dB));\n } else {\n \n \n float za = zA;\n for (int j = 0; j < 5; j++) {\n float zm = 0.5 * (za + zHit);\n if (cloth(uv - view * zm, m, foldN).x >= zm) zHit = zm;\n else za = zm;\n }\n }\n }\n vec2 hp = uv - view * zHit;\n vec4 hit = found ? cloth(hp, m, foldN) : vec4(-1.0);\n if (found && hit.x < 0.0) {\n zHit = zB;\n hp = uv - view * zB;\n hit = cloth(hp, m, foldN);\n }\n vec4 col = vec4(0.0);\n float cover = 0.0;\n if (hit.x >= 0.0) {\n float xc = hit.y;\n float sy = hit.z;\n float ph = hit.w;\n \n float slope = PI * zMax * foldN;\n \n float mu = min(0.25 * slope * slope / (1.0 + 0.25 * slope * slope), 0.5);\n float u = xc - mu * sin(2.0 * ph) / (4.0 * PI * foldN);\n \n float h = max(topY - botY, 1e-4);\n float comp = max(1.0 - h, 0.0);\n float v = sy * (1.0 - comp) + comp * sy * sy * sy;\n vec4 tex = getFromColor(mirror(vec2(u, v)));\n float span = topEdge(hp.x - shiftX, m) - botY; \n \n float e = 0.002;\n float hx = cloth(hp + vec2(e, 0.0), m, foldN).x;\n float hy = cloth(hp + vec2(0.0, e), m, foldN).x;\n float hx0 = hx >= 0.0 ? hx : hit.x;\n float hy0 = hy >= 0.0 ? hy : hit.x;\n vec3 nrm = normalize(vec3(-(hx0 - hit.x) / e, -(hy0 - hit.x) / e, 1.0));\n vec3 light = normalize(vec3(-0.45, 0.35, 1.0));\n float diffuse = mix(1.0, max(dot(nrm, light), 0.0) / light.z, min(1.0, 3.0 * f));\n \n float valley = 1.0 - (0.5 - 0.5 * cos(ph));\n float ao = 1.0 - 0.6 * depth * f * valley * valley * (0.35 + 0.65 * sy);\n \n float rim = exp(-(1.0 - sy) * span * 70.0) * 0.35 * f;\n \n float under = max(hit.x - zHit, 0.0);\n float back = min(1.0, under / max(0.1 * zMax, 1e-6));\n tex.rgb *= diffuse * ao * (1.0 - rim) * (1.0 - 0.6 * back);\n col = tex;\n \n float aa = 0.003 * f;\n float inside = min((1.0 - sy) * span - view.y * under, min(xc, 1.0 - xc));\n cover = aa > 0.0 ? clamp(inside / aa, 0.0, 1.0) : 1.0;\n if (cover >= 1.0) return col;\n }\n \n vec4 to = getToColor(uv);\n float x = uv.x - shiftX;\n float pull = sidePull((uv.y - botY) / max(topEdge(x, m) - botY, 1e-4), f);\n float outside = max(uv.y - topEdge(x, m), max(-x, x - 1.0) - pull);\n float sh = shadow * exp(-max(outside, 0.0) * 16.0) * f * clamp(8.0 * (1.0 - t), 0.0, 1.0);\n return mix(vec4(to.rgb * (1.0 - 0.8 * sh), to.a), col, 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","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","DuotoneFade":"// DuotoneFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DuotoneFade.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is printed in two inks, shadows first, as a bold high-contrast duotone; the incoming image is printed over it in the same two inks, its dark tones landing before its highlights, then its own colors come back, highlights first\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 shadowInk; \n\nuniform vec4 highlightInk; \n\nuniform float contrast; \n\nuniform float grain; \n\nfloat dfHash(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 dfLuma(vec4 c) {\n return clamp(dot(c.rgb, vec3(0.299, 0.587, 0.114)), 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n float la = dfLuma(a);\n float lb = dfLuma(b);\n \n vec2 q = uv * 360.0 * vec2(max(ratio, 1.0), max(1.0 / ratio, 1.0));\n float g = dfHash(floor(q)) - 0.5;\n\n \n float inks = smoothstep(0.0, 0.35, progress);\n float lift = smoothstep(0.65, 1.0, progress);\n float amount = min(\n clamp(inks * 1.35 - 0.35 * la, 0.0, 1.0),\n clamp((1.0 - lift) * 1.35 - 0.35 * lb, 0.0, 1.0)\n );\n amount = amount * amount * (3.0 - 2.0 * amount);\n\n \n float x = smoothstep(0.25, 0.75, progress) * 1.6 - 0.3;\n float t = lb + 0.2 * grain * g;\n float s = smoothstep(t - 0.15, t + 0.15, x);\n\n \n float c = 0.4 * contrast;\n float tone = smoothstep(c + 0.03, 1.03 - c, mix(la, lb, s) + 0.08 * grain * g);\n vec4 ink = mix(shadowInk, highlightInk, tone);\n\n \n vec4 base = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), s);\n if (base.a <= 0.0) return vec4(0.0);\n return vec4(mix(base.rgb / base.a, ink.rgb, amount * ink.a), 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","EchoSlide":"// EchoSlide — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/EchoSlide.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image slides away leaving a trail of discrete fading copies of itself, a stroboscopic echo, and the incoming image's echoes converge 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 vec2 direction; \n\nuniform int echoes; \n\nuniform float trail; \n\nuniform float decay; \n\nconst float EDGE = 0.002;\n\nconst int MAX_ECHOES = 7;\n\nfloat easeInOut(float t) {\n return t * t * (3.0 - 2.0 * t);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat past(float s, float x) {\n return x <= 0.0 ? 1.0 : x >= 1.0 ? 0.0 : clamp((s - x) / EDGE + 0.5, 0.0, 1.0);\n}\n\nfloat edgeAt(float t) {\n return easeInOut(clamp(t, 0.0, 1.0));\n}\n\nvec4 echoStep(vec2 uv, float s, vec2 shift, float j, float t0, float lag, float n) {\n float e0 = edgeAt(t0 + j * lag);\n float e1 = edgeAt(t0 + (j + 1.0) * lag);\n vec4 a = getFromColor(mirror(uv - shift * e0));\n vec4 b = getToColor(mirror(uv - shift * (e1 - 1.0)));\n vec4 c = mix(b, a, pow((j + 0.5) / n, 0.5 + 2.0 * clamp(decay, 0.0, 1.0)));\n \n c.rgb *= 1.0 - 0.25 * exp(-max(e1 - s, 0.0) / 0.02) * min((e1 - e0) / 0.02, 1.0);\n return c;\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 \n float ext = abs(d.x) + abs(d.y);\n vec2 shift = d * ext;\n float s = 0.5 + dot(uv - 0.5, d) / ext;\n\n float n = clamp(float(echoes), 1.0, float(MAX_ECHOES));\n float tr = clamp(trail, 0.05, 0.6);\n float lag = tr / n;\n \n \n \n float t0 = progress >= 1.0 ? 1.0 : progress * (1.0 + tr) - tr;\n float eIn = edgeAt(t0);\n float eOut = edgeAt(t0 + tr);\n\n float wIn = 1.0 - past(s, eIn);\n float wOut = past(s, eOut);\n float wGap = max(1.0 - wIn - wOut, 0.0);\n vec4 c = vec4(0.0);\n if (wGap > 0.0) {\n \n float jf = 0.0;\n for (int k = 1; k < MAX_ECHOES; k++) {\n float m = float(k);\n if (m >= n) break;\n jf += past(s, edgeAt(t0 + m * lag));\n }\n float j = floor(jf);\n c = echoStep(uv, s, shift, j, t0, lag, n);\n if (jf > j) c = mix(c, echoStep(uv, s, shift, j + 1.0, t0, lag, n), jf - j);\n c *= wGap;\n }\n \n if (wIn > 0.0) c += wIn * getToColor(mirror(uv - shift * (eIn - 1.0)));\n if (wOut > 0.0) c += wOut * getFromColor(mirror(uv - shift * eOut));\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","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","FacetedGlass":"// FacetedGlass — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FacetedGlass.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is seen through a pane of irregular cut-glass facets, each one showing its own shifted, zoomed and tilted view of the image, with bright beveled edges and thin dark seams; the facets turn to the incoming image one by one, then the glass flattens out 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 facets; \n\nuniform float refraction; \n\nuniform float bevel; \n\nuniform vec4 highlight; \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\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.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 \n float h = 1.0 - abs(2.0 * progress - 1.0);\n float amount = h * h * (3.0 - 2.0 * h);\n\n float n = max(facets, 1.0);\n vec2 aspect = vec2(ratio, 1.0);\n \n vec2 p = uv * aspect * n;\n vec2 i = floor(p);\n vec2 f = p - i;\n vec2 offset = vec2(17.31, 41.97) * seed;\n \n float bw = 0.18 * amount;\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 + 0.1 + 0.8 * 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 vec2 normal = vec2(0.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 + 0.1 + 0.8 * hash22(i + g + offset) - f;\n vec2 dr = r - mr;\n if (dot(dr, dr) > 0.00001) {\n vec2 dn = normalize(dr);\n float e = dot(0.5 * (mr + r), dn);\n edge = min(edge, e);\n float w = max(1.0 - e / bw, 0.0);\n normal += dn * w * w;\n }\n }\n }\n float nl = length(normal);\n normal = nl > 0.0 ? normal / nl : vec2(0.0);\n\n \n vec2 id = i + mg + offset;\n vec2 h1 = hash22(id + 31.7);\n vec2 h2 = hash22(id + 59.3);\n vec2 h3 = hash22(id + 97.1);\n float angle = 6.2831853 * h1.x;\n vec2 dir = vec2(cos(angle), sin(angle));\n vec2 shift = dir * (0.4 + 0.6 * h1.y) * refraction;\n float zoom = (h2.x - 0.5) * 6.0 * refraction;\n float tilt = (h2.y - 0.5) * 2.0 * refraction;\n\n \n vec2 q = -mr / n;\n vec2 view = -q * zoom + vec2(-q.y, q.x) * sin(tilt) + q * (cos(tilt) - 1.0);\n\n \n float bv = 1.0 - smoothstep(0.0, bw, edge);\n bv *= bv;\n \n vec2 bend = normal * bv * 0.4 * refraction;\n\n \n float start = 0.15 + 0.5 * h3.x;\n float m = smoothstep(start, start + 0.2, progress);\n vec2 d = amount * (view + bend);\n vec2 s = amount * shift;\n vec4 ca = getFromColor(mirror(uv + (s + d) / aspect));\n vec4 cb = getToColor(mirror(uv + (d - s) / aspect));\n \n vec4 c = mix(vec4(ca.rgb * ca.a, ca.a), vec4(cb.rgb * cb.a, cb.a), m);\n\n \n vec2 light = normalize(vec2(-0.6, 0.8));\n vec2 slope = dir * (0.4 + 0.6 * h1.y);\n float facetLight = 0.12 * amount * dot(slope, light);\n \n float lit = dot(normal, light);\n float k = clamp(bevel, 0.0, 1.0);\n float glow = k * bv * max(lit, 0.0) * 1.1 * amount;\n float shade = k * bv * max(-lit, 0.0) * 0.6 * amount;\n \n float turn = sin(3.14159265 * m);\n glow += k * 0.15 * amount * turn * turn;\n \n float seam = 0.6 * amount * (1.0 - smoothstep(0.0, 2.0 * AA, edge / n - 0.5 * AA));\n\n c.rgb *= (1.0 + facetLight) * (1.0 - shade) * (1.0 - seam);\n c.rgb += highlight.rgb * highlight.a * glow * c.a;\n return c.a > 0.0 ? vec4(clamp(c.rgb / c.a, 0.0, 1.0), 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","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","FrostWipe":"// FrostWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FrostWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Ice crystals grow in from the edges of the frame with feathery, branching fronts, frosting the outgoing image white and blurry until it is covered, then thaw back out to the edges 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 spread; \n\nuniform float scale; \n\nuniform float blur; \n\nuniform vec4 color; \n\nconst int TAPS = 12;\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 ridged(vec2 v) {\n float sum = 0.0;\n float amp = 0.5;\n for (int i = 0; i < 4; i++) {\n float n = 1.0 - abs(2.0 * vnoise(v) - 1.0);\n sum += amp * n * n;\n v = mat2(1.6, 1.2, -1.2, 1.6) * v + 4.7;\n amp *= 0.5;\n }\n return sum / 0.9375;\n}\n\nvec4 grains(vec2 v) {\n vec2 i = floor(v);\n vec2 f = fract(v);\n float d1 = 8.0;\n float d2 = 8.0;\n vec3 seed = vec3(0.0);\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 c = vec2(float(x), float(y));\n vec2 o = c + vec2(hash12(i + c), hash12(i + c + 17.3)) - f;\n float d = dot(o, o);\n if (d < d1) {\n d2 = d1;\n d1 = d;\n seed = vec3(hash12(i + c + 41.9), -o);\n } else if (d < d2) {\n d2 = d;\n }\n }\n }\n return vec4(sqrt(d2) - sqrt(d1), seed);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 image(vec2 uv, float m) {\n if (m <= 0.0) return getFromColor(uv);\n if (m >= 1.0) return getToColor(uv);\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float h = 1.0 - abs(2.0 * p - 1.0);\n float a = clamp(h / 0.85, 0.0, 1.0);\n a = a * (1.6 - 0.6 * a); \n float m = smoothstep(0.47, 0.53, p);\n if (a <= 0.0) return image(uv, m);\n\n \n vec2 q = uv * vec2(ratio, 1.0);\n vec2 dEdge = min(uv, 1.0 - uv) * vec2(ratio, 1.0);\n float depth = min(dEdge.x, dEdge.y) / (0.5 * min(ratio, 1.0));\n depth = 1.0 - (1.0 - depth) * (1.0 - depth); \n\n \n \n float reach = 0.2 + 0.6 * clamp(spread, 0.0, 1.0);\n float front = mix(-0.1, 1.0 + reach + 0.2, a);\n if (depth > front + 0.08) return image(uv, m);\n\n \n \n vec2 gv = q * scale;\n \n vec4 gr = grains(gv + 0.35 * vec2(vnoise(gv * 1.7), vnoise(gv * 1.7 + 23.1)));\n \n float u = 2.0 * gr.y - 1.0;\n vec2 dir = vec2(1.0 - u * u, 2.0 * u) / (1.0 + u * u);\n float t = dot(gr.zw, dir) * 7.0;\n float needle = 1.0 - abs(2.0 * fract(t) - 1.0); \n float nh = fract(gr.y + 0.618034 * floor(t));\n float len = mix(0.15, 0.6, nh); \n float r = ridged(gv * 1.3);\n float rf = ridged(gv * 4.0 + 11.0);\n \n \n float grow = min(gr.x * 3.5, gr.x / len * 0.5 + (1.0 - needle) * 1.2 + 0.2 * fract(nh * 13.7));\n float field = depth + reach * (0.8 * min(grow, 1.0) + 0.2 * (1.0 - r)) + 0.1 * (1.0 - rf);\n float inside = front - field; \n float f = smoothstep(0.0, 0.03, inside);\n \n float haze = 0.4 * smoothstep(0.9, 1.0, rf) * smoothstep(-0.08, 0.0, inside);\n float frost = max(f, haze);\n if (frost <= 0.0) return image(uv, m);\n\n \n float thick = smoothstep(0.0, 0.5, inside);\n float full = smoothstep(0.75, 0.95, h); \n\n \n float radius = (0.004 + 0.03 * blur) * frost * (0.5 + 0.5 * thick);\n float rot = 6.2831853 * hash12(floor(q * 90.0));\n vec3 rgb = vec3(0.0);\n float alpha = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float k = (float(i) + 0.5) / float(TAPS);\n float th = rot + float(i) * 2.3999632;\n vec2 off = sqrt(k) * vec2(cos(th), sin(th)) * radius;\n vec4 c = image(mirror(uv + off / vec2(ratio, 1.0)), m);\n rgb += c.rgb * c.a;\n alpha += c.a;\n }\n alpha /= float(TAPS);\n rgb = alpha > 0.0 ? rgb / (alpha * float(TAPS)) : vec3(0.0);\n\n \n \n float stem = 1.0 - smoothstep(0.0, 0.03, gr.x);\n float needles = smoothstep(0.7, 1.0, needle) * (1.0 - smoothstep(0.0, len, gr.x));\n float glint = 0.4 + 0.6 * rf;\n float veins = clamp(glint * max(0.35 * stem, 0.55 * needles) + 0.3 * smoothstep(0.6, 0.95, r), 0.0, 1.0);\n float rim = smoothstep(0.0, 0.02, inside) * (1.0 - smoothstep(0.02, 0.07, inside));\n vec3 ice = clamp(color.rgb * (0.82 + 0.25 * veins), 0.0, 1.0);\n float cover = frost * (0.35 + 0.3 * thick + 0.25 * veins);\n cover = clamp(mix(cover, frost, full), 0.0, 1.0);\n vec4 under = vec4(rgb * mix(vec3(1.0), color.rgb, 0.5 * frost), alpha);\n \n vec4 res = mix(under, vec4(ice, color.a), cover);\n\n \n vec2 sq = q * 36.0;\n vec2 cell = floor(sq);\n vec2 d = abs(sq - cell - 0.25 - 0.5 * vec2(hash12(cell + 1.3), hash12(cell + 5.9)));\n float star = max(0.0, 1.0 - 9.0 * length(d)) + max(0.0, 1.0 - 4.0 * (d.x + d.y) - 30.0 * min(d.x, d.y));\n float tw = 0.5 + 0.5 * sin(6.2831853 * (hash12(cell + 9.1) + 2.0 * p));\n float sparkle = step(0.82, hash12(cell + 3.7)) * min(star, 1.0) * tw * f * (0.4 + 0.6 * veins);\n float light = clamp(0.4 * rim + 0.8 * sparkle, 0.0, 1.0);\n res = mix(res, vec4(mix(color.rgb, vec3(1.0), 0.6), color.a), light);\n return clamp(res, 0.0, 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","Funnel":"// Funnel — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Funnel.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image narrows into a curved funnel toward a point on the bottom edge and slides into it, its sides bending like a window minimized into a dock, 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 target; \n\nuniform float curvature; \n\nuniform float shadow; \n\nconst float NECK = 0.04;\n\nconst float OVERSHOOT = 0.03;\n\nconst float EDGE = 0.0015;\n\nconst float SOFT = 0.06;\n\nvec4 transition(vec2 uv) {\n float t = progress;\n \n float f = smoothstep(0.0, 1.0, 1.0 - (1.0 - t) * (1.0 - t) * (1.0 - t));\n float slide = (1.0 + OVERSHOOT) * t * t * (1.5 - 0.5 * t);\n\n float r = max(ratio, 1e-4);\n float nh = 0.5 * NECK / r;\n \n float tx = clamp(target, nh, 1.0 - nh);\n float c = clamp(curvature, 0.0, 1.0);\n\n \n float q = clamp(uv.y, 0.0, 1.0);\n float w = mix(q, q * q * (3.0 - 2.0 * q), c);\n float dw = mix(1.0, 6.0 * q * (1.0 - q), c);\n float L = f * mix(tx - nh, 0.0, w);\n float R = 1.0 - f * (1.0 - mix(tx + nh, 1.0, w));\n float dL = -f * (tx - nh) * dw;\n float dR = f * (1.0 - tx - nh) * dw;\n float v = uv.y + slide;\n\n \n float e = EDGE * min(1.0, 10.0 * t) + 1e-6;\n float left = L > 0.0 ? (uv.x - L) * r / sqrt(1.0 + dL * dL * r * r) : 1.0;\n float right = R < 1.0 ? (R - uv.x) * r / sqrt(1.0 + dR * dR * r * r) : 1.0;\n float cov = clamp(min(min(left, right), 1.0 - v) / e + 0.5, 0.0, 1.0);\n\n vec4 img = vec4(0.0);\n float s = clamp(shadow, 0.0, 1.0);\n if (cov > 0.0) {\n float width = R - L;\n vec2 src = clamp(vec2((uv.x - L) / width, v), 0.0, 1.0);\n img = getFromColor(src);\n \n float across = 2.0 * src.x - 1.0;\n img.rgb *= 1.0 - s * (1.0 - width) * (0.5 * across * across + 0.3 * (1.0 - w));\n if (cov >= 1.0) return img;\n }\n\n vec4 bg = getToColor(uv);\n \n float ox = max(L - uv.x, uv.x - R) * r;\n float oy = uv.y - (1.0 - slide);\n float dist = length(max(vec2(ox, oy), 0.0));\n bg.rgb *= 1.0 - s * 0.6 * f * (1.0 - t) * (1.0 - smoothstep(0.0, SOFT, dist));\n\n return mix(bg, img, cov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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","GeometricCollage":"// GeometricCollage — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GeometricCollage.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image arrives cut into a geometric poster of quarter discs, half discs, triangles and their complements: piece after piece swings in around a corner of its cell, a flat plate of color just ahead of it, and lands flat with a soft paper 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 int cells; \n\nuniform float stagger; \n\nuniform int plates; \n\nuniform vec4 color1; \n\nuniform vec4 color2; \n\nuniform vec4 color3; \n\nuniform float shadow; \n\nconst float PI = 3.141592653589793;\n\nconst float DUR = 0.24;\nconst float GAP = 0.07;\nconst float LEAD = 0.06;\n\nconst float SETTLE = 0.8;\n\nconst float EDGE = 0.002;\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 orient(vec2 l, float k) {\n vec2 c = l - 0.5;\n if (k < 0.5) return l;\n if (k < 1.5) return vec2(-c.y, c.x) + 0.5;\n if (k < 2.5) return 0.5 - c;\n return vec2(c.y, -c.x) + 0.5;\n}\n\nvec2 pivotCorner(float k) {\n if (k < 0.5) return vec2(0.0, 0.0);\n if (k < 1.5) return vec2(0.0, 1.0);\n if (k < 2.5) return vec2(1.0, 1.0);\n return vec2(1.0, 0.0);\n}\n\nfloat shapeDist(vec2 o, float type) {\n if (type < 0.5) return length(o) - 1.0; \n if (type < 1.5) return length(o - vec2(0.5, 0.0)) - 0.5; \n return (o.x + o.y - 1.0) * 0.70710678; \n}\n\nfloat pieceDist(vec2 l, vec2 cell, float piece) {\n float k = floor(hash12(cell + 1.7) * 4.0);\n \n float sd = shapeDist(orient(l, k), mod(cell.x + 2.0 * cell.y + 1.0, 3.0));\n return piece > 0.5 ? -sd : sd;\n}\n\nfloat boxDist(vec2 l) {\n return min(min(l.x, l.y), min(1.0 - l.x, 1.0 - l.y));\n}\n\nfloat easeOutCubic(float t) {\n float u = 1.0 - clamp(t, 0.0, 1.0);\n return 1.0 - u * u * u;\n}\n\nfloat lift(float t) {\n return 1.0 - smoothstep(0.3, 1.0, t);\n}\n\nfloat spread() {\n return (1.0 - DUR - GAP - LEAD - 0.02) * clamp(stagger, 0.0, 1.0);\n}\nfloat swing() {\n return 1.0 - GAP - LEAD - 0.02 - spread();\n}\n\nfloat startTime(vec2 cell, vec2 n) {\n float order = (cell.x + (n.y - 1.0 - cell.y)) / max(n.x + n.y - 2.0, 1.0);\n order = clamp(order * 0.75 + 0.25 * hash12(cell + 4.4), 0.0, 1.0);\n return LEAD + spread() * order;\n}\n\nvec3 swingPoint(vec2 p, vec2 cell, vec2 cs, float piece, float t) {\n vec2 pc = pivotCorner(floor(hash12(cell + 1.7) * 4.0));\n \n vec2 piv = (cell + (piece < 0.5 ? pc : 1.0 - pc)) * cs;\n float sgn = hash12(cell + vec2(piece * 3.3, 5.2)) < 0.5 ? -1.0 : 1.0;\n \n float s = smoothstep(0.0, 0.45, t) * (1.0 + 0.1 * lift(t));\n \n float a = sgn * 0.5 * PI * (1.0 - easeOutCubic(t / SETTLE));\n float ca = cos(a), sa = sin(a);\n vec2 d = p - piv;\n d = vec2(ca * d.x + sa * d.y, -sa * d.x + ca * d.y) / max(s, 0.001);\n return vec3((piv + d) / cs - cell, s);\n}\n\nvec3 layerCover(vec2 p, vec2 cell, vec2 cs, float piece, float t) {\n vec3 q = swingPoint(p, cell, cs, piece, t);\n if (q.z < 0.01) return vec3(0.0);\n float e = EDGE / (min(cs.x, cs.y) * q.z);\n float m = clamp(boxDist(q.xy) / e + 0.5, 0.0, 1.0) * clamp(-pieceDist(q.xy, cell, piece) / e + 0.5, 0.0, 1.0);\n return vec3(m, clamp(q.xy, 0.0, 1.0));\n}\n\nfloat layerShadow(vec2 p, vec2 cell, vec2 cs, float piece, float t) {\n float h = lift(t);\n vec3 q = swingPoint(p - vec2(0.07, -0.1) * h * cs.y, cell, cs, piece, t);\n if (q.z < 0.01) return 0.0;\n float soft = 0.02 + 0.05 * h;\n return h * (1.0 - smoothstep(-soft, soft, pieceDist(q.xy, cell, piece))) * smoothstep(-soft, soft, boxDist(q.xy));\n}\n\nvec4 plateColor(vec2 cell, float piece) {\n float c = mod(floor(hash12(cell * 1.3 + 0.7) * 3.0) + piece, 3.0);\n return c < 0.5 ? color1 : c < 1.5 ? color2 : color3;\n}\n\nvec4 premultiplied(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 transition(vec2 uv) {\n float kc = float(cells < 1 ? 1 : cells);\n vec2 n = ratio >= 1.0 ? vec2(max(1.0, floor(ratio * kc + 0.5)), kc) : vec2(kc, max(1.0, floor(kc / ratio + 0.5)));\n vec2 cs = vec2(ratio, 1.0) / n;\n vec2 p = uv * vec2(ratio, 1.0);\n vec2 cell0 = floor(p / cs);\n float sw = swing();\n\n \n \n vec2 l0 = p / cs - cell0;\n float t00 = startTime(cell0, n);\n float sd0 = pieceDist(l0, cell0, 0.0);\n float e0 = EDGE / min(cs.x, cs.y);\n float landed = (progress >= t00 + sw ? clamp(-sd0 / e0 + 0.5, 0.0, 1.0) : 0.0)\n + (progress >= t00 + GAP + sw ? clamp(sd0 / e0 + 0.5, 0.0, 1.0) : 0.0);\n \n \n vec4 top = vec4(-1.0, 0.0, 0.0, 0.0);\n vec4 topPos = vec4(0.0);\n vec4 und = vec4(-1.0, 0.0, 0.0, 0.0);\n vec4 undPos = vec4(0.0);\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cell = cell0 + vec2(float(dx), float(dy));\n if (cell.x < 0.0 || cell.y < 0.0 || cell.x >= n.x || cell.y >= n.y) continue;\n float tc = startTime(cell, n);\n for (int pc = 0; pc < 2; pc++) {\n float piece = float(pc);\n float t0 = tc + GAP * piece;\n \n float tp = (progress - t0) / sw;\n for (int ly = 0; ly < 2; ly++) {\n float isPlate = ly == 0 ? 1.0 : 0.0;\n if (isPlate > 0.5 && !(plates != 0)) continue;\n float ts = t0 - LEAD * isPlate;\n float t = (progress - ts) / sw;\n \n if (t <= 0.0 || tp >= 1.0 || (isPlate > 0.5 && tp >= SETTLE)) continue;\n vec3 L = layerCover(p, cell, cs, piece, min(t, 1.0));\n if (isPlate > 0.5) L.x *= 1.0 - smoothstep(SETTLE - 0.1, SETTLE, tp);\n if (L.x <= 0.0) continue;\n vec4 cur = vec4(ts, L.x, isPlate, piece);\n vec4 curPos = vec4(cell, L.yz);\n if (ts > top.x) {\n und = top;\n undPos = topPos;\n top = cur;\n topPos = curPos;\n } else if (ts > und.x) {\n und = cur;\n undPos = curPos;\n }\n }\n }\n }\n }\n \n if (top.z < 0.5 && und.x < 0.0 && topPos.x == cell0.x && topPos.y == cell0.y) {\n landed = top.y < 1.0 ? landed / (1.0 - top.y) : 1.0;\n }\n vec4 c = mix(premultiplied(getFromColor(uv)), premultiplied(getToColor(uv)), clamp(landed, 0.0, 1.0));\n if (und.x >= 0.0) {\n vec4 uc = und.z > 0.5 ? plateColor(undPos.xy, und.w) : getToColor((undPos.xy + undPos.zw) * cs / vec2(ratio, 1.0));\n c = mix(c, premultiplied(uc), und.y);\n }\n if (top.x >= 0.0) {\n vec4 tc = top.z > 0.5 ? plateColor(topPos.xy, top.w) : getToColor((topPos.xy + topPos.zw) * cs / vec2(ratio, 1.0));\n c = mix(c, premultiplied(tc), top.y);\n }\n\n \n float sh = 0.0;\n if (shadow > 0.0) {\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cell = cell0 + vec2(float(dx), float(dy));\n if (cell.x < 0.0 || cell.y < 0.0 || cell.x >= n.x || cell.y >= n.y) continue;\n float tc = startTime(cell, n);\n for (int pc = 0; pc < 2; pc++) {\n float piece = float(pc);\n float t0 = tc + GAP * piece;\n float tp = (progress - t0) / sw;\n for (int ly = 0; ly < 2; ly++) {\n float isPlate = ly == 0 ? 1.0 : 0.0;\n if (isPlate > 0.5 && (!(plates != 0) || tp >= SETTLE)) continue;\n float ts = t0 - LEAD * isPlate;\n float t = (progress - ts) / sw;\n if (ts <= top.x || t <= 0.0 || t >= 1.0) continue;\n sh = max(sh, layerShadow(p, cell, cs, piece, t));\n }\n }\n }\n }\n }\n c.rgb *= 1.0 - 0.7 * clamp(shadow, 0.0, 1.0) * sh;\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","GlintDissolve":"// GlintDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlintDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The bright points of the outgoing image sparkle into crisp four-point star glints that swell and twinkle up to the cut, then shrink back into the highlights of the incoming image, which 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 size; \n\nuniform float threshold; \n\nuniform float intensity; \n\nuniform int diagonals; \n\nuniform float rotation; \n\nuniform float rainbow; \n\nuniform vec3 tint; \n\nconst float REACH = 6.0;\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 ray(vec2 d, float len, float width) {\n float a = abs(d.x) / len;\n if (a >= 1.0) return 0.0;\n float fall = (1.0 - a) * (1.0 - a);\n float w = width * (1.0 - 0.7 * a);\n return fall * exp(-d.y * d.y / (w * w));\n}\n\nvec3 spectrum(float a) {\n return 0.5 + 0.5 * cos(6.2831853 * (a + vec3(0.0, 0.33, 0.67)));\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float t = 1.0 - abs(2.0 * p - 1.0);\n float amount = t * (2.0 - t);\n \n float m = smoothstep(0.42, 0.58, p);\n if (amount <= 0.0) return m < 0.5 ? getFromColor(uv) : getToColor(uv);\n\n vec4 fromColor = getFromColor(uv);\n vec4 toColor = getToColor(uv);\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 = c.rgb / c.a;\n\n \n float cell = size / REACH;\n float ang = radians(rotation);\n vec2 cs = vec2(cos(ang), sin(ang));\n vec2 aspect = vec2(ratio, 1.0);\n vec2 o = (uv - 0.5) * aspect;\n vec2 q = vec2(o.x * cs.x + o.y * cs.y, o.y * cs.x - o.x * cs.y) / cell;\n vec2 home = floor(q);\n \n float width = min(0.0022 / cell, 0.07);\n\n vec3 light = vec3(0.0);\n \n \n for (int k = 0; k < 29; k++) {\n float fk = float(k);\n vec2 off = vec2(0.0);\n if (k >= 1 && k <= 12) off = vec2(fk < 7.0 ? fk - 7.0 : fk - 6.0, 0.0);\n else if (k >= 13 && k <= 24) off = vec2(0.0, fk < 19.0 ? fk - 19.0 : fk - 18.0);\n else if (k >= 25) off = vec2(mod(fk, 2.0) * 2.0 - 1.0, fk < 27.0 ? -1.0 : 1.0);\n \n if (max(abs(off.x), abs(off.y)) > REACH * amount + 1.0) continue;\n vec2 id = home + off;\n \n if (hash12(id + 89.5) > 0.55) continue;\n float h0 = hash12(id + 0.5);\n float h1 = hash12(id + 19.5);\n float h2 = hash12(id + 41.5);\n float h3 = hash12(id + 67.5);\n \n vec2 center = id + 0.5 + 0.6 * (vec2(h0, h1) - 0.5);\n vec2 cw = center * cell;\n vec2 st = vec2(cw.x * cs.x - cw.y * cs.y, cw.x * cs.y + cw.y * cs.x) / aspect + 0.5;\n if (st.x < 0.0 || st.x > 1.0 || st.y < 0.0 || st.y > 1.0) continue;\n \n \n float turn = 0.15 + 0.7 * h3;\n vec4 src = m < turn ? getFromColor(st) : getToColor(st);\n float lum = dot(src.rgb, vec3(0.2126, 0.7152, 0.0722)) * src.a;\n \n float knee = threshold + 0.8 * (1.0 - threshold) * h2;\n float b = smoothstep(knee, knee + 0.2 * (1.0 - threshold) + 1e-3, lum);\n if (b <= 0.0) continue;\n \n float twinkle = (0.6 + 0.4 * sin(6.2831853 * (h2 + (1.5 + h0) * p))) * smoothstep(0.0, 0.12, abs(m - turn));\n float len = REACH * amount * (0.45 + 0.55 * b) * (0.3 + 0.7 * h1 * h1) * (0.85 + 0.15 * twinkle);\n vec2 d = q - center;\n float r = length(d);\n float star = ray(d, len, width) + ray(d.yx, len, width);\n if ((diagonals != 0)) {\n vec2 e = vec2(d.x + d.y, d.x - d.y) * 0.70710678;\n star += 0.5 * (ray(e, 0.25 * len, width) + ray(e.yx, 0.25 * len, width));\n }\n \n float cr = r / (0.08 * len);\n star += exp(-cr * cr) + 0.3 * exp(-r / 0.2);\n \n float along = r / len;\n vec3 hue = mix(vec3(1.0), spectrum(1.3 * along + h0), rainbow * smoothstep(0.05, 0.4, along));\n vec3 col = mix(src.rgb / max(max(src.r, max(src.g, src.b)), 1e-3), vec3(1.0), 0.6);\n light += b * twinkle * star * hue * col;\n }\n light *= tint * intensity * amount * amount;\n \n light = 1.0 - exp(-light);\n return vec4(clamp(base + light - base * light, 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","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","GlitterDissolve":"// GlitterDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlitterDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The image becomes a shimmering field of tiny diamond sequins that flip over in 3D at random moments, each lifting and tilting on its own axis and flashing a glint of light, and land 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 tiles; \n\nuniform int hexagons; \n\nuniform float sparkle; \n\nuniform vec3 glint; \n\nuniform float seed; \n\nuniform vec4 backColor; \n\nconst float FLIP = 0.28;\n\nconst float LIFT = 0.3;\n\nconst float EDGE = 0.04;\n\nconst vec2 SHIFT = vec2(0.37, 0.21);\nconst float PI = 3.14159265;\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\nvec2 mirrored(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nfloat flipOf(vec2 id) {\n float t = clamp((progress - hash12(id) * (1.0 - FLIP)) / FLIP, 0.0, 1.0);\n return t * t * (3.0 - 2.0 * t);\n}\n\nvec2 axisOf(vec2 id) {\n float a = 2.0 * PI * hash12(id + 41.7);\n return vec2(cos(a), sin(a));\n}\n\nvec2 unproject(vec2 s, vec2 n, float f) {\n float c = abs(cos(PI * f));\n float along = dot(s, n);\n return (s + n * (along / max(c, 1e-4) - along)) / (1.0 + LIFT * sin(PI * f));\n}\n\nfloat shape(vec2 v) {\n v = abs(v);\n return (hexagons != 0) ? max(v.y, dot(v, vec2(0.8660254, 0.5))) : v.x + v.y;\n}\n\nvec2 idOf(vec2 center) {\n \n vec2 grid = (hexagons != 0) ? vec2(1.1547005, 2.0) : vec2(2.0);\n return floor(center * grid + 0.5) + vec2(13.0, 7.0) * floor(seed) + 3.0;\n}\n\nfloat coverOf(vec2 p, vec2 center) {\n vec2 id = idOf(center);\n float f = flipOf(id);\n if (f <= 0.0 || f >= 1.0) return 0.0;\n float z = sin(PI * f);\n \n float onScreen = (1.0 + LIFT * z) * max(abs(cos(PI * f)), 0.15);\n \n float edge = EDGE * min(1.0, 4.0 * z) + 1e-4;\n return clamp((0.5 - shape(unproject(p - center, axisOf(id), f))) * onScreen / edge, 0.0, 1.0);\n}\n\nvec4 tileColor(vec2 p, vec2 center) {\n vec2 id = idOf(center);\n float f = flipOf(id);\n vec2 n = axisOf(id);\n float c = cos(PI * f);\n float z = sin(PI * f);\n vec2 s0 = unproject(p - center, n, f);\n vec2 suv = mirrored((center + s0 - SHIFT) / tiles / vec2(ratio, 1.0) + 0.5);\n vec4 col = c > 0.0 ? getFromColor(suv) : getToColor(suv);\n \n vec3 nrm = normalize(vec3(n * z * (c < 0.0 ? -1.0 : 1.0) + 0.5 * s0, abs(c)));\n vec3 L = normalize(vec3(-0.3, 0.4, 1.0));\n float shade = 0.45 + 0.55 * clamp(dot(nrm, L) / L.z, 0.0, 1.6);\n \n vec3 H = normalize(vec3(-0.45, 0.55, 1.0));\n float spec = smoothstep(0.94, 0.995, dot(nrm, H)) * 2.0 + pow(1.0 - abs(c), 6.0) * 0.6;\n vec3 light = clamp(glint * sparkle * spec * z, 0.0, 1.0);\n vec3 base = clamp(col.rgb * mix(1.0, shade, z), 0.0, 1.0);\n return vec4(base + light - base * light, col.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 p = (uv - 0.5) * vec2(ratio, 1.0) * tiles + SHIFT;\n \n vec2 home;\n if ((hexagons != 0)) {\n vec2 s = vec2(1.7320508, 1.0);\n vec2 a = mod(p, s) - 0.5 * s;\n vec2 b = mod(p - 0.5 * s, s) - 0.5 * s;\n home = dot(a, a) < dot(b, b) ? p - a : p - b;\n } else {\n \n vec2 q = floor(vec2(p.x + p.y, p.y - p.x)) + 0.5;\n home = vec2(q.x - q.y, q.x + q.y) * 0.5;\n }\n\n \n float fHome = flipOf(idOf(home));\n vec4 under = fHome <= 0.0 ? getFromColor(uv) : fHome >= 1.0 ? getToColor(uv) : backColor;\n\n \n \n float z1 = -1.0;\n float z2 = -1.0;\n float cover1 = 0.0;\n float cover2 = 0.0;\n vec2 center1 = home;\n vec2 center2 = home;\n for (int k = 0; k < 9; k++) {\n float fk = float(k);\n vec2 off;\n if ((hexagons != 0)) {\n if (k > 6) break;\n off = k == 0 ? vec2(0.0) : k < 3 ? vec2(0.0, fk * 2.0 - 3.0) : vec2(mod(fk, 2.0) * 1.7320508 - 0.8660254, fk < 5.0 ? -0.5 : 0.5);\n } else {\n vec2 o = vec2(mod(fk, 3.0) - 1.0, floor(fk / 3.0) - 1.0);\n off = vec2(o.x - o.y, o.x + o.y) * 0.5;\n }\n vec2 center = home + off;\n float cover = coverOf(p, center);\n if (cover <= 0.0) continue;\n float z = sin(PI * flipOf(idOf(center)));\n if (z > z1) {\n z2 = z1;\n cover2 = cover1;\n center2 = center1;\n z1 = z;\n cover1 = cover;\n center1 = center;\n } else if (z > z2) {\n z2 = z;\n cover2 = cover;\n center2 = center;\n }\n }\n if (z1 < 0.0) return under;\n vec4 c = under;\n if (z2 >= 0.0 && cover1 < 1.0) c = mix(c, tileColor(p, center2), cover2);\n return mix(c, tileColor(p, center1), 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","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","GravityLens":"// GravityLens — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GravityLens.glsl\n// Author: gre\n// License: MIT\n// Description: A black disk appears and grows, bending the outgoing image around it like a heavy mass bends light: the image is stretched into a bright ring at the disk's edge and swallowed until the frame is black, then the disk shrinks back, unbending 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 strength; \n\nuniform float glow; \n\nuniform vec4 hole; \n\nconst float OVERSHOOT = 0.12;\n\nconst float PEAK = 0.55;\n\nconst float AA = 0.002;\n\nconst vec3 WARM = vec3(1.0, 0.86, 0.68);\n\nvec2 mirrored(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nvec4 transition(vec2 uv) {\n \n bool swallowing = progress < PEAK;\n float u = swallowing ? progress / PEAK : (1.0 - progress) / (1.0 - PEAK);\n float u2 = u * u;\n float k = u2 * (0.6 + 0.4 * u2);\n\n \n vec2 aspect = vec2(ratio, 1.0);\n vec2 far = max(center, 1.0 - center) * aspect;\n float rh = length(far) * (1.0 + OVERSHOOT) * k;\n \n float re = rh * (1.0 + max(strength, 0.0));\n\n vec2 d = (uv - center) * aspect;\n float r = max(length(d), 1e-5);\n \n vec2 q = mirrored(center + d * (1.0 - re * re / (r * r)) / aspect);\n vec4 c = swallowing ? getFromColor(q) : getToColor(q);\n \n float amount = smoothstep(0.0, 0.04, rh);\n \n float inner = clamp((r - rh) / (re - rh + 1e-4), 0.0, 1.0);\n c.rgb *= 1.0 - 0.7 * amount * (1.0 - inner * inner * (3.0 - 2.0 * inner));\n\n \n float g = max(glow, 0.0) * amount;\n float einstein = (r - re) / (0.3 * (re - rh) + 0.01);\n float photon = max(r - rh, 0.0) / (0.006 + 0.012 * rh);\n float light = g * (0.7 * exp(-einstein * einstein) + 1.6 * exp(-photon * photon));\n c.rgb = min(c.rgb * (1.0 + light) + WARM * (0.35 * light * c.a), vec3(1.0));\n\n \n float cov = clamp((rh - r) / (2.0 * AA), 0.0, 1.0);\n return mix(c, hole, cov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 cards that lift apart and turn over in perspective one after another, each one showing its part of the incoming image on its 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 ivec2 size; \n\nuniform float pause; \n\nuniform float dividerWidth; \n\nuniform vec4 bgcolor; \n\nuniform float randomness; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.0012;\n\nconst float EYE = 2.2;\n\nconst float STAGGER = 0.55;\n\nconst vec2 LIGHT = vec2(-0.45, 0.3);\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 easeInOut(float t) {\n return mix(t, t * t * (3.0 - 2.0 * t), 0.7);\n}\n\nfloat pausePart() {\n return clamp(pause, 0.05, 0.4);\n}\n\nfloat flipTime(vec2 cell, vec2 grid, float q, float stagger) {\n \n float wave = (cell.x + (grid.y - 1.0 - cell.y)) / max(grid.x + grid.y - 2.0, 1.0);\n float order = mix(wave, hash12(cell + 7.31), clamp(randomness, 0.0, 1.0));\n return easeInOut(clamp((q - order * stagger) / (1.0 - stagger), 0.0, 1.0));\n}\n\nfloat gapAmount() {\n float pp = pausePart();\n return smoothstep(0.0, pp, progress) * (1.0 - smoothstep(1.0 - pp, 1.0, progress));\n}\n\nfloat aa(float d, float e) {\n return clamp(d / max(2.0 * e, 1e-6) + 0.5, 0.0, 1.0);\n}\n\nfloat boxShadow(vec2 p, vec2 halfSize, float blur) {\n vec2 d = abs(p) - halfSize;\n float dist = length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);\n return 1.0 - smoothstep(-blur, blur, dist);\n}\n\nvec4 transition(vec2 uv) {\n vec2 grid = max(vec2(size), 1.0);\n vec2 frame = vec2(ratio, 1.0);\n vec2 tileSize = frame / grid;\n vec2 cell = clamp(floor(uv * grid), vec2(0.0), grid - 1.0);\n vec2 pos = uv * frame;\n float gapOpen = gapAmount();\n float minSide = min(tileSize.x, tileSize.y);\n float gap = clamp(dividerWidth, 0.0, 0.4) * minSide * gapOpen;\n vec2 halfTile = 0.5 * tileSize - gap;\n float eye = EYE * max(tileSize.x, tileSize.y);\n \n float pp = 0.6 * pausePart();\n float q = clamp((progress - pp) / (1.0 - 2.0 * pp), 0.0, 1.0);\n \n float stagger = grid.x * grid.y > 1.5 ? STAGGER : 0.0;\n\n \n vec4 c1 = vec4(0.0);\n vec4 c2 = vec4(0.0);\n float m1 = 0.0;\n float m2 = 0.0;\n float z1 = 1e9;\n float z2 = 1e9;\n bool rest1 = true;\n bool rest2 = true;\n float shadowBg = 0.0;\n float shadowFlip = 0.0;\n\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n vec2 nc = cell + vec2(float(i), float(j));\n if (nc.x < 0.0 || nc.y < 0.0 || nc.x > grid.x - 1.0 || nc.y > grid.y - 1.0) continue;\n float t = flipTime(nc, grid, q, stagger);\n float a = PI * t;\n float ca = cos(a);\n float sa = sin(a);\n bool rest = t <= 0.0 || t >= 1.0;\n if (rest) {\n ca = t <= 0.0 ? 1.0 : -1.0;\n sa = 0.0;\n }\n vec2 center = (nc + 0.5) * tileSize;\n vec2 q = pos - center;\n\n \n float lift = 0.05 * gapOpen * minSide + 0.35 * halfTile.x * sa;\n vec2 shOffset = -LIGHT * lift;\n vec2 shHalf = vec2(halfTile.x * abs(ca) + 0.5 * lift, halfTile.y);\n float sh = boxShadow(q - shOffset, shHalf, 0.01 * minSide + 0.5 * lift);\n shadowBg = 1.0 - (1.0 - shadowBg) * (1.0 - 0.45 * gapOpen * sh);\n shadowFlip = max(shadowFlip, 0.45 * sa * sa * sh);\n\n \n \n float den = eye * ca - q.x * sa;\n if (abs(den) < 1e-6) continue;\n float s = eye * ca / den;\n if (s <= 0.0) continue;\n vec3 hit = vec3(s * q.x, s * q.y, eye * (1.0 - s));\n float u = hit.x * ca - hit.z * sa;\n \n float xa = halfTile.x * ca * eye / (eye + halfTile.x * sa);\n float xb = -halfTile.x * ca * eye / (eye - halfTile.x * sa);\n float dx = min(q.x - min(xa, xb), max(xa, xb) - q.x);\n float dy = (halfTile.y - abs(hit.y)) / s;\n \n float e = max(min(EDGE, gap), EDGE * min(8.0 * sa, 1.0));\n float m = aa(min(dx, dy), e);\n if (m <= 0.0) continue;\n\n \n bool front = ca > 0.0;\n vec2 src = (center + vec2(front ? u : -u, hit.y)) / frame;\n vec4 col = front ? getFromColor(src) : getToColor(src);\n if (!rest) {\n \n float nx = front ? sa : -sa;\n float lit = abs(ca) + nx * LIGHT.x;\n col.rgb *= mix(0.35, 1.0, clamp(lit, 0.0, 1.0)) + 0.25 * max(lit - 1.0, 0.0);\n \n col.rgb += 0.12 * sa * (1.0 - smoothstep(0.0, 3.0 * EDGE, min(dx, dy)));\n }\n\n if (s < z1) {\n c2 = c1; m2 = m1; z2 = z1; rest2 = rest1;\n c1 = col; m1 = m; z1 = s; rest1 = rest;\n } else if (s < z2) {\n c2 = col; m2 = m; z2 = s; rest2 = rest;\n }\n }\n }\n\n \n vec4 color = bgcolor;\n color.rgb *= 1.0 - clamp(max(shadowBg, shadowFlip), 0.0, 1.0);\n if (rest2) c2.rgb *= 1.0 - shadowFlip;\n if (rest1) c1.rgb *= 1.0 - shadowFlip;\n color = mix(color, c2, m2);\n color = mix(color, c1, m1);\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","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 grows from the center with a little heartbeat 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\nuniform float pulse; \n\nuniform vec3 glowColor; \n\nuniform float glow; \n\nfloat dot2(vec2 v) { return dot(v, v); }\n\nfloat sdHeart(vec2 p) {\n p.x = abs(p.x);\n if (p.x + p.y > 1.0) return sqrt(dot2(p - vec2(0.25, 0.75))) - 0.35355339;\n return sqrt(min(dot2(p - vec2(0.0, 1.0)), dot2(p - 0.5 * max(p.x + p.y, 0.0)))) * sign(p.x - p.y);\n}\n\nfloat heartScale(vec2 p) {\n float l = length(p);\n if (l < 1e-6) return 0.0;\n vec2 d = vec2(abs(p.x), p.y) / l;\n vec2 m = vec2(0.0, 0.55) - vec2(0.25, 0.75);\n float b = dot(m, d);\n float tDisk = -b + sqrt(b * b - dot2(m) + 0.35355339 * 0.35355339);\n float tSide = d.x > d.y ? vec2(0.0, 0.55).y / (d.x - d.y) : 1e6;\n float tTop = d.x + d.y > 0.0 ? (1.0 - vec2(0.0, 0.55).y) / (d.x + d.y) : 1e6;\n return l / max(tDisk, min(tSide, tTop));\n}\n\nvec4 transition (vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n vec2 asp = vec2(ratio, 1.0);\n vec2 c = center * asp;\n \n \n float cx = clamp(center.x, 0.0, 1.0) * ratio;\n float full = max(\n max(max(heartScale(vec2(0.0, 0.0) - c), heartScale(vec2(ratio, 0.0) - c)),\n max(heartScale(vec2(0.0, 1.0) - c), heartScale(vec2(ratio, 1.0) - c))),\n heartScale(vec2(cx, 1.0) - c));\n float sm = max(smoothness, 0.001);\n \n full += 4.0 * sm;\n\n \n float p = progress;\n float e = p * p * (2.0 - p);\n float env = max(sin(3.14159265 * p), 0.0);\n float beat = sin(6.28318531 * 2.0 * p) * env * env;\n float s = full * clamp(e + 0.09 * pulse * beat, 0.0, 1.0);\n if (s <= 0.0) return a;\n\n vec2 q = uv * asp - c;\n float d = s * sdHeart(q / s + vec2(0.0, 0.55));\n float m = smoothstep(0.0, sm, -d);\n vec4 col = mix(a, b, m);\n \n float light = exp(-max(d, 0.0) / (0.008 + sm)) * (1.0 - m) * glow * min(1.0, 4.0 * env);\n return col + vec4(glowColor * light, 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","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","HingedSquares":"// HingedSquares — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HingedSquares.glsl\n// Author: gre\n// License: MIT\n// Description: The image is cut into squares that turn in alternate directions while staying hinged at their corners, so the sheet opens into a checkerboard of diamonds showing the incoming image; those diamonds then turn back into place and close the sheet\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 cells; \n\nuniform float shading; \n\nuniform float zoom; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.0012;\n\nvec2 rot(vec2 v, vec2 cs) {\n return vec2(cs.x * v.x + cs.y * v.y, -cs.y * v.x + cs.x * v.y);\n}\n\nvec2 node(float i) {\n return vec2(mod(i, 2.0), floor(i * 0.5));\n}\n\nfloat parity(vec2 n) {\n return mod(n.x + n.y, 2.0) < 0.5 ? 1.0 : -1.0;\n}\n\nvec4 nearest(vec2 w, vec2 g, float spacing, vec2 off, vec2 cs) {\n vec4 best = vec4(0.0, 0.0, 1e5, 0.0);\n for (int i = 0; i < 4; i++) {\n vec2 n = g + node(float(i));\n vec2 l = rot(w - (n + off) * spacing, vec2(cs.x, parity(n) * cs.y));\n vec2 q = abs(l) - 0.5;\n float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0);\n if (d < best.z) best = vec4(l, d, float(i));\n }\n return best;\n}\n\nvec3 gap(vec2 w, vec2 g, float spacing, vec2 off, vec2 cs) {\n vec3 best = vec3(0.0, 0.0, 0.0);\n float r = 1e5;\n for (int i = 0; i < 4; i++) {\n vec2 n = g + node(float(i));\n vec2 v = w - (n + off) * spacing;\n vec2 h = parity(n) > 0.0 ? cs.yx : cs;\n \n float ri = abs(v.x) * h.y + abs(v.y) * h.x;\n if (ri < r) {\n r = ri;\n best = vec3(rot(v, vec2(0.7071068, parity(n) * 0.7071068)), float(i));\n }\n }\n return best;\n}\n\nvec2 toUV(vec2 c, float n) {\n vec2 uv = c / (n * vec2(ratio, 1.0)) + 0.5;\n return abs(mod(uv + 1.0, 2.0) - 1.0);\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(cells), 1.0);\n float e = progress * progress * (3.0 - 2.0 * progress);\n float a = 0.5 * PI * e;\n \n float th = min(a, 0.5 * PI - a);\n \n vec2 cs = vec2(cos(th), sin(th));\n float spacing = cs.x + cs.y;\n float scale = n * mix(1.0, spacing, clamp(zoom, 0.0, 1.0));\n vec2 w = (uv - 0.5) * vec2(ratio, 1.0) * scale;\n bool first = a < 0.25 * PI;\n vec2 offF = first ? vec2(0.0) : vec2(0.5);\n vec2 offB = vec2(0.5) - offF;\n vec2 gF = floor(w / spacing - offF);\n vec2 gB = floor(w / spacing - offB);\n \n vec4 f = nearest(w, gF, spacing, offF, cs);\n vec3 b = gap(w, gB, spacing, offB, cs);\n vec2 nf = gF + node(f.w);\n vec2 nb = gB + node(b.z);\n vec2 uvF = toUV(nf + offF + f.xy, n);\n vec2 uvB = toUV(nb + offB + b.xy, n);\n vec4 colF = first ? getFromColor(uvF) : getToColor(uvF);\n vec4 colB = first ? getToColor(uvB) : getFromColor(uvB);\n\n \n float depth = clamp(shading, 0.0, 1.0) * sin(4.0 * th);\n \n if (depth > 0.0) {\n vec2 ws = w - vec2(0.12, -0.12) * depth;\n vec4 sh = nearest(ws, floor(ws / spacing - offF), spacing, offF, cs);\n colB.rgb *= 1.0 - 0.75 * depth * (1.0 - smoothstep(-0.12, 0.25, sh.z));\n }\n \n vec2 side = abs(f.x) > abs(f.y) ? vec2(sign(f.x), 0.0) : vec2(0.0, sign(f.y));\n float facing = dot(rot(side, vec2(cs.x, -parity(nf) * cs.y)), vec2(-0.7071, 0.7071));\n float rim = smoothstep(-0.07, -0.01, f.z);\n colF.rgb *= 1.0 + 0.35 * depth * rim * facing;\n\n \n float aa = EDGE * scale;\n float seal = aa * (1.0 - smoothstep(0.0, 3.0 * aa, cs.y));\n float cover = 1.0 - smoothstep(-aa, aa, f.z - seal);\n return mix(colB, colF, 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","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","HorizontalHold":"// HorizontalHold — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HorizontalHold.glsl\n// Author: gre\n// License: MIT\n// Description: The picture loses its horizontal hold like an old TV: it shears into diagonal bands that slide sideways and wrap around, separated by a slanted blanking bar that carries the incoming image in, then the shear straightens, wobbles and locks\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 slips; \n\nuniform float shear; \n\nuniform float barWidth; \n\nuniform vec4 barColor; \n\nfloat slipCount() {\n return max(float(slips), 1.0);\n}\n\nvec4 stream(float x, float y, float unsync) {\n float period = 1.0 + barWidth;\n float n = floor(x / period);\n float xm = x - n * period;\n vec2 q = vec2(min(xm, 1.0), y);\n vec4 c = n >= floor(0.5 * slipCount() + 0.5) ? getToColor(q) : getFromColor(q);\n \n float d = min(xm, 1.0 - xm);\n \n float g = max(1.0 - d / 0.05, 0.0);\n c.rgb += 0.3 * unsync * g * g * c.a;\n float soft = min(0.012 * unsync, 0.5 * barWidth) + 1e-5;\n return mix(barColor, c, clamp(d / soft, 0.0, 1.0));\n}\n\nvec4 transition(vec2 uv) {\n float period = 1.0 + barWidth;\n \n float t = min(progress / 0.88, 1.0);\n float err = 16.0 * t * t * (1.0 - t) * (1.0 - t);\n float slip = t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n \n float u = clamp((progress - 0.74) / 0.26, 0.0, 1.0);\n float lock = u * (1.0 - u) * (1.0 - u);\n float tilt = -0.5 * max(shear, 0.5) * lock * sin(9.42478 * u);\n float unsync = min(err + 3.0 * lock, 1.0);\n \n float ripple = 0.012 * sin(uv.y * 9.0 + progress * 40.0) + 0.005 * sin(uv.y * 31.0 - progress * 70.0);\n float x = uv.x + period * (slipCount() * slip + shear * err * (1.0 - uv.y) + tilt * (1.0 - uv.y)) + err * ripple;\n \n float blur = 0.002 * err * slipCount();\n vec4 c = stream(x, uv.y, unsync);\n if (blur > 0.0) {\n for (int i = 0; i < 4; i++) {\n c += stream(x + blur * (float(i) - 1.5), uv.y, unsync);\n }\n c /= 5.0;\n }\n \n c.rgb *= 1.0 - unsync * (0.1 + 0.08 * sin(uv.y * 480.0));\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","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","InsetWipe":"// InsetWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/InsetWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A rectangle anchored in a corner, on an edge or in the center grows until the incoming image fills the frame, revealing it in place without scaling it; in reverse, the outgoing image shrinks into the rectangle\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 anchor; \n\nuniform float smoothness; \n\nuniform float borderWidth; \n\nuniform vec4 borderColor; \n\nuniform int reverse; \n\nconst float AA = 0.001;\n\nvec4 premultiplied(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\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 an = clamp(anchor, 0.0, 1.0);\n vec2 sq = vec2(ratio, 1.0);\n \n \n vec2 ext = max(an, 1.0 - an) * sq;\n vec2 d = abs(uv - an) * sq;\n float s = max(smoothness, AA);\n float bw = max(borderWidth, 0.0);\n\n \n \n float t = (reverse != 0) ? 1.0 - progress : progress;\n float p = mix(t, t * t * (3.0 - 2.0 * t), 0.3);\n vec2 size = p * ext + mix(-(bw + s), s, p);\n \n float e = max(d.x - size.x, d.y - size.y);\n\n \n vec4 inside = (reverse != 0) ? a : b;\n vec4 c = premultiplied((reverse != 0) ? b : a);\n if (bw > 0.0) {\n \n float m = 1.0 - smoothstep(bw - s, bw + s, e);\n c = premultiplied(borderColor) * m + c * (1.0 - borderColor.a * m);\n }\n c = mix(c, premultiplied(inside), 1.0 - smoothstep(-s, s, e));\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","InsideCube":"// InsideCube — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/InsideCube.glsl\n// Author: gre\n// License: MIT\n// Description: The camera stands inside a cube: the outgoing image covers the wall in front of it and the view turns toward the next inner wall, so the outgoing image swings away in perspective as the incoming one turns into view, the walls darkening into the shaded inner corner 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 vec2 direction; \n\nuniform float fov; \n\nuniform float shading; \n\nuniform vec4 background; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.002;\n\nvec4 premultiply(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nfloat cornerShadow(float dist, float size) {\n float k = 1.0 - smoothstep(0.0, size, dist);\n return k * k;\n}\n\nvec4 wallColor(vec2 l, bool incoming, bool vertical, float s) {\n vec2 h = vec2(l.x * s, l.y);\n vec2 p = vertical ? h.yx : h;\n vec2 st = clamp(p / vec2(ratio, 1.0) + 0.5, 0.0, 1.0);\n return premultiply(incoming ? getToColor(st) : getFromColor(st));\n}\n\nvec4 transition(vec2 uv) {\n bool vertical = abs(direction.y) > abs(direction.x);\n float s = (vertical ? direction.y : direction.x) < 0.0 ? -1.0 : 1.0;\n \n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n vec2 q = vertical ? p.yx : p;\n q.x *= s;\n \n float A = vertical ? 0.5 : 0.5 * ratio;\n float B = vertical ? 0.5 * ratio : 0.5;\n \n \n float F = A / tan(radians(clamp(fov, 55.0, 170.0)) * 0.5);\n\n float e = smoothstep(0.0, 1.0, progress);\n float th = 0.5 * PI * e;\n float c = cos(th);\n float sn = sin(th);\n float amount = max(sin(PI * e), 0.0); \n float aa = EDGE * min(1.0, 40.0 * amount) + 1e-6;\n float shadow = shading * min(1.0, 4.0 * amount);\n\n \n \n \n vec2 cam = (A - F) * e * vec2(1.0, -1.0);\n vec2 d = vec2(q.x * c + F * sn, F * c - q.x * sn);\n\n \n vec2 P = vec2(A, F) - cam;\n float sc = F * (P.x * c - P.y * sn) / max(P.x * sn + P.y * c, 1e-6);\n\n \n float tf = d.y > 1e-6 ? (F - cam.y) / d.y : 1e6;\n float af = cam.x + tf * d.x;\n vec2 lf = vec2(af, q.y * tf);\n \n float ti = d.x > 1e-6 ? (A - cam.x) / d.x : 1e6;\n float ai = (F - A) - (cam.y + ti * d.y);\n vec2 li = vec2(ai, q.y * ti);\n\n \n float size = 0.8 * min(A, B);\n float edgeF = cornerShadow(A - af, size) + 0.5 * cornerShadow(B - abs(lf.y), size);\n float edgeI = cornerShadow(ai + A, size) + 0.5 * cornerShadow(B - abs(li.y), size);\n float shadeF = (1.0 - shading * 0.8 * (1.0 - c)) * (1.0 - 0.7 * shadow * min(edgeF, 1.0));\n float shadeI = (1.0 - shading * 0.8 * (1.0 - sn)) * (1.0 - 0.7 * shadow * min(edgeI, 1.0));\n\n \n \n \n float wF = clamp(0.5 + (sc - q.x) / aa, 0.0, 1.0);\n float covF = wF * clamp(0.5 + (B / tf - abs(q.y)) / aa, 0.0, 1.0)\n * clamp(0.5 + (af + A) * d.y / (tf * F * aa), 0.0, 1.0);\n float covI = (1.0 - wF) * clamp(0.5 + (B / ti - abs(q.y)) / aa, 0.0, 1.0)\n * clamp(0.5 + (A - ai) * d.x / (ti * F * aa), 0.0, 1.0);\n \n vec4 colF = covF > 0.0 ? wallColor(lf, false, vertical, s) : vec4(0.0);\n vec4 colI = covI > 0.0 ? wallColor(li, true, vertical, s) : vec4(0.0);\n colF.rgb *= shadeF;\n colI.rgb *= shadeI;\n\n \n vec4 bg = premultiply(background);\n float cov = covF + covI;\n if (cov < 1.0) {\n \n float tb = min(B / max(abs(q.y), 1e-6), min(tf, ti));\n vec2 fl = cam + tb * d;\n float edgeB = cornerShadow(F - fl.y, size) + cornerShadow(A - fl.x, size);\n bg.rgb *= 1.0 - 0.5 * shadow * min(edgeB, 1.0);\n }\n vec4 col = colF * covF + colI * covI + bg * (1.0 - cov);\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","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","KeyholeWipe":"// KeyholeWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/KeyholeWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A keyhole grows steadily from the center until the incoming image fills the frame, its bevelled rim and inner shadow making it read as a hole cut in a plate\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 rim; \n\nuniform float smoothness; \n\nconst float SLOT_HE = 0.23;\nconst float SLOT_TOP = 0.085;\nconst float SLOT_BOTTOM = 0.165;\nconst float SLOT_ROUND = 0.025;\n\nconst float GROW_Y = 0.1;\n\nconst float BEVEL = 0.028;\nconst float SHADE = 0.05;\n\nfloat dot2(vec2 v) { return dot(v, v); }\n\nfloat sdSlot(vec2 p) {\n p.y -= -0.17;\n float r1 = SLOT_BOTTOM - SLOT_ROUND;\n float r2 = SLOT_TOP - SLOT_ROUND;\n float he = SLOT_HE - SLOT_ROUND;\n vec2 k1 = vec2(r2, he);\n vec2 k2 = vec2(r2 - r1, 2.0 * he);\n p.x = abs(p.x);\n vec2 ca = vec2(p.x - min(p.x, p.y < 0.0 ? r1 : r2), abs(p.y) - he);\n vec2 cb = p - k1 + k2 * clamp(dot(k1 - p, k2) / dot2(k2), 0.0, 1.0);\n float s = (cb.x < 0.0 && ca.y < 0.0) ? -1.0 : 1.0;\n return s * sqrt(min(dot2(ca), dot2(cb))) - SLOT_ROUND;\n}\n\nfloat sdKeyhole(vec2 p) {\n return min(length(p - vec2(0.0, 0.2)) - 0.25, sdSlot(p));\n}\n\nfloat reach(vec2 p) {\n vec2 h = vec2(0.0, 0.2) - vec2(0.0, GROW_Y);\n float k = 0.25 * 0.25 - dot2(h);\n float b = dot(p, h);\n return (sqrt(b * b + k * dot2(p)) - b) / k;\n}\n\nvec4 transition (vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n vec2 asp = vec2(ratio, 1.0);\n vec2 c = center * asp;\n float sm = max(smoothness, 0.0005);\n\n \n \n vec2 o = c;\n vec2 lo = -o - 2.5 * sm;\n vec2 hi = asp - o + 2.5 * sm;\n float full = max(max(reach(lo), reach(hi)), max(reach(vec2(lo.x, hi.y)), reach(vec2(hi.x, lo.y))));\n\n \n float p = progress;\n float s = full * p;\n if (s <= 0.0) return a;\n\n vec2 q = (uv * asp - o) / s + vec2(0.0, GROW_Y);\n float d = sdKeyhole(q);\n \n float hole = 1.0 - smoothstep(-sm, sm, d * s + sm);\n\n float fade = smoothstep(0.0, 0.08, p) * (1.0 - smoothstep(0.7, 1.0, p));\n float rimA = rim * fade;\n if (rimA > 0.0) {\n \n \n vec2 e = vec2(0.002, 0.0);\n vec2 n = vec2(sdKeyhole(q + e) - sdKeyhole(q - e), sdKeyhole(q + e.yx) - sdKeyhole(q - e.yx));\n float lit = -dot(n / max(length(n), 1e-6), vec2(-0.35, 0.94));\n float bevel = 1.0 - smoothstep(0.0, BEVEL, d);\n float shade = exp(-max(d, 0.0) / SHADE);\n a.rgb *= 1.0 - rimA * (0.35 * shade + bevel * 0.4 * max(-lit, 0.0));\n a.rgb += rimA * bevel * bevel * 0.3 * max(lit, 0.0) * a.a;\n\n \n \n float wall = smoothstep(-0.03, 0.03, sdKeyhole(q + vec2(0.0, 0.05)));\n float vign = exp(min(d, 0.0) / SHADE);\n b.rgb *= 1.0 - rimA * (0.5 * wall + 0.3 * vign);\n }\n\n return mix(a, b, hole);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LayoutGrid":"// LayoutGrid — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LayoutGrid.glsl\n// Author: gre\n// License: MIT\n// Description: The frame splits into an asymmetric magazine grid as paper gutters open between the panels; panel after panel in reading order, the incoming image pushes the outgoing one out of its panel from a different side, a colored accent band between them, then the gutters close over the full 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 gutter; \n\nuniform float overlap; \n\nuniform float band; \n\nuniform float shadow; \n\nuniform vec4 paper; \n\nuniform vec4 accent; \n\nconst int PANELS = 6;\n\nconst float OPEN = 0.28;\n\nconst float START = 0.1;\n\nconst float EDGE = 0.0025;\n\nvec4 panelRect(int i, bool portrait) {\n if (portrait) {\n if (i == 0) return vec4(0.0, 0.68, 0.62, 1.0);\n if (i == 1) return vec4(0.62, 0.68, 1.0, 1.0);\n if (i == 2) return vec4(0.0, 0.36, 1.0, 0.68);\n if (i == 3) return vec4(0.0, 0.0, 0.46, 0.36);\n if (i == 4) return vec4(0.46, 0.17, 1.0, 0.36);\n return vec4(0.46, 0.0, 1.0, 0.17);\n }\n if (i == 0) return vec4(0.0, 0.42, 0.4, 1.0);\n if (i == 1) return vec4(0.4, 0.64, 1.0, 1.0);\n if (i == 2) return vec4(0.4, 0.0, 0.7, 0.64);\n if (i == 3) return vec4(0.7, 0.32, 1.0, 0.64);\n if (i == 4) return vec4(0.7, 0.0, 1.0, 0.32);\n return vec4(0.0, 0.0, 0.4, 0.42);\n}\n\nvec2 panelDir(int i, bool portrait) {\n if (portrait) {\n if (i == 0) return vec2(1.0, 0.0);\n if (i == 1) return vec2(0.0, -1.0);\n if (i == 2) return vec2(-1.0, 0.0);\n if (i == 3) return vec2(0.0, 1.0);\n if (i == 4) return vec2(1.0, 0.0);\n return vec2(-1.0, 0.0);\n }\n if (i == 0) return vec2(0.0, -1.0);\n if (i == 1) return vec2(-1.0, 0.0);\n if (i == 2) return vec2(0.0, 1.0);\n if (i == 3) return vec2(1.0, 0.0);\n if (i == 4) return vec2(-1.0, 0.0);\n return vec2(1.0, 0.0);\n}\n\nfloat easeInOut(float t) {\n return t < 0.5 ? 4.0 * t * t * t : 1.0 - 4.0 * (1.0 - t) * (1.0 - t) * (1.0 - t);\n}\n\nfloat span1(float x, float lo, float hi, float aa) {\n return smoothstep(lo - aa, lo + aa, x) * (1.0 - smoothstep(hi - aa, hi + aa, x));\n}\n\nfloat boxDist(vec2 p, vec2 lo, vec2 hi) {\n vec2 d = abs(p - 0.5 * (lo + hi)) - 0.5 * (hi - lo);\n return length(max(d, 0.0)) + min(max(d.x, d.y), 0.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 bool portrait = ratio < 1.0;\n \n vec2 aspect = vec2(ratio, 1.0) / min(ratio, 1.0);\n vec2 p = uv * aspect;\n \n float open = smoothstep(0.0, OPEN, progress) * (1.0 - smoothstep(1.0 - OPEN, 1.0, progress));\n float g = gutter * open;\n float ov = clamp(overlap, 0.0, 0.9);\n \n float span = (1.0 - 2.0 * START) / (1.0 + float(PANELS - 1) * (1.0 - ov));\n\n vec4 color = vec4(0.0);\n float cover = 0.0;\n float shade = 0.0;\n for (int i = 0; i < PANELS; i++) {\n vec4 r = panelRect(i, portrait);\n vec2 lo = r.xy * aspect + 0.5 * g;\n vec2 hi = r.zw * aspect - 0.5 * g;\n \n lo = mix(lo, vec2(-1.0), step(r.xy, vec2(0.0)));\n hi = mix(hi, aspect + 1.0, step(vec2(1.0), r.zw));\n float t = clamp((progress - START - float(i) * span * (1.0 - ov)) / span, 0.0, 1.0);\n \n float lift = 1.0 + 1.2 * sin(3.141592653589793 * t);\n \n float sd = boxDist(p - vec2(0.2, -0.35) * g * lift, lo, hi);\n shade = max(shade, (1.0 - smoothstep(-0.2 * g, 0.6 * g * lift + 1e-4, sd)) / sqrt(lift));\n \n float inside = span1(p.x, lo.x, hi.x, EDGE) * span1(p.y, lo.y, hi.y, EDGE);\n if (inside > 0.0) {\n vec2 dir = panelDir(i, portrait);\n vec4 c;\n if (t <= 0.0) {\n c = getFromColor(uv);\n } else if (t >= 1.0) {\n c = getToColor(uv);\n } else {\n float e = easeInOut(t);\n \n float len = abs(dot(r.zw - r.xy, dir));\n float w = band * len;\n vec2 q = uv - dir * e * (len + w);\n \n float a = dot(q - (dir.x + dir.y < 0.0 ? r.zw : r.xy), dir);\n \n float af = a * abs(dot(aspect, dir));\n float wf = w * abs(dot(aspect, dir));\n float fromW = smoothstep(-EDGE, 0.0, af);\n float toW = 1.0 - smoothstep(-wf, -wf + EDGE, af);\n \n float bandShade = 1.0 - shadow * 0.5 * (1.0 - smoothstep(-wf, -wf + 0.35 * wf + 1e-4, af));\n vec4 b = vec4(accent.rgb * bandShade, accent.a);\n \n c = mix(b, getFromColor(clamp(q, r.xy, r.zw)), fromW);\n c = mix(c, getToColor(clamp(q + dir * (len + w), r.xy, r.zw)), toW);\n }\n color += c * inside;\n cover += inside;\n }\n }\n color /= max(cover, 1.0);\n cover = min(cover, 1.0);\n vec4 bg = vec4(paper.rgb * (1.0 - shadow * shade * open), paper.a);\n return color + bg * (1.0 - 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","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","LedWall":"// LedWall — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LedWall.glsl\n// Author: gre\n// License: MIT\n// Description: The picture zooms into a giant LED screen of round glowing diodes on a dark panel; a refresh wave sweeps across it, each diode flicking with a bright pop as it switches to the incoming image, then the diodes melt back into the plain picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 glow; \n\nuniform float flash; \n\nuniform float zoom; \n\nuniform int triads; \n\nuniform vec2 direction; \n\nuniform vec4 panel; \n\nconst float RADIUS = 0.36;\n\nconst float EDGE = 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\nvec2 mirrored(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nfloat disc(float d, float r) {\n return 1.0 - smoothstep(r - EDGE, r + EDGE, d);\n}\n\nvec4 transition(vec2 uv) {\n \n float led = smoothstep(0.0, 0.3, progress) * (1.0 - smoothstep(0.7, 1.0, progress));\n float z = 1.0 + max(zoom, 0.0) * smoothstep(0.0, 0.45, progress) * (1.0 - smoothstep(0.55, 1.0, progress));\n vec2 p = 0.5 + (uv - 0.5) / z;\n\n \n vec2 aspect = vec2(ratio, 1.0);\n vec2 toCells = aspect * max(cells, 1.0) / min(ratio, 1.0);\n vec2 q = (p - 0.5) * toCells;\n vec2 id = floor(q + 0.5);\n vec2 local = q - id;\n vec2 side = vec2(local.x < 0.0 ? -1.0 : 1.0, local.y < 0.0 ? -1.0 : 1.0);\n\n \n vec2 dir = length(direction) > 1e-4 ? normalize(direction) : vec2(1.0, 0.0);\n float extent = abs(dir.x) * ratio + abs(dir.y);\n\n vec4 own = vec4(0.0);\n float ownSwitch = 0.0;\n vec4 halo = vec4(0.0);\n float haloWeight = 0.0;\n \n for (int i = 0; i < 4; i++) {\n \n if (i > 0 && glow * led <= 0.0) break;\n vec2 o = vec2(mod(float(i), 2.0), floor(float(i) / 2.0)) * side;\n vec2 c = id + o;\n vec2 cuv = c / toCells + 0.5;\n \n float s = clamp(dot((cuv - 0.5) * z * aspect, dir) / extent + 0.5, 0.0, 1.0);\n float when = 0.2 + 0.52 * s + 0.05 * (hash12(c + 71.0) - 0.5);\n float sw = smoothstep(when - 0.012, when + 0.012, progress);\n \n float x = (progress - when) / 0.018;\n float pop = exp(-x * x) - 0.5 * exp(-(x + 1.6) * (x + 1.6));\n vec2 suv = mirrored(cuv);\n vec4 col = mix(getFromColor(suv), getToColor(suv), sw);\n col.rgb = col.rgb * (1.0 + 1.4 * flash * pop) + 0.2 * flash * max(pop, 0.0);\n if (i == 0) {\n own = col;\n ownSwitch = sw;\n }\n float d = length(local - o);\n float w = 0.9 * glow * exp(-6.0 * max(d - RADIUS, 0.0)) * (1.0 + 0.8 * flash * max(pop, 0.0));\n \n if (o.x != 0.0) w *= smoothstep(0.0, 0.2, abs(local.x));\n if (o.y != 0.0) w *= smoothstep(0.0, 0.2, abs(local.y));\n halo += w * col;\n haloWeight += w;\n }\n\n \n vec4 plain = mix(getFromColor(p), getToColor(p), ownSwitch);\n float d = length(local);\n \n \n float r = mix(0.8, RADIUS, smoothstep(0.0, 0.6, led));\n vec4 gap = vec4(panel.rgb, panel.a * own.a);\n if (haloWeight > 0.0) {\n gap = mix(gap, halo / haloWeight, clamp(haloWeight * led, 0.0, 1.0));\n }\n vec4 body = own;\n if ((triads != 0)) {\n \n vec3 sub = vec3(\n disc(length(local - vec2(0.0, 0.15)), 0.2),\n disc(length(local - vec2(-0.13, -0.075)), 0.2),\n disc(length(local - vec2(0.13, -0.075)), 0.2));\n float m = max(sub.r, max(sub.g, sub.b));\n body = vec4(gap.rgb * (1.0 - m) + own.rgb * 1.5 * sub, mix(gap.a, own.a, m));\n \n r = max(r, 0.45);\n } else {\n \n float k = clamp(d / RADIUS, 0.0, 1.0);\n body.rgb *= 0.8 + 0.45 * (1.0 - k * k);\n }\n \n float lit = smoothstep(0.0, 0.8, led);\n body = mix(plain, body, lit * mix(1.0, lit, smoothstep(0.0, 0.7, d)));\n vec4 color = mix(gap, body, disc(d, r));\n return clamp(color, 0.0, 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","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","LightningFlash":"// LightningFlash — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LightningFlash.glsl\n// Author: gre\n// License: MIT\n// Description: Forked lightning bolts crack down from the top of the frame, the screen flashes white in a few stuttering strobes, and the incoming image appears lit by the last flickers as they fade out\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 bolts; \n\nuniform float strike; \n\nuniform float seed; \n\nuniform vec3 color; \n\nuniform float glow; \n\nuniform int flashes; \n\nconst float LEADER = 0.3;\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 jag(float s, float k) {\n float i = floor(s);\n return mix(hash(vec2(i, k)), hash(vec2(i + 1.0, k)), fract(s)) - 0.5;\n}\n\nfloat zigzag(float y, float k) {\n return min(ratio, 1.0) * (0.15 * jag(y * 5.0, k) + 0.06 * jag(y * 13.0, k + 1.0) + 0.03 * jag(y * 31.0, k + 2.0) + 0.012 * jag(y * 67.0, k + 3.0));\n}\n\nfloat boltX(float y, float x0, float x1, float y1, float z0, float z1, float k) {\n float t = (1.0 - y) / (1.0 - y1);\n return mix(x0 - z0, x1 - z1, t) + zigzag(y, k);\n}\n\nfloat branchX(float y, float xb, float yb, float zb, float dir, float k) {\n return xb + dir * (yb - y) + 0.6 * (zigzag(y, k) - zb);\n}\n\nfloat curveDist(vec2 q, float x, float slope, float outside) {\n float dx = abs(q.x - x);\n float d = dx * mix(inversesqrt(1.0 + slope * slope), 1.0, smoothstep(0.0, 0.08, dx));\n return length(vec2(d, max(outside, 0.0)));\n}\n\nfloat pulse(float p, float t0, float hold, float decay) {\n float x = p - t0;\n if (x < 0.0) return smoothstep(-0.012, 0.0, x);\n return exp(-max(x - hold, 0.0) / decay);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 q = vec2(uv.x * ratio, uv.y);\n \n float k0 = floor(seed) * 61.0;\n int nb = bolts < 1 ? 1 : (bolts > 3 ? 3 : bolts);\n int nf = flashes < 1 ? 1 : (flashes > 4 ? 4 : flashes);\n \n int cut = nf > 1 ? 1 : 0;\n\n \n float flash = 0.0;\n float lit = 0.0;\n float tCut = LEADER;\n float tLast = LEADER;\n float t = LEADER;\n for (int i = 0; i < 4; i++) {\n if (i < nf) {\n bool isCut = i == cut;\n float amp = isCut ? 1.0 : (i < cut ? 0.55 : 0.7 * pow(0.75, float(i - cut - 1)));\n float s = amp * pulse(p, t, isCut ? 0.025 : 0.004, isCut ? 0.03 : 0.022);\n flash = max(flash, s);\n lit = max(lit, pulse(p, t, 0.01, 0.045));\n if (isCut) tCut = t;\n tLast = t;\n t += (isCut ? 0.12 : 0.08) + 0.04 * hash(vec2(float(i), k0 + 5.0));\n }\n }\n \n float stutter = mix(0.7, 1.0, hash(vec2(floor(p * 70.0), k0 + 9.0)));\n flash *= stutter;\n \n float whiteout = pulse(p, tCut, 0.025, 0.02);\n \n float tail = p > tLast ? exp(-(p - tLast) / 0.1) * smoothstep(0.03, 0.06, p - tLast) : 0.0;\n flash = max(flash, 0.35 * tail * step(0.45, hash(vec2(floor(p * 40.0), k0 + 13.0))));\n\n \n float grow = clamp(p / LEADER, 0.0, 1.0);\n grow = (floor(grow * 7.0) + smoothstep(0.0, 1.0, fract(grow * 7.0))) / 7.0;\n float faint = 0.5 * mix(0.6, 1.0, hash(vec2(floor(p * 50.0), k0 + 11.0)));\n float boltLight = p < LEADER ? faint * smoothstep(0.0, 0.06, p) : max(lit * stutter, faint * exp(-(p - LEADER) / 0.12));\n boltLight = max(boltLight, 0.6 * flash * tail);\n boltLight *= 1.0 - smoothstep(tLast + 0.1, tLast + 0.3, p);\n\n \n float core = 0.0;\n float halo = 0.0;\n float near = 10.0;\n bool lightsOn = boltLight > 0.0 || flash > 0.0;\n for (int b = 0; b < 3; b++) {\n if (b < nb && lightsOn) {\n float fb = float(b);\n float kb = k0 + fb * 17.0;\n float x1 = strike * ratio;\n float y1 = -0.05;\n float bright = 1.0;\n if (b > 0) {\n \n float roomy = strike < 0.5 ? 1.0 : -1.0;\n bool cramped = min(strike, 1.0 - strike) < 0.25;\n float side = b == 1 || cramped ? roomy : -roomy;\n float dist = b == 2 && cramped ? 0.5 : 0.22;\n x1 = clamp(x1 + side * ratio * (dist + 0.12 * hash(vec2(fb, kb))), 0.08 * ratio, 0.92 * ratio);\n y1 = 0.25 + 0.25 * hash(vec2(fb, kb + 1.0));\n bright = 0.7;\n }\n float x0 = clamp(x1 + (hash(vec2(fb, kb + 2.0)) - 0.5) * 0.5 * min(ratio, 1.0), 0.1 * ratio, 0.9 * ratio);\n \n float tip = mix(1.02, y1, grow);\n \n float e = 0.01;\n float z0 = zigzag(1.0, kb);\n float z1 = zigzag(y1, kb);\n float x = boltX(q.y, x0, x1, y1, z0, z1, kb);\n float slope = (boltX(q.y + e, x0, x1, y1, z0, z1, kb) - boltX(q.y - e, x0, x1, y1, z0, z1, kb)) / (2.0 * e);\n float d = curveDist(q, x, slope, max(max(y1, tip) - q.y, q.y - 1.05));\n near = min(near, d);\n float w = 0.003 * mix(1.0, 0.7, fb / 2.0);\n core += bright * exp(-d * d / (w * w));\n halo += bright * (0.7 * exp(-d * 24.0) + 0.25 * exp(-d * 6.0));\n \n for (int j = 0; j < 3; j++) {\n float fj = float(j);\n float kj = kb + 3.0 + fj * 5.0;\n float tb = 0.12 + 0.2 * fj + 0.15 * hash(vec2(fj, kj));\n float yb = mix(1.0, y1, tb);\n float len = (0.3 + 0.25 * hash(vec2(fj, kj + 1.0))) * (1.0 - tb) * (1.0 - y1);\n float dir = (j == 1 ? -1.0 : 1.0) * (0.2 + 0.45 * hash(vec2(fj, kj + 2.0))) * min(ratio, 1.0);\n float xb = boltX(yb, x0, x1, y1, z0, z1, kb);\n float zb = zigzag(yb, kj);\n float bx = branchX(q.y, xb, yb, zb, dir, kj);\n float bs = (branchX(q.y + e, xb, yb, zb, dir, kj) - branchX(q.y - e, xb, yb, zb, dir, kj)) / (2.0 * e);\n float bd = curveDist(q, bx, bs, max(max(yb - len, tip) - q.y, q.y - yb));\n near = min(near, bd);\n float along = clamp((yb - q.y) / len, 0.0, 1.0);\n float fade = bright * (1.0 - 0.8 * along);\n float bw = w * mix(0.8, 0.4, along);\n core += fade * exp(-bd * bd / (bw * bw));\n halo += fade * 0.6 * (0.7 * exp(-bd * 24.0) + 0.25 * exp(-bd * 6.0));\n }\n }\n }\n\n \n float m = smoothstep(tCut, tCut + 0.025, p);\n vec4 c = vec4(0.0);\n if (m < 1.0) {\n vec4 a = getFromColor(uv);\n c += (1.0 - m) * vec4(a.rgb * a.a, a.a);\n }\n if (m > 0.0) {\n vec4 a = getToColor(uv);\n c += m * vec4(a.rgb * a.a, a.a);\n }\n if (c.a <= 0.0) return vec4(0.0);\n vec3 col = c.rgb / c.a;\n\n \n float live = smoothstep(0.0, 0.03, p) * (1.0 - smoothstep(0.85, 1.0, p));\n \n \n float dim = 0.4 * smoothstep(0.0, LEADER, p) * (1.0 - smoothstep(tCut, tLast + 0.15, p));\n float f = flash * mix(0.6 + 0.4 * exp(-near * 4.0), 1.0, smoothstep(0.6, 1.0, flash));\n col *= 1.0 - dim * live;\n col = col * (1.0 + 2.5 * f * live) + color * (1.1 * f * live);\n float g = 0.4 + 1.2 * glow;\n vec3 light = mix(color, vec3(1.0), 0.75) * min(core, 1.5) * 1.6 + color * g * halo;\n col += light * boltLight * live;\n col = mix(col, vec3(1.0), 0.92 * whiteout * live);\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","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","MoireWipe":"// MoireWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MoireWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Two sets of fine concentric rings, centered on two points that drift toward each other, overlay the image and interfere into a shifting moire of wide bands; the bands open onto the incoming image and widen until it fills the frame, while the thin dark and light ring lines fade 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\nuniform float density; \n\nuniform float bands; \n\nuniform float drift; \n\nuniform float lines; \n\nconst float PI = 3.141592653589793;\n\nconst float AA = 0.0012;\n\nconst float LINE = 0.1;\n\nconst float EDGE = 0.05;\n\nconst float START = 0.35;\n\nconst float INK = 0.7;\n\nfloat ringLines(float r, float f) {\n float q = abs(fract(r * f + 0.5) - 0.5);\n float aa = AA * f;\n float c = clamp((LINE - q) / (2.0 * aa) + 0.5, 0.0, 1.0);\n return mix(c, 2.0 * LINE, clamp(10.0 * aa - 0.5, 0.0, 1.0));\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 = progress * progress * (3.0 - 2.0 * progress);\n float f = max(density, 1.0);\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n\n \n float ang = 2.0 * PI * drift * t + START;\n float k = max(bands, 1.0) * (1.0 - 0.75 * t);\n vec2 axis = vec2(cos(ang), sin(ang)) * 0.5 * k / f;\n float r1 = length(p - axis);\n float r2 = length(p + axis);\n \n float f2 = f + 1.2 * k;\n\n \n \n float beat = abs(fract(f2 * r2 - f * r1 + 0.5) - 0.5);\n \n \n vec2 grad = f2 * (p + axis) / max(r2, AA) - f * (p - axis) / max(r1, AA);\n float s = min(AA * length(grad) + 0.004, EDGE);\n float w = mix(-EDGE, 0.5 + EDGE, t);\n float m = 1.0 - smoothstep(w - s, w + s, beat);\n\n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n\n \n \n float o = INK * clamp(lines, 0.0, 1.0) * sin(PI * t);\n float l = 1.0 - (1.0 - o * ringLines(r1, f)) * (1.0 - o * ringLines(r2, f2));\n c.rgb = mix(c.rgb, vec3(c.a * m), l);\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","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","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","PaperFold":"// PaperFold — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PaperFold.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a sheet of paper that folds in half in 3D along a vertical crease, then in half again along a horizontal one, its lit and shaded faces turning to show the back of the paper, and the small folded packet flies off the frame, leaving its shadow on 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 vec2 direction; \n\nuniform float tilt; \n\nuniform float shading; \n\nuniform vec4 paper; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.0015;\n\nconst float SHOW = 0.1;\n\nconst float CREASE = 0.02;\n\nconst vec3 LIGHT = vec3(-0.3995, 0.4494, 0.799);\n\nvec4 front(vec2 st) {\n return getFromColor(st / vec2(ratio, 1.0));\n}\n\nvec4 back(vec2 st) {\n vec4 c = front(st);\n return vec4(mix(paper.rgb, c.rgb, SHOW), c.a * paper.a);\n}\n\nvec4 topFace(vec2 st, bool second) {\n return second ? back(vec2(ratio - st.x, st.y)) : front(st);\n}\n\nfloat inside(vec2 p, float h, float k) {\n return min(min(p.x, h - p.x), min(p.y, k - p.y));\n}\n\nvec3 hitFlap(vec3 o, vec3 v, float h, vec3 n, vec3 along) {\n float den = dot(n, v);\n if (abs(den) < 1e-5) return vec3(-1.0, 0.0, 0.0);\n vec3 hinge = vec3(h, 0.0, 0.0);\n float t = dot(n, hinge - o) / den;\n vec3 q = o + t * v;\n return vec3(t, dot(q - hinge, along), q.y);\n}\n\nfloat shadowAt(vec3 q, vec3 l, float h, float k, vec3 n, vec3 along) {\n float sh = 0.0;\n if (q.z < -1e-4) {\n float soft = 0.004 - 0.4 * q.z;\n sh = smoothstep(-soft, soft, inside(q.xy - q.z / l.z * l.xy, h, k));\n }\n vec3 hit = hitFlap(q, l, h, n, along);\n if (hit.x > 0.0) {\n float height = hit.x * l.z;\n float soft = 0.004 + 0.3 * height;\n \n sh = max(sh, min(4.0 * n.x * n.x, 1.0) * smoothstep(-soft, soft, inside(hit.yz, h, k)) / (1.0 + 3.0 * height));\n }\n return sh;\n}\n\nvec3 toSheet(vec3 v, vec2 yaw, vec2 pitch, vec2 spin) {\n v = vec3(yaw.x * v.x + yaw.y * v.z, v.y, yaw.x * v.z - yaw.y * v.x);\n v = vec3(v.x, pitch.x * v.y + pitch.y * v.z, pitch.x * v.z - pitch.y * v.y);\n return vec3(spin.x * v.x + spin.y * v.y, spin.x * v.y - spin.y * v.x, v.z);\n}\n\nvec4 transition(vec2 uv) {\n float w = ratio;\n float shade = clamp(shading, 0.0, 1.0);\n \n float s = 2.0 * smoothstep(0.0, 0.62, progress);\n bool second = s > 1.0;\n float x = second ? s - 1.0 : s;\n float a = PI * mix(x, x * x * (3.0 - 2.0 * x), 0.6);\n float f = clamp((progress - 0.5) / 0.47, 0.0, 1.0);\n\n \n \n float turn = clamp(tilt, 0.0, 1.0) * (smoothstep(0.0, 0.25, progress) - smoothstep(0.4, 0.8, progress));\n vec2 yaw = vec2(cos(0.45 * turn), sin(0.45 * turn));\n vec2 pitch = vec2(cos(0.55 * turn), -sin(0.55 * turn));\n float dist = 2.5 * max(w, 1.0);\n float recede = dist * 0.35 * turn;\n\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n \n vec2 c = vec2(0.5 * w - 0.25 * w * min(s, 1.0), 0.5 - 0.25 * max(s - 1.0, 0.0));\n \n float reach = 0.5 * (abs(dir.x) * w + abs(dir.y)) + length(vec2(0.25 * w, 0.25)) + 0.4;\n float lift = 0.3 * smoothstep(0.0, 0.5, f);\n float turned = (dir.x < 0.0 ? 0.7 : -0.7) * f * f;\n vec2 spin = vec2(cos(turned), sin(turned));\n\n \n \n vec3 center = vec3(vec2(0.5 * w, 0.5) + dir * reach * f * f, -recede);\n vec3 eye = vec3(0.5 * w, 0.5, dist);\n vec3 e = toSheet(eye - center, yaw, pitch, spin) + vec3(c, 0.0);\n vec3 d = toSheet(vec3(uv.x * w, uv.y, 0.0) - eye, yaw, pitch, spin);\n vec3 l = toSheet(LIGHT, yaw, pitch, spin);\n if (second) {\n e.xy = e.yx;\n d.xy = d.yx;\n l.xy = l.yx;\n }\n float h = second ? 0.5 : 0.5 * w;\n float k = second ? 0.5 * w : 1.0;\n float creased = sin(a);\n vec3 n = vec3(-creased, 0.0, cos(a));\n vec3 along = vec3(cos(a), 0.0, creased);\n\n vec4 col = getToColor(uv);\n if (d.z < 0.0) {\n vec3 g = e + d * (e.z + lift) / -d.z;\n \n col.rgb *= 1.0 - 0.7 * shade * (1.0 - f * f) * shadowAt(g, l, h, k, n, along);\n }\n\n \n float t = d.z < 0.0 ? e.z / -d.z : -1.0;\n vec3 p = e + t * d;\n float m = clamp(inside(p.xy, h, k) / (EDGE * t) + 1.0, 0.0, 1.0);\n if (t > 0.0 && m > 0.0) {\n vec4 img = topFace(second ? p.yx : p.xy, second);\n float sh = shadowAt(p, l, h, k, n, along);\n img.rgb *= (1.0 - 0.7 * shade * sh) * (1.0 - 0.5 * shade * creased * exp(-abs(h - p.x) / CREASE));\n col = mix(col, img, m);\n }\n\n \n vec3 hit = hitFlap(e, d, h, n, along);\n if (hit.x > 0.0) {\n float r = hit.y;\n \n float dr = dot(along, normalize(d));\n float fore = sqrt(max(1.0 - dr * dr, 0.0025));\n float mf = clamp(min(min(r, h - r) * fore, min(hit.z, k - hit.z)) / (EDGE * hit.x) + 1.0, 0.0, 1.0);\n if (mf > 0.0) {\n bool up = dot(n, e - vec3(h, 0.0, 0.0)) > 0.0;\n vec2 st = vec2(h + r, hit.z);\n if (second) st = st.yx;\n vec4 img = up ? topFace(st, second) : back(st);\n \n float lit = dot(up ? n : -n, l) - l.z;\n img.rgb *= max(1.0 + 0.6 * shade * lit, 0.0) * (1.0 - 0.5 * shade * creased * exp(-abs(r) / CREASE));\n col = mix(col, img, mf);\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","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","ProjectorThrow":"// ProjectorThrow — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ProjectorThrow.glsl\n// Author: gre\n// License: MIT\n// Description: The lights go down on the outgoing image and a projector throws the incoming one onto it: a small, blurred, keystoned picture of light lands on the scene, tinted by the colors it falls on, then grows, comes into focus and squares up until it fills the frame as the scene beneath it fades 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\nuniform float darkness; \n\nuniform float keystone; \n\nuniform float blur; \n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 projected(vec2 q, vec2 r) {\n vec4 c = vec4(0.0);\n for (int i = 0; i < 8; i++) {\n float a = float(i) * 2.39996;\n vec2 o = sqrt((float(i) + 0.5) / 8.0) * vec2(cos(a), sin(a));\n vec4 t = getToColor(mirror(q + o * r));\n c += vec4(t.rgb * t.a, t.a);\n }\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a / 8.0) : vec4(0.0);\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 vec4 from = getFromColor(uv);\n\n \n float on = smoothstep(0.06, 0.26, p);\n float ambient = 1.0 - darkness * smoothstep(0.0, 0.2, p);\n \n float g = smoothstep(0.02, 1.0, p);\n float focus = 1.0 - smoothstep(0.15, 0.85, p);\n float size = mix(0.32, 1.0, g * (0.6 + 0.4 * g));\n float k = keystone * (1.0 - g);\n float cy = mix(0.58, 0.5, g);\n\n \n float y = (uv.y - cy) / size + 0.5;\n float wy = max(1.0 - 0.5 * k + k * y, 0.05);\n vec2 q = vec2((uv.x - 0.5) / (size * wy) + 0.5, y * (1.0 + 0.5 * k) / wy);\n\n \n float e = min((0.5 * size * wy - abs(uv.x - 0.5)) * ratio, size * min(y, 1.0 - y));\n float soft = 0.0015 + 0.035 * focus;\n float cov = mix(smoothstep(-soft, soft, e), 1.0, smoothstep(0.9, 1.0, p));\n \n float halo = 0.15 * focus * on * exp(-24.0 * max(-e, 0.0)) * (1.0 - cov);\n\n \n vec2 d = q - 0.5;\n float gain = on * mix(1.25, 1.0, g) * (1.0 + focus * (0.15 - 1.2 * dot(d, d)));\n \n vec2 r = blur * focus / (size * wy) * vec2(1.0 / ratio, (1.0 - 0.25 * k * k) / wy);\n vec4 pic = projected(q, r);\n vec3 light = pic.rgb * gain * cov + halo;\n\n \n \n float screen = smoothstep(0.35, 0.95, p);\n vec3 surface = mix(from.rgb, vec3(1.0), 0.35 + 0.65 * screen);\n vec3 col = from.rgb * ambient * (1.0 - cov * screen) + surface * light;\n \n return vec4(col, mix(max(from.a, pic.a * cov * on), pic.a, cov * screen));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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","PuzzleCube":"// PuzzleCube — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PuzzleCube.glsl\n// Author: gre\n// License: MIT\n// Description: The frame becomes the face of a twisty cube puzzle: dark gaps open between its cubies, then whole columns and rows of cubies turn a quarter turn around the cube one after another in 3D, each bringing the incoming image from the cube's side to the front, until the gaps close 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 size; \n\nuniform float gap; \n\nuniform float shading; \n\nuniform vec4 background; \n\nconst float PI = 3.141592653589793;\n\nconst float STAGGER = 0.45;\n\nconst float EDGE = 0.0012;\n\nfloat gridSize() {\n return float(size < 2 ? 2 : (size > 8 ? 8 : size));\n}\n\nfloat groupLength(float m) {\n return m > 0.0 ? 1.0 + (m - 1.0) * STAGGER : 0.0;\n}\n\nvec3 timeline(float n) {\n float lenEven = groupLength(floor((n + 1.0) * 0.5));\n float lenOdd = groupLength(floor(n * 0.5));\n float u = clamp((progress - 0.05) / 0.85, 0.0, 1.0) * (2.0 * lenEven + lenOdd);\n return vec3(u, lenEven, lenOdd);\n}\n\nfloat turnTime(vec3 tl, bool isCol, float idx, float n) {\n \n float k = isCol ? idx : n - 1.0 - idx;\n bool odd = mod(k, 2.0) > 0.5;\n \n if (odd && !isCol) return 0.0;\n float start = (odd ? 2.0 * tl.y : (isCol ? 0.0 : tl.y)) + floor(k * 0.5) * STAGGER;\n return clamp(tl.x - start, 0.0, 1.0);\n}\n\nfloat turnDir(bool isCol, float idx) {\n return mod(idx + (isCol ? 0.0 : 1.0), 2.0) < 0.5 ? 1.0 : -1.0;\n}\n\nfloat turnAngle(float t) {\n return 0.5 * PI * mix(t, t * t * (3.0 - 2.0 * t), 0.8);\n}\n\nfloat faceMask(vec2 fp, float n, float g) {\n if (g <= 0.0) return 1.0;\n vec2 cell = vec2(ratio, 1.0) / n;\n vec2 c = fp / cell;\n vec2 r = floor(c + 0.5);\n \n vec2 d = abs(c - r) * cell;\n d.x = (r.x < 0.5 || r.x > n - 0.5) ? 1.0 : d.x;\n d.y = (r.y < 0.5 || r.y > n - 0.5) ? 1.0 : d.y;\n float e = min(EDGE, 0.5 * g);\n return smoothstep(0.5 * g - e, 0.5 * g + e, min(d.x, d.y));\n}\n\nbool isDone(vec3 tl, vec2 fp, float n) {\n vec2 cell = clamp(floor(fp / (vec2(ratio, 1.0) / n)), 0.0, n - 1.0);\n return turnTime(tl, true, cell.x, n) >= 1.0 || turnTime(tl, false, cell.y, n) >= 1.0;\n}\n\nvec4 sticker(vec2 fp, bool incoming, float light, float n, float g) {\n vec2 uv = clamp(fp / vec2(ratio, 1.0), 0.0, 1.0);\n vec4 img = incoming ? getToColor(uv) : getFromColor(uv);\n vec4 body = vec4(background.rgb * light, background.a);\n return mix(body, vec4(img.rgb * light, img.a), faceMask(fp, n, g));\n}\n\nfloat lighting(vec3 nrm, bool isCol) {\n vec3 l = normalize(vec3(-0.35, 0.55, 1.0));\n if (isCol) l = l.yxz;\n return 1.0 - shading * (1.0 - clamp(dot(nrm, l) / l.z, 0.0, 1.0));\n}\n\nvec2 rot(vec2 v, float a) {\n float c = cos(a), s = sin(a);\n return vec2(c * v.x - s * v.y, s * v.x + c * v.y);\n}\n\nvec4 sliceHit(vec3 o, vec3 d, float a0, float w, float S, float a) {\n vec2 lo = rot(o.yz - vec2(0.5 * S, -0.5 * S), -a);\n vec2 ld = rot(d.yz, -a);\n ld = vec2(abs(ld.x) < 1e-6 ? 1e-6 : ld.x, abs(ld.y) < 1e-6 ? 1e-6 : ld.y);\n float dx = abs(d.x) < 1e-6 ? 1e-6 : d.x;\n vec3 t1 = vec3((a0 - o.x) / dx, (-0.5 * S - lo) / ld);\n vec3 t2 = vec3((a0 + w - o.x) / dx, (0.5 * S - lo) / ld);\n vec3 tn = min(t1, t2);\n vec3 tf = max(t1, t2);\n float tNear = max(tn.x, max(tn.y, tn.z));\n float tFar = min(tf.x, min(tf.y, tf.z));\n if (tNear > tFar || tNear <= 0.0) return vec4(-1.0);\n vec2 q = (lo + tNear * ld) / (0.5 * S);\n float across = o.x + tNear * d.x;\n if (tn.x >= tn.y && tn.x >= tn.z) return vec4(tNear, 4.0, across, sign(-dx));\n if (tn.y > tn.z) return vec4(tNear, ld.x < 0.0 ? 2.0 : 3.0, across, q.y);\n return vec4(tNear, ld.y < 0.0 ? 0.0 : 1.0, across, q.x);\n}\n\nvec4 sliceColor(vec4 hit, vec3 tl, bool isCol, float a, float dir, float S, float n, float g) {\n float f = hit.y;\n if (f > 3.5) return vec4(background.rgb * lighting(vec3(hit.w, 0.0, 0.0), isCol), background.a);\n vec2 nl = f < 0.5 ? vec2(0.0, 1.0) : f < 1.5 ? vec2(0.0, -1.0) : f < 2.5 ? vec2(1.0, 0.0) : vec2(-1.0, 0.0);\n float light = lighting(vec3(0.0, rot(nl, a)), isCol);\n \n \n bool front = f < 0.5;\n bool coming = nl.x * dir > 0.5;\n if (!front && !coming) return vec4(background.rgb * light, background.a);\n \n float r = 0.5 * S * (1.0 + (front ? hit.w : -dir * hit.w));\n vec2 fp = isCol ? vec2(hit.z, r) : vec2(r, hit.z);\n return sticker(fp, coming || isDone(tl, fp, n), light, n, g);\n}\n\nvec4 transition(vec2 uv) {\n float n = gridSize();\n vec3 tl = timeline(n);\n \n float g = gap * smoothstep(0.0, 0.1, progress) * (1.0 - smoothstep(0.9, 1.0, progress));\n vec2 P = vec2(uv.x * ratio, uv.y);\n\n \n bool isCol = tl.x < tl.y || tl.x >= 2.0 * tl.y;\n \n \n float w = (isCol ? ratio : 1.0) / n;\n float S = isCol ? 1.0 : ratio;\n vec2 pp = isCol ? P : P.yx;\n vec3 o = vec3(isCol ? vec2(0.5 * ratio, 0.5) : vec2(0.5, 0.5 * ratio), 1.2 + 0.6 * max(ratio, 1.0));\n \n vec3 d = vec3(pp, 0.0) - o;\n\n float k0 = clamp(floor(pp.x / w), 0.0, n - 1.0);\n float t0 = turnTime(tl, isCol, k0, n);\n\n float nearest = 1.0;\n vec4 color;\n if (t0 <= 0.0 || t0 >= 1.0) {\n \n color = isDone(tl, P, n) ? getToColor(uv) : getFromColor(uv);\n color = mix(background, color, faceMask(P, n, g));\n \n for (int j = -1; j <= 1; j += 2) {\n float k = k0 + float(j);\n if (k < 0.0 || k > n - 1.0) continue;\n float tk = turnTime(tl, isCol, k, n);\n if (tk <= 0.0 || tk >= 1.0) continue;\n float dist = abs(pp.x - (k + 0.5) * w) - 0.5 * w;\n color.rgb *= 1.0 - 0.5 * shading * sin(2.0 * turnAngle(tk)) * exp(-dist / (0.2 * w));\n }\n } else {\n \n float tw = abs(d.x) < 1e-6 ? 1e6 : (d.x < 0.0 ? k0 * w - o.x : (k0 + 1.0) * w - o.x) / d.x;\n float tb = (o.z + S) / -d.z;\n nearest = min(tw, tb);\n float along = o.y + nearest * d.y;\n float depth = (o.z + nearest * d.z) / -S;\n float light = tw < tb ? lighting(vec3(-sign(d.x), 0.0, 0.0), isCol) : 1.0;\n light *= 1.0 - shading * (0.5 + 0.4 * clamp(depth, 0.0, 1.0));\n \n color = along < 0.0 || along > S ? background : vec4(background.rgb * light, background.a);\n }\n\n \n for (int j = -1; j <= 1; j++) {\n float k = k0 + float(j);\n if (k < 0.0 || k > n - 1.0) continue;\n float tk = turnTime(tl, isCol, k, n);\n if (tk <= 0.0 || tk >= 1.0) continue;\n float dir = turnDir(isCol, k);\n float a = dir * turnAngle(tk);\n vec4 hit = sliceHit(o, d, k * w, w, S, a);\n if (hit.x > 0.0 && hit.x < nearest) {\n nearest = hit.x;\n color = sliceColor(hit, tl, isCol, a, dir, S, n, g);\n }\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","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","Reassemble":"// Reassemble — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Reassemble.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image cracks into irregular shards that burst apart toward the viewer, each one turning over in 3D at its own moment, then fly back together and lock into place as the incoming image carried on their backs\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 rows; \n\nuniform float depth; \n\nuniform float spread; \n\nuniform vec4 backColor; \n\nconst float PI = 3.141592653589793;\n\nconst float EYE = 2.5;\n\nconst float EDGE = 0.0015;\nconst float CRACK = 0.005;\n\nconst float START = 0.03;\nconst float DELAY = 0.08;\nconst float FLIGHT = 0.86;\n\nvec3 hash3(vec2 p) {\n vec3 q = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n q += dot(q, q.yxz + 33.33);\n return fract((q.xxy + q.yzz) * q.zyx);\n}\n\nvec2 seed(vec2 g, float size) {\n return (g + 0.5 + 0.7 * (hash3(g).xy - 0.5)) * size;\n}\n\nfloat shardDist(vec2 q, vec2 g, float size) {\n vec2 sj = seed(g, size);\n float d = 1e9;\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n if (x == 0 && y == 0) continue;\n vec2 sk = seed(g + vec2(float(x), float(y)), size);\n vec2 dir = sk - sj;\n d = min(d, dot(0.5 * (sj + sk) - q, dir) / length(dir));\n }\n }\n return d;\n}\n\nfloat ease(float t) {\n return t * t * (3.0 - 2.0 * t);\n}\n\nfloat burst(float t) {\n float u = clamp(t / 0.4, 0.0, 1.0);\n float v = clamp((t - 0.4) / 0.6, 0.0, 1.0);\n return t < 0.4 ? 1.0 - (1.0 - u) * (1.0 - u) : 1.0 - ease(v);\n}\n\nvec4 transition(vec2 uv) {\n vec2 aspect = vec2(ratio, 1.0);\n vec2 x = (uv - 0.5) * aspect;\n float size = 1.0 / clamp(float(rows), 1.0, 8.0);\n float E = clamp(spread, 0.0, 0.5);\n float Z = clamp(depth, 0.0, 1.0);\n float p = clamp(progress, 0.0, 1.0);\n vec3 L = normalize(vec3(-0.45, 0.55, 1.0));\n vec3 H = normalize(L + vec3(0.0, 0.0, 1.0));\n vec3 eye = vec3(0.0, 0.0, EYE);\n vec3 dir = vec3(x, -EYE);\n \n float act = smoothstep(0.0, START + DELAY, p) * (1.0 - smoothstep(START + FLIGHT, 1.0, p));\n\n \n float b0 = burst(clamp((p - START - 0.5 * DELAY) / FLIGHT, 0.0, 1.0));\n vec2 x0 = x * (EYE - 0.75 * Z * b0) / EYE / (1.0 + E * b0);\n vec2 cell0 = floor(x0 / size);\n\n \n float z1 = 1e9, z2 = 1e9;\n vec2 q1 = x, q2 = x;\n float f1 = 1.0, f2 = 1.0, m1 = 0.0, m2 = 0.0;\n float s1 = 1.0, s2 = 1.0, r1 = 0.0, r2 = 0.0;\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n vec2 g = cell0 + vec2(float(i), float(j));\n vec3 h = hash3(g + 17.0);\n float t = clamp((p - START - DELAY * h.x) / FLIGHT, 0.0, 1.0);\n float b = burst(t);\n \n float th = PI * ease(clamp((t - 0.1 - 0.48 * h.z) / 0.24, 0.0, 1.0));\n float ct = cos(th), st = sin(th);\n \n float phi = PI * h.y;\n float rz = 0.5 * (h.z - 0.5) * b;\n vec2 a0 = vec2(cos(phi), sin(phi));\n vec2 p0 = vec2(-a0.y, a0.x);\n vec3 a = vec3(cos(phi + rz), sin(phi + rz), 0.0);\n vec3 w = vec3(-a.y, a.x, 0.0) * ct + vec3(0.0, 0.0, st);\n vec2 c = seed(g, size);\n vec3 center = vec3(c * (1.0 + E * b), Z * b * (0.5 + 0.5 * h.x));\n vec3 nrm = cross(a, w);\n float den = dot(dir, nrm);\n if (abs(den) < 1e-6) continue;\n float lam = dot(center - eye, nrm) / den;\n if (lam <= 0.0) continue;\n vec3 hit = eye + lam * dir - center;\n float u = dot(hit, a), v = dot(hit, w);\n \n \n float front = den < 0.0 ? 1.0 : -1.0;\n vec2 q = c + u * a0 + front * v * p0;\n \n float k = EYE / (EYE - center.z);\n float e = shardDist(q, g, size) - CRACK * act;\n vec2 box = 0.5 * aspect - abs(q);\n e = min(e, min(box.x, box.y)) * k * mix(1.0, max(abs(ct), 0.2), min(b * 8.0, 1.0)) + 4.0 * EDGE * (1.0 - act);\n float m = clamp(e / (2.0 * EDGE) + 0.5, 0.0, 1.0);\n \n float zk = lam - 0.001 * m;\n if (m <= 0.0 || zk >= z2) continue;\n \n vec3 n = nrm * front;\n float lit = mix(0.45, 1.0, clamp(dot(n, L) / L.z, 0.0, 1.0));\n float glint = 0.2 * min(b * 4.0, 1.0) * pow(max(dot(n, H), 0.0), 24.0);\n \n float lock = sin(PI * clamp((t - 0.86) / 0.14, 0.0, 1.0));\n float rim = (0.3 * act * min(b * 4.0, 1.0) + 0.35 * lock) * (1.0 - smoothstep(0.0, 0.006, e));\n if (zk < z1) {\n z2 = z1; q2 = q1; f2 = f1; m2 = m1; s2 = s1; r2 = r1;\n z1 = zk; q1 = q; f1 = front; m1 = m; s1 = lit + glint; r1 = rim;\n } else {\n z2 = zk; q2 = q; f2 = front; m2 = m; s2 = lit + glint; r2 = rim;\n }\n }\n }\n\n vec4 col = backColor;\n if (m2 > 0.0) {\n vec2 src = q2 / aspect + 0.5;\n vec4 img = f2 > 0.0 ? getFromColor(src) : getToColor(src);\n img.rgb = mix(min(img.rgb * s2, vec3(img.a)), vec3(img.a), r2);\n col = mix(col, img, m2);\n }\n if (m1 > 0.0) {\n vec2 src = q1 / aspect + 0.5;\n vec4 img = f1 > 0.0 ? getFromColor(src) : getToColor(src);\n img.rgb = mix(min(img.rgb * s1, vec3(img.a)), vec3(img.a), r1);\n col = mix(col, img, m1);\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","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","RibbonTwist":"// RibbonTwist — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RibbonTwist.glsl\n// Author: gre\n// License: MIT\n// Description: The image twists like a ribbon around its horizontal center line, the twist travelling smoothly across its width, the outgoing image on its front and the incoming one on its 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 spread; \n\nuniform float perspective; \n\nuniform float shading; \n\nuniform int vertical; \n\nuniform vec4 backColor; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.002;\n\nvec4 transition (vec2 uv) {\n \n vec2 q = (vertical != 0) ? vec2(1.0 - uv.y, uv.x) : uv;\n \n float halfSize = (vertical != 0) ? 0.5 * ratio : 0.5;\n \n float t = smoothstep(0.0, 1.0, (progress * (1.0 + spread) - q.x) / spread);\n \n bool front = t < 0.5;\n float angle = PI * (front ? t : t - 1.0);\n float c = cos(angle);\n float s = sin(angle);\n \n \n float w = 2.0 * q.y - 1.0;\n float den = c + perspective * w * s;\n if (den <= 0.0) return backColor;\n float v = w / den;\n if (abs(v) >= 1.0) return backColor;\n \n float edge = max(EDGE * min(1.0, 20.0 * abs(s)), 1e-4);\n float top = c / (1.0 - perspective * s);\n float bottom = -c / (1.0 + perspective * s);\n float cover = clamp(min(top - w, w - bottom) * halfSize / edge, 0.0, 1.0);\n vec2 p = vec2(q.x, 0.5 + 0.5 * v);\n p = (vertical != 0) ? vec2(p.y, 1.0 - p.x) : p;\n vec4 img = front ? getFromColor(p) : getToColor(p);\n \n float lambert = clamp(c - 0.25 * s, 0.0, 1.0);\n vec4 color = vec4(img.rgb * mix(1.0 - shading, 1.0, lambert), img.a);\n return mix(backColor, 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","RingSpin":"// RingSpin — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RingSpin.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is cut into concentric rings that spin like the dials of a combination lock, in alternating directions and blurred with speed, one after another from the center outward; each ring overshoots a little and locks into place 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 rings; \n\nuniform int square; \n\nuniform int turns; \n\nuniform float stagger; \n\nuniform float blur; \n\nuniform float settle; \n\nconst float PI = 3.141592653589793;\n\nconst float SETTLE = 0.2;\n\nconst float GAP = 0.0035;\nconst float RIM = 0.012;\nconst float EDGE = 0.0015;\n\nvec2 mirrorUV(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec2 rotate(vec2 v, float a) {\n float c = cos(a), s = sin(a);\n return vec2(c * v.x + s * v.y, c * v.y - s * v.x);\n}\n\nfloat ringDelay(float n) {\n float m = max(n - 1.0, 1.0);\n return min(clamp(stagger, 0.0, 0.8) / m, 0.7 / (1.0 + 0.7 * m));\n}\n\nfloat ringTime(float i, float n) {\n float d = ringDelay(n);\n return progress >= 1.0 ? 1.0 : clamp((progress - d * i) / (1.0 - d * (n - 1.0)), 0.0, 1.0);\n}\n\nfloat activity(float i, float n) {\n float t = ringTime(i, n);\n return smoothstep(0.0, 0.08, t) * (1.0 - smoothstep(0.88, 1.0, t));\n}\n\nfloat spin(float t, float total) {\n float amp = 0.1 * settle * sign(total);\n float stopT = 1.0 - SETTLE;\n \n float v1 = amp * PI * stopT / (total * SETTLE);\n float u = clamp(t / stopT, 0.0, 1.0);\n float b = clamp((t - stopT) / SETTLE, 0.0, 1.0);\n return total * (u * u * (3.0 - 2.0 * u) + v1 * (u * u * u - u * u)) + amp * sin(PI * b) * (1.0 - b) * (1.0 - b);\n}\n\nvec4 transition(vec2 uv) {\n vec2 aspect = vec2(ratio, 1.0);\n vec2 c = (uv - 0.5) * aspect;\n float r = (square != 0) ? max(abs(c.x), abs(c.y)) : length(c);\n float n = clamp(float(rings), 1.0, 12.0);\n float w = ((square != 0) ? 0.5 * max(ratio, 1.0) : length(0.5 * aspect)) / n;\n float f = r / w;\n float i = min(floor(f), n - 1.0);\n float t = ringTime(i, n);\n\n vec4 col;\n if (t <= 0.0) col = getFromColor(uv);\n else if (t >= 1.0) col = getToColor(uv);\n else {\n float total = 2.0 * PI * max(float(turns), 1.0) * (mod(i, 2.0) < 0.5 ? 1.0 : -1.0);\n float a = spin(t, total);\n \n \n float u = min(t / (1.0 - SETTLE), 1.0);\n float omega = abs(total) * 6.0 * u * (1.0 - u) / ((1.0 - SETTLE) * (1.0 - ringDelay(n) * (n - 1.0)));\n float span = blur * min(omega * 0.015, 0.1 / max(r, 0.01));\n \n float m = smoothstep(0.3, 0.5, t);\n col = vec4(0.0);\n float ws = 0.0;\n for (int k = 0; k < 8; k++) {\n float x = float(k) / 7.0 - 0.5;\n vec2 q = mirrorUV(rotate(c, a + span * x) / aspect + 0.5);\n vec4 s = mix(getFromColor(q), getToColor(q), m);\n col += (1.0 - abs(x)) * s;\n ws += 1.0 - abs(x);\n }\n col /= ws;\n }\n\n \n \n float bj = clamp(floor(f + 0.5), 1.0, max(n - 1.0, 1.0));\n float act = n > 1.5 ? max(activity(bj - 1.0, n), activity(bj, n)) : 0.0;\n float d = (f - bj) * w;\n vec2 nr = (square != 0) ? (abs(c.x) > abs(c.y) ? vec2(sign(c.x), 0.0) : vec2(0.0, sign(c.y))) : c / max(r, 1e-4);\n \n float light = -sign(d) * dot(nr, vec2(-0.6, 0.8)) * (1.0 - smoothstep(GAP, GAP + RIM, abs(d))) * act;\n col.rgb = light > 0.0 ? mix(col.rgb, vec3(col.a), 0.35 * light) : col.rgb * (1.0 + 0.45 * light);\n col.rgb *= 1.0 - 0.85 * act * (1.0 - smoothstep(GAP - EDGE, GAP + EDGE, abs(d)));\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","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","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","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 cracks like a pane of glass from an impact point, then its shards break loose from the impact outward, tumbling in 3D and falling away with gravity to reveal the incoming image behind\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 shards; \n\nuniform float gravity; \n\nuniform float seed; \n\nconst float EYE = 2.5;\n\nconst float JITTER = 0.32;\n\nconst float EDGE = 0.0012;\nconst float CRACK_WIDTH = 0.0025;\nconst float BEVEL = 0.006;\n\nvec3 hash32(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yxz + 33.33);\n return fract((p3.xxy + p3.yzz) * p3.zyx);\n}\n\nfloat cellSize() {\n return 1.0 / clamp(shards, 3.0, 8.0);\n}\n\nvec2 seedOffset() {\n return vec2(37.0, 17.0) * floor(seed);\n}\n\nvec2 corner(vec2 p) {\n return (p + JITTER * (2.0 * hash32(p + seedOffset()).xy - 1.0)) * cellSize();\n}\n\nfloat side(vec2 q, vec2 a, vec2 b) {\n vec2 d = b - a;\n return (d.x * (q.y - a.y) - d.y * (q.x - a.x)) / length(d);\n}\n\nbool diagonalUp(vec2 c) {\n return hash32(c + seedOffset() + 0.5).z > 0.5;\n}\n\nfloat triangleDist(vec2 q, vec2 p0, vec2 p1, vec2 p2) {\n return min(min(side(q, p0, p1), side(q, p1, p2)), side(q, p2, p0));\n}\n\nvec4 locate(vec2 q) {\n vec2 c = floor(q / cellSize());\n \n vec2 a, b, cc, d;\n for (int i = 0; i < 2; i++) {\n a = corner(c);\n b = corner(c + vec2(1.0, 0.0));\n cc = corner(c + 1.0);\n d = corner(c + vec2(0.0, 1.0));\n c.x += side(q, d, a) < 0.0 ? -1.0 : (side(q, b, cc) < 0.0 ? 1.0 : 0.0);\n a = corner(c);\n b = corner(c + vec2(1.0, 0.0));\n cc = corner(c + 1.0);\n d = corner(c + vec2(0.0, 1.0));\n c.y += side(q, a, b) < 0.0 ? -1.0 : (side(q, cc, d) < 0.0 ? 1.0 : 0.0);\n }\n a = corner(c);\n b = corner(c + vec2(1.0, 0.0));\n cc = corner(c + 1.0);\n d = corner(c + vec2(0.0, 1.0));\n bool up = diagonalUp(c);\n float d0 = up ? triangleDist(q, a, b, cc) : triangleDist(q, a, b, d);\n float d1 = up ? triangleDist(q, a, cc, d) : triangleDist(q, b, cc, d);\n return vec4(c, d1 > d0 ? 1.0 : 0.0, abs(max(d0, d1)));\n}\n\nvec3 rotate(vec3 v, vec3 k, float angle) {\n float c = cos(angle), s = sin(angle);\n return v * c + cross(k, v) * s + k * dot(k, v) * (1.0 - c);\n}\n\nvec2 impact() {\n return clamp(center, 0.0, 1.0) * vec2(ratio, 1.0);\n}\n\nfloat reach() {\n vec2 c = impact();\n return length(max(c, vec2(ratio, 1.0) - c));\n}\n\nfloat fallMargin() {\n return 0.1 + 1.5 * cellSize();\n}\n\nfloat releaseTime(vec2 mid, float dn, float h, float g, float margin) {\n float latest = max(0.98 - sqrt(2.0 * (mid.y + margin) / g), 0.04);\n return 0.04 + (latest - 0.04) * (0.8 * pow(dn, 0.8) + 0.2 * h);\n}\n\nfloat flash(vec2 q) {\n float f = sin(3.141592653589793 * clamp(progress / 0.12, 0.0, 1.0));\n vec2 d = q - impact();\n return 0.6 * f * exp(-dot(d, d) / (0.004 + 0.02 * progress));\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n float s = cellSize();\n vec2 a = vec2(uv.x * ratio, uv.y);\n vec3 eye = vec3(0.5 * ratio, 0.5, -EYE);\n vec3 ray = vec3(a, 0.0) - eye;\n vec3 light = normalize(vec3(-0.35, 0.55, -1.0));\n vec3 halfway = normalize(light - normalize(ray));\n float g = 12.0 * clamp(gravity, 0.5, 3.0);\n vec2 imp = impact();\n float rch = reach();\n float margin = fallMargin();\n \n float crackTime = clamp(0.6 * (0.94 - sqrt(2.0 * (1.0 + margin) / g)), 0.05, 0.22);\n\n \n vec4 pane = vec4(0.0);\n float paneDepth = 1e9;\n vec4 here = locate(a);\n vec2 hc = here.xy;\n vec2 ha = corner(hc), hb = corner(hc + vec2(1.0, 0.0)), hcc = corner(hc + 1.0), hd = corner(hc + vec2(0.0, 1.0));\n bool hup = diagonalUp(hc);\n vec2 hcenter = here.z < 0.5 ? (hup ? ha + hb + hcc : ha + hb + hd) : (hup ? ha + hcc + hd : hb + hcc + hd);\n vec3 hh = hash32(hc + vec2(0.31, 0.57) * (here.z + 1.0) + seedOffset());\n hcenter /= 3.0;\n if (progress < releaseTime(hcenter, clamp(length(hcenter - imp) / rch, 0.0, 1.0), hh.x, g, margin)) {\n vec4 col = getFromColor(uv);\n float crack = clamp((progress - crackTime * length(a - imp) / rch) / 0.03, 0.0, 1.0);\n \n vec3 n = rotate(vec3(0.0, 0.0, -1.0), normalize(vec3(hh.yz - 0.5, 0.0) + 1e-4), 0.06 * crack * (hh.x - 0.5));\n col.rgb *= 1.0 + 1.2 * (dot(n, light) + light.z);\n col.rgb += crack * 0.35 * pow(max(dot(n, halfway), 0.0), 400.0) * col.a;\n float line = crack * (1.0 - smoothstep(0.0, CRACK_WIDTH, here.w));\n col.rgb = mix(col.rgb, vec3(0.95, 0.98, 1.0) * col.a, 0.85 * line);\n pane = col;\n paneDepth = 1.0;\n }\n\n \n float t1 = 1e9, t2 = 1e9;\n vec4 c1 = vec4(0.0), c2 = vec4(0.0);\n float a1 = 0.0, a2 = 0.0;\n float shadow = 0.0;\n\n \n \n vec2 look = a - 0.06 * progress * (a - imp) / rch - (a - eye.xy) * 0.06 * progress;\n vec2 g0 = floor(look / s) - 1.0;\n float rows = ceil(1.0 / s);\n for (int ri = 0; ri < 11; ri++) {\n float j = g0.y + float(ri);\n if (j > rows) break;\n if (j < -1.0) continue;\n for (int ci = 0; ci < 3; ci++) {\n vec2 c = vec2(g0.x + float(ci), j);\n vec2 ca = corner(c), cb = corner(c + vec2(1.0, 0.0)), ccc = corner(c + 1.0), cd = corner(c + vec2(0.0, 1.0));\n bool up = diagonalUp(c);\n for (int k = 0; k < 2; k++) {\n \n vec2 p0 = (k == 1 && !up) ? cb : ca;\n vec2 p1 = k == 0 ? cb : ccc;\n vec2 p2 = (k == 0 && up) ? ccc : cd;\n vec2 mid = (p0 + p1 + p2) / 3.0;\n vec3 h1 = hash32(c + vec2(0.31, 0.57) * float(k + 1) + seedOffset());\n vec2 away = mid - imp;\n float dist = length(away);\n float dn = clamp(dist / rch, 0.0, 1.0);\n float e = progress - releaseTime(mid, dn, h1.x, g, margin);\n if (e <= 0.0) continue;\n vec3 h2 = hash32(c + vec2(0.73, 0.19) * float(k + 1) + seedOffset());\n \n float near = 1.0 - dn;\n vec3 vel = vec3(away / max(dist, 1e-3) * (0.03 + 0.08 * h1.y) * (0.4 + near), -(0.05 + 0.2 * near * h1.z));\n vec3 pos = vec3(mid, 0.0) + vel * e - vec3(0.0, 0.5 * g * e * e, 0.0);\n \n if (pos.y + 1.5 * s < -0.05) continue;\n vec3 axis = normalize(vec3(h2.x - 0.5, h2.y - 0.5, 0.3 * (h2.z - 0.5)) + 1e-4);\n float angle = (3.0 + 5.0 * h2.z) * (h2.x < 0.5 ? -1.0 : 1.0) * e;\n vec3 n = rotate(vec3(0.0, 0.0, -1.0), axis, angle);\n float rel = smoothstep(0.0, 0.04, e);\n\n \n float den = dot(ray, n);\n float t = dot(pos - eye, n) / (abs(den) > 1e-4 ? den : 1e-4);\n vec2 q = mid + rotate(eye + t * ray - pos, axis, -angle).xy;\n float border = min(min(q.x, ratio - q.x), min(q.y, 1.0 - q.y));\n float inside = triangleDist(q, p0, p1, p2);\n float ed = min(inside, border);\n if (t > 0.0 && t < t2 && t < paneDepth && ed > 0.0) {\n vec3 nf = den > 0.0 ? -n : n;\n vec4 col = getFromColor(vec2(q.x / ratio, q.y));\n col.rgb *= mix(1.0, clamp(dot(nf, light) / -light.z, 0.45, 1.1), rel);\n float glint = max(dot(nf, halfway), 0.0);\n col.rgb += rel * 0.3 * pow(glint, 60.0) * col.a;\n \n float line = 0.85 * (1.0 - smoothstep(0.0, CRACK_WIDTH, inside)) * (1.0 - rel);\n float bevel = 0.8 * rel * (1.0 - smoothstep(0.0, BEVEL, ed)) * (0.3 + 0.7 * pow(glint, 6.0));\n col.rgb = mix(col.rgb, vec3(0.92, 0.97, 0.97) * col.a, max(line, bevel));\n float cover = mix(1.0, smoothstep(0.0, 2.0 * EDGE, ed), rel);\n if (t < t1) {\n t2 = t1; c2 = c1; a2 = a1;\n t1 = t; c1 = col; a1 = cover;\n } else {\n t2 = t; c2 = col; a2 = cover;\n }\n }\n\n \n float lden = dot(light, n);\n float ts = dot(pos - vec3(a, 0.0), n) / (abs(lden) > 1e-4 ? lden : 1e-4);\n vec2 qs = mid + rotate(vec3(a, 0.0) + ts * light - pos, axis, -angle).xy;\n float eds = min(triangleDist(qs, p0, p1, p2), min(min(qs.x, ratio - qs.x), min(qs.y, 1.0 - qs.y)));\n if (ts > 0.0 && eds > 0.0) {\n shadow = max(shadow, rel * smoothstep(0.0, 0.004 + 0.08 * ts, eds) * 0.45 * (1.0 - smoothstep(0.1, 0.9, ts)));\n }\n }\n }\n }\n\n \n vec4 back = getToColor(uv);\n back.rgb *= 1.0 - shadow;\n pane.rgb *= 1.0 - shadow;\n if (paneDepth == 1.0) back = pane;\n vec4 color = c1 * a1 + c2 * min(a2, 1.0 - a1) + back * max(1.0 - a1 - a2, 0.0);\n color.rgb += flash(a) * color.a;\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","Shockwave":"// Shockwave — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Shockwave.glsl\n// Author: Gilad Levi, github @Giladx\n// License: MIT\n// Description: A diagonal shockwave breaks the outgoing image into tiny falling glass tiles. Each tile slips away with a brief chromatic split and neon edge glow, revealing the incoming image beneath 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 tileSize; \n \n uniform float scatter; \n \n uniform float diagonal; \n \n uniform float prism; \n \n uniform float glow; \n\n \n float toseeHash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n }\n\n vec4 transition(vec2 uv) {\n \n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n \n float size = max(tileSize, 0.008);\n vec2 grid = max(vec2(1.0), floor(vec2(ratio, 1.0) / size));\n vec2 cell = floor(uv * grid);\n vec2 cellUV = fract(uv * grid);\n vec2 centerUV = (cell + 0.5) / grid;\n\n \n float sweep = mix(\n centerUV.x,\n 0.64 * centerUV.x + 0.36 * (1.0 - centerUV.y),\n clamp(diagonal, 0.0, 1.0)\n );\n\n float noise = toseeHash(cell);\n float start = 0.62 * sweep + 0.07 * noise;\n float t = clamp((progress - start) / 0.29, 0.0, 1.0);\n float movement = t * clamp(scatter, 0.0, 1.5);\n\n \n float wobble = toseeHash(cell + vec2(19.3, 7.7)) * 2.0 - 1.0;\n vec2 drift = vec2(0.65 * wobble, -0.95) * movement;\n vec2 movingCellUV = cellUV - drift;\n\n \n float inside =\n step(0.012, movingCellUV.x) *\n step(movingCellUV.x, 0.988) *\n step(0.012, movingCellUV.y) *\n step(movingCellUV.y, 0.988);\n\n float tileShape = mix(1.0, inside, smoothstep(0.0, 0.13, t));\n float oldVisibility = 1.0 - smoothstep(0.48, 0.87, t);\n float oldMask = tileShape * oldVisibility;\n\n \n vec2 oldUV = clamp(uv - drift / grid, 0.0, 1.0);\n vec4 oldColor = getFromColor(oldUV);\n\n \n float flare = sin(3.14159265 * t);\n vec2 shift = vec2(0.006, -0.002) * prism * flare;\n vec4 offsetColor = getFromColor(\n clamp(oldUV + shift, 0.0, 1.0)\n );\n oldColor.r = offsetColor.r;\n\n \n vec4 result = mix(getToColor(uv), oldColor, oldMask);\n\n \n float edgeDistance = min(\n min(movingCellUV.x, 1.0 - movingCellUV.x),\n min(movingCellUV.y, 1.0 - movingCellUV.y)\n );\n\n float edge =\n (1.0 - smoothstep(0.0, 0.10, edgeDistance)) * inside;\n\n vec3 cyan = vec3(0.12, 0.95, 1.0);\n vec3 pink = vec3(1.0, 0.20, 0.65);\n\n vec3 rimColor = mix(\n cyan,\n pink,\n toseeHash(cell + vec2(5.4, 28.6))\n );\n\n result.rgb = clamp(\n result.rgb + rimColor * edge * flare * glow * oldMask * 0.60,\n 0.0,\n 1.0\n );\n\n return result;\n }\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ShoreWash":"// ShoreWash — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ShoreWash.glsl\n// Author: gre\n// License: MIT\n// Description: A thin sheet of water runs up over the outgoing image like the last of a wave on a beach, its lobed front edged with bubbly foam; it slows, stops just past the far edge and drains back, leaving the incoming image wet and glossy as it dries\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 foam; \n\nuniform float refraction; \n\nuniform vec4 water; \n\nconst float AA = 0.002;\n\nconst float LOBE = 0.06;\n\nconst float LACE = 0.3;\n\nconst float CELL = 0.045;\n\nconst float RUNUP = 0.4;\n\nconst float FOAMW = 0.1;\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\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\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(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 bubbles(vec2 p, float density) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n float d1 = 8.0;\n float d2 = 8.0;\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 o = vec2(float(x), float(y));\n vec2 c = o + 0.15 + 0.7 * hash22(i + o) - f;\n float d = dot(c, c);\n if (d < d1) {\n d2 = d1;\n d1 = d;\n } else if (d < d2) {\n d2 = d;\n }\n }\n }\n float e = sqrt(d2) - sqrt(d1);\n float w = 0.12 + 0.6 * density;\n return (1.0 - smoothstep(w - 0.12, w + 0.12, e)) * smoothstep(0.0, 0.35, density);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(0.0, 1.0);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n \n float a = dot(q, dir);\n float b = dot(q, vec2(-dir.y, dir.x));\n \n float extent = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n float start = -extent - LOBE - 0.1;\n float stop = extent + LOBE + 0.01;\n\n \n float up = clamp(progress / RUNUP, 0.0, 1.0);\n float back = clamp((progress - RUNUP) / (1.0 - RUNUP), 0.0, 1.0);\n float front = mix(start, stop, 1.0 - pow(1.0 - up, 1.6)) - (stop - start) * pow(back, 1.5);\n\n \n float lobes = vnoise(vec2(b * 7.0 + 3.1, progress * 2.0)) * 0.7 + vnoise(vec2(b * 17.0, 5.0 + progress * 3.0)) * 0.3;\n float behind = front + LOBE * (lobes - 0.5) * 2.0 - a; \n float sheet = smoothstep(-AA, AA, behind);\n\n \n \n float swapped = max(smoothstep(0.01, 0.8 * FOAMW, behind), (progress < RUNUP ? sheet : 1.0) * smoothstep(RUNUP - 0.08, RUNUP, progress));\n\n \n vec2 rp = vec2(a * 20.0, b * 5.0 + 3.0 * vnoise(q * 4.0)) - vec2(7.0 * min(progress, RUNUP) - 5.0 * back, 0.0);\n float n0 = vnoise(rp);\n vec2 g = (vnoise(rp + vec2(0.15, 0.0)) - n0) / 0.15 * dir + (vnoise(rp + vec2(0.0, 0.15)) - n0) / 0.15 * vec2(-dir.y, dir.x);\n \n float thick = sheet * smoothstep(0.0, 0.12, behind);\n vec2 off = g * refraction * thick * vec2(1.0 / ratio, 1.0);\n\n vec4 c = mix(getFromColor(mirror(uv + off)), getToColor(mirror(uv + off)), swapped);\n c.rgb = mix(c.rgb, water.rgb, water.a * sheet * (0.3 + 0.7 * smoothstep(0.0, 0.35, behind)));\n \n float glint = pow(max(dot(normalize(vec3(-g, 3.0)), normalize(vec3(-0.3, 0.6, 1.0))), 0.0), 14.0);\n c.rgb += glint * 0.4 * thick;\n\n \n float wet = (1.0 - sheet) * exp(min(behind, 0.0) * 2.5) * smoothstep(RUNUP, RUNUP + 0.05, progress) * (1.0 - smoothstep(0.7, 1.0, progress));\n c.rgb *= mix(vec3(1.0), c.rgb, 0.55 * wet);\n c.rgb += 0.1 * wet * smoothstep(0.4, 0.9, vnoise(vec2(a * 30.0, b * 6.0)));\n\n \n \n \n vec2 lp = vec2(a - 0.4 * (progress < RUNUP ? front : stop), b) / CELL;\n \n float patches = smoothstep(0.45, 0.8, 0.6 * vnoise(lp * vec2(0.4, 0.1) + 4.0) + 0.4 * vnoise(lp * 0.3 + 9.0));\n float bandW = FOAMW * (0.5 + vnoise(vec2(b * 25.0, 2.0)));\n float density = (1.0 - smoothstep(0.0, bandW, behind)) * (1.0 - smoothstep(RUNUP - 0.05, RUNUP + 0.12, progress));\n density = max(density, 0.55 * patches * (1.0 - smoothstep(0.0, LACE, behind)) * (1.0 - 0.5 * back));\n density = max(density, 0.9 * (1.0 - smoothstep(0.0, 0.012 + 0.02 * vnoise(vec2(b * 40.0, 1.0)), behind)));\n density *= sheet;\n \n float f = 0.0;\n if (density > 0.0) {\n f = max(bubbles(lp, density), 0.85 * bubbles(lp * 1.7 + 7.0, density * 0.9));\n f = max(f, 0.45 * smoothstep(0.15, 0.7, density)) * foam;\n }\n \n c.rgb *= 1.0 - 0.25 * sheet * foam * (1.0 - f) * smoothstep(0.0, 0.6, density);\n c.rgb = mix(c.rgb, vec3(0.97, 0.98, 0.97), clamp(f, 0.0, 1.0));\n \n float sh = smoothstep(-0.03, 0.0, behind);\n c.rgb *= 1.0 - 0.35 * (1.0 - sheet) * sh * sh * (1.0 - smoothstep(RUNUP - 0.05, RUNUP, progress));\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","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","ShutterWipe":"// ShutterWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ShutterWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A camera's focal-plane shutter fires across the frame, seen through the camera's gate: thin metal blades fan down from a tight stack above it until they overlap over the whole frame, then keep running down and stack below it, uncovering the incoming image from the 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\nuniform int blades; \n\nuniform float tilt; \n\nuniform float gate; \n\nuniform vec4 color; \n\nconst float STACK = 0.016;\nconst float REST = 0.05;\n\nvec4 transition(vec2 uv) {\n float n = clamp(float(blades), 3.0, 10.0);\n \n float h = 1.7 / n + 0.02;\n float pile = (n - 1.0) * STACK;\n \n \n float travel = 1.0 + 2.0 * REST + h + pile;\n vec2 t = clamp((progress - vec2(0.0, 0.3)) / 0.7, 0.0, 1.0);\n vec2 pos = 1.0 + REST + vec2(0.0, pile) - travel * t * t * (3.0 - 2.0 * t);\n vec2 vel = travel * 6.0 * t * (1.0 - t) / 0.7;\n\n float x = (uv.x - 0.5) * ratio;\n \n vec4 col = progress < 0.5 ? getFromColor(uv) : getToColor(uv);\n \n for (int i = 0; i < 10; i++) {\n float k = float(i) / (n - 1.0);\n if (k < 1.0001) {\n float v = mix(vel.x, vel.y, k);\n \n float d = uv.y - mix(pos.x, pos.y, k) + tilt * 0.1 * v * x;\n \n float aa = 0.002 + 0.005 * v;\n float sh = (1.0 - smoothstep(0.0, 0.03 + 0.012 * v, -d)) * (1.0 - smoothstep(-aa, aa, d));\n col.rgb *= 1.0 - 0.65 * color.a * sh * sh;\n \n \n \n float l = clamp(d / h, 0.0, 1.0);\n float lip = smoothstep(0.003, 0.007, d) * (1.0 - smoothstep(0.007, 0.014, d));\n float s = (uv.y - d - 0.55 + 0.3 * x) * 2.5;\n float sheen = 0.3 * exp(-s * s) * (1.0 - l) * (1.0 - l);\n vec3 metal = color.rgb * (1.3 - 0.75 * l) + (0.25 * lip + sheen) * (0.6 + 0.4 * color.rgb) * color.a;\n metal *= 0.4 + 0.6 * smoothstep(0.0, 0.005, d);\n float cover = smoothstep(-aa, aa, d) * (1.0 - smoothstep(h - aa, h + aa, d));\n col = mix(col, vec4(clamp(metal, 0.0, 1.0), color.a), cover);\n }\n }\n \n float g = gate * smoothstep(0.0, 0.12, progress) * (1.0 - smoothstep(0.88, 1.0, progress));\n vec2 c = abs(uv - 0.5) * vec2(ratio, 1.0) - vec2(0.5 * ratio, 0.5) + 1.5 * g;\n float e = length(max(c, 0.0)) + min(max(c.x, c.y), 0.0) - 0.5 * g;\n float on = smoothstep(0.0, 0.002, gate) * smoothstep(0.0, 0.04, progress) * (1.0 - smoothstep(0.96, 1.0, progress));\n \n col.rgb *= 1.0 - 0.5 * color.a * on * smoothstep(-0.4 * g - 0.001, 0.0, e);\n vec3 housing = min(color.rgb * (1.5 - smoothstep(0.0, 0.2 * g + 0.001, e)), 1.0);\n return mix(col, vec4(housing, color.a), on * smoothstep(-0.002, 0.002, e));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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","SketchDissolve":"// SketchDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SketchDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image fades back to blank paper while the incoming one is drawn on it in pencil, outlines first and then hatching in the shadows, before its shading and colors fill in until the picture is complete\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 lineWidth; \n\nuniform float edges; \n\nuniform float hatching; \n\nuniform vec4 paper; \n\nuniform vec4 ink; \n\nfloat sdHash (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 sdNoise (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(sdHash(i), sdHash(i + vec2(1.0, 0.0)), f.x),\n mix(sdHash(i + vec2(0.0, 1.0)), sdHash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nvec2 sdTone (vec2 uv) {\n vec4 c = getToColor(uv);\n return vec2(dot(c.rgb, vec3(0.299, 0.587, 0.114)), c.a);\n}\n\nfloat sdHatch (vec2 q, vec2 d, float dark) {\n float s = dot(q, d) * 60.0 + 0.5 * sdNoise(q * 9.0 + d * 13.0);\n float row = floor(s);\n \n float along = dot(q, vec2(-d.y, d.x)) * 8.0 + sdHash(vec2(row, d.y * 7.0)) * 5.0;\n float cell = floor(along);\n float k = sdHash(vec2(row, cell) + d * 31.0);\n float gap = smoothstep(0.0, 0.12, fract(along)) * (1.0 - smoothstep(0.75 - 0.2 * k, 1.0, fract(along)));\n float w = 0.5 * clamp(dark, 0.0, 1.0) * (0.7 + 0.3 * k);\n return (1.0 - smoothstep(w - 0.24, w, abs(fract(s) - 0.5))) * gap * (0.6 + 0.4 * k);\n}\n\nvec4 transition (vec2 uv) {\n vec2 q = vec2(uv.x * ratio, uv.y);\n \n vec2 wob = (vec2(sdNoise(q * 6.0), sdNoise(q * 6.0 + 17.0)) - 0.5) * 0.004;\n vec2 su = uv + wob * (1.0 - progress);\n vec2 dx = vec2(0.001 * lineWidth / ratio, 0.0);\n vec2 dy = vec2(0.0, 0.001 * lineWidth);\n vec2 tl = sdTone(su - dx + dy), tm = sdTone(su + dy), tr = sdTone(su + dx + dy);\n vec2 ml = sdTone(su - dx), mr = sdTone(su + dx);\n vec2 bl = sdTone(su - dx - dy), bm = sdTone(su - dy), br = sdTone(su + dx - dy);\n vec2 gx = (tr + 2.0 * mr + br) - (tl + 2.0 * ml + bl);\n vec2 gy = (tl + 2.0 * tm + tr) - (bl + 2.0 * bm + br);\n float g = max(length(vec2(gx.x, gy.x)), length(vec2(gx.y, gy.y))) * max(edges, 0.0);\n float outline = smoothstep(0.12, 0.5, g);\n vec4 toC = getToColor(uv);\n float l = clamp((tm.x + bm.x + ml.x + mr.x) * 0.25, 0.0, 1.0);\n\n \n float grain = 0.65 + 0.35 * sdNoise(q * vec2(180.0, 60.0));\n float order = sdNoise(q * 3.0 + 4.0);\n float fine = sdNoise(q * 24.0);\n float drawOutline = smoothstep(0.0, 0.1, progress - (0.22 * order + 0.05 * fine));\n float drawHatch = smoothstep(0.0, 0.12, progress - (0.2 + 0.2 * order + 0.05 * fine));\n\n \n float fill = smoothstep(0.0, 0.22, progress - (0.4 + 0.25 * l + 0.1 * order));\n\n \n float dark = 1.0 - l;\n float h1 = sdHatch(q, vec2(0.7071, 0.7071), smoothstep(0.35, 0.9, dark));\n float h2 = sdHatch(q, vec2(0.7071, -0.7071), smoothstep(0.65, 1.0, dark));\n float hatch = hatching * 0.8 * max(h1, 0.8 * h2) * toC.a;\n\n \n hatch *= drawHatch * (1.0 - 0.6 * fill);\n float pencil = max(outline * drawOutline, hatch) * grain;\n \n pencil *= 1.0 - smoothstep(0.7, 1.0, progress);\n\n \n vec4 base = mix(getFromColor(uv), paper, smoothstep(0.02, 0.38, progress));\n float sat = smoothstep(0.55, 1.0, progress);\n vec4 tone = vec4(paper.rgb * mix(0.3, 1.0, l), paper.a * toC.a);\n vec4 col = mix(tone, toC, sat);\n base = mix(base, col, fill);\n return mix(base, ink, pencil);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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","SlotReels":"// SlotReels — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SlotReels.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is cut into vertical reels that spin downward like drums, motion-blurred with speed, carrying the outgoing image then the incoming one, and stop one after another from left to right with a small mechanical bounce\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 reels; \n\nuniform float blur; \n\nuniform float stagger; \n\nuniform float bounce; \n\nuniform vec4 separator; \n\nconst float PI = 3.141592653589793;\n\nconst float ARC = 1.15;\n\nconst float SETTLE = 0.1;\n\nconst float LINE = 0.006;\n\nconst float EDGE = 0.0015;\n\nfloat stopTime(float i, float n) {\n float order = n > 1.0 ? i / (n - 1.0) : 1.0;\n return (1.0 - SETTLE) * (1.0 - clamp(stagger, 0.0, 0.9) * (1.0 - order));\n}\n\nfloat reelOffset(float t, float stopT, float turns) {\n float amp = 0.07 * bounce;\n \n float v1 = amp * PI * stopT / (turns * SETTLE);\n float u = clamp(t / stopT, 0.0, 1.0);\n float g = u * u * (3.0 - 2.0 * u) + v1 * (u * u * u - u * u);\n float b = clamp((t - stopT) / SETTLE, 0.0, 1.0);\n return turns * g + amp * sin(PI * b) * (1.0 - b) * (1.0 - b);\n}\n\nfloat reelSpeed(float t, float stopT, float turns) {\n float amp = 0.07 * bounce;\n float v1 = amp * PI * stopT / (turns * SETTLE);\n if (t < stopT) {\n float u = max(t / stopT, 0.0);\n return turns * (6.0 * u * (1.0 - u) + v1 * u * (3.0 * u - 2.0)) / stopT;\n }\n float b = min((t - stopT) / SETTLE, 1.0);\n return amp * (1.0 - b) * (PI * cos(PI * b) * (1.0 - b) - 2.0 * sin(PI * b)) / SETTLE;\n}\n\nvec4 transition (vec2 uv) {\n float n = max(float(reels), 1.0);\n float i = min(floor(uv.x * n), n - 1.0);\n float lx = uv.x * n - i;\n float stopT = stopTime(i, n);\n \n float turns = 2.0 * floor(stopT * 4.0) + 1.0;\n\n \n float drum = smoothstep(0.0, 0.12, progress) * (1.0 - smoothstep(stopT, stopT + SETTLE, progress));\n float y = 2.0 * uv.y - 1.0;\n \n float theta = asin(clamp(y * sin(ARC), -1.0, 1.0));\n float v = mix(uv.y, 0.5 + theta / (2.0 * ARC), drum);\n \n float depth = (1.0 - cos(theta)) * drum;\n float px = 0.5 + (lx - 0.5) * (1.0 + 0.2 * depth);\n\n \n float off = reelOffset(progress, stopT, turns) - turns;\n float speed = abs(reelSpeed(progress, stopT, turns));\n \n float spread = blur * min(speed * 0.02, 0.22) * drum;\n\n \n vec4 c = vec4(0.0);\n float wsum = 0.0;\n for (int k = 0; k < 8; k++) {\n float f = float(k) / 7.0 - 0.5;\n float w = 1.0 - abs(f);\n float vv = v + off + spread * f;\n float seg = floor(vv);\n vec2 q = vec2((i + clamp(px, 0.0, 1.0)) / n, vv - seg);\n \n vec4 s = mod(seg, 2.0) < 0.5 ? getToColor(q) : getFromColor(q);\n \n s.rgb *= 1.0 - 0.6 * drum * (1.0 - y * y) * (1.0 - smoothstep(0.0, 0.02, min(q.y, 1.0 - q.y)));\n c += w * s;\n wsum += w;\n if (spread < 1e-4) break;\n }\n c /= wsum;\n\n \n float facing = cos(theta);\n c.rgb *= mix(1.0, 0.25 + 0.75 * facing * facing, drum);\n c.rgb += drum * 0.07 * c.a * exp(-12.0 * (y - 0.3) * (y - 0.3));\n\n \n float env = smoothstep(0.0, 0.1, progress) * (1.0 - smoothstep(0.9, 1.0, progress));\n float reelW = ratio / n;\n float persp = reelW / (1.0 + 0.2 * depth);\n \n float dSide = min(px, 1.0 - px) * persp;\n float dInner = min(i > 0.5 ? px : 2.0, i < n - 1.5 ? 1.0 - px : 2.0) * persp;\n float line = 1.0 - smoothstep(0.5 * LINE - EDGE, 0.5 * LINE + EDGE, dInner);\n float outside = 1.0 - smoothstep(-EDGE, 0.0, dSide);\n \n c.rgb *= 1.0 - 0.35 * env * (1.0 - smoothstep(0.0, 0.03 * reelW + LINE, dInner));\n return mix(c, separator, max(line * env, outside));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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","SplitFlap":"// SplitFlap — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitFlap.glsl\n// Author: gre\n// License: MIT\n// Description: The frame becomes a split-flap board: in each cell the top half of the outgoing image flips down on a hinge across the middle, cell after cell, its back bringing the bottom half of 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; \n\nuniform float stagger; \n\nuniform float randomness; \n\nuniform int flaps; \n\nuniform float gap; \n\nuniform float perspective; \n\nuniform float shading; \n\nuniform vec4 background; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.001;\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 cellTime(vec2 cell, vec2 grid) {\n float wave = (cell.x + 0.5 * (grid.y - 1.0 - cell.y)) / max(grid.x - 1.0 + 0.5 * (grid.y - 1.0), 1.0);\n float order = mix(wave, hash12(cell + 17.0), randomness);\n float delay = clamp(stagger, 0.0, 0.99);\n return clamp((progress - order * delay) / (1.0 - delay), 0.0, 1.0);\n}\n\nfloat flapIndex(float t, float n) {\n return min(floor(t * n), n - 1.0);\n}\n\nfloat flapAngle(float t, float n) {\n float u = t * n - flapIndex(t, n);\n return PI * u * (0.3 + 0.7 * u);\n}\n\nvec4 card(float i, float n, vec2 cell, vec2 grid, vec2 lc) {\n if (i < 0.5) return getFromColor((cell + lc) / grid);\n vec2 src = cell;\n if (i < n - 0.5) src = floor(vec2(hash12(cell * 3.7 + i * 11.3), hash12(cell * 5.3 + i * 7.9 + 1.7)) * grid);\n return getToColor((src + lc) / grid);\n}\n\nfloat cardMask(float x, float f, vec2 cellSize, float g) {\n if (g <= 0.0) return 1.0;\n float e = EDGE * min(1.0, g / max(gap, 1e-4));\n \n float d = min(min(x, 1.0 - x) * cellSize.x, min(2.0 * f, 0.5 - f) * cellSize.y);\n return smoothstep(0.5 * g - e, 0.5 * g + e, d);\n}\n\nvec4 transition (vec2 uv) {\n vec2 grid = max(vec2(size), 1.0);\n float n = max(float(flaps), 1.0);\n vec2 cellSize = vec2(ratio, 1.0) / grid / min(ratio, 1.0);\n vec2 cell = floor(uv * grid);\n vec2 l = uv * grid - cell;\n \n float g = gap * smoothstep(0.0, 0.12, progress) * (1.0 - smoothstep(0.88, 1.0, progress));\n \n float w = l.y - 0.5;\n bool upper = w >= 0.0;\n\n \n \n float t = cellTime(cell, grid);\n float k = flapIndex(t, n);\n float a = flapAngle(t, n);\n bool started = t * n > k;\n bool landed = t >= 1.0;\n vec4 color = card(k + (upper ? (started ? 1.0 : 0.0) : (landed ? 1.0 : 0.0)), n, cell, grid, l);\n \n if (started && !landed) color.rgb *= 1.0 - 0.45 * shading * max(upper ? cos(a) : -cos(a), 0.0);\n color = mix(background, color, cardMask(l.x, abs(w), cellSize, g));\n\n \n float nearest = -1.0;\n for (int d = -1; d <= 1; d++) {\n vec2 nc = cell + vec2(float(d), 0.0);\n if (nc.x < 0.0 || nc.x > grid.x - 1.0) continue;\n float nt = d == 0 ? t : cellTime(nc, grid);\n float na = d == 0 ? a : flapAngle(nt, n);\n float fc = cos(na);\n float fs = sin(na);\n \n if (abs(fc) < 1e-5 || (w >= 0.0) != (fc > 0.0)) continue;\n float f = w / fc;\n if (f > 0.5) continue;\n float z = f * fs;\n if (z <= nearest) continue;\n float lx = 0.5 + (l.x - float(d) - 0.5) * (1.0 - perspective * z);\n if (lx < 0.0 || lx > 1.0) continue;\n bool front = fc > 0.0;\n vec2 lc = vec2(lx, front ? 0.5 + f : 0.5 - f);\n float m = cardMask(lx, f, cellSize, g);\n if (m <= 0.0) continue;\n vec4 img = card(flapIndex(nt, n) + (front ? 0.0 : 1.0), n, nc, grid, lc);\n \n float lambert = (front ? 0.92 * fc - 0.4 * fs : 0.4 * fs - 0.92 * fc) / 0.92;\n img.rgb *= mix(1.0 - shading, 1.0, clamp(lambert, 0.0, 1.0));\n color = mix(color, img, m);\n nearest = z;\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","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","SpotlightWipe":"// SpotlightWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SpotlightWipe.glsl\n// Author: gre\n// License: MIT\n// Description: The stage lights go down on the outgoing image and a soft oval spotlight searches across it along a curved path, comes to rest and lights the incoming image inside it, then widens until the stage lights come back up 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 vec2 center; \n\nuniform float size; \n\nuniform float darkness; \n\nuniform vec3 warmth; \n\nconst float FLAT = 0.72;\n\nconst float LIT = 0.74;\n\nvec2 path(float t, vec2 c) {\n vec2 a = vec2(0.08, 0.3);\n vec2 b = vec2(0.35, 1.15);\n vec2 d = vec2(1.05, 0.95);\n float s = 1.0 - t;\n return s * s * s * a + 3.0 * s * s * t * b + 3.0 * s * t * t * d + t * t * t * c;\n}\n\nvec4 transition(vec2 uv) {\n vec2 asp = vec2(ratio, 1.0);\n float p = progress;\n\n \n \n float t = clamp(p / 0.5, 0.0, 1.0);\n t = t * t * (3.0 - 2.0 * t);\n vec2 c = path(t, center);\n\n \n vec2 far = max(center, 1.0 - center) * asp;\n float full = length(vec2(far.x, far.y / FLAT)) / LIT;\n float g = smoothstep(0.44, 1.0, p);\n float radius = mix(0.5 * size, full, g * (0.3 + 0.7 * g));\n\n \n vec2 q = (uv - c) * asp;\n float r = length(vec2(q.x, q.y / FLAT)) / radius;\n\n \n float core = 1.0 - smoothstep(0.72, 1.08, r);\n float ring = (r - 0.9) / 0.09;\n float spot = max(core * (1.0 - 0.1 * r * r), 0.12 * (1.0 - smoothstep(0.9, 2.4, r))) + 0.16 * exp(-ring * ring);\n\n \n float s = darkness * smoothstep(0.0, 0.18, p) * (1.0 - smoothstep(0.72, 1.0, p));\n vec3 light = 1.0 - s + s * spot * warmth;\n\n \n float lit = smoothstep(0.42, 0.58, p) * (1.0 - smoothstep(LIT, 1.0, r));\n vec4 col = mix(getFromColor(uv), getToColor(uv), lit);\n return vec4(col.rgb * light, 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","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","StopMotion":"// StopMotion — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StopMotion.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a paper cutout that jerks off the frame in choppy stop-motion steps, with a tiny new tilt and offset each step and a drop shadow, while the incoming cutout jerks in the same way and lands\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 jitter; \n\nuniform float shadow; \n\nuniform vec4 backColor; \n\nuniform vec4 rimColor; \n\nconst float SHRINK = 0.2; \nconst float RIM = 0.012; \nconst float RADIUS = 0.006; \nconst float AA = 0.0015; \n\nfloat hash11(float p) {\n p = fract(p * 0.1031);\n p *= p + 33.33;\n p *= p + p;\n return fract(p);\n}\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\nfloat offFrame(vec2 h, float a) {\n return 0.5 * ratio + abs(cos(a)) * h.x + abs(sin(a)) * h.y + 0.08;\n}\n\nvec2 cutoutSize(float s, float l) {\n return (0.5 * vec2(ratio, 1.0) + RIM * l) * s;\n}\n\nvec4 drawCutout(vec4 col, vec2 q, vec2 c, float a, float s, float l, bool incoming) {\n vec2 asp = vec2(ratio, 1.0);\n vec2 halfImage = 0.5 * asp;\n vec2 halfCut = halfImage + RIM * l;\n float rad = RADIUS * l;\n float ca = cos(a), sa = sin(a);\n mat2 unrotate = mat2(ca, -sa, sa, ca);\n\n \n \n vec2 rs = unrotate * (q - c - vec2(0.018, -0.026) * l) / s;\n vec2 ss = clamp(rs / asp + 0.5, 0.0, 1.0);\n float sAlpha = max(incoming ? getToColor(ss).a : getFromColor(ss).a, rimColor.a);\n float ds = roundedBox(rs, halfCut, rad) * s;\n float blur = 0.004 + 0.016 * l;\n col.rgb *= 1.0 - clamp(shadow, 0.0, 1.0) * 0.75 * l * sAlpha * (1.0 - smoothstep(-blur, blur, ds));\n\n vec2 r = unrotate * (q - c) / s;\n float dCut = roundedBox(r, halfCut, rad) * s;\n float dImage = roundedBox(r, halfImage, 0.0) * s;\n float cutCover = clamp(0.5 - dCut / AA, 0.0, 1.0);\n float imageCover = clamp(0.5 - dImage / AA, 0.0, 1.0);\n vec2 st = clamp(r / asp + 0.5, 0.0, 1.0);\n vec4 img = premultiply(incoming ? getToColor(st) : getFromColor(st));\n \n vec4 cut = mix(premultiply(rimColor), img, imageCover) * cutCover;\n return cut + col * (1.0 - cut.a);\n}\n\nvec4 transition(vec2 uv) {\n float n = float(steps < 2 ? 2 : steps);\n \n float k = floor(progress * n + 0.5);\n if (k <= 0.0) return getFromColor(uv);\n if (k >= n) return getToColor(uv);\n\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float j = clamp(jitter, 0.0, 1.0);\n\n \n float l0 = min(k / 2.0, 1.0);\n float m0 = clamp((k - 1.0) / (0.45 * n), 0.0, 1.0);\n m0 = m0 * m0 * (0.4 + 0.6 * m0);\n float s0 = 1.0 - SHRINK * l0;\n float a0 = 0.22 * m0 + l0 * j * 0.2 * (hash11(k) - 0.5);\n vec2 c0 = vec2(-offFrame(cutoutSize(s0, l0), a0) * m0, 0.05 * m0 * m0)\n + l0 * j * vec2(0.07 * (hash11(k + 100.0) - 0.5), 0.05 * (hash11(k + 200.0) - 0.5));\n\n \n float l1 = min((n - k) / 2.0, 1.0);\n float m1 = clamp((n - 2.0 - k) / (0.45 * n), 0.0, 1.0);\n m1 = m1 * m1 * (0.4 + 0.6 * m1);\n float s1 = 1.0 - SHRINK * l1;\n float a1 = -0.25 * m1 + l1 * j * 0.2 * (hash11(k + 300.0) - 0.5);\n vec2 c1 = vec2(offFrame(cutoutSize(s1, l1), a1) * m1, -0.06 * m1 * m1)\n + l1 * j * vec2(0.07 * (hash11(k + 400.0) - 0.5), 0.05 * (hash11(k + 500.0) - 0.5));\n\n \n vec4 col = premultiply(backColor);\n if (m0 < 1.0) col = drawCutout(col, q, c0, a0, s0, l0, false);\n if (m1 < 1.0) col = drawCutout(col, q, c1, a1, s1, l1, true);\n if (col.a <= 0.0) return vec4(0.0);\n col.rgb /= col.a;\n \n col.rgb *= 1.0 - 0.04 * j * hash11(k + 600.0);\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","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: The image twists into a round swirl around the center that peaks mid-way, where the outgoing image dissolves into the incoming one, then untwists\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 radius; \n\nuniform vec2 center; \n\nconst float PI = 3.141592653589793;\nconst float TAU = 6.283185307179586;\n\nconst float ZOOM = 0.12;\n\nconst float BLUR = 0.05;\nconst int TAPS = 12;\n\nvec2 mirrored(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nvec4 transition(vec2 uv) {\n \n float s = sin(PI * progress);\n float amount = s * s;\n \n float speed = PI * sin(TAU * progress);\n \n float reveal = smoothstep(0.3, 0.7, progress);\n\n \n vec2 aspect = vec2(ratio, 1.0);\n vec2 d = (uv - center) * aspect;\n float x = clamp(length(d) / max(radius, 1e-3), 0.0, 1.0);\n \n float falloff = (1.0 - x) * (1.0 - x);\n float twist = strength * TAU * falloff;\n float angle = twist * amount;\n \n float spread = clamp(twist * speed * BLUR, -1.2, 1.2);\n \n d *= 1.0 - ZOOM * amount * falloff;\n\n vec4 col = vec4(0.0);\n float total = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float k = float(i) / float(TAPS - 1) - 0.5;\n float w = 1.0 - abs(k);\n float a = angle + spread * k;\n float c = cos(a);\n float sn = sin(a);\n vec2 q = mirrored(center + vec2(c * d.x - sn * d.y, sn * d.x + c * d.y) / aspect);\n col += mix(getFromColor(q), getToColor(q), reveal) * w;\n total += w;\n }\n return col / 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","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","TruchetWipe":"// TruchetWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TruchetWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A grid of square tiles, each holding two quarter-circle arcs, links into long winding paths; starting from the middle and spreading outward, the paths are drawn as thin lines of the incoming image, then thicken into bands with a dark outline and a soft shadow until they merge over 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 cells; \n\nuniform float outline; \n\nuniform float spread; \n\nconst float AA = 0.0012;\n\nconst float LINE = 0.003;\n\nconst float SHADOW = 0.025;\n\nconst float STROKE = 0.08;\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\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n\n float n = max(floor(cells + 0.5), 1.0);\n \n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n vec2 g = p * n + 0.5;\n vec2 cell = floor(g);\n vec2 q = fract(g);\n \n if (hash12(cell + 17.0) > 0.5) q.x = 1.0 - q.x;\n \n float d = min(abs(length(q) - 0.5), abs(length(q - 1.0) - 0.5));\n\n \n float T = clamp(length(p) / (0.5 * length(vec2(ratio, 1.0))) + 0.4 * (vnoise(p * 3.0 + 4.0) - 0.5), 0.0, 1.0);\n float lag = 0.8 * clamp(spread, 0.0, 1.0);\n \n float s = clamp((progress - lag * T) / (0.95 - lag), 0.0, 1.0);\n \n float aa = AA * n;\n float k = clamp((s - 0.25) / 0.75, 0.0, 1.0);\n float w = STROKE * smoothstep(0.0, 0.3, s) + (0.5 + LINE * n + 3.0 * aa - STROKE) * k * k;\n \n float e = d - w;\n\n float band = 1.0 - smoothstep(-2.0 * aa, 0.0, e);\n \n float gap = max(e + aa, 0.0);\n float fall = 1.0 - smoothstep(0.0, SHADOW * n, gap);\n float edge = max(0.8 * (1.0 - smoothstep(LINE * n, LINE * n + 2.0 * aa, gap)), 0.4 * fall * fall);\n float shade = clamp(outline, 0.0, 1.0) * smoothstep(0.0, STROKE, w) * edge;\n\n vec4 a = getFromColor(uv);\n a.rgb *= 1.0 - shade;\n vec4 b = getToColor(uv);\n \n vec4 o = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), band);\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","Tumble":"// Tumble — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Tumble.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is thrown away like a rigid card, tumbling end over end with a slight spin as it flies off into the distance in perspective, its darker back showing on every flip and its soft shadow shrinking on 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 flips; \n\nuniform float spin; \n\nuniform vec2 direction; \n\nuniform float perspective; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\n\nconst float EDGE = 0.0015;\n\nconst vec3 LIGHT = vec3(0.348, 0.696, -0.628);\n\nvec3 roll(vec3 v, float c, float s) {\n return vec3(c * v.x - s * v.y, s * v.x + c * v.y, v.z);\n}\n\nfloat cardDistance(vec2 q) {\n vec2 e = abs(q) - vec2(0.5 * ratio, 0.5);\n return max(e.x, e.y);\n}\n\nvec3 castOnCard(vec3 d, vec3 rel, vec3 U, vec3 V, vec3 N) {\n float dn = dot(d, N);\n if (abs(dn) < 1e-6) return vec3(0.0, 0.0, -1.0);\n float k = dot(rel, N) / dn;\n vec3 h = k * d - rel;\n return vec3(dot(h, U), dot(h, V), k);\n}\n\nvec2 cardUv(vec2 q) {\n return clamp(vec2(q.x / ratio, q.y) + 0.5, 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n \n float t = clamp(progress / 0.95, 0.0, 1.0);\n \n float size = exp(-2.8 * t * t * (0.4 + 0.6 * t));\n float away = 1.0 - size;\n \n float turn = t * t * (3.0 - 2.0 * t);\n float a = 2.0 * PI * flips * turn;\n float r = 2.0 * PI * spin * turn;\n float cr = cos(r), sr = sin(r);\n \n vec3 U = roll(vec3(1.0, 0.0, 0.0), cr, sr);\n vec3 V = roll(vec3(0.0, cos(a), sin(a)), cr, sr);\n vec3 N = roll(vec3(0.0, -sin(a), cos(a)), cr, sr);\n\n \n float dist = 1.0 / clamp(perspective, 0.1, 1.0);\n \n vec2 seen = direction * away + vec2(0.0, 0.12 * t * (1.0 - t));\n vec3 rel = vec3(seen / size, dist / size);\n float fade = 1.0 - smoothstep(0.8, 1.0, t);\n float shadowAmount = 0.6 * shading * sqrt(size) * fade;\n\n vec2 p = vec2((uv.x - 0.5) * ratio, uv.y - 0.5);\n vec4 color = getToColor(uv);\n\n \n if (shadowAmount > 0.0) {\n vec3 ds = vec3(p - vec2(-0.05, -0.08) * min(4.0 * t, 1.0) * size, dist);\n vec3 hs = castOnCard(ds, rel, U, V, N);\n if (hs.z > 0.0) {\n float blur = 0.005 + 0.06 * min(3.0 * t, 1.0) * size;\n float sd = cardDistance(hs.xy) * max(abs(dot(ds, N)) / length(ds), 0.05) / hs.z;\n float sh = (1.0 - smoothstep(-blur, blur, sd)) * getFromColor(cardUv(hs.xy)).a;\n color.rgb *= 1.0 - shadowAmount * sh;\n }\n }\n\n \n vec3 d = vec3(p, dist);\n vec3 hit = castOnCard(d, rel, U, V, N);\n if (hit.z <= 0.0) return color;\n float dn = dot(d, N);\n \n float grazing = max(abs(dn) / length(d), 0.05);\n float e = EDGE * min(20.0 * t, 1.0) * hit.z / grazing;\n float m = clamp(0.5 - cardDistance(hit.xy) / max(e, 1e-6), 0.0, 1.0) * fade;\n if (m <= 0.0) return color;\n\n vec4 card = getFromColor(cardUv(hit.xy));\n \n bool front = dn > 0.0;\n vec3 facing = front ? -N : N;\n float lit = min((0.35 + 0.65 * max(dot(facing, LIGHT), 0.0)) / (0.35 + 0.65 * -LIGHT.z), 1.0);\n float shade = mix(1.0, lit * (front ? 1.0 : 0.55), shading);\n if (!front) card.rgb = mix(card.rgb, vec3(dot(card.rgb, vec3(0.299, 0.587, 0.114))), 0.4 * shading);\n \n float glint = pow(max(dot(facing, normalize(LIGHT - normalize(d))), 0.0), 60.0);\n card.rgb = card.rgb * shade + 0.35 * shading * glint * smoothstep(0.0, 0.2, t);\n if (m >= 1.0) return card;\n \n vec4 mixed = mix(vec4(color.rgb * color.a, color.a), vec4(card.rgb * card.a, card.a), m);\n return mixed.a > 0.0 ? vec4(mixed.rgb / mixed.a, mixed.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","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","Vaporize":"// Vaporize — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Vaporize.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image goes up in smoke: from one side, the picture itself turns to vapour that rises over what is still intact, curls into wisps and pales as it thins 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 vec2 direction; \n\nuniform float rise; \n\nuniform float swirl; \n\nuniform vec4 color; \n\nconst float RAGGED = 0.09;\nconst float BAND = 0.12;\n\nconst float LIFE = 0.16;\nconst int TAPS = 6;\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 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(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 p) {\n return 0.55 * vnoise(p) + 0.3 * vnoise(p * 2.03 + 5.1) + 0.15 * vnoise(p * 4.1 + 9.7);\n}\n\nvec2 curl(vec2 p) {\n float e = 0.1;\n float n = vnoise(p);\n float nx = vnoise(p + vec2(e, 0.0));\n float ny = vnoise(p + vec2(0.0, e));\n return vec2(ny - n, n - nx) / e;\n}\n\nfloat sweep(float t) {\n return t + 0.6 * t * (1.0 - t) * (1.0 - 2.0 * t);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(0.0, 1.0);\n vec2 side = vec2(-dir.y, dir.x);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float along = dot(q, dir);\n float across = dot(q, side);\n float ext = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n\n \n float ragged = RAGGED * (2.0 * fbm(q * 2.5 + 1.3) - 1.0);\n float start = -ext - RAGGED;\n float travel = 2.0 * ext + 2.0 * RAGGED + BAND;\n float front = start + travel * sweep(progress) + ragged;\n\n \n \n float gone = smoothstep(0.0, BAND, front - along);\n vec4 base = mix(getFromColor(uv), getToColor(uv), gone);\n\n \n float height = max(rise, 0.05) * (0.7 + 0.6 * vnoise(vec2(across * 3.0 + 2.7, 0.5)));\n float age = (along - front) / height;\n float released = progress - age * LIFE;\n if (age <= 0.0 || age >= 1.0 || released <= 0.0) return base;\n\n \n float origin = start + travel * sweep(released) + ragged;\n vec2 org = q - dir * (along - origin);\n\n \n vec2 sw = curl(org * 3.0 + dir * progress * 1.5) * (swirl * 0.08 * sqrt(age));\n vec2 src = org - sw;\n\n \n vec2 spreadOut = (side * 0.07 + dir * 0.02) * sqrt(age);\n vec4 c = vec4(0.0);\n for (int i = 0; i < TAPS; i++) {\n float t = float(i) / float(TAPS - 1) - 0.5;\n vec4 img = getFromColor(mirror((src + spreadOut * t) / vec2(ratio, 1.0) + 0.5));\n c += vec4(img.rgb * img.a, img.a);\n }\n c = c.a > 0.0 ? vec4(c.rgb / c.a, c.a / float(TAPS)) : vec4(0.0);\n\n \n vec2 wq = (q - 0.6 * sw - dir * (progress * 2.5)) * 4.0;\n float w = fbm(vec2(dot(wq, side), dot(wq, dir) * 0.6) + 2.0);\n float density = smoothstep(1.2 * age - 0.2, 1.2 * age + 0.1, w);\n density *= 1.0 - smoothstep(0.3, 1.0, age);\n \n density *= smoothstep(-ext, -ext + 0.05, origin);\n\n \n float pale = smoothstep(0.0, 0.5, age);\n float l = dot(c.rgb, vec3(0.299, 0.587, 0.114));\n c = mix(c, vec4(mix(vec3(l), color.rgb, 0.7), c.a * color.a), pale * 0.85);\n \n c.rgb = min(c.rgb + 0.12 * pale * density * (1.0 - density), vec3(1.0));\n \n float a = density * c.a;\n float outA = a + base.a * (1.0 - a);\n if (outA <= 0.0) return vec4(0.0);\n return vec4((c.rgb * a + base.rgb * base.a * (1.0 - a)) / outA, outA);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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","WarpSpeed":"// WarpSpeed — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WarpSpeed.glsl\n// Author: gre\n// License: MIT\n// Description: The camera jumps to light speed: star streaks shoot out from the center and stretch longer and longer while the outgoing image is pulled into a radial smear, then after a flash the incoming image emerges from the center as the streaks shrink 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 vec2 center; \n\nuniform float streaks; \n\nuniform vec4 streakColor; \n\nuniform float strength; \n\nuniform float flash; \n\nconst float PI = 3.141592653589793;\nconst int TAPS = 12;\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 stars(float a, float r, float n, float layer, float travel, float speed, float reach) {\n float cell = floor(a * n);\n float h1 = hash(vec2(cell, layer));\n float h2 = hash(vec2(cell, layer + 17.0));\n float h3 = hash(vec2(cell, layer + 31.0));\n \n \n float life = fract(h1 + travel * (0.6 + 0.8 * h2));\n float head = reach * (0.05 + 1.05 * pow(life, 1.4));\n \n float tail = head * (1.0 - min(0.9, speed * (0.15 + 0.5 * h3)));\n float along = clamp((r - tail) / max(head - tail, 1e-4), 0.0, 1.0);\n float inside = step(tail, r) * (1.0 - smoothstep(head - 0.006, head, r));\n \n float profile = inside * along * along;\n \n \n float f = fract(a * n);\n float cellWidth = 2.0 * PI * r / n;\n float offset = 0.3 + 0.4 * h3;\n float across = (f - offset) * cellWidth;\n float width = min(0.0014 + 0.002 * r / reach, 0.15 * cellWidth);\n float x = across * across / (width * width);\n float line = (exp(-x) + 0.25 * exp(-x / 9.0)) * smoothstep(0.0, 0.2, min(f, 1.0 - f));\n \n float fade = smoothstep(0.0, 0.2, life) * (1.0 - smoothstep(0.9, 1.0, life));\n return profile * line * fade * (0.4 + 0.6 * h2) * step(0.25, hash(vec2(cell, layer + 43.0)));\n}\n\nvec4 smear(vec2 uv, float k, float b, float jitter, bool incoming) {\n if (b <= 0.0 && k >= 1.0) {\n vec4 c = incoming ? getToColor(uv) : getFromColor(uv);\n return vec4(c.rgb * c.a, c.a);\n }\n vec4 sum = vec4(0.0);\n for (int i = 0; i < TAPS; i++) {\n float s = k * (1.0 - b * (float(i) + jitter) / float(TAPS));\n vec2 q = center + (uv - center) * s;\n vec4 c = incoming ? getToColor(q) : getFromColor(q);\n sum += vec4(c.rgb * c.a, c.a);\n }\n return sum / float(TAPS);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 aspect = vec2(ratio, 1.0);\n vec2 d = (uv - center) * aspect;\n float r = length(d);\n \n float a = atan(d.y, d.x + 1e-6) / (2.0 * PI) + 0.5;\n \n vec2 far = max(center, 1.0 - center) * aspect;\n float reach = length(far);\n\n \n float speed = sin(PI * p);\n speed *= speed;\n float travel = 3.0 * (p - sin(2.0 * PI * p) / (2.0 * PI));\n float jitter = hash(floor(uv * aspect * 997.0));\n\n \n \n float goOut = smoothstep(0.0, 0.55, p);\n float goIn = 1.0 - smoothstep(0.45, 1.0, p);\n \n float soft = 0.35 * reach;\n float edge = mix(-soft, reach + soft, smoothstep(0.42, 0.78, p));\n float m = 1.0 - smoothstep(edge - soft, edge, r);\n vec4 before = vec4(0.0);\n vec4 after = vec4(0.0);\n if (m < 1.0) before = smear(uv, 1.0 - 0.3 * strength * goOut * goOut, 0.6 * strength * goOut, jitter, false);\n if (m > 0.0) after = smear(uv, 1.0 - 0.3 * strength * goIn * goIn, 0.6 * strength * goIn, jitter, true);\n vec4 c = mix(before, after, m);\n \n \n float dark = p < 0.5 ? speed : speed * speed * speed;\n c.rgb *= 1.0 - 0.65 * (0.5 + 0.5 * strength) * dark;\n\n \n float n = max(floor(streaks), 1.0);\n float len = speed * (0.5 + 1.5 * strength);\n float s = stars(a, r, n, 1.0, travel, len, reach);\n s += stars(fract(a + 0.37), r, max(floor(n * 0.71), 1.0), 2.0, travel * 1.3, len, reach);\n \n float core = r / (0.35 * reach);\n float peak = (p - 0.5) * 9.0;\n float glow = flash * exp(-peak * peak) * speed * (0.35 + 0.9 * exp(-core * core));\n vec3 light = streakColor.rgb * streakColor.a * (2.2 * s * speed + glow);\n \n return c.a > 0.0 ? vec4(clamp(c.rgb / c.a + light, 0.0, 1.0), 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","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: A drop falls into the image like into still water: round ripples spread out from where it hits, bending the image with glints on their slopes, the incoming image shows up inside the leading ripple, and the water calms down\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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\nuniform vec2 center; \n\nuniform float refraction; \n\nuniform float highlight; \n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat wave(float s, float k, float lambda, float t) {\n \n float env = smoothstep(-0.3 * lambda, 0.6 * lambda, s) * exp(-s / (3.5 * lambda));\n \n return env * sin(k * s + speed * t);\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 k = 2.0 * max(amplitude, 1.0);\n float lambda = 6.2831853 / k;\n \n vec2 q = (uv - center) * vec2(ratio, 1.0);\n float r = length(q);\n vec2 dir = r > 0.0 ? q / r : vec2(0.0);\n \n vec2 far = max(center, 1.0 - center) * vec2(ratio, 1.0);\n float R = length(far);\n\n \n float edge = 0.35 * lambda;\n float soft = 0.1 * lambda;\n \n \n float t = progress;\n float e = mix(t, 1.0 - (1.0 - t) * (1.0 - t), 0.4);\n float front = mix(-0.3 * lambda, R + edge + soft + 0.01, e);\n float s = front - r;\n\n \n float calm = 1.0 - smoothstep(0.55, 1.0, t);\n calm *= calm;\n \n \n float d = 0.02 * lambda;\n float r0 = max(r - d, 0.0);\n float slope = calm * (wave(front - r - d, k, lambda, t) - wave(front - r0, k, lambda, t)) / ((r + d - r0) * k);\n vec2 offset = dir * slope * refraction / vec2(ratio, 1.0);\n\n vec4 ca = getFromColor(mirror(uv - offset));\n vec4 cb = getToColor(mirror(uv - offset));\n float m = smoothstep(edge - soft, edge + soft, s);\n \n vec4 c = mix(vec4(ca.rgb * ca.a, ca.a), vec4(cb.rgb * cb.a, cb.a), m);\n\n \n \n float h = calm * wave(s, k, lambda, t);\n float lit = -dot(dir, normalize(vec2(-0.6, 0.8))) * slope;\n float glint = highlight * (0.2 * h + 0.6 * smoothstep(0.2, 0.9, lit) - 0.3 * smoothstep(0.2, 0.9, -lit));\n c.rgb = clamp(c.rgb + glint * c.a, 0.0, c.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","WaveWipe":"// WaveWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WaveWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A breaking wave crashes across the frame, its lip curling over in front of its face and throwing foam and spray ahead, its shadow darkening the outgoing image; the incoming image is left behind it, tinted and bent by the water, clearing as the wave passes\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 curl; \n\nuniform float foam; \n\nuniform float refraction; \n\nuniform vec4 water; \n\nuniform vec4 foamColor; \n\nconst float PI = 3.141592653589793;\n\nconst float AA = 0.002;\n\nconst float TRAIL = 0.35;\n\nconst float BAND = 0.4;\n\nconst float REACH = 0.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 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\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat droplets(vec2 q, float cell, float density, float seed) {\n vec2 g = q / cell;\n vec2 id = floor(g);\n if (hash12(id + seed) >= density) return 0.0;\n float r = 0.1 + 0.2 * hash12(id + seed + 4.7);\n vec2 c = id + 0.5 + (0.45 - r) * (vec2(hash12(id + seed + 1.3), hash12(id + seed + 8.1)) * 2.0 - 1.0);\n float px = AA / cell;\n return 1.0 - smoothstep(r - px, r + px, length(g - c));\n}\n\nvec4 transition(vec2 uv) {\n if (progress <= 0.0) return getFromColor(uv);\n if (progress >= 1.0) return getToColor(uv);\n float t = progress;\n\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n \n vec2 up = vec2(-dir.y, dir.x);\n if (up.y < 0.0 || (up.y == 0.0 && up.x > 0.0)) up = -up;\n \n float e = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n float w = 0.5 * (abs(up.x) * ratio + abs(up.y));\n \n vec2 p = (uv - 0.5) * vec2(ratio, 1.0) / (2.0 * w);\n vec2 q = vec2(dot(p, dir), dot(p, up) + 0.5);\n float E = e / (2.0 * w);\n\n float R = max(curl, 0.01);\n \n float Rb = 0.5 * R;\n \n float tipAngle = PI * (0.08 - 0.5 * smoothstep(0.0, 0.85, t));\n \n float travel = mix(t, t * t * (3.0 - 2.0 * t), 0.25);\n vec2 C = vec2(mix(-E - R - REACH, E + Rb + TRAIL + BAND, travel), 1.02 - R);\n\n \n vec2 d = q - C;\n \n if (d.x == 0.0) d.x = 1e-6;\n float r = length(d);\n float ang = atan(d.y, d.x);\n \n float k = clamp((ang - tipAngle) / (PI - tipAngle), 0.0, 1.0);\n float rIn = R - (R - Rb) * (1.0 - (1.0 - k) * (1.0 - k));\n bool curled = ang >= tipAngle;\n \n float s = 1.0 - clamp(q.y / C.y, 0.0, 1.0);\n float face = C.x - Rb - TRAIL * s * s;\n float behind = face - q.x; \n\n float wet;\n if (curled) {\n wet = smoothstep(-AA, AA, r - rIn) * (ang > 0.5 * PI ? 1.0 : 1.0 - smoothstep(-AA, AA, r - R));\n } else {\n wet = smoothstep(-AA, AA, behind);\n }\n \n float lip = curled ? 1.0 - smoothstep(0.5 * PI - 0.3, 0.5 * PI + 0.5, ang) : 0.0;\n\n float n = vnoise(q * vec2(14.0, 10.0) + vec2(-9.0 * t, 3.0 * t));\n\n \n vec4 a = getFromColor(uv);\n float gap = max(min(r - R, -behind), 0.0);\n float shade = 0.55 * exp(-gap / 0.1) * (1.0 - smoothstep(0.0, REACH, gap)) * smoothstep(0.0, 0.6, q.y) * (1.0 - smoothstep(C.y + 0.2 * R, C.y + 1.1 * R, q.y));\n shade += 0.25 * (1.0 - smoothstep(0.0, R, r));\n a.rgb *= 1.0 - shade;\n \n float fwd = max(r - R, 0.0);\n float zone = smoothstep(tipAngle - 0.4, tipAngle + 0.2, ang) * (1.0 - smoothstep(0.0, REACH, fwd)) * step(0.0, r - R);\n \n vec2 sq = (d - t * vec2(0.5, -0.25)) * vec2(0.55, 1.0);\n float thin = exp(-fwd / 0.12);\n float spray = droplets(sq, 0.02, foam * thin, 1.0) + 0.6 * droplets(sq * 1.6 + 3.1, 0.02, foam * thin, 7.0);\n \n float mist = foam * n * n * exp(-fwd / 0.06) * (1.0 - smoothstep(0.0, REACH, fwd)) * smoothstep(-AA, AA, r - R) * smoothstep(tipAngle, tipAngle + 0.3, ang);\n a.rgb = mix(a.rgb, foamColor.rgb, foamColor.a * clamp(spray * zone + mist, 0.0, 1.0));\n\n \n float band = max(1.0 - smoothstep(0.05, BAND, behind), lip);\n float bend = refraction * band * band;\n vec2 off = bend * (dir * sin(17.0 * q.y + 2.0 * sin(9.0 * q.x) - 6.0 * t) + up * cos(13.0 * q.x - 5.0 * t));\n vec4 b = getToColor(mirror(uv + off * 2.0 * w / vec2(ratio, 1.0)));\n float luma = dot(b.rgb, vec3(0.299, 0.587, 0.114));\n \n vec3 tinted = water.rgb * (0.4 + 0.9 * luma) * (1.0 + 0.6 * q.y);\n tinted += 0.18 * lip * (1.0 - k) * vec3(0.5, 1.0, 0.9);\n tinted *= 1.0 - 0.35 * lip * (1.0 - smoothstep(0.0, 0.06, r - rIn));\n \n tinted += 0.35 * (curled ? k * (1.0 - smoothstep(0.0, 0.015, r - rIn)) : 1.0 - smoothstep(0.0, 0.015, behind)) * vec3(0.7, 0.95, 1.0);\n b.rgb = mix(b.rgb, tinted, water.a * band);\n\n \n float crest = curled ? (1.0 - smoothstep(0.01, 0.02 + 0.12 * n, abs(R - r))) * smoothstep(tipAngle, tipAngle + 0.4, ang) * (1.0 - smoothstep(0.5 * PI + 0.2, 0.5 * PI + 0.8, ang)) : 0.0;\n float churn = (1.0 - smoothstep(0.0, 0.15 + 0.1 * n, q.y)) * (1.0 - smoothstep(0.0, 0.3, abs(behind))) * smoothstep(0.3, 0.7, n);\n b.rgb = mix(b.rgb, foamColor.rgb, foamColor.a * clamp(foam * 1.5 * (crest + churn), 0.0, 1.0));\n\n \n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), wet);\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","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","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;\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 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 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 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 float cFrom = 1.0 - e;\n float cTo = e;\n if (a < cFrom || cTo <= 0.0) {\n return pleated(a / cFrom, cFrom, len, b * bLen, bLen, false, positive, vertical);\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 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 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 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 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 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 float l0 = 0.92 * min(1.0, ratio) / max(1.0, 2.0 * tan(h));\n float o0 = -e - 2.0 * tipPad - body * l0;\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 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;\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 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 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 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","BandWipe":"// BandWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BandWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Alternating bands wipe in from opposite sides together and interleave like fingers, while both images stay still\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 int vertical; \n\nuniform float smoothness; \n\nuniform float stagger; \n\nconst float AA = 0.0015;\n\nfloat bandMask(float i, float n, float a, float l, float s) {\n float k = (vertical != 0) ? i : n - 1.0 - i;\n float g = clamp(stagger, 0.0, 0.95);\n float t = clamp((progress - g * k / max(n - 1.0, 1.0)) / (1.0 - g), 0.0, 1.0);\n t = mix(t, t * t * (3.0 - 2.0 * t), 0.5);\n float x = mod(i, 2.0) > 0.5 ? l - a : a;\n \n float c = mix(-s, l + s, t);\n return 1.0 - smoothstep(c - s, c + s, x);\n}\n\nvec4 transition(vec2 uv) {\n float n = float(bands < 1 ? 1 : bands);\n \n float along = (vertical != 0) ? uv.y : uv.x * ratio;\n float across = (vertical != 0) ? uv.x : uv.y;\n float l = (vertical != 0) ? 1.0 : ratio;\n float aaAcross = (vertical != 0) ? AA / ratio : AA;\n float s = max(smoothness, AA);\n\n float f = across * n;\n float i = clamp(floor(f), 0.0, n - 1.0);\n float m = bandMask(i, n, along, l, s);\n\n \n \n float fr = f - i;\n float edge = min(fr, 1.0 - fr) / n;\n if (edge < aaAcross) {\n float j = clamp(fr < 0.5 ? i - 1.0 : i + 1.0, 0.0, n - 1.0);\n m = mix(bandMask(j, n, along, l, s), m, 0.5 + 0.5 * smoothstep(0.0, aaAcross, edge));\n }\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 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","BeadUp":"// BeadUp — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BeadUp.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a thin film of liquid on glass that pulls itself apart like water on a waxed surface: dry holes open and grow with glossy rolled rims, meet in a web of ridges, the ridges break into round beads that magnify the picture, and the beads dry up over 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 holes; \n\nuniform float rim; \n\nuniform float gloss; \n\nvec2 fold(vec2 p) {\n return 1.0 - abs(1.0 - mod(p, 2.0));\n}\n\nvec3 hash3(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.xxy + p3.yzz) * p3.zyx);\n}\n\nvec2 liquid(vec2 x, float p) {\n float cs = 1.0 / max(holes, 1.0);\n \n float w = clamp(rim, 0.001, 0.15 * cs);\n vec2 cell = floor(x / cs);\n float d1 = 1e3, d2 = 1e3;\n vec2 c1 = vec2(0.0), c2 = vec2(1.0, 0.0);\n float s1 = 0.0, s2 = 0.0;\n float hRim = 0.0;\n for (int j = -2; j <= 2; j++) {\n for (int i = -2; i <= 2; i++) {\n vec2 n = cell + vec2(float(i), float(j));\n vec3 h = hash3(n + 17.0);\n vec2 c = (n + 0.5 + 0.75 * (h.xy - 0.5)) * cs;\n float age = p - 0.28 * h.z;\n if (age <= 0.0) continue;\n float d = length(x - c) - 2.3 * cs * age - 0.6 * smoothstep(0.6, 1.0, p);\n \n float wh = w * smoothstep(0.0, 0.06, age);\n hRim = max(hRim, sqrt(max(wh * wh - (d - wh) * (d - wh), 0.0)));\n if (d < d1) { d2 = d1; c2 = c1; s2 = s1; d1 = d; c1 = c; s1 = h.x; }\n else if (d < d2) { d2 = d; c2 = c; s2 = h.x; }\n }\n }\n hRim *= step(0.0, d1);\n if (d2 > 1e2) return vec2(d1, hRim);\n float e = 0.5 * (d2 - d1);\n float meet = clamp(1.0 - 0.5 * (d1 + d2) / (2.0 * w), 0.0, 1.0);\n vec2 axis = normalize(c2 - c1);\n \n axis *= axis.x < 0.0 ? -1.0 : 1.0;\n float along = dot(x - 0.5 * (c1 + c2), vec2(-axis.y, axis.x));\n float lambda = 6.5 * w;\n float k = along / lambda + s1 + s2;\n float db = length(vec2(e, (fract(k) - 0.5) * lambda));\n float beading = smoothstep(0.4, 0.62, p);\n float dry = 1.0 - smoothstep(0.62, 0.97, p);\n float wr = w * sqrt(meet) * (1.0 - beading);\n float rb = 1.55 * w * smoothstep(0.0, 1.0, beading) * dry;\n float hRidge = sqrt(max(wr * wr - e * e, 0.0));\n float hBead = sqrt(max(rb * rb - db * db, 0.0));\n float inside = max(d1, max(wr > 0.0 ? wr - e : -1.0, rb > 0.0 ? rb - db : -1.0));\n return vec2(inside, max(hRim, max(hRidge, hBead)));\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 asp = vec2(ratio, 1.0);\n vec2 x = uv * asp;\n vec2 L = liquid(x, p);\n float px = 0.0015;\n float cover = clamp(L.x / px + 0.5, 0.0, 1.0);\n vec4 to = getToColor(uv);\n to.rgb *= 1.0 - 0.18 * gloss * (1.0 - smoothstep(0.8, 0.98, p)) * (1.0 - smoothstep(0.0, 0.012, -L.x)) * step(L.x, 0.0);\n if (cover <= 0.0) return to;\n\n float eps = 0.002;\n vec2 g = vec2(liquid(x + vec2(eps, 0.0), p).y - L.y, liquid(x + vec2(0.0, eps), p).y - L.y) / eps;\n g = clamp(g, -6.0, 6.0);\n vec3 n = normalize(vec3(-g, 1.0));\n vec2 off = g * L.y * 0.5 * gloss;\n vec4 img = getFromColor(fold((x + off) / asp));\n vec3 light = normalize(vec3(-0.45, 0.55, 0.7));\n vec3 hv = normalize(light + vec3(0.0, 0.0, 1.0));\n float diffuse = dot(n, light) - light.z;\n float spec = max(pow(max(dot(n, hv), 0.0), 60.0) - pow(hv.z, 60.0), 0.0);\n float side = pow(1.0 - n.z, 3.0);\n vec3 c = img.rgb * (1.0 + 0.45 * gloss * diffuse) * (1.0 - 0.5 * gloss * side) + gloss * spec;\n c *= 1.0 - 0.35 * gloss * (1.0 - smoothstep(0.0, 0.004, L.x));\n vec4 wet = vec4(c, img.a);\n return mix(to, wet, 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","BillowWipe":"// BillowWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BillowWipe.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image flows over the outgoing one like one fluid sliding over another, its front rolling up into a row of curling spirals that wind the two images into each other, tighten as they sweep across the frame and drift sideways, then leave 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 spacing; \n\nuniform float winding; \n\nuniform float drift; \n\nconst float SIZE = 0.47;\n\nconst float START = 1.5;\n\nconst float ENTER = 0.5;\n\nconst float RAMP = 0.15;\n\nconst float LIP = 0.02;\nconst float SHADOW = 0.035;\n\nconst float AA = 0.0015;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(0.0, -1.0);\n \n vec2 side = vec2(-dir.y, dir.x);\n vec2 aspect = vec2(ratio, 1.0);\n vec2 p = (uv - 0.5) * aspect;\n \n float E = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n float S = max(spacing, 0.01);\n float R = SIZE * S;\n\n \n float e = mix(t, t * t * (3.0 - 2.0 * t), 0.3);\n float front = mix(-E - max(ENTER * R, SHADOW + AA), E + R + 0.02, e);\n float slide = drift * t;\n \n float u = dot(p, side) - slide;\n float v = front - dot(p, dir);\n \n float cu = floor(u / S + 0.5) * S;\n vec2 q = vec2(u - cu, v);\n float r = length(q);\n \n if (v < -max(R, SHADOW)) return getFromColor(uv);\n if (v > max(R, LIP)) return getToColor(uv);\n\n \n float x = clamp(r / R, 0.0, 1.0);\n float s = 1.0 - x * x * (3.0 - 2.0 * x);\n float fall = s * s;\n \n float turns = (START + winding * t) * smoothstep(0.0, RAMP, t);\n float a = turns * fall;\n float c = cos(a);\n float sn = sin(a);\n vec2 w = vec2(c * q.x + sn * q.y, c * q.y - sn * q.x);\n\n vec2 src = mirror(uv + ((w.x - q.x) * side - (w.y - q.y) * dir) / aspect);\n vec4 outgoing = getFromColor(src);\n vec4 incoming = getToColor(src);\n\n \n float dfall = -12.0 * s * x * (1.0 - x) / R;\n vec2 grad = vec2(-sn, c) - w.x * turns * dfall * (r > 0.0 ? q / r : vec2(0.0));\n float phi = w.y / max(length(grad), 0.1);\n float m = smoothstep(-AA, AA, phi);\n\n \n float lip = 1.0 - smoothstep(0.0, LIP, phi);\n float shadow = 1.0 - smoothstep(0.0, SHADOW, -phi);\n incoming.rgb += (1.0 - incoming.rgb) * 0.25 * lip;\n outgoing.rgb *= 1.0 - 0.3 * shadow * shadow;\n\n \n vec4 col = mix(vec4(outgoing.rgb * outgoing.a, outgoing.a), vec4(incoming.rgb * incoming.a, incoming.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","Bite":"// Bite — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Bite.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is eaten like a cookie: bites are snapped out of its edges one after another, each deeper than the last and leaving a scalloped tooth-marked hole with a dark bitten rim, a jolt and falling crumbs, until a last big bite takes the rest and leaves 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 bites; \n\nuniform float jolt; \n\nuniform float shading; \n\nconst float START = 0.04;\nconst float LAST = 0.74;\nconst float SNAP = 0.06;\nconst float CRUMB_LIFE = 0.26;\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 hash2(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 = p - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash2(i), hash2(i + vec2(1.0, 0.0)), f.x),\n mix(hash2(i + vec2(0.0, 1.0)), hash2(i + vec2(1.0, 1.0)), f.x), f.y);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat scale() {\n return min(ratio, 1.0);\n}\n\nfloat biteCount() {\n return clamp(float(bites), 1.0, 9.0);\n}\n\nfloat biteStart(float k) {\n return START + k * (LAST - START) / biteCount();\n}\n\nfloat biteRadius(float k) {\n return (0.28 + 0.22 * k / biteCount()) * scale();\n}\n\nvec2 biteDir(float k) {\n float a = 2.39996 * k + 0.6;\n return vec2(cos(a), sin(a));\n}\n\nvec2 biteCenter(float k) {\n vec2 d = biteDir(k);\n vec2 h = vec2(0.5 * ratio, 0.5);\n float e = min(h.x / max(abs(d.x), 1e-4), h.y / max(abs(d.y), 1e-4));\n float r = biteRadius(k);\n return h + d * (e + r - r * (0.55 + 0.6 * k / biteCount()));\n}\n\nfloat teeth(vec2 d, float r, float seed) {\n vec2 n = d / max(length(d), 1e-5);\n float lobes = abs(sin(atan(d.y, abs(d.x) < 1e-6 ? 1e-6 : d.x) * 12.0 + seed));\n return length(d) - r * (1.0 + 0.04 * lobes + 0.03 * noise(n * 9.0 + seed * 3.7));\n}\n\nfloat growth(float t0) {\n float t = 1.0 - clamp((progress - t0) / SNAP, 0.0, 1.0);\n return 0.92 * (1.0 - t * t * t) + 0.08 * clamp((progress - t0) / (LAST - t0), 0.0, 1.0);\n}\n\nvec2 kick(float tau, vec2 toward) {\n return step(0.0, tau) * exp(-max(tau, 0.0) * 28.0) * sin(tau * 85.0) * toward;\n}\n\nvec4 transition(vec2 uv) {\n float s = scale();\n vec2 P = vec2(uv.x * ratio, uv.y);\n vec2 hc = vec2(0.5 * ratio, 0.5);\n vec2 off = vec2(0.012, -0.02) * s;\n vec2 cl = vec2(-0.12 * s, 0.9);\n float rl = length(vec2(ratio, 0.0) - cl) + 0.1;\n float tl = 1.0 - clamp((progress - LAST) / (1.0 - LAST), 0.0, 1.0);\n \n float lastGrowth = 1.0 - tl * tl;\n\n vec2 shake = kick(progress - LAST, normalize(cl - hc));\n for (int k = 0; k < 9; k++) {\n float fk = float(k);\n if (fk >= biteCount()) break;\n shake += kick(progress - biteStart(fk), biteDir(fk));\n }\n vec2 Q = P - shake * 0.018 * jolt * s;\n\n float dm = teeth(Q - cl, rl * lastGrowth, 3.0) + 0.05 * (1.0 - lastGrowth);\n float sh = teeth(Q - off - cl, rl * lastGrowth, 3.0) + 0.05 * (1.0 - lastGrowth);\n vec2 crumbUV = vec2(0.0);\n float crumbShade = 1.0;\n float ca = 0.0;\n for (int k = 0; k < 9; k++) {\n float fk = float(k);\n if (fk >= biteCount()) break;\n float t0 = biteStart(fk);\n if (progress < t0) break;\n float g = growth(t0);\n vec2 c = biteCenter(fk);\n float r = biteRadius(fk);\n \n dm = min(dm, teeth(Q - c, r * g, fk) + 0.05 * (1.0 - g));\n sh = min(sh, teeth(Q - off - c, r * g, fk) + 0.05 * (1.0 - g));\n\n float tau = progress - t0;\n if (tau > 0.0 && tau < CRUMB_LIFE) {\n vec2 inward = hc - c;\n float base = atan(inward.y, inward.x);\n for (int j = 0; j < 5; j++) {\n float fj = float(j);\n float h1 = hash(fk * 7.13 + fj * 1.37);\n float h2 = hash(fk * 3.71 + fj * 5.19 + 11.0);\n float h3 = hash(fk * 9.17 + fj * 2.31 + 23.0);\n float a = base + (h1 - 0.5) * 1.6;\n vec2 o = c + vec2(cos(a), sin(a)) * r * g * 0.98;\n vec2 pos = o + vec2((h2 - 0.5) * 0.5, 0.25 * h3) * tau * s - vec2(0.0, 3.2 * tau * tau);\n float sz = (0.007 + 0.01 * h3) * s;\n float rot = h2 * 6.283 + tau * (h1 - 0.5) * 30.0;\n vec2 q = mat2(cos(rot), sin(rot), -sin(rot), cos(rot)) * (Q - pos);\n float cd = mix(length(q), max(abs(q.x), abs(q.y * 1.3)), 0.6) - sz;\n float m = (1.0 - smoothstep(-0.0015, 0.0015, cd)) * smoothstep(0.0, SNAP, tau) * (1.0 - smoothstep(0.6 * CRUMB_LIFE, CRUMB_LIFE, tau));\n if (m > ca) {\n ca = m;\n crumbUV = o / vec2(ratio, 1.0);\n crumbShade = 0.62 + 0.3 * clamp(0.5 + 0.5 * q.y / sz, 0.0, 1.0);\n }\n }\n }\n }\n\n vec4 a = getFromColor(mirror(Q / vec2(ratio, 1.0)));\n float rimW = 0.016 * s;\n float rim = 1.0 - smoothstep(0.0, rimW, dm);\n a.rgb *= 1.0 - shading * 0.55 * rim * rim * (0.7 + 0.3 * noise(Q * 60.0));\n vec4 b = getToColor(uv);\n float caster = getFromColor(mirror((Q - off) / vec2(ratio, 1.0))).a;\n b.rgb *= 1.0 - shading * 0.5 * caster * smoothstep(-0.035, 0.01, sh);\n\n float cover = clamp(dm * 400.0 + 0.5, 0.0, 1.0);\n vec4 col = mix(vec4(b.rgb * b.a, b.a), vec4(a.rgb * a.a, a.a), cover);\n vec4 cr = getFromColor(mirror(crumbUV));\n cr.a *= ca;\n col = vec4(cr.rgb * crumbShade * cr.a, cr.a) + col * (1.0 - cr.a);\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","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 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 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","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 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 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 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 float zi = hash(vec2(i, r) + 3.7) < 0.5 ? z : 0.0;\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 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 float amount = 4.0 * p * (1.0 - p);\n float peak = amount * amount;\n float flood = peak * peak * peak;\n float m = smoothstep(0.44, 0.56, p);\n if (amount <= 0.0) return m < 0.5 ? getFromColor(uv) : getToColor(uv);\n\n vec4 c = image(uv, m);\n if (c.a <= 0.0) return vec4(0.0);\n c.rgb /= c.a;\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 bloom += w * mix(vec3(1.0), tint, smoothstep(0.0, 0.5, r)) * l;\n total += w;\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","Blossom":"// Blossom — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Blossom.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture is a closed bud: it parts into overlapping petals from its middle, and the petals curl back and open outward like a flower blooming, the outer whorl first and the inner one just after, onto the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 petals; \n\nuniform float curl; \n\nuniform float overlap; \n\nuniform float twist; \n\nconst float PI = 3.14159265;\nconst float TIP = 0.04;\nconst vec3 LIGHT = vec3(-0.42, 0.5, 0.757);\n\nfloat ease(float x) {\n x = clamp(x, 0.0, 1.0);\n float x4 = x * x * x * x;\n return 0.78 * x + 0.22 * x4 * x4;\n}\n\nvec2 mirrorUv(vec2 v) { return 1.0 - abs(1.0 - mod(v, 2.0)); }\n\nvec4 petal(float r, float ang, float j, vec4 w, float da, float tw, float R, float soft) {\n float off = ang - tw - j * da;\n off -= 2.0 * PI * floor(off / (2.0 * PI) + 0.5);\n float arg = w.z + w.y * (R - r);\n float a = asin(min(arg, 1.0));\n float m = R - (a - w.x) / w.y;\n float psi = off * r / max(m, 1e-4);\n float u = clamp(m / R, 0.0, 1.0);\n \n float hw = max(0.5 * da * (1.04 + overlap * (1.0 - u * u)), TIP / max(m, 1e-4));\n float aa = (0.0025 + soft) * min(1.0, 30.0 * w.w) + 1e-6;\n float cov = (1.0 - smoothstep(1.0 - 2.0 * w.y * aa, 1.0, arg))\n * smoothstep(0.0, aa, (hw - abs(psi)) * m + 1e-5)\n * smoothstep(0.0, aa, m);\n return vec4(cov, m, j * da + psi, a);\n}\n\nvec4 whorl(float f) {\n float h = 0.5 * PI * f * f;\n \n return vec4(h, max(curl * f * (2.0 - f), 1e-3), sin(h), f);\n}\n\nvec4 shade(vec4 pe, float axis) {\n vec2 q = 0.5 + pe.y * vec2(cos(pe.z), sin(pe.z));\n vec4 c = getFromColor(mirrorUv(q));\n float lambert = cos(pe.w) * LIGHT.z - sin(pe.w) * dot(vec2(cos(axis), sin(axis)), LIGHT.xy);\n c.rgb *= mix(0.3, 1.0, clamp(lambert / LIGHT.z, 0.0, 1.2));\n return c;\n}\n\nvec4 over(vec4 c, vec4 pe, float axis, float dim) {\n vec4 pc = shade(pe, axis);\n pc.rgb *= 1.0 - dim;\n return mix(c, pc, pe.x);\n}\n\nvec2 pair(float s, float parity) {\n float j = 2.0 * floor((s - parity) / 2.0 + 0.5) + parity;\n return vec2(j, j + (s >= j ? 2.0 : -2.0));\n}\n\nvec4 transition(vec2 uv) {\n \n vec2 p = uv - 0.5 + vec2(1e-5, 0.0);\n float R = 0.73;\n float da = PI / float(petals);\n float t = progress;\n float tw = twist * ease(t);\n vec4 wo = whorl(ease(t / 0.93));\n vec4 wi = whorl(ease((t - 0.07) / 0.93));\n float env = sin(PI * t);\n\n float r = length(p);\n float ang = atan(p.y, p.x);\n float s = (ang - tw) / da;\n \n vec2 jo = pair(s, 0.0);\n vec2 ji = pair(s, 1.0);\n vec4 o1 = petal(r, ang, jo.x, wo, da, tw, R, 0.0);\n vec4 o2 = petal(r, ang, jo.y, wo, da, tw, R, 0.0);\n vec4 i1 = petal(r, ang, ji.x, wi, da, tw, R, 0.0);\n vec4 i2 = petal(r, ang, ji.y, wi, da, tw, R, 0.0);\n\n vec2 ps = p + 0.045 * env * LIGHT.xy;\n float rs = length(ps);\n float angs = atan(ps.y, ps.x);\n float ss = (angs - tw) / da;\n vec2 kso = pair(ss, 0.0);\n vec2 ksi = pair(ss, 1.0);\n float shI = max(petal(rs, angs, ksi.x, wi, da, tw, R, 0.02).x, petal(rs, angs, ksi.y, wi, da, tw, R, 0.02).x);\n float shO = max(petal(rs, angs, kso.x, wo, da, tw, R, 0.02).x, petal(rs, angs, kso.y, wo, da, tw, R, 0.02).x);\n\n vec4 c = getToColor(uv);\n c.rgb *= 1.0 - 0.5 * env * max(shI, shO);\n float dim = 0.45 * env * shI;\n c = over(c, o2, jo.y * da + tw, dim);\n c = over(c, o1, jo.x * da + tw, dim);\n c = over(c, i2, ji.y * da + tw, 0.0);\n return over(c, i1, ji.x * da + tw, 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","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 float t = 1.0 - abs(2.0 * progress - 1.0);\n float k = t * t * (3.0 - 2.0 * t);\n float w = smoothstep(0.35, 0.65, progress);\n float r = radius * k;\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 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 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 right half of the outgoing image is a book page that turns over from right to left on the spine at the middle of the frame, curling near its free edge, its back bringing the left half of 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 perspective; \n\nuniform float shading; \n\nuniform float curl; \n\nconst float PI = 3.141592653589793;\nconst float EDGE = 0.0015;\nconst float CURL_PART = 0.45;\n\nconst vec2 LIGHT = vec2(-0.447214, 0.894427);\n\nfloat cross2(vec2 a, vec2 b) {\n return a.x * b.y - a.y * b.x;\n}\n\nfloat pageAngle() {\n float p = clamp(progress, 0.0, 1.0);\n return PI * p * (0.35 + p * (1.95 - 1.3 * p));\n}\n\nvec3 hitPage(vec2 eye, vec2 dir, float a, float k, float straight, vec2 c, float w) {\n vec3 best = vec3(-1.0, 0.0, 0.0);\n vec2 d = vec2(cos(a), sin(a));\n float den = cross2(d, dir);\n if (abs(den) > 1e-7) {\n float u = cross2(eye, dir) / den;\n float t = cross2(eye, d) / den;\n if (t > 0.0 && u >= 0.0 && u <= straight) best = vec3(t, u, a);\n }\n if (k != 0.0) {\n float r = 1.0 / k;\n vec2 oc = eye - c;\n float qa = dot(dir, dir);\n float qb = dot(oc, dir);\n float disc = qb * qb - qa * (dot(oc, oc) - r * r);\n if (disc >= 0.0) {\n float sq = sqrt(disc);\n for (int i = 0; i < 2; i++) {\n float t = (-qb + (i == 0 ? -sq : sq)) / qa;\n if (t > 0.0 && (best.x < 0.0 || t < best.x)) {\n \n vec2 v = (oc + t * dir) * k;\n float db = atan(v.x, -v.y) - a;\n db -= 2.0 * PI * floor((db + PI) / (2.0 * PI));\n float s = db / k;\n if (s >= 0.0 && s <= w - straight) best = vec3(t, straight + s, a + db);\n }\n }\n }\n }\n return best;\n}\n\nvec2 curlPoint(vec2 c, float k, float b) {\n return c + vec2(sin(b), -cos(b)) / k;\n}\n\nvec4 transition (vec2 uv) {\n float a = pageAngle();\n float lift = sin(a);\n float w = 0.5 * ratio;\n float x = uv.x * ratio - w;\n float dist = w * (1.0 + 1.5 / max(perspective, 0.01));\n vec2 eye = vec2(0.0, dist);\n vec2 dir = vec2(x, -dist);\n\n vec2 d = vec2(cos(a), sin(a));\n float k = -clamp(curl, 0.0, 1.0) * lift / (CURL_PART * w);\n if (abs(k) * CURL_PART * w <= 1e-4) k = 0.0;\n float straight = k != 0.0 ? (1.0 - CURL_PART) * w : w;\n vec2 c = straight * d + vec2(-d.y, d.x) / (k != 0.0 ? k : 1.0);\n vec2 bend = straight * d;\n vec2 middle = k != 0.0 ? curlPoint(c, k, a + 0.5 * k * (w - straight)) : bend;\n vec2 edge = k != 0.0 ? curlPoint(c, k, a + k * (w - straight)) : bend;\n\n \n float aa = EDGE * min(20.0 * lift, 1.0);\n vec4 img = vec4(0.0);\n float m = 0.0;\n vec3 hit = hitPage(eye, dir, a, k, straight, c, w);\n if (hit.x > 0.0) {\n float t = hit.x;\n float u = hit.y;\n float b = hit.z;\n vec2 pt = eye + t * dir;\n float y = clamp(0.5 + (uv.y - 0.5) * t, 0.0, 1.0);\n float edgeX = edge.x * dist / max(dist - edge.y, 1e-4);\n m = aa > 0.0 && u > (k != 0.0 ? straight : 0.5 * w) ? clamp(abs(x - edgeX) / aa, 0.0, 1.0) : 1.0;\n vec2 normal = vec2(-sin(b), cos(b));\n bool front = dot(normal, eye - pt) > 0.0;\n img = front\n ? getFromColor(vec2(clamp(w + u, w, ratio) / ratio, y))\n : getToColor(vec2(clamp(w - u, 0.0, w) / ratio, y));\n float diffuse = max(dot(front ? normal : -normal, LIGHT), 0.0) / LIGHT.y;\n float shade = mix(1.0, 0.25 + 0.75 * diffuse, shading);\n shade *= 1.0 - 0.35 * shading * lift * exp(-u / (0.04 * w));\n img.rgb *= shade;\n if (m >= 1.0) return img;\n }\n\n vec4 color = x < 0.0 ? getFromColor(uv) : getToColor(uv);\n vec2 toEdge = edge - vec2(x, 0.0);\n float cosEdge = toEdge.x / max(length(toEdge), 1e-6);\n float blocked = 0.5 * abs((x < 0.0 ? 1.0 : -1.0) - cosEdge);\n float shadow = blocked * blocked * (3.0 - 2.0 * blocked);\n float slope = -LIGHT.x / LIGHT.y;\n vec3 reach = vec3(bend.x, middle.x, edge.x) + slope * vec3(bend.y, middle.y, edge.y);\n float lo = min(0.0, min(reach.x, min(reach.y, reach.z)));\n float hi = max(0.0, max(reach.x, max(reach.y, reach.z)));\n float soft = max(0.25 * edge.y, 1e-5);\n shadow = max(0.5 * shadow, 0.85 * clamp(min(x - lo, hi - x) / soft + 0.5, 0.0, 1.0) * min(4.0 * lift, 1.0));\n color.rgb *= 1.0 - shading * shadow;\n return mix(color, img, 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","Bottleneck":"// Bottleneck — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Bottleneck.glsl\n// Author: gre\n// License: MIT\n// Description: A narrow neck travels down the frame like a ring slipped along a sheet: the outgoing image is pinched into an hourglass and squeezed through it, shaded like a tube where it narrows, and the incoming image swells back to full width above the neck\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 depth; \n\nuniform float neck; \n\nuniform vec4 background; \n\nvec2 mirrorUv(vec2 uv) { return 1.0 - abs(1.0 - mod(uv, 2.0)); }\n\nvec4 transition(vec2 uv) {\n float t = progress;\n float nk = clamp(neck, 0.05, 0.5);\n float e = mix(t, t * t * (3.0 - 2.0 * t), 0.6);\n \n float margin = 0.6 * nk;\n float dy = (uv.y - mix(1.0 + margin, -margin, e)) / nk;\n float env = smoothstep(0.0, 0.25, t) * (1.0 - smoothstep(0.75, 1.0, t));\n float pinch = clamp(depth, 0.3, 0.97) * env * exp(-dy * dy);\n float w = 1.0 - pinch;\n float x = (uv.x - 0.5) / w;\n\n \n vec2 q = mirrorUv(vec2(x + 0.5, uv.y + 0.25 * nk * dy * pinch));\n vec4 c = mix(getFromColor(q), getToColor(q), smoothstep(-0.15, 0.15, dy));\n\n float across = sqrt(max(1.0 - 4.0 * x * x, 0.0));\n \n float sx = (x + 0.17) / max(0.07, 0.004 / w);\n c.rgb = c.rgb * mix(1.0, 0.35 + 0.65 * across, pinch) + 0.3 * pinch * exp(-sx * sx);\n\n float inside = 1.0 - smoothstep(0.5, 0.5 + 0.003 / w, abs(x));\n vec4 bg = background;\n bg.rgb *= mix(0.55, 1.0, clamp((abs(uv.x - 0.5) - 0.5 * w) / 0.06, 0.0, 1.0));\n return mix(bg, c, 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","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: Two triangles grow from the top and bottom edges into a bow tie that reveals the incoming image, with an adjustable shape, and 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 return getToColor(uv);\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","BrickCollapse":"// BrickCollapse — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/BrickCollapse.glsl\n// Author: gre\n// License: MIT\n// Description: Faint mortar joints turn the outgoing image into a brick wall: one brick of the bottom course is yanked out downward, the steep wedge of bricks it held drops through the hole, and the collapse spreads sideways course by course until the last bricks at the edges tumble out and the incoming image stands where the wall was\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 rows; \n\nuniform float origin; \n\nuniform float shading; \n\nconst float G = 14.0;\nconst float PULL = 0.16;\nconst float EDGE = 0.0012;\n\nfloat hash(vec2 p) {\n vec3 q = fract(p.xyx * 0.1031);\n q += dot(q, q.yzx + 33.33);\n return fract((q.x + q.y) * q.z);\n}\n\nmat2 rot(float a) {\n float c = cos(a), s = sin(a);\n return mat2(c, -s, s, c);\n}\n\nfloat courseOffset(float r, float bw) {\n return mod(r, 2.0) * 0.5 * bw;\n}\n\nfloat fallStart(float r, float i, float bh, float bw, float x0, float reach) {\n float d = abs((i + 0.5) * bw + courseOffset(r, bw) - x0);\n if (r < 0.5 && d < 0.5 * bw) return -1.0;\n \n float v = 0.5 * bw + 0.3 * r * bh * min(ratio, 1.0);\n float far = max(reach - v, bw);\n \n float deadline = 0.95 - sqrt((r + 3.0) * bh / G);\n float excess = max(d - v, 0.0);\n float jitter = 0.05 * (hash(vec2(i, r) + 3.7) - 0.5) * step(0.001, excess);\n return mix(PULL * 0.7 + r * bh * 0.2, deadline, clamp(excess / far + jitter, 0.0, 1.0));\n}\n\nfloat rectCover(vec2 q, vec2 halfSize, float soft) {\n vec2 d = halfSize - abs(q);\n return clamp(min(d.x, d.y) / soft + 0.5, 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float bh = min(ratio, 1.0) / clamp(float(rows), 1.0, 12.0);\n float bw = 2.1 * bh;\n vec2 hs = vec2(0.5 * bw, 0.5 * bh);\n vec2 P = vec2(uv.x * ratio, uv.y);\n float x0 = (clamp(floor(clamp(origin, 0.0, 1.0) * ratio / bw), 0.0, max(floor(ratio / bw - 0.5), 0.0)) + 0.5) * bw;\n float reach = max(x0, ratio - x0);\n float k = clamp(shading, 0.0, 1.0);\n float appear = smoothstep(0.0, 0.06, progress);\n\n float ao = 0.0, shadow = 0.0;\n vec4 wall = vec4(0.0);\n float wallCov = 0.0;\n vec4 fall = vec4(0.0);\n float fallCov = 0.0, fallGrow = 0.0;\n\n for (int j = 0; j < 48; j++) {\n float r = float(j);\n if (r * bh >= 1.0) break;\n \n if (P.y - (r + 0.5) * bh > bw) continue;\n float off = courseOffset(r, bw);\n for (int n = -1; n < 2; n++) {\n float i = floor((P.x - off) / bw) + float(n);\n float t0 = fallStart(r, i, bh, bw, x0, reach);\n vec2 home = vec2((i + 0.5) * bw + off, (r + 0.5) * bh);\n vec2 q;\n float s, grow = 1.0;\n vec2 shadowOffset = vec2(0.0);\n if (t0 < 0.0) {\n s = clamp(progress / PULL, 0.0, 1.0);\n q = P - home + vec2(0.0, 1.1 * bh * s * s);\n } else {\n s = max(progress - t0, 0.0);\n float spin = (hash(vec2(i, r) + 1.3) - 0.5) * 2.2 * G * s * s;\n float drift = sign(x0 - home.x) * 0.25 * G * s * s * bh;\n \n grow = 1.0 + 0.7 * s;\n mat2 m = rot(spin);\n q = m * (P - home - vec2(drift, -G * s * s)) / grow;\n shadowOffset = m * vec2(0.25, -0.45) * bh * min(4.0 * s, 1.0) / grow;\n }\n float falling = step(0.0001, s);\n float moving = smoothstep(0.0, 0.05, s);\n float e = min(hs.x - abs(q.x), hs.y - abs(q.y));\n if (falling > 0.0) {\n float soft = 0.15 * bh * min(4.0 * s, 1.0) + EDGE;\n shadow = max(shadow, rectCover(q - shadowOffset, hs, soft / grow) * min(8.0 * s, 1.0));\n }\n \n if (e < -1e-4 - 0.5 * EDGE * moving / grow) {\n ao = max(ao, exp(e / (0.25 * bh)) * appear * (1.0 - moving));\n continue;\n }\n vec2 src = home + q;\n \n vec4 b = getFromColor(falling > 0.0 ? vec2(src.x / ratio, src.y) : uv);\n vec2 inFrame = clamp(min(src, vec2(ratio, 1.0) - src) * grow / EDGE + 1.0, 0.0, 1.0);\n vec2 l = q / vec2(bw, bh) + 0.5;\n float lit = min(s * 8.0, 1.0);\n float joint = 1.0 - smoothstep(0.0, 0.004 + 0.004 * lit, e);\n b.rgb *= 1.0 - 0.45 * k * joint * appear;\n b.rgb *= 1.0 + 0.25 * k * lit * (l.y - l.x);\n b.rgb *= 1.0 - 0.35 * k * falling * min(s * 4.0, 1.0) * (1.0 - l.y);\n if (falling > 0.0) {\n float a = mix(1.0, clamp(e * grow / EDGE + 0.5, 0.0, 1.0), moving) * inFrame.x * inFrame.y;\n \n if (grow > fallGrow) {\n float nc = a + fallCov * (1.0 - a);\n if (nc > 0.0) fall = mix(fall, b, a / nc);\n fallCov = nc;\n fallGrow = grow;\n } else {\n float w = a * (1.0 - fallCov);\n fallCov += w;\n if (w > 0.0) fall = mix(fall, b, w / fallCov);\n }\n } else {\n wall = b;\n wallCov = 1.0;\n }\n }\n }\n vec4 c = getToColor(uv);\n c.rgb *= 1.0 - 0.55 * k * ao;\n c = mix(c, wall, wallCov);\n c.rgb *= 1.0 - 0.45 * k * shadow;\n return mix(c, fall, fallCov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n float n = fbm(uv * 4.);\n float e = progress * 1.05 - 0.05;\n float l = smoothstep(e, e + 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","ButterflyFlight":"// ButterflyFlight — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ButterflyFlight.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture becomes a butterfly: its two halves round off into wings that start beating, folding toward the viewer on the center line, and the butterfly flutters away up and to the right, growing smaller as it bobs along, until it leaves the frame and its shadow fades off the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 beats; \n\nconst float PI = 3.1415927;\n\nfloat ellipse(vec2 p, vec2 c, vec2 r, float a) {\n p -= c;\n p = mat2(cos(a), -sin(a), sin(a), cos(a)) * p;\n return (length(p / r) - 1.0) * min(r.x, r.y);\n}\n\nfloat wing(vec2 v, float hw, float h, float m) {\n \n vec2 b = abs(v) - vec2(hw, 0.5);\n float rect = length(max(b, 0.0)) + min(max(b.x, b.y), 0.0);\n vec2 w = v / vec2(hw, h);\n float fore = ellipse(w, vec2(0.5, 0.15), vec2(0.56, 0.33), 0.45);\n float hind = ellipse(w, vec2(0.36, -0.2), vec2(0.4, 0.28), -0.6);\n float body = ellipse(w, vec2(0.0, -0.04), vec2(0.06, 0.4), 0.0);\n return mix(rect, min(min(fore, hind), body) * min(hw, h), m);\n}\n\nvec4 butterfly(vec2 p, float t, float blur) {\n \n float fly = clamp((t - 0.08) / 0.92, 0.0, 1.0);\n float S = mix(1.0, 0.15, smoothstep(0.0, 0.8, fly));\n vec2 c = vec2(0.5 * ratio + 0.2, 0.66) * fly * fly + vec2(0.0, 0.24 * sin(PI * beats * t) * fly * (1.0 - fly));\n float tilt = -0.35 * fly;\n vec2 q = mat2(cos(tilt), sin(tilt), -sin(tilt), cos(tilt)) * (p - c) / S;\n float amp = 1.15 * smoothstep(0.0, 0.25, t) * (1.0 - smoothstep(0.9, 1.0, t));\n float th = amp * (0.5 - 0.5 * cos(2.0 * PI * beats * t));\n float sn = sin(th), cs = cos(th);\n float hw = 0.5 * ratio;\n \n float h = min(1.0, 1.15 * hw);\n \n float f = 2.5 * max(hw, h);\n float X = abs(q.x);\n float d = X * f / (cs * f + X * sn);\n float y = q.y * (f - d * sn) / f;\n float m = smoothstep(0.0, 0.12, t);\n float sd = wing(vec2(d, y), hw, h, m);\n float px = (0.003 + blur) / S * smoothstep(0.0, 0.04, t) + 1e-4;\n float cov = clamp(-sd / px + 1.0 - smoothstep(0.0, 0.04, t) * 0.5, 0.0, 1.0);\n \n float bd = ellipse(q, vec2(0.0, -0.02), vec2(0.025 * hw, 0.38 * h), 0.0);\n float body = m * (1.0 - smoothstep(-px, px, bd));\n return vec4(vec2(sign(q.x) * d / ratio + 0.5, y + 0.5), cov, max(0.45 * sn, body));\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n vec4 bf = butterfly(p, t, 0.0);\n vec4 shadowBf = butterfly(p - vec2(0.03, -0.05) * smoothstep(0.0, 0.3, t), t, 0.02 * smoothstep(0.0, 0.3, t));\n vec4 b = getToColor(uv);\n b.rgb *= 1.0 - 0.45 * shadowBf.z * smoothstep(0.0, 0.2, t) * (1.0 - smoothstep(0.85, 1.0, t));\n vec4 a = getFromColor(clamp(bf.xy, 0.0, 1.0));\n a.rgb *= 1.0 - 0.8 * bf.w;\n return mix(b, a, bf.z);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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;\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 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 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 float open = envelope(progress);\n float shutter = 0.8 * blur / jolts * open;\n float lag = 0.2 * split / jolts * open;\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 float w = 1.0 - 1.4 * abs(u);\n \n bool incoming = t >= 0.5;\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","CardDeal":"// CardDeal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CardDeal.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is dealt onto the frame like a hand of cards: tile after tile is flicked from below the frame, spinning through the air with a lifting shadow, and slides to a stop in its place until the picture is complete\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 deck; \n\nuniform float spin; \n\nuniform float shadow; \n\nconst float PI = 3.141592653589793;\nconst int MAX_CARDS = 36;\n\nconst float DEAL = 0.16;\n\nconst float TOUCH = 0.55;\nconst float THROW = 2.2;\nconst float SLIDE = 0.35;\n\nconst float LIFT = 0.45;\nconst float EYE = 2.4;\nconst float EDGE = 0.0015;\n\nfloat hash(float n) {\n vec2 p = fract(vec2(n) * vec2(0.1031, 0.1030));\n p += dot(p, p.yx + 33.33);\n return fract((p.x + p.y) * p.x);\n}\n\nvec2 gridSize() {\n return clamp(vec2(grid), 1.0, 6.0);\n}\n\nfloat cardTime(float j, float n) {\n float flight = 1.0 / (1.0 + (n - 1.0) * DEAL);\n return clamp((progress - j * DEAL * flight) / flight, 0.0, 1.0);\n}\n\nvec2 cardCell(float j, vec2 g) {\n float row = floor(j / g.x);\n return vec2(j - row * g.x, g.y - 1.0 - row);\n}\n\nfloat cardDist(vec2 q, vec2 size) {\n vec2 e = min(q, 1.0 - q) * size;\n return min(e.x, e.y);\n}\n\nvec4 transition(vec2 uv) {\n vec2 g = gridSize();\n float n = g.x * g.y;\n vec2 asp = vec2(ratio, 1.0);\n vec2 size = asp / g;\n vec2 p = uv * asp;\n vec2 origin = deck * asp;\n float darkness = clamp(shadow, 0.0, 1.0);\n\n vec2 own = min(floor(uv * g), g - 1.0);\n float ownIndex = (g.y - 1.0 - own.y) * g.x + own.x;\n vec4 col = cardTime(ownIndex, n) >= 1.0 ? getToColor(uv) : getFromColor(uv);\n\n \n for (int i = 0; i < MAX_CARDS; i++) {\n float j = float(i);\n if (j >= n) break;\n float u = cardTime(j, n);\n if (u <= 0.0) break;\n if (u >= 1.0) continue;\n\n vec2 cell = cardCell(j, g);\n vec2 target = (cell + 0.5) * size;\n vec2 way = target - origin;\n float len = max(length(way), 1e-3);\n vec2 side = vec2(-way.y, way.x);\n float r1 = hash(j + 1.0);\n float r2 = hash(j + 60.0);\n float turn = r2 < 0.5 ? -1.0 : 1.0;\n float slide = min(SLIDE * size.y / len, 0.5);\n float a = min(u / TOUCH, 1.0);\n float s = clamp((u - TOUCH) / (1.0 - TOUCH), 0.0, 1.0);\n \n float v1 = 2.0 * slide * TOUCH / ((1.0 - TOUCH) * (1.0 - slide));\n float f = (3.0 - 2.0 * a) * a * a + THROW * (a * a * a - 2.0 * a * a + a) + v1 * (a * a * a - a * a);\n float e = u < TOUCH ? (1.0 - slide) * f : 1.0 - slide * (1.0 - s) * (1.0 - s);\n vec2 c = origin + way * e + side * turn * (0.05 + 0.05 * r1) * sin(PI * e);\n float h = LIFT * (0.7 + 0.3 * r1) * sin(PI * a) * (1.0 - 0.35 * a);\n float angle = turn * spin * (0.8 + 0.4 * r2) * 2.0 * PI * (1.0 - e);\n float tilt = 0.45 * sin(PI * a) * cos(angle * 0.5 + 6.0 * r1);\n float air = 1.0 - a * a;\n float fade = smoothstep(0.0, 0.05, u);\n\n vec2 sp = p - c - vec2(0.18, -0.3) * h - vec2(0.002, -0.003);\n float ca = cos(angle), sa = sin(angle);\n mat2 rot = mat2(ca, -sa, sa, ca);\n vec2 sq = rot * sp / size + 0.5;\n float soft = 0.006 + 0.08 * h;\n float sh = smoothstep(-soft, soft, cardDist(sq, size));\n float dark = mix(0.8 * (1.0 - s), 0.65 - 0.3 * h / LIFT, air);\n col.rgb *= 1.0 - fade * darkness * dark * sh;\n\n vec2 d = rot * (p - c) * (EYE - h) / EYE;\n float ct = cos(tilt), st = sin(tilt);\n \n float den = EYE * ct + d.y * st;\n float k = den > 1e-3 ? EYE * ct / den : 1e3;\n vec2 q = vec2(k * d.x, k * d.y * ct + EYE * (1.0 - k) * st) / size + 0.5;\n \n float edge = EDGE * (1.0 + 2.0 * air) * min(10.0 * (1.0 - s), 1.0);\n float m = fade * clamp(cardDist(q, size) / max(edge, 1e-6) + 0.5, 0.0, 1.0);\n if (m > 0.0) {\n vec4 face = getToColor((cell + clamp(q, 0.0, 1.0)) / g);\n float light = 1.0 + 0.6 * st * (0.6 - 0.4 * turn * sin(angle));\n float rim = 1.0 - smoothstep(0.0, 0.008, cardDist(q, size));\n face.rgb = mix(min(face.rgb * light, vec3(face.a)), vec3(face.a), 0.45 * air * rim);\n col = mix(col, face, m);\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","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 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 tc.rgb *= 1.0 - 0.35 * k * k;\n \n vec4 col = mix(premultiply(backColor), premultiply(tc), cb);\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 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 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\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 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 edge /= 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 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","CircleBurst":"// CircleBurst — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CircleBurst.glsl\n// Author: gre\n// License: MIT\n// Description: Discs of three solid colors burst out of a point one after another, each covering the last, then a hole bursts open from the same point in the last one 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 vec4 color1; \n\nuniform vec4 color2; \n\nuniform vec4 color3; \n\nuniform float stagger; \n\nconst float AA = 0.0015;\nconst float SW = 0.03;\nconst float SO = 0.32;\n\nfloat phase(float s, float d) {\n return clamp((progress - s) / d, 0.0, 1.0);\n}\n\nfloat radius(float t, float R) {\n float u = 1.0 - t;\n return mix(-SW - AA, R, mix(t, 1.0 - u * u * u, 0.8));\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(abs(v), 2.0));\n}\n\nvec4 layer(vec4 p, vec4 c, float r, float x) {\n float k = smoothstep(r - AA, r + AA, x);\n float s = SO * c.a * k * (1.0 - smoothstep(0.0, SW, x - r));\n p = p * (1.0 - s) + vec4(0.0, 0.0, 0.0, s);\n k = c.a * (1.0 - k);\n return p * (1.0 - k) + vec4(c.rgb, 1.0) * k;\n}\n\nvec4 transition(vec2 uv) {\n vec2 asp = vec2(ratio, 1.0);\n float x = length((uv - center) * asp);\n \n float R = length(max(center, 1.0 - center) * asp) + SW + AA;\n float k = clamp(stagger, 0.0, 1.0);\n float d = 1.0 / (1.0 + 3.0 * k);\n\n float t = phase(0.0, d);\n vec4 a = getFromColor(mirror(center + (uv - center) / (1.0 + 0.06 * t * (2.0 - t))));\n vec4 p = vec4(a.rgb * a.a, a.a);\n p = layer(p, color1, radius(t, R), x);\n p = layer(p, color2, radius(phase(k * d, d), R), x);\n float r = radius(phase(2.0 * k * d, d), R);\n p = layer(p, color3, r, x);\n\n t = phase(3.0 * k * d, d);\n float h = radius(t, R);\n float u = 1.0 - t;\n vec4 b = getToColor(mirror(center + (uv - center) / (1.0 + 0.14 * u * u * (1.0 - 2.4 * t))));\n float s = SO * color3.a * clamp((r - h) / SW, 0.0, 1.0) * (1.0 - smoothstep(0.0, SW, h - x));\n vec4 q = vec4(b.rgb * b.a * (1.0 - s), b.a * (1.0 - s) + s);\n p = mix(p, q, 1.0 - smoothstep(h - AA, h + AA, x));\n return p.a > 0.0 ? vec4(p.rgb / p.a, p.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","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","CirclePacking":"// CirclePacking — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CirclePacking.glsl\n// Author: gre\n// License: MIT\n// Description: Fine, slowly turning guide circles pack the outgoing picture into an Apollonian gasket; the biggest circles open first, each swelling from its own center into a bright-rimmed window on the incoming picture, then the next sizes follow, faster and faster down into the ever smaller gaps\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 depth; \n\nuniform vec4 lineColor; \n\nconst float R1 = 0.46410162; \n\nvec2 rot(vec2 v, float a) {\n float c = cos(a), 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 float p = progress;\n vec2 asp = vec2(ratio, 1.0);\n float Rd = 0.5 * length(asp) * 1.04;\n float turn = 0.35 - 0.25 * p;\n vec2 z = rot((uv - 0.5) * asp / Rd, turn);\n\n \n vec2 a = vec2(0.0, -1.0);\n float k = 2.0 * R1 / (1.0 - R1);\n vec2 d = z - a;\n vec2 w = d * k / max(dot(d, d), 1e-6);\n vec2 P = vec2(w.x + 0.5, w.y - 0.5 * k);\n vec2 cc = vec2(0.0, -(1.0 - R1));\n float cr = R1;\n vec3 steps[12];\n int level = -1;\n if (P.y <= 1.0) {\n for (int i = 0; i < 12; i++) {\n float n = floor(P.x + 0.5);\n P.x -= n;\n vec2 o = P - vec2(0.0, 0.5);\n steps[i] = vec3(n, 0.0, 0.0);\n if (dot(o, o) < 0.25) {\n level = i;\n break;\n }\n steps[i].y = step(0.5, P.y);\n if (P.y > 0.5) P.y = 1.0 - P.y;\n steps[i].z = step(P.x, 0.0);\n P.x = abs(P.x);\n P /= max(dot(P, P), 1e-6);\n }\n \n vec2 c = vec2(0.0, 0.5);\n float r = 0.5;\n for (int j = 0; j < 12; j++) {\n int i = 11 - j;\n \n vec3 s = steps[11 - j];\n if (i < level) {\n float q = dot(c, c) - r * r;\n c /= q;\n r /= abs(q);\n if (s.z > 0.5) c.x = -c.x;\n if (s.y > 0.5) c.y = 1.0 - c.y;\n }\n if (i <= level) c.x += s.x;\n }\n c = vec2(c.x - 0.5, c.y + 0.5 * k);\n float q = dot(c, c) - r * r;\n cc = a + k * c / q;\n cr = level < 0 ? 1e-4 : k * r / abs(q);\n }\n float rad = cr * Rd;\n float rho = length(z - cc) / cr;\n\n float t = clamp(p / 0.95, 0.0, 1.0);\n t *= sqrt(t);\n float thr = mix(log(R1 * Rd * 1.02), log(0.003), t);\n float local = clamp(log(rad) - thr, 0.0, 1.0);\n float fill = 1.0 - pow(1.0 - local, 2.5);\n float aa = 0.0025;\n \n float e = (fill - rho) * rad + aa * smoothstep(0.85, 1.0, fill);\n float m = smoothstep(-aa, aa, e) * smoothstep(0.0, 0.05, fill);\n \n float dust = smoothstep(0.78, 0.99, p);\n float open = 1.0 - smoothstep(0.75, 1.0, local);\n\n float line = 1.0 - smoothstep(0.0005, 0.0025, abs(1.0 - rho) * rad);\n line *= smoothstep(0.0, 0.12, p) * smoothstep(thr - 2.0, thr, log(rad)) * smoothstep(0.002, 0.012, rad) * (1.0 - m) * (1.0 - dust);\n float rw = 0.0015 + 0.004 * smoothstep(0.0, 0.2, rad);\n float rim = (1.0 - smoothstep(rw - 0.0015, rw + 0.0015, abs(e))) * smoothstep(0.0, 0.03, local) * open * smoothstep(0.002, 0.02, rad);\n\n vec2 center = clamp(rot(cc, -turn) * Rd / asp + 0.5, 0.0, 1.0);\n vec2 tuv = mix(uv, center, (level < 0 ? 0.0 : 0.3) * depth * (1.0 - smoothstep(0.0, 1.0, fill)) * (1.0 - dust));\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(tuv);\n \n vec2 dir = rot(z - cc, -turn) / max(cr * rho, 1e-6);\n float inner = (1.0 - smoothstep(0.0, 0.07 * smoothstep(0.0, 0.15, rad) + 1e-4, e)) * (0.6 + 0.4 * dot(dir, vec2(-0.6, 0.8)));\n to.rgb *= 1.0 - 0.6 * depth * inner * open * (1.0 - dust);\n\n vec4 c = mix(vec4(from.rgb * from.a, from.a), vec4(to.rgb * to.a, to.a), max(m, dust));\n c = mix(c, vec4(lineColor.rgb, 1.0), lineColor.a * max(line, rim * (1.0 - dust)));\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","Cleave":"// Cleave — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Cleave.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is driven into the outgoing one like a wedge into a log: a crack runs ahead of its point, the two halves are shoved aside and bunch up against its sides, then fall apart out of 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 opening; \n\nuniform float squash; \n\nuniform float shading; \n\nconst float EDGE = 0.0025;\n\nconst float FALLOFF = 0.11;\n\nfloat zigzag (float v) {\n return abs(fract(v) - 0.5) * 4.0 - 1.0;\n}\n\nvec4 transition (vec2 uv) {\n float p = progress;\n vec2 S = vec2(ratio, 1.0);\n \n vec2 D = abs(direction.x) > abs(direction.y) ? vec2(sign(direction.x), 0.0) : vec2(0.0, direction.y > 0.0 ? 1.0 : -1.0);\n vec2 N = vec2(-D.y, D.x);\n vec2 q = (uv - 0.5) * S;\n float len = abs(D.x) * ratio + abs(D.y);\n float halfWidth = 0.5 * (abs(D.y) * ratio + abs(D.x));\n float t = dot(q, D) + 0.5 * len;\n float c = dot(q, N);\n float x = abs(c);\n float side = c < 0.0 ? -1.0 : 1.0;\n\n float a = clamp(p / 0.62, 0.0, 1.0);\n float drive = a * a * (3.0 - 2.0 * a);\n float tip = len * drive;\n float b = clamp((p - 0.5) / 0.5, 0.0, 1.0);\n float apart = b * b;\n float k = tan(radians(opening));\n\n float wedge = k * max(tip - t, 0.0);\n \n float w = wedge + (halfWidth + 0.02 + 0.3 * (len - t)) * apart * clamp(1.0 + (tip - t) / EDGE, 0.0, 1.0);\n\n \n vec4 to = getToColor((q + D * len * (1.0 - drive)) / S + 0.5);\n float shadow = shading * 0.7 * exp(-max(w - x, 0.0) * cos(radians(opening)) / 0.035) * (1.0 - apart) * clamp(1.0 + (w - x) / EDGE, 0.0, 1.0);\n to.rgb *= 1.0 - shadow;\n\n \n \n float d = max(x - w, 0.0);\n float bunch = wedge * squash * (1.0 - apart);\n float fall = exp(-d / FALLOFF);\n vec2 qf = (t - 0.5 * len) * D + side * (d + bunch * (1.0 - fall)) * N;\n vec4 from = getFromColor(qf / S + 0.5);\n\n float ridge = bunch / FALLOFF * fall;\n float lip = 1.0 - smoothstep(0.0, 0.012, d);\n float light = 1.0 + shading * (0.5 * lip * min(ridge, 1.0) - 0.3 * min(ridge, 1.5) * (1.0 - lip) * (1.0 - 0.5 * fall));\n\n float grow = clamp(p / 0.08, 0.0, 1.0);\n float crackLen = 0.2 * grow;\n float ahead = t - tip;\n if (ahead > 0.0 && ahead < crackLen) {\n float xc = smoothstep(0.0, 0.02, ahead) * (0.006 * zigzag(t * 21.0) + 0.0025 * zigzag(t * 57.0 + 0.3));\n float taper = 1.0 - ahead / crackLen;\n float width = 0.0015 + 0.004 * taper;\n light *= 1.0 - 0.75 * (1.0 - smoothstep(width, width + EDGE, abs(c - xc))) * taper * grow;\n }\n from.rgb *= light;\n\n \n float m = mix(1.0, clamp(0.5 + 0.5 * (x - w) / EDGE, 0.0, 1.0), clamp(w / EDGE, 0.0, 1.0));\n return mix(to, from, 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","Clothesline":"// Clothesline — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Clothesline.glsl\n// Author: gre\n// License: MIT\n// Description: The camera pulls back to show the outgoing image as a print hung by two clothespins on a line in front of a wall, the line is pulled sideways and carries it away while the incoming print slides in, both prints swinging and tilting like hanging paper, then the camera moves back in on the incoming print 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 sway; \n\nuniform float size; \n\nuniform vec4 background; \n\nuniform vec4 lineColor; \n\nuniform vec4 pinColor; \n\nconst float FOCAL = 2.0; \nconst float GAP = 0.35;\nconst float WALL = 0.14;\nconst float ROPE = 0.0055;\nconst vec2 PIN = vec2(0.021, 0.072);\nconst float PIN_Y = -0.01; \nconst float AA = 0.0015;\nconst vec3 LIGHT = vec3(-0.28, 0.48, 0.83); \nconst float PIN_X = 0.32; \nconst int STEPS = 32;\n\nconst float SLIDE_START = 0.1;\nconst float SLIDE_END = 0.86;\n\nvec4 premultiply(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nfloat slideTime(float p) {\n return clamp((p - SLIDE_START) / (SLIDE_END - SLIDE_START), 0.0, 1.0);\n}\n\nfloat slideAmount(float u) {\n return u * u * u * (u * (u * 6.0 - 15.0) + 10.0);\n}\n\nfloat slideAccel(float p) {\n float u = slideTime(p);\n float dur = SLIDE_END - SLIDE_START;\n return 60.0 * u * (1.0 - u) * (1.0 - 2.0 * u) / (dur * dur);\n}\n\nfloat swing(float p) {\n const float OMEGA = 10.0; \n const float DAMP = 0.28;\n const float STEP = 1.0 / float(STEPS);\n float x = 0.0;\n float v = 0.0;\n \n for (int i = 0; i < STEPS; i++) {\n float t0 = float(i) * STEP;\n float dt = clamp(p - t0, 0.0, STEP);\n float a = slideAccel(t0 + 0.5 * dt) - OMEGA * OMEGA * x - 2.0 * DAMP * OMEGA * v;\n v += a * dt;\n x += v * dt;\n }\n return x * (1.0 - smoothstep(0.7, 1.0, p));\n}\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\nvec3 printHit(vec3 o, vec3 d, float cx, float psi) {\n vec3 dn = vec3(0.0, -cos(psi), -sin(psi));\n vec3 n = vec3(0.0, sin(psi), -cos(psi));\n vec3 p0 = vec3(cx, 0.5, 0.0);\n float t = dot(p0 - o, n) / dot(d, n);\n vec3 q = o + d * t - p0;\n return vec3(q.x, dot(q, dn), t);\n}\n\nfloat bendShift(float v, float bend) {\n float h = clamp(v, 0.0, 1.0);\n return bend * h * (0.6 + 0.4 * h);\n}\n\nfloat paperDist(vec2 uv, float bend) {\n vec2 q = abs(vec2(uv.x - bendShift(uv.y, bend), uv.y - 0.5)) - vec2(0.5 * ratio, 0.5);\n return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0);\n}\n\nfloat pinDist(vec2 uv) {\n vec2 q = vec2(abs(uv.x) - PIN_X * ratio, uv.y - PIN_Y);\n return roundedBox(q, PIN, 0.012);\n}\n\nvec4 drawPrint(vec4 col, vec3 h, bool isFrom, float bend, float psi, float aa, float vis) {\n vec2 lp = h.xy;\n float d = paperDist(lp, bend);\n float cov = clamp(0.5 - d / (h.z * aa), 0.0, 1.0);\n if (cov > 0.0) {\n vec2 st = clamp(vec2((lp.x - bendShift(lp.y, bend)) / ratio + 0.5, 1.0 - lp.y), 0.0, 1.0);\n vec4 c = premultiply(isFrom ? getFromColor(st) : getToColor(st));\n float shade = 1.0 - 1.2 * abs(sin(psi)) * lp.y - 0.35 * abs(bend) * lp.y;\n float ps = pinDist(lp - vec2(0.006, 0.01));\n shade -= 0.35 * vis * (1.0 - smoothstep(-0.004, 0.012, ps));\n c.rgb *= clamp(shade, 0.0, 1.0);\n col = c * cov + col * (1.0 - c.a * cov);\n }\n return col;\n}\n\nvec4 drawPins(vec4 col, vec3 h, float aa, float vis) {\n vec2 lp = h.xy;\n float d = pinDist(lp);\n float cov = vis * clamp(0.5 - d / (h.z * aa), 0.0, 1.0);\n if (cov > 0.0) {\n float k = clamp((abs(lp.x) - PIN_X * ratio) / PIN.x, -1.0, 1.0);\n vec3 c = pinColor.rgb * (0.62 + 0.45 * sqrt(1.0 - k * k));\n float y = lp.y - PIN_Y;\n float spring = 1.0 - smoothstep(0.004, 0.007, abs(y + 0.02));\n c = mix(c, vec3(0.3, 0.31, 0.33) * (0.6 + 0.8 * sqrt(1.0 - k * k)), spring);\n c *= 1.0 - 0.3 * (1.0 - smoothstep(0.002, 0.005, abs(y - 0.012)));\n vec4 pc = premultiply(vec4(c, pinColor.a));\n col = pc * cov + col * (1.0 - pc.a * cov);\n }\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 sw = clamp(sway, 0.0, 1.0);\n\n float back = smoothstep(0.0, 0.3, p) * (1.0 - smoothstep(0.6, 1.0, p));\n float zoom = mix(1.0, clamp(size, 0.1, 1.0), back);\n float vis = smoothstep(0.0, 0.35, back);\n vec3 o = vec3(0.0, 0.05 * back, FOCAL / zoom);\n vec3 d = vec3((uv - 0.5) * vec2(ratio, 1.0), -FOCAL);\n float aa = max(AA * min(1.0, 40.0 * back), 1e-6);\n\n float u = slideTime(p);\n float m = slideAmount(u);\n float speed = 16.0 * u * u * (1.0 - u) * (1.0 - u);\n float spacing = ratio + GAP;\n float cFrom = -s * spacing * m;\n float cTo = s * spacing * (1.0 - m);\n float bend = s * 0.65 * sw * swing(p);\n float psi = 0.45 * sw * speed;\n\n vec3 hf = printHit(o, d, cFrom, psi);\n vec3 ht = printHit(o, d, cTo, psi);\n\n vec4 col = premultiply(background);\n float cover = max(\n clamp(0.5 - paperDist(hf.xy, bend) / (hf.z * aa), 0.0, 1.0),\n clamp(0.5 - paperDist(ht.xy, bend) / (ht.z * aa), 0.0, 1.0));\n col *= mix(1.0, back, cover);\n if (back > 0.0) {\n vec3 w = o + d * ((o.z + WALL) / FOCAL);\n vec3 sf = printHit(w, LIGHT, cFrom, psi);\n vec3 st = printHit(w, LIGHT, cTo, psi);\n float blur = 0.025;\n float sh = 1.0 - smoothstep(-blur, blur, min(paperDist(sf.xy, bend), paperDist(st.xy, bend)));\n sh = max(sh, 1.0 - smoothstep(-0.012, 0.02, min(pinDist(sf.xy), pinDist(st.xy))));\n float ry = w.y + LIGHT.y * (WALL / LIGHT.z) - (0.5 - 0.012);\n sh = max(sh, 0.8 * (1.0 - smoothstep(0.0, 0.012, abs(ry))));\n float fall = 0.1 * clamp(length(w.xy - vec2(-0.4 * ratio, 0.6)) / (1.2 * ratio + 0.6), 0.0, 1.0);\n col.rgb *= (1.0 - 0.42 * vis * sh) * (1.0 - fall * vis);\n }\n\n col = drawPrint(col, hf, true, bend, psi, aa, vis);\n col = drawPrint(col, ht, false, bend, psi, aa, vis);\n\n if (vis > 0.0) {\n float tl = (o.z - 0.004) / FOCAL;\n float ly = o.y + d.y * tl - (0.5 - 0.012);\n float lc = vis * clamp(0.5 - (abs(ly) - ROPE) / (tl * aa), 0.0, 1.0);\n if (lc > 0.0) {\n float k = clamp(ly / ROPE, -1.0, 1.0);\n float lx = o.x + d.x * tl + s * spacing * m;\n float strand = 0.88 + 0.12 * sin((lx + ly * 0.6) * 360.0);\n vec3 c = lineColor.rgb * (0.7 + 0.45 * sqrt(1.0 - k * k) + 0.15 * k) * strand;\n vec4 lcp = premultiply(vec4(c, lineColor.a));\n col = lcp * lc + col * (1.0 - lcp.a * lc);\n }\n col = drawPins(col, hf, aa, vis);\n col = drawPins(col, ht, aa, vis);\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","CloudDive":"// CloudDive — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CloudDive.glsl\n// Author: gre\n// License: MIT\n// Description: The camera dives down through a deck of clouds: sunlit billows with shadowed undersides drift in over the outgoing picture and rush past the lens layer after layer, a brief white-out inside the cloud, then the billows thin and part as the incoming picture opens out below 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 density; \n\nuniform vec4 shade; \n\nfloat hash(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yxz + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p), f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x), mix(hash(i + vec2(0.0, 1.0)), hash(i + 1.0), f.x), f.y);\n}\n\nfloat fbm(vec2 p) {\n float s = 0.0, a = 0.5;\n \n mat2 r = mat2(1.6, 1.2, -1.2, 1.6);\n for (int i = 0; i < 5; i++) {\n s += a * noise(p);\n p = r * p;\n a *= 0.48;\n }\n return s;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 c = (uv - 0.5) * vec2(ratio, 1.0);\n float m = smoothstep(0.46, 0.54, p);\n vec2 sa = c / (1.0 + 0.5 * p * p) / vec2(ratio, 1.0) + 0.5;\n vec2 sb = c / (1.0 + 0.3 * (1.0 - p) * (1.0 - p)) / vec2(ratio, 1.0) + 0.5;\n vec4 a = getFromColor(sa);\n vec4 b = getToColor(sb);\n vec4 col = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n col.rgb = col.a > 0.0 ? col.rgb / col.a : vec3(0.0);\n\n vec2 sun = normalize(vec2(-0.5, 0.8));\n float up = smoothstep(-0.5, 0.5, c.y);\n float sky = 0.88 + 0.12 * up;\n \n for (int k = 0; k < 6; k++) {\n float fi = float(5 - k);\n float t = 1.6 * p - 0.12 * fi;\n float z = 2.2 - 2.0 * clamp(t, 0.0, 1.0);\n float life = smoothstep(0.0, 0.15, t) * (1.0 - smoothstep(0.75, 1.0, t));\n vec2 q = c / z * 1.8 + vec2(fi * 1.7, fi * 0.9);\n float cov = 1.0 - density * (0.34 + 0.34 * life);\n float d = fbm(q);\n float body = smoothstep(cov, cov + 0.1, d);\n \n float ds = fbm(q + sun * 0.12);\n float lit = exp(-6.0 * max(ds - cov, 0.0));\n \n float rim = (1.0 - smoothstep(0.0, 0.1, d - cov)) * 0.35;\n vec3 cl = mix(shade.rgb, vec3(1.0, 0.98, 0.94), clamp(lit + rim, 0.0, 1.0));\n col.rgb = mix(col.rgb, cl * sky, body * life);\n }\n float white = smoothstep(0.38, 0.5, p) * (1.0 - smoothstep(0.5, 0.62, p));\n col.rgb = mix(col.rgb, vec3(0.96, 0.97, 1.0) * (0.92 + 0.08 * up), white);\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","CodeRain":"// CodeRain — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CodeRain.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image darkens into a grid of flickering code characters tinted by its colors, then glowing streams of characters fall down the columns at their own speeds, each with a bright head and a fading tail, leaving the incoming image behind\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 float trail; \n\nuniform float tint; \n\nuniform vec4 glow; \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\nvec4 hash42(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * vec4(0.1031, 0.1030, 0.0973, 0.1099));\n p4 += dot(p4, p4.wzxy + 33.33);\n return fract((p4.xxyz + p4.yzzw) * p4.zywx);\n}\n\nvec4 band(vec4 d) {\n return 1.0 - smoothstep(0.3, 0.6, d);\n}\n\nfloat glyph(vec2 cell, float t, vec2 local) {\n vec2 b = local * vec2(6.0, 8.0) - 0.5;\n float x = b.x;\n float y = b.y;\n float d = 0.667 * y;\n \n float x04 = abs(x - 2.0) - 2.0;\n float y06 = abs(y - 3.0) - 3.0;\n float y03 = abs(y - 1.5) - 1.5;\n float y36 = abs(y - 4.5) - 1.5;\n vec2 seed = cell + t * vec2(37.0, 61.0);\n \n \n vec4 sa = band(abs(vec4(y, y - 3.0, y - 6.0, x - d))) * band(vec4(x04, x04, x04, y06));\n vec4 sb = band(abs(vec4(x, x, x - 4.0, x - 4.0))) * band(vec4(y03, y36, y03, y36));\n vec4 sc = band(abs(vec4(x - 2.0, x - 2.0, x + d - 4.0, y - 1.0))) * band(vec4(y03, y36, y06, abs(x - 2.0) - 1.0));\n float on = dot(step(0.68, hash42(seed)), sa);\n on += dot(step(0.68, hash42(seed + 41.0)), sb);\n on += dot(step(0.68, hash42(seed + 83.0)), sc);\n return min(on, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float h = max(cellSize, 0.005);\n vec2 dims = vec2(0.75 * h, h);\n vec2 fp = vec2(uv.x * ratio, 1.0 - uv.y);\n \n vec2 grid = fp / dims + vec2(0.389, 0.278);\n vec2 cell = floor(grid);\n vec2 local = grid - cell;\n float rc = hash12(cell + vec2(97.0, 131.0));\n\n float r1 = hash12(vec2(cell.x, 11.0));\n float r2 = hash12(vec2(cell.x, 23.0));\n float r3 = hash12(vec2(cell.x, 37.0));\n float T = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.5);\n float len = max(trail, 0.01) * (0.5 + r3);\n float u = clamp((T - 0.03 - 0.5 * r1) / (0.3 + 0.12 * r2), 0.0, 1.0);\n float head = mix(-0.2, 1.0 + h + len, u * (0.7 + 0.3 * u));\n float dy = head - (cell.y - 0.278) * h;\n\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n\n vec2 cuv = clamp(vec2((cell.x + 0.111) * dims.x / ratio, 1.0 - (cell.y + 0.222) * h), 0.0, 1.0);\n vec4 ca = getFromColor(cuv);\n float lum = dot(ca.rgb, vec3(0.299, 0.587, 0.114));\n vec3 hue = ca.rgb / max(max(ca.r, max(ca.g, ca.b)), 0.05);\n vec3 ink = mix(glow.rgb * glow.a, hue, tint) * (0.1 + 0.6 * lum);\n float near = smoothstep(-0.15, 0.0, dy);\n float dim = max(smoothstep(0.0, 0.3, T), near);\n float g = max(smoothstep(0.0, 0.2, T - 0.12 * rc), near);\n float passed = step(0.0, dy);\n float slow = mod(floor(T * 12.0 + rc * 7.0), 32.0);\n float fast = 32.0 + mod(floor(T * 40.0 + rc * 13.0), 32.0);\n float chr = glyph(cell, mix(slow, fast, passed), local);\n vec3 code = a.rgb * (1.0 - 0.8 * dim) + ink * chr * g;\n\n float fade = clamp(1.0 - dy / len, 0.0, 1.0);\n float shade = 1.0 - smoothstep(0.3 * len, len, dy);\n float hot = 1.0 - smoothstep(h, 3.0 * h, dy);\n vec3 col = mix(glow.rgb * 1.2, vec3(1.0), 0.8 * hot) * glow.a;\n vec3 stream = b.rgb * (1.0 - 0.8 * shade) + col * chr * (fade * (2.0 - fade) + hot * fade);\n\n float yy = (head - fp.y) / (1.5 * h);\n float halo = 1.6 * u * (1.0 - u) * exp(-yy * yy) * (1.0 - smoothstep(0.25, 0.5, abs(local.x - 0.5)));\n vec3 rgb = mix(code, stream, passed) + glow.rgb * glow.a * halo;\n return vec4(clamp(rgb, 0.0, 1.0), mix(a.a, mix(b.a, a.a, shade), passed));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CoinSettle":"// CoinSettle — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CoinSettle.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image settles onto the outgoing one like a spun coin coming to rest: it starts standing on its edge, then leans over while its lifted side whirls around faster and faster with a sweeping shadow, rocking on its corners in a quickening rattle, until it drops flat and still over 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 whirls; \n\nuniform float twist; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\n\nconst float D = 6.0;\nconst float START_SCALE = 0.72;\nconst float AA = 0.0015;\n\nvec3 rotAxis(vec3 v, vec3 a, float t) {\n return v * cos(t) + cross(a, v) * sin(t) + a * dot(a, v) * (1.0 - cos(t));\n}\n\nfloat nonZero(float x) {\n return x < 0.0 ? min(x, -1e-5) : max(x, 1e-5);\n}\n\nvec4 transition(vec2 uv) {\n float s = 1.0 - progress;\n float tilt = 0.5 * PI * pow(s, 1.2);\n \n const float K = 0.04;\n float phi = 2.0 * PI * whirls * (sqrt(1.0 + K) - sqrt(s + K)) / (sqrt(1.0 + K) - sqrt(K)) - 0.4;\n float psi = twist * s * s;\n\n vec3 axis = vec3(-sin(phi), cos(phi), 0.0);\n vec3 e1 = rotAxis(vec3(cos(psi), sin(psi), 0.0), axis, tilt);\n vec3 e2 = rotAxis(vec3(-sin(psi), cos(psi), 0.0), axis, tilt);\n vec3 n = cross(e1, e2);\n float sc = mix(1.0, START_SCALE, 1.0 - cos(tilt));\n vec2 hs = vec2(0.5 * ratio, 0.5) * sc;\n \n float h = abs(hs.x * e1.z) + abs(hs.y * e2.z);\n vec3 C = vec3(0.0, 0.0, -h);\n\n vec2 p = vec2((uv.x - 0.5) * ratio, uv.y - 0.5);\n vec3 d = vec3(p, D);\n float dn = nonZero(dot(d, n));\n float t = (D - h) * n.z / dn;\n vec3 g = vec3(0.0, 0.0, -D) + d * t - C;\n vec2 q = vec2(dot(g, e1), dot(g, e2));\n vec2 eq = abs(q) - hs;\n \n vec2 g1 = t * (e1.xy - dot(d, e1) / dn * n.xy);\n vec2 g2 = t * (e2.xy - dot(d, e2) / dn * n.xy);\n vec2 ex = eq / clamp(vec2(length(g1), length(g2)), 1e-3, 40.0);\n float m = 1.0 - smoothstep(0.0, AA, max(ex.x, ex.y));\n m *= smoothstep(0.001, 0.02, abs(n.z));\n\n vec3 L = normalize(vec3(-0.4, 0.5, -1.0));\n vec3 P = vec3(p, 0.0);\n float ln = dot(L, n);\n float ts = dot(C - P, n) / nonZero(ln);\n vec3 gs = P + L * ts - C;\n vec2 es = abs(vec2(dot(gs, e1), dot(gs, e2))) - hs;\n float soft = 0.01 + 0.15 * clamp(ts, 0.0, 2.0);\n float shadow = (1.0 - smoothstep(-soft, soft, max(es.x, es.y))) * smoothstep(0.0, 0.15, h) * smoothstep(0.0, 0.06, progress) * smoothstep(0.0, 0.02, ts);\n \n shadow *= smoothstep(0.03, 0.15, abs(ln));\n\n vec4 bg = getFromColor(uv);\n bg.rgb *= 1.0 - 0.6 * shading * shadow;\n\n vec4 img = getToColor(clamp(vec2(q.x / ratio, q.y) / sc + 0.5, 0.0, 1.0));\n float lit = L.z - dot(n, L);\n float spec = pow(max(-dot(n, normalize(L + vec3(0.0, 0.0, -1.0))), 0.0), 30.0) * sin(tilt);\n vec2 rim = 1.0 - smoothstep(0.0, 0.025 * hs.y, -eq);\n img.rgb = img.rgb * (1.0 + shading * max(1.2 * lit, -0.45)) + shading * (0.3 * spec + 0.25 * sin(tilt) * max(rim.x, rim.y));\n return mix(bg, img, 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","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;\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 vec2 a = (dir + k * vec2(-dir.y, dir.x)) / sqrt(1.0 + k * k);\n float x = dot(p, a);\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 vec2 d = vec2(cut - hold, 1.0 - cut - hold) / (1.0 + m * st);\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 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 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","ComicPanels":"// ComicPanels — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ComicPanels.glsl\n// Author: gre\n// License: MIT\n// Description: The frame splits into slanted comic-book panels with gutters and ink borders; one after another in reading order, each panel lifts off the page with a zoom kick and a drop shadow and punches over to the incoming image, then the gutters close up over the full 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 gutter; \n\nuniform vec4 gutterColor; \n\nuniform vec4 borderColor; \n\nuniform float seed; \n\nconst float PI = 3.141592653589793;\nconst float INK = 0.005;\nconst float EDGE = 0.0012;\nconst float PUNCH = 0.3;\n\nconst float START = 0.05;\nconst float END = 0.97;\nconst float SPIKES = 11.0;\n\nfloat hash(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 cols(float r) {\n float h = hash(vec2(r * 7.0 + 3.0, seed * 1.37 + 11.0));\n float n = h < 0.15 ? 1.0 : (h < 0.6 ? 2.0 : 3.0);\n \n if (r == 1.0) n = max(n, 2.0);\n if (ratio < 0.8) n = min(n, 2.0);\n return n;\n}\n\nfloat rowDist(float k, vec2 p) {\n if (k < 0.5) return p.y;\n if (k > 2.5) return p.y - 1.0;\n float y = (k + (hash(vec2(k * 5.0 + 1.0, seed * 1.37)) - 0.5) * 0.35) / 3.0;\n float s = (hash(vec2(k * 9.0 + 4.0, seed * 1.37 + 5.0)) - 0.5) * 0.24;\n return (p.y - y - s * (p.x / ratio - 0.5)) / sqrt(1.0 + s * s / (ratio * ratio));\n}\n\nfloat colDist(float r, float j, float n, vec2 p) {\n if (j < 0.5) return p.x;\n if (j > n - 0.5) return p.x - ratio;\n float x = (j + (hash(vec2(r * 3.0 + j * 13.0, seed * 1.37 + 2.0)) - 0.5) * 0.45) / n;\n float s = (hash(vec2(r * 11.0 + j * 5.0, seed * 1.37 + 7.0)) - 0.5) * 0.5;\n return (p.x - ratio * (x + s * (p.y - 0.5))) / sqrt(1.0 + ratio * ratio * s * s);\n}\n\nfloat panelDist(float r, float c, float n, vec2 p) {\n return min(min(rowDist(r, p), -rowDist(r + 1.0, p)), min(colDist(r, c, n, p), -colDist(r, c + 1.0, n, p)));\n}\n\nvec2 panelCenter(float r, float c, float n) {\n \n float y0 = rowDist(r, vec2(0.5 * ratio, 0.0)) + rowDist(r + 1.0, vec2(0.5 * ratio, 0.0));\n float y1 = rowDist(r, vec2(0.5 * ratio, 1.0)) + rowDist(r + 1.0, vec2(0.5 * ratio, 1.0));\n float y = y0 / (y0 - y1);\n float x0 = colDist(r, c, n, vec2(0.0, y)) + colDist(r, c + 1.0, n, vec2(0.0, y));\n float x1 = colDist(r, c, n, vec2(1.0, y)) + colDist(r, c + 1.0, n, vec2(1.0, y));\n return vec2(x0 / (x0 - x1), y);\n}\n\nfloat panelTime(float k, float total) {\n float t0 = START + (END - START - PUNCH) * k / max(total - 1.0, 1.0);\n return clamp((progress - t0) / PUNCH, 0.0, 1.0);\n}\n\nfloat lift(float t) {\n float u = 1.0 - (1.0 - t) * (1.0 - t);\n return sin(PI * u);\n}\n\nvec4 panelImage(vec2 p, vec2 center, float t) {\n float k = lift(t);\n vec2 q = center + (p - center) / (1.0 + 0.1 * k);\n vec2 uv = vec2(q.x / ratio, 1.0 - q.y);\n if (t <= 0.0) return getFromColor(uv);\n if (t >= 1.0) return getToColor(uv);\n vec2 v = p - center;\n float a = (atan(v.y, v.x + 1e-6) + PI) / (2.0 * PI) * SPIKES + center.x * 7.0;\n float i = floor(a);\n \n float spike = (1.0 - abs(2.0 * (a - i) - 1.0)) * (0.5 + 0.5 * hash(vec2(mod(i, SPIKES), center.y * 13.0 + seed)));\n \n float burst = 1.5 * max(1.0, ratio / 1.8) * smoothstep(0.06, 0.42, t);\n float d = length(v) - burst * (0.62 + 0.38 * spike);\n float w = 1.4 * INK;\n vec4 c = mix(getToColor(uv), borderColor, smoothstep(-w - EDGE, -w + EDGE, d));\n return mix(c, getFromColor(uv), smoothstep(-EDGE, EDGE, d));\n}\n\nvec4 drawPanel(vec4 color, vec4 img, float d, float g, float ink, float fade) {\n vec4 c = mix(borderColor, img, mix(1.0, smoothstep(g + ink - EDGE, g + ink + EDGE, d), fade));\n return mix(color, c, mix(1.0, smoothstep(g - EDGE, g + EDGE, d), fade));\n}\n\nvec4 transition(vec2 uv) {\n vec2 p = vec2(uv.x * ratio, 1.0 - uv.y);\n\n float open = smoothstep(0.0, 0.14, progress) * (1.0 - smoothstep(0.8, 1.0, progress));\n float g = 0.5 * gutter * open;\n float ink = INK * open;\n \n float fade = clamp(open * 6.0, 0.0, 1.0);\n\n float n0 = cols(0.0);\n float n1 = cols(1.0);\n float n2 = cols(2.0);\n float total = n0 + n1 + n2;\n\n float r = rowDist(1.0, p) < 0.0 ? 0.0 : (rowDist(2.0, p) < 0.0 ? 1.0 : 2.0);\n float n = r == 0.0 ? n0 : (r == 1.0 ? n1 : n2);\n float c = colDist(r, 1.0, n, p) < 0.0 ? 0.0 : (colDist(r, 2.0, n, p) < 0.0 || n < 2.5 ? 1.0 : 2.0);\n c = min(c, n - 1.0);\n float first = r == 0.0 ? 0.0 : (r == 1.0 ? n0 : n0 + n1);\n float t = panelTime(first + c, total);\n\n vec4 color = gutterColor;\n if (t <= 0.0 || t >= 1.0) {\n color = drawPanel(color, panelImage(p, panelCenter(r, c, n), t), panelDist(r, c, n, p), g, ink, fade);\n }\n\n \n float spacing = (END - START - PUNCH) / max(total - 1.0, 1.0);\n \n float kFirst = floor((progress - START - PUNCH) / spacing - 0.01) + 1.0;\n for (int i = 0; i < 4; i++) {\n float pk = kFirst + float(i);\n if (pk < 0.0 || pk > total - 0.5) continue;\n float pt = panelTime(pk, total);\n if (pt <= 0.0 || pt >= 1.0) continue;\n float pr = pk < n0 ? 0.0 : (pk < n0 + n1 ? 1.0 : 2.0);\n float pn = pr == 0.0 ? n0 : (pr == 1.0 ? n1 : n2);\n float pc = pk - (pr == 0.0 ? 0.0 : (pr == 1.0 ? n0 : n0 + n1));\n float k = lift(pt);\n vec2 center = panelCenter(pr, pc, pn);\n float s = 1.0 + 0.08 * k;\n vec2 sq = center + (p - vec2(0.012, 0.018) * k - center) / s;\n float sd = panelDist(pr, pc, pn, sq) - g;\n color.rgb *= 1.0 - 0.4 * k * fade * smoothstep(-0.02, 0.01, sd);\n vec2 q = center + (p - center) / s;\n color = drawPanel(color, panelImage(q, center, pt), panelDist(pr, pc, pn, q), g, ink, 1.0);\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","Condensation":"// Condensation — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Condensation.glsl\n// Author: gre\n// License: MIT\n// Description: Warm breath fogs the cold glass in front of the picture: an uneven milky haze blooms out from the middle, water beads swell in it and act as tiny lenses holding sharp upside-down views, a few grow heavy and run down leaving clear trails, then the fog evaporates from the edges inward, the beads last, off the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 droplets; \n\nuniform float milk; \n\nfloat hash(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yxz + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p), f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x), mix(hash(i + vec2(0.0, 1.0)), hash(i + 1.0), f.x), f.y);\n}\n\nfloat fbm(vec2 p) {\n return 0.5 * noise(p) + 0.3 * noise(p * 2.1 + 3.7) + 0.2 * noise(p * 4.3 - 1.9);\n}\n\nvec4 scene(vec2 uv, float m) {\n uv = mod(uv, 2.0);\n uv = min(uv, 2.0 - uv);\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n return mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n}\n\nfloat front() {\n float e = clamp(progress / 0.3, 0.0, 1.0);\n return mix(-0.4, 1.6, 1.0 - (1.0 - e) * (1.0 - e));\n}\n\nfloat reach(vec2 q, float jitter) {\n return length((q - vec2(0.06, -0.04)) * vec2(0.85, 1.0)) / (0.5 * length(vec2(ratio, 1.0))) + 0.35 * (jitter - 0.5);\n}\n\nfloat beadSize(float rr, float lag) {\n float end = 0.8 + 0.2 * clamp(1.0 - rr, 0.0, 1.0);\n return smoothstep(0.0, 0.3, front() - lag - rr) * sqrt(clamp((end - progress) / 0.3, 0.0, 1.0));\n}\n\nvec4 bead(vec2 g, vec2 ctr, float r, float cell) {\n float rs = max(r, 1e-3);\n vec2 d = (g - ctr) * vec2(1.0, 1.08);\n float w = max(1.0 - dot(d, d) / (rs * rs), 0.0);\n float sw = sqrt(w);\n vec2 slope = -d * sw / (rs * (w + 0.01)) * min(r * 1000.0, 1.0);\n \n return vec4(w > 0.0 ? r * sw : -1.0, slope, length(slope) / cell);\n}\n\nvec4 merge(vec4 a, vec4 b) {\n float k = 0.03;\n float h = clamp(0.5 + 0.5 * (b.x - a.x) / k, 0.0, 1.0);\n vec4 c = mix(a, b, h);\n c.x += k * h * (1.0 - h);\n return c;\n}\n\nvec4 beads(vec4 acc, vec2 q, float cell, float fill, float lag, float grow, float salt) {\n vec2 g = q / cell;\n vec2 base = floor(g);\n for (int j = -1; j <= 1; j++)\n for (int i = -1; i <= 1; i++) {\n vec2 c = base + vec2(float(i), float(j)) + salt;\n float h = hash(c);\n vec2 ctr = c - salt + 0.2 + 0.6 * vec2(hash(c + 17.0), hash(c + 31.0));\n float size = beadSize(reach(ctr * cell, hash(c + 71.0)), lag) * grow;\n float r = (0.16 + 0.34 * h * h) * size * step(1.0 - fill, hash(c + 53.0));\n acc = merge(acc, bead(g, ctr, r, cell));\n }\n return acc;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float n = fbm(q * 3.0 + 2.0);\n \n float rr = length((q - vec2(0.06, -0.04)) * vec2(0.85, 1.0)) / (0.5 * length(vec2(ratio, 1.0))) + 0.35 * (n - 0.5);\n float fr = front();\n float back = 1.6 - 2.7 * clamp((p - 0.42) / 0.58, 0.0, 1.0);\n float fog = smoothstep(0.0, 0.3, fr - rr) * smoothstep(0.0, 0.3, back - rr);\n float m = smoothstep(0.34, 0.5, p);\n\n float cell = 1.0 / droplets;\n float grow = smoothstep(0.08, 0.45, p);\n vec4 water = beads(vec4(-1.0, 0.0, 0.0, 0.0), q, cell, 0.6, 0.2, grow, 0.0);\n water = beads(water, q, cell * 0.4, 0.5, 0.05, 1.0, 71.0);\n\n float cw = 2.3 * cell;\n float col = floor(q.x / cw);\n float hk = hash(vec2(col, 7.0));\n float t0 = 0.24 + 0.16 * hash(vec2(col, 13.0));\n float slide = smoothstep(t0, t0 + 0.55, p);\n float y0 = 0.45 - 0.6 * hash(vec2(col, 29.0));\n float yr = y0 - 1.4 * slide;\n float xr = (col + 0.5) * cw + 0.25 * cell * sin(q.y * 9.0 + hk * 6.0);\n float xh = (col + 0.5) * cw + 0.25 * cell * sin(yr * 9.0 + hk * 6.0);\n float rRun = 0.36 * grow * beadSize(reach(vec2(xh, yr), hk), 0.2) * step(0.35, hk);\n float trail = (1.0 - smoothstep(0.15, 0.3, abs(q.x - xr) / cell)) * step(yr, q.y) * (1.0 - smoothstep(y0 - 0.02, y0 + 0.02, q.y)) * smoothstep(0.0, 0.1, rRun);\n \n water = merge(mix(water, vec4(-1.0, 0.0, 0.0, 0.0), trail), bead(q / cell, vec2(xh, yr) / cell, rRun, cell));\n float dens = fog * (0.6 + 0.9 * fbm(q * 2.2 + 9.0)) * (0.8 + 0.4 * fbm(q * 8.0 - 4.0)) * (1.0 - trail);\n \n dens *= 1.0 - 0.5 * smoothstep(0.0, 0.05, water.x);\n dens = clamp(dens, 0.0, 1.0);\n\n float rad = 0.035 * dens;\n vec4 c = vec4(0.0);\n for (int k = 0; k < 12; k++) {\n float fk = float(k);\n float a = fk * 2.39996;\n c += scene(uv + rad * sqrt((fk + 0.5) / 12.0) * vec2(cos(a) / ratio, sin(a)), m);\n }\n c /= 12.0;\n vec3 rgb = c.a > 0.0 ? c.rgb / c.a : vec3(0.0);\n vec3 haze = mix(vec3(dot(rgb, vec3(0.299, 0.587, 0.114))), vec3(1.0), 0.65) * vec3(0.95, 0.97, 1.0);\n rgb = mix(rgb, haze, clamp(milk * dens, 0.0, 1.0));\n\n float T = 0.03;\n \n float aa = clamp(water.w * 0.0015, 1e-4, 0.4 * T);\n float inside = smoothstep(-aa, aa, water.x - T);\n \n vec2 slope = water.yz * 1.3;\n vec3 nrm = normalize(vec3(-slope, 1.0));\n vec4 lc = scene(uv - nrm.xy * vec2(0.35 / ratio, 0.35), m);\n vec3 drop = lc.a > 0.0 ? lc.rgb / lc.a : vec3(0.0);\n float steep = 1.0 - nrm.z;\n vec3 L = normalize(vec3(-0.45, 0.6, 0.66));\n float spec = pow(max(dot(nrm, normalize(L + vec3(0.0, 0.0, 1.0))), 0.0), 80.0);\n float caustic = smoothstep(0.1, 0.4, steep) * max(dot(slope, -L.xy), 0.0) / max(length(slope), 1e-3);\n drop = drop * (1.0 - 0.8 * smoothstep(0.45, 0.8, steep)) + 0.3 * caustic * (1.0 - smoothstep(0.5, 0.75, steep));\n drop += 0.9 * spec + 0.12 * smoothstep(0.75, 0.9, steep);\n rgb *= 1.0 - 0.25 * smoothstep(0.5 * T, T, water.x) * (1.0 - inside);\n\n float aOut = mix(c.a, lc.a, inside);\n return vec4(mix(rgb, drop, inside), aOut);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CorePunch":"// CorePunch — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CorePunch.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a thick solid block: a round core is scored in its middle and punched straight back through it, showing the bore's shaded walls, and drops away behind; then a wider ring is punched out around the hole, then another, until the outer frame is punched back and falls, leaving 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 thickness; \n\nuniform float shading; \n\nconst int N = 4;\nconst float EYE = 2.2;\nconst float SCORE = 0.25;\nconst float FALL = 0.6;\nconst vec3 L = vec3(-0.45, 0.65, 0.61);\n\nconst float BEAT = 1.0 / (float(N) + FALL);\n\nfloat localU(int k) {\n return (progress - float(k) * BEAT) / BEAT;\n}\n\nfloat outerR(int k, float hmin) {\n return k >= N - 1 ? 1e3 : hmin * (0.3 + 0.28 * float(k));\n}\n\nfloat lit(vec3 n) {\n return mix(1.0, (0.3 + 0.7 * max(dot(n, L), 0.0)) / (0.3 + 0.7 * L.z), shading);\n}\n\nvec2 crossings(vec2 a, vec2 b, float r) {\n float A = dot(a, a);\n float B = dot(a, b);\n float C = dot(b, b) - r * r;\n float disc = B * B - A * C;\n if (A < 1e-9 || disc < 0.0) return vec2(-1.0);\n float sq = sqrt(disc);\n \n float far = B > 0.0 ? -C / (B + sq) : (sq - B) / A;\n float near = B < 0.0 ? C / (sq - B) : -(B + sq) / A;\n return vec2(far, near);\n}\n\nvec3 rotX(vec3 v, float c, float s) {\n return vec3(v.x, c * v.y - s * v.z, s * v.y + c * v.z);\n}\n\nfloat score(vec2 q, float hmin) {\n float g = 1.0;\n for (int k = 0; k < N - 1; k++) {\n float u = localU(k);\n float sc = smoothstep(0.0, SCORE, u) * (1.0 - smoothstep(SCORE, SCORE + 0.25, u));\n g *= 1.0 - 0.7 * sc * (1.0 - smoothstep(0.0015, 0.004, abs(length(q) - outerR(k, hmin))));\n }\n return g;\n}\n\nvec4 hitPiece(int k, vec2 p, float T, float hmin) {\n float u = localU(k);\n float t = clamp((u - SCORE) / (1.0 - SCORE), 0.0, 1.0);\n bool frame = k == N - 1;\n \n float w0 = frame ? 0.6 : 1.0;\n float w = clamp((u - w0) / (1.0 + FALL - w0), 0.0, 1.0);\n if (w >= 1.0) return vec4(1e4);\n float s = T * (1.0 - (1.0 - t) * (1.0 - t) * (1.0 - t)) + 0.3 * w;\n \n float drop = (1.3 + 1.2 * T) * w * w;\n \n float tilt = frame ? -1.2 * w * w : -1.4 * w;\n vec3 pv = frame ? vec3(0.0, -0.5, -T) : vec3(0.0, 0.0, -0.5 * T);\n float c = cos(tilt), sn = sin(tilt);\n vec3 ol = rotX(vec3(0.0, drop, EYE + s) - pv, c, -sn) + pv;\n vec3 dl = rotX(vec3(p, -EYE), c, -sn);\n float rin = k == 0 ? 0.0 : outerR(k - 1, hmin);\n float rout = outerR(k, hmin);\n float sink = 1.0 - (frame ? 0.2 : 0.5) * shading * smoothstep(0.0, T, s);\n vec2 hw = vec2(0.5 * ratio, 0.5);\n vec4 best = vec4(1e4);\n\n if (abs(dl.z) > 1e-6) {\n \n bool front = dl.z < 0.0;\n float r = ((front ? 0.0 : -T) - ol.z) / dl.z;\n vec2 q = ol.xy + r * dl.xy;\n float rq = length(q);\n bool onFace = frame ? abs(q.x) <= hw.x && abs(q.y) <= hw.y : rq <= rout;\n if (r > 0.0 && rq >= rin && onFace) {\n float l = front ? sink * (t > 0.0 ? 1.0 : score(q, hmin)) : 0.6 * sink;\n best = vec4(r, lit(rotX(vec3(0.0, 0.0, front ? 1.0 : -1.0), c, sn)) * l, q);\n }\n }\n if (k > 0) {\n float r = crossings(dl.xy, ol.xy, rin).x;\n float z = ol.z + r * dl.z;\n if (r > 0.0 && z <= 0.0 && z >= -T && r < best.x) {\n vec2 q = ol.xy + r * dl.xy;\n float rim = 1.0 - smoothstep(0.0, 0.012, -z);\n float l = lit(rotX(vec3(-q / rin, 0.0), c, sn)) * (1.0 - 0.6 * shading * -z / T) + 0.3 * shading * rim;\n best = vec4(r, l * sink, q);\n }\n }\n if (!frame) {\n float r = crossings(dl.xy, ol.xy, rout).y;\n float z = ol.z + r * dl.z;\n if (r > 0.0 && z <= 0.0 && z >= -T && r < best.x) {\n vec2 q = ol.xy + r * dl.xy;\n best = vec4(r, lit(rotX(vec3(q / rout, 0.0), c, sn)) * sink, q);\n }\n } else {\n \n for (int i = 0; i < 4; i++) {\n vec2 n = i == 0 ? vec2(0.0, 1.0) : i == 1 ? vec2(0.0, -1.0) : i == 2 ? vec2(1.0, 0.0) : vec2(-1.0, 0.0);\n float dn = dot(dl.xy, n);\n if (dn >= 0.0) continue;\n float r = (dot(hw, abs(n)) - dot(ol.xy, n)) / dn;\n vec3 x = ol + r * dl;\n vec2 off = abs(x.xy) - hw;\n if (r > 0.0 && x.z <= 0.0 && x.z >= -T && dot(off, abs(n.yx)) <= 0.0 && r < best.x) {\n vec2 q = x.xy - n * 0.001;\n best = vec4(r, lit(rotX(vec3(n, 0.0), c, sn)) * (1.0 - 0.4 * shading * -x.z / T) * sink, q);\n }\n }\n }\n return best;\n}\n\nvec4 scene(vec2 p, vec4 back, float T, float hmin) {\n vec4 best = vec4(1e4);\n for (int k = 0; k < N; k++) {\n vec4 h = hitPiece(k, p, T, hmin);\n if (h.x < best.x) best = h;\n }\n if (best.x > 1e3) return back;\n vec4 c = getFromColor(best.zw / vec2(ratio, 1.0) + 0.5);\n return vec4(c.rgb * min(best.y, 1.15), c.a);\n}\n\nvec4 transition(vec2 uv) {\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n float T = max(thickness, 0.01);\n float hmin = 0.5 * min(ratio, 1.0);\n vec4 back = getToColor(uv);\n \n float j = 0.0012 * sin(3.14159265 * progress);\n return 0.25 * (scene(p + vec2(-j, -j), back, T, hmin) + scene(p + vec2(j, -j), back, T, hmin)\n + scene(p + vec2(-j, j), back, T, hmin) + scene(p + vec2(j, j), back, T, hmin));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","CornerPin":"// CornerPin — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CornerPin.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image appears as a small card in the middle of the frame, then its corners are pinned out to the corners of the frame one after another, each snapping into place with a springy overshoot that skews the card in perspective, until it lies flat over 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 start; \n\nuniform float overshoot; \n\nuniform float shadow; \n\nfloat cross2(vec2 a, vec2 b) { return a.x * b.y - a.y * b.x; }\n\nfloat snap(float x) {\n x -= 1.0;\n float c = 1.70158 * overshoot;\n return 1.0 + (c + 1.0) * x * x * x + c * x * x;\n}\n\nvec2 corner(vec2 target, float x, float grow) {\n return mix(0.5 + (target - 0.5) * start * grow, target, snap(x));\n}\n\nfloat edge(vec2 p, vec2 e0, vec2 e1) {\n return cross2(e1 - e0, p - e0) / max(length(e1 - e0), 1e-6);\n}\n\nfloat cover(float dist, float x0, float x1) {\n return clamp(dist / (0.002 * sqrt(1.0 - min(x0, x1)) + 1e-6) + 0.5, 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n vec2 asp = vec2(ratio, 1.0);\n float appear = smoothstep(0.0, 0.12, t);\n \n float grow = max(appear, 1e-3);\n float xa = clamp((t - 0.10) / 0.32, 0.0, 1.0), xb = clamp((t - 0.28) / 0.32, 0.0, 1.0);\n float xc = clamp((t - 0.46) / 0.32, 0.0, 1.0), xd = clamp((t - 0.64) / 0.32, 0.0, 1.0);\n vec2 a = corner(vec2(0.0, 1.0), xa, grow) * asp;\n vec2 b = corner(vec2(1.0, 1.0), xb, grow) * asp;\n vec2 c = corner(vec2(1.0, 0.0), xc, grow) * asp;\n vec2 d = corner(vec2(0.0, 0.0), xd, grow) * asp;\n vec2 p = uv * asp;\n\n \n vec2 s = d - c + b - a, e1 = c - b, e2 = a - b;\n float den = cross2(e1, e2);\n float g = cross2(s, e2) / den, h = cross2(e1, s) / den;\n vec3 cu = vec3(c - d + g * c, g), cv = vec3(a - d + h * a, h), c1 = vec3(d, 1.0);\n vec3 hp = vec3(p, 1.0);\n float w = dot(cross(cu, cv), hp);\n \n w = w < 0.0 ? min(w, -1e-6) : max(w, 1e-6);\n vec2 q = vec2(dot(cross(cv, c1), hp), dot(cross(c1, cu), hp)) / w;\n\n float inside = min(min(cover(edge(p, d, c), xd, xc), cover(edge(p, c, b), xc, xb)),\n min(cover(edge(p, b, a), xb, xa), cover(edge(p, a, d), xa, xd)));\n inside *= smoothstep(0.0, 0.02, t);\n\n float lift = 1.0 - smoothstep(0.3, 1.0, xd);\n vec2 ps = p - vec2(0.012, -0.02) * lift * grow;\n float blur = 0.025 * grow;\n float sd = min(min(edge(ps, d, c), edge(ps, c, b)), min(edge(ps, b, a), edge(ps, a, d)));\n float sh = shadow * lift * appear * smoothstep(-blur, blur, sd);\n\n vec4 from = getFromColor(uv);\n from.rgb *= 1.0 - sh;\n return mix(from, getToColor(clamp(q, 0.0, 1.0)), 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","Crankshaft":"// Crankshaft — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Crankshaft.glsl\n// Author: gre\n// License: MIT\n// Description: The picture is cut into upright slats hung on the throws of one crankshaft: as it turns, each slat circles up and back while the slat of the incoming picture on the opposite throw circles down and forward into its place, the turn rolling across the frame 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 slats; \n\nuniform float depth; \n\nconst float PI = 3.14159265;\n\nconst float MARGIN = 0.01;\nconst float THROW = 0.5 + MARGIN;\n\nconst float OVER = 0.12;\nconst float PERSP = 0.6;\nconst float AA = 0.003;\n\nconst float TIE = 0.01;\n\nfloat slatCount() {\n return clamp(floor(slats * sqrt(ratio * 0.5625) + 0.5), 2.0, 16.0);\n}\n\nfloat crankAngle(float i, float n) {\n float c = clamp(progress * 1.6 - 0.6 * i / (n - 1.0), 0.0, 1.0);\n return PI * c * c * (3.0 - 2.0 * c);\n}\n\nfloat depthOf(float a) {\n return max(depth, 0.05) * (1.0 - cos(a));\n}\n\nvec4 slatAt(vec2 P, float fi, float k, float n, float w) {\n float a = crankAngle(fi, n) + PI * k;\n float z = depthOf(a);\n float s = 1.0 / (1.0 + PERSP * z);\n vec2 Q = P / s - vec2(0.0, THROW * sin(a));\n vec2 d = abs(Q - vec2((fi + 0.5) * w - 0.5 * ratio, 0.0)) - vec2((0.5 + OVER) * w, 0.5 + MARGIN);\n return vec4(max(d.x, d.y) * s, z, Q);\n}\n\nfloat shadowAt(vec2 P, float zr, float n, float w) {\n float sh = 0.0;\n for (int i = 0; i < 16; i++) {\n float fi = float(i);\n if (fi >= n) break;\n for (int k = 0; k < 2; k++) {\n float gap = zr - depthOf(crankAngle(fi, n) + PI * float(k));\n if (gap < 1e-3) continue;\n vec4 c = slatAt(P - vec2(0.04, -0.07) * gap, fi, float(k), n, w);\n sh = max(sh, (1.0 - smoothstep(-0.01, 0.02 + 0.08 * gap, c.x)) * min(gap / max(depth, 0.05), 1.0));\n }\n }\n return sh;\n}\n\nvec4 transition(vec2 uv) {\n vec2 P = (uv - 0.5) * vec2(ratio, 1.0);\n float n = slatCount();\n float w = ratio / n;\n vec4 c1 = vec4(0.0), c2 = vec4(0.0);\n float z1 = 1e3, z2 = 1e3, a1 = 0.0, a2 = 0.0;\n for (int i = 0; i < 16; i++) {\n float fi = float(i);\n if (fi >= n) break;\n for (int k = 0; k < 2; k++) {\n vec4 sl = slatAt(P, fi, float(k), n, w);\n float cov = clamp(0.5 - sl.x / AA, 0.0, 1.0);\n if (cov <= 0.0) continue;\n float z = sl.y;\n vec2 q = 1.0 - abs(1.0 - abs(sl.zw / vec2(ratio, 1.0) + 0.5));\n vec4 col = k == 0 ? getFromColor(q) : getToColor(q);\n col.rgb *= 1.0 - 0.45 * z / (2.0 * max(depth, 0.05)) - 0.25 * (1.0 - smoothstep(0.0, 0.01, -sl.x)) * sin(crankAngle(fi, n));\n \n float dz = z - z1;\n if (abs(dz) < TIE) {\n float m = abs(dz) / TIE;\n vec4 front = dz < 0.0 ? mix(c1, col, cov) : mix(col, c1, a1);\n c1 = mix(mix(c1, col, cov / max(a1 + cov, 1e-4)), front, m);\n a1 = mix(min(a1 + cov, 1.0), a1 + cov - a1 * cov, m);\n z1 = min(z1, z);\n }\n else if (z < z1) { z2 = z1; c2 = c1; a2 = a1; z1 = z; c1 = col; a1 = cov; }\n else if (abs(z - z2) < 1e-4) { c2 = mix(c2, col, cov / max(a2 + cov, 1e-4)); a2 = min(a2 + cov, 1.0); }\n else if (z < z2) { z2 = z; c2 = col; a2 = cov; }\n }\n }\n vec4 bg = getToColor(uv);\n bg.rgb *= 0.3;\n if (a2 > 0.0 && a1 < 1.0) c2.rgb *= 1.0 - 0.6 * shadowAt(P, z2, n, w);\n if (a1 > 0.0) c1.rgb *= 1.0 - 0.6 * shadowAt(P, z1, n, w);\n return mix(mix(bg, c2, a2), c1, a1);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Craze":"// Craze — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Craze.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a brittle coat on a sheet pulled from both sides: it stretches, a crack runs down its middle and gapes open, then cracks run down the middle of every piece in turn, each strip snapping back to its own width as the gaps widen onto the incoming image, until the strips lose their grip and drop out of 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 int levels; \n\nuniform float shadow; \n\nconst int MAXN = 16;\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 zigzag(float x) {\n float i = floor(x);\n return mix(hash(i), hash(i + 1.0), x - i);\n}\n\nfloat ease(float x) {\n x = clamp(x, 0.0, 1.0);\n return x * x * (3.0 - 2.0 * x);\n}\n\nfloat crackTime(int j, int L) {\n int lv = L - 1;\n int k = j;\n for (int i = 0; i < 4; i++) {\n if (k > 0 && k - 2 * (k / 2) == 0) { k /= 2; lv--; }\n }\n return 0.12 + 0.36 * float(lv) / float(L) + 0.04 * hash(float(j) * 3.7);\n}\n\nfloat jag(int j, float y) {\n float s = float(j) * 7.13;\n return 0.022 * (zigzag(y * 7.0 + s) - 0.5) + 0.012 * (zigzag(y * 23.0 + s) - 0.5);\n}\n\nfloat crackFront(int j, int L) {\n return 1.0 - clamp((progress - crackTime(j, L) + 0.06) / 0.06, 0.0, 1.0) * 1.02;\n}\n\nfloat gapW(int j, int L, float fN) {\n float t = max(progress - crackTime(j, L), 0.0);\n return 0.09 * ratio / float(L) * (1.0 - exp(-t * 9.0)) + 1.12 * t / fN;\n}\n\nvec4 transition(vec2 uv) {\n int L = levels < 1 ? 1 : (levels > 4 ? 4 : levels);\n int N = L == 1 ? 2 : (L == 2 ? 4 : (L == 3 ? 8 : 16));\n float fN = float(N);\n float X = uv.x * ratio;\n float p = progress;\n float first = crackTime(N / 2, L);\n float strain = 0.07 * ease(p / 0.14) * (1.0 - ease((p - first) / 0.1));\n float shadeIn = clamp((p - first) * 8.0, 0.0, 1.0);\n\n float total = 0.0;\n for (int j = 1; j < MAXN; j++) {\n if (j >= N) break;\n total += gapW(j, L, fN);\n }\n float w = ratio / fN;\n float x = 0.5 * ratio - 0.5 * (ratio * (1.0 + strain) + total);\n\n vec4 col = vec4(0.0);\n float cov = 0.0, shade = 0.0;\n for (int i = 0; i < MAXN; i++) {\n if (i >= N) break;\n float fi = float(i);\n float t0 = 0.52 + 0.2 * hash(fi * 1.7 + fN);\n float ft = max(p - t0, 0.0) / (1.0 - t0);\n float fall = 1.6 * ft * ft;\n float a = 0.35 * ft * ft * (hash(fi * 5.3 + fN) - 0.5);\n float sw = w * (1.0 + strain);\n vec2 piv = vec2(x + 0.5 * sw, 0.5 - fall);\n for (int s = 0; s < 2; s++) {\n vec2 o = s == 0 ? vec2(0.012, -0.018) * (1.0 + 3.0 * ft) : vec2(0.0);\n vec2 d = vec2(X, uv.y) - piv - o;\n d = vec2(cos(a) * d.x + sin(a) * d.y, -sin(a) * d.x + cos(a) * d.y);\n float u = (d.x + 0.5 * sw) / sw;\n float y = d.y + 0.5;\n float lo = i == 0 ? -1.0 : jag(i, y) / w;\n float hi = i == N - 1 ? 2.0 : 1.0 + jag(i + 1, y) / w;\n float sharp = s == 0 ? 50.0 : 400.0;\n \n float m = clamp(min(min(u - lo, hi - u) * sw * sharp + 0.5, min(y, 1.0 - y) * sharp + 1.0), 0.0, 1.0);\n if (s == 0) {\n shade = max(shade, m * shadeIn);\n } else if (m > 0.0) {\n vec2 q = vec2((fi + u) / fN, y);\n vec4 c = getFromColor(q);\n c.rgb *= 1.0 - 0.9 * abs(a);\n for (int k = 0; k < 2; k++) {\n int j = i + k;\n if (j > 0 && j < N) {\n float cx = fi / fN + jag(j, y) / ratio + float(k) / fN;\n float dl = abs(q.x - cx) * ratio;\n float open = clamp(gapW(j, L, fN) * 200.0, 0.0, 1.0);\n float line = (1.0 - smoothstep(0.0, 0.006, dl)) * step(crackFront(j, L), y);\n c.rgb *= 1.0 - 0.6 * line * (1.0 - open);\n c.rgb = mix(c.rgb, vec3(0.95), 0.6 * (1.0 - smoothstep(0.0, 0.005, dl)) * open);\n }\n }\n \n float add = min(m, 1.0 - cov);\n col += c * add;\n cov += add;\n }\n }\n x += sw + (i < N - 1 ? gapW(i + 1, L, fN) : 0.0);\n }\n vec4 to = getToColor(uv);\n to.rgb *= 1.0 - shadow * shade;\n return mix(to, col / max(cov, 1e-4), cov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 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 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 vec4 b = getToColor(uv);\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 float lift = 0.012 * c + 0.06 * t;\n\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\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 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 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 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 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 box that turns a quarter turn in perspective, the outgoing face darkening as it turns away, above a reflective floor\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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; \n\nuniform float unzoom; \n\nuniform float reflection; \n\nuniform float floating; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\nconst float EDGE = 0.002;\n\nvec4 hitBox(vec3 eye, vec3 dir, float w, float c, float s) {\n vec2 pivot = vec2(0.5 * w);\n vec2 e = eye.xz - pivot;\n vec2 o = vec2(e.x * c + e.y * s, -e.x * s + e.y * c) + pivot;\n vec2 d = vec2(dir.x * c + dir.z * s, -dir.x * s + dir.z * c);\n vec2 inv = 1.0 / vec2(d.x < 0.0 ? min(d.x, -1e-6) : max(d.x, 1e-6), d.y < 0.0 ? min(d.y, -1e-6) : max(d.y, 1e-6));\n vec2 t0 = (vec2(0.0) - o) * inv;\n vec2 t1 = (vec2(w) - o) * inv;\n vec2 tn = min(t0, t1);\n vec2 tf = max(t0, t1);\n float tin = max(tn.x, tn.y);\n if (tin <= 0.0 || tin > min(tf.x, tf.y)) return vec4(-1.0);\n vec2 hit = o + tin * d;\n float y = eye.y + tin * dir.y;\n if (y < 0.0 || y > 1.0) return vec4(-1.0);\n \n if (tn.y >= tn.x) {\n if (d.y <= 0.0) return vec4(-1.0);\n return vec4(tin, hit.x / w, y, 0.0);\n }\n if (d.x <= 0.0) return vec4(-1.0);\n return vec4(tin, 1.0 - hit.y / w, y, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float w = ratio;\n float turn = progress * progress * (3.0 - 2.0 * progress);\n float a = 0.5 * PI * turn;\n float c = cos(a), s = sin(a);\n if (progress >= 1.0) { c = 0.0; s = 1.0; }\n \n float motion = sin(PI * clamp(progress, 0.0, 1.0));\n float zoom = 1.0 + max(unzoom, 0.0) * motion;\n\n \n float dist = 0.8 * max(w, 1.0) / clamp(persp, 0.01, 1.0);\n vec3 eye = vec3(0.5 * w, 0.5, -dist);\n vec2 sp = (uv - 0.5) * zoom + 0.5;\n vec3 dir = vec3(sp.x * w, sp.y, 0.0) - eye;\n\n float px = EDGE * zoom * min(10.0 * motion, 1.0);\n float shade0 = 1.0 - shading * (1.0 - c);\n float shade1 = 1.0 - shading * (1.0 - s);\n\n vec4 front = vec4(0.0);\n vec4 b = hitBox(eye, dir, w, c, s);\n if (b.x > 0.0) {\n vec4 img = b.w < 0.5 ? getFromColor(vec2(b.y, b.z)) : getToColor(vec2(b.y, b.z));\n float m = 1.0;\n if (px > 0.0) {\n float e = px * b.x;\n vec3 n = b.w < 0.5 ? vec3(s, 0.0, -c) : vec3(-c, 0.0, -s);\n float fore = max(abs(dot(n, normalize(dir))), 0.05);\n float edge = b.w < 0.5 ? 1.0 - b.y : b.y;\n m = clamp(min(b.z, 1.0 - b.z) / e, 0.0, 1.0)\n * clamp(edge * w * fore / e, 0.0, 1.0);\n }\n \n if (m >= 1.0 && img.a >= 1.0) {\n return vec4(img.rgb * (b.w < 0.5 ? shade0 : shade1), img.a);\n }\n front = vec4(img.rgb * (b.w < 0.5 ? shade0 : shade1) * img.a, img.a) * m;\n }\n\n vec4 ground = vec4(0.0);\n float h = 0.005 * max(floating, 0.0);\n if (dir.y < 0.0 && motion > 0.0) {\n float tf = -(eye.y + h) / dir.y;\n vec3 f = eye + tf * dir;\n vec3 meye = vec3(eye.x, -2.0 * h - eye.y, eye.z);\n vec3 mdir = vec3(dir.x, -dir.y, dir.z);\n vec4 r = hitBox(meye, mdir, w, c, s);\n if (r.x > 0.0) {\n vec4 img = r.w < 0.5 ? getFromColor(vec2(r.y, r.z)) : getToColor(vec2(r.y, r.z));\n float k = clamp(reflection, 0.0, 1.0) * (1.0 - r.z) * (1.0 - r.z);\n ground = vec4(img.rgb * (r.w < 0.5 ? shade0 : shade1) * img.a, img.a) * k;\n }\n vec2 q = f.xz - vec2(0.5 * w);\n vec2 l = vec2(q.x * c + q.y * s, -q.x * s + q.y * c);\n float soft = 0.03 + 1.5 * h;\n float sh = shading * 0.7 * exp(-length(max(abs(l) - vec2(0.5 * w), 0.0)) / soft);\n \n vec2 bl = l + vec2(0.5 * w);\n sh *= l.y < l.x\n ? getFromColor(vec2(clamp(bl.x / w, 0.0, 1.0), 0.0)).a\n : getToColor(vec2(clamp(1.0 - bl.y / w, 0.0, 1.0), 0.0)).a;\n ground = ground * (1.0 - sh) + vec4(0.0, 0.0, 0.0, sh);\n ground *= min(6.0 * motion, 1.0);\n }\n\n vec4 color = front + ground * (1.0 - front.a);\n return color.a > 0.0 ? vec4(color.rgb / color.a, color.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","CurtainRise":"// CurtainRise — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/CurtainRise.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image rises like a theater festoon curtain: cords lift its hem into scalloped swags while the fabric gathers into shaded ruffles, and it is drawn up out of the frame over 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 swags; \n\nuniform float sag; \n\nuniform float ruffles; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\n\nvec4 transition (vec2 uv) {\n float p = progress;\n float f = 1.0 - (1.0 - p) * (1.0 - p) * (1.0 - p);\n float e = mix(p, p * p * (3.0 - 2.0 * p), 0.4);\n float s = sag * f;\n float lift = mix(-0.01, 1.0 + sag + 0.08, e);\n \n float n = max(1.0, floor(swags * sqrt(ratio / 1.78) + 0.5)); \n float u = fract(uv.x * n) * 2.0 - 1.0;\n float bump = 1.0 - u * u;\n float hem = lift - s * bump;\n float aa = 0.002 + 0.004 * f;\n float inside = smoothstep(hem - aa, hem + aa, uv.y);\n\n vec4 c = vec4(0.0);\n if (inside > 0.0) {\n \n float h = max(1.0 - max(hem, 0.0), 1e-4);\n float q = clamp((1.0 - uv.y) / h, 0.0, 1.0);\n \n \n float m = min(max(1.0, floor(ruffles + 0.5)), h / 0.02);\n float a = 2.0 * PI * m * q;\n float g = 0.85 * f * min(1.0, 0.3 + 5.0 * (1.0 - h)) * (0.6 + 0.4 * bump);\n float v = clamp(q + g * sin(a) / (2.0 * PI * m), 0.0, 1.0);\n float pull = 0.25 * f * q * q * sin(PI * u) / (PI * n);\n c = getFromColor(vec2(uv.x - pull, 1.0 - v));\n\n float slope = 2.5 * g * cos(a);\n float diffuse = (1.0 - 0.35 * slope) / sqrt(1.0 + slope * slope);\n float crease = 0.5 + 0.5 * sin(a);\n float light = mix(1.0, diffuse * (1.0 - 0.45 * crease * crease), shading * g);\n light += 0.18 * shading * g * smoothstep(0.4, 1.0, -cos(a));\n float depth = f * q * (0.3 + 0.7 * q);\n light *= 1.0 - shading * depth * (0.35 * u * u + 0.5 * exp(-(1.0 - abs(u)) * 14.0));\n light *= 1.0 - 0.35 * shading * f * exp(-(uv.y - hem) * 120.0);\n c.rgb *= light;\n if (inside >= 1.0) return c;\n }\n vec4 to = getToColor(uv);\n float below = max(hem - uv.y, 0.0);\n float shadow = 0.6 * shading * exp(-below * 22.0) * smoothstep(0.0, 0.05, lift) * (1.0 - smoothstep(1.0, 1.06, lift - s));\n to.rgb *= 1.0 - shadow;\n return mix(to, c, 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","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 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 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 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 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 float lift = edge - side;\n float spread = 0.012 + 0.25 * lift;\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 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 float h3 = h * h * h;\n float peak = h3 * h3;\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 float edgeY = sin(phi) / (DIST - cos(phi));\n\n vec2 n = 2.0 * uv - 1.0;\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 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 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","Cymatics":"// Cymatics — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Cymatics.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a layer of sand on a vibrating plate: it shivers, then runs together into the symmetric lines of a sound figure, uncovering the incoming image beneath as the plate, before the lines thin out and their grains hop 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 float modeX; \n\nuniform float modeY; \n\nuniform float lineWidth; \n\nconst float PI = 3.14159265;\nconst float GRAINS = 140.0;\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\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n \n float side = min(ratio, 1.0);\n vec2 toPlate = vec2(ratio, 1.0) / side;\n vec2 p = (uv - 0.5) * toPlate + 0.5;\n\n float n = modeX * PI;\n float m = modeY * PI;\n \n float c = 1.0 - 2.0 * smoothstep(0.0, 1.0, abs(modeX - modeY));\n vec2 cn = cos(n * p);\n vec2 cm = cos(m * p);\n vec2 sn = sin(n * p);\n vec2 sm = sin(m * p);\n float f = cn.x * cm.y + c * cm.x * cn.y;\n vec2 g = -vec2(n * sn.x * cm.y + c * m * sm.x * cn.y, m * cn.x * sm.y + c * n * cm.x * sn.y);\n float gl2 = max(dot(g, g), 1e-3);\n\n \n float x = clamp(t / 0.55, 0.0, 1.0);\n float gather = x * (1.6 - 0.6 * x);\n float w = mix(3.2, lineWidth, gather) * (1.0 - smoothstep(0.5, 0.97, t));\n float shake = smoothstep(0.0, 0.08, t) * (1.0 - 0.6 * smoothstep(0.4, 0.75, t));\n\n vec2 gid = floor(uv * vec2(ratio, 1.0) * GRAINS);\n float r1 = hash12(gid);\n float r2 = hash12(gid + 17.3);\n float r3 = hash12(gid + 41.7);\n\n \n \n \n float k = 3.2 / max(w, lineWidth);\n vec2 d = g / gl2 * (clamp(f * k, -2.0, 2.0) - f);\n d *= smoothstep(0.0, 0.1, t) / (1.0 + length(d) / 0.1);\n vec2 jit = (vec2(r1, r2) - 0.5) * 0.004 * shake * sin(t * 48.0 + r1 * 6.28);\n vec4 sand = getFromColor(mirror(uv + (d + jit) / toPlate));\n\n \n float gn = sqrt(gl2);\n float even = mix(1.0, clamp(gn / (2.06 * length(vec2(modeX, modeY))), 0.45, 1.6), gather);\n float s = abs(f) / max(w * even, 1e-4);\n \n float lit = dot(min(s, 1.2) * sign(f) * g / gn, vec2(-0.7071, 0.7071)) * 0.3;\n float relief = smoothstep(0.08, 0.4, t);\n sand.rgb *= 1.0 + shake * (r1 - 0.5) * 0.14 + relief * lit;\n\n float hop = smoothstep(0.6, 0.97, t);\n float thr = 0.72 + 0.4 * r2;\n float a = (1.0 - smoothstep(thr - 0.06, thr + 0.06, s)) * step(hop, r3 * 0.9 + 0.05);\n\n vec4 plate = getToColor(uv);\n float sh = (1.0 - smoothstep(1.0, 1.7, s)) * 0.3 * gather * (1.0 - hop);\n plate.rgb *= 1.0 - sh;\n return mix(plate, sand, 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","DamBreak":"// DamBreak — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DamBreak.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a body of water held back by a dam on one side: the dam gives way, its top sinks toward the open side into a long rippling slope with a glossy, foaming surface that rushes out of the frame, stretching the picture along the flow, and the rest drains 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 gloss; \n\nuniform float foam; \n\nuniform int leftward; \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 flowArea(float a, float x, float tau) {\n float p = 2.0 - a / tau;\n float q = 2.0 - x / tau;\n return tau * (p * p * p - q * q * q) / 27.0;\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n float L = ratio;\n float u = (leftward != 0) ? 1.0 - uv.x : uv.x;\n \n float x = (u - 1.0) * L;\n float tau = max(1.6 * max(L, 0.8) * pow(t, 1.4), 1e-4);\n float drain = 1.0 - smoothstep(0.45, 1.0, t);\n\n float a = max(-L, -tau);\n float xc = min(x, 2.0 * tau);\n float M = max(min(xc, a) + L, 0.0) + (xc > a ? flowArea(a, xc, tau) : 0.0);\n float Mt = (a + L) + flowArea(a, 2.0 * tau, tau);\n\n \n float r = min(max(2.0 * tau - x, 0.0), 6.0 * tau) / (3.0 * tau);\n float k = 0.12;\n float sk = clamp(0.5 + 0.5 * (r * r - 1.0) / k, 0.0, 1.0);\n float hs = mix(r * r, 1.0, sk) - k * sk * (1.0 - sk);\n \n float dhs = -(1.0 - sk) * 2.0 * r / (3.0 * tau);\n \n float e = smoothstep(0.0, 0.02, t);\n hs = mix(1.0, hs, e);\n dhs *= e;\n\n float moving = clamp(1.0 - hs, 0.0, 1.0);\n float ramp = min(moving * 4.0, 1.0) * (1.0 - t);\n float ph = 34.0 * x - 60.0 * t;\n float ph2 = 71.0 * x - 115.0 * t + 1.7;\n float wave = (0.014 * sin(ph) + 0.005 * sin(ph2)) * ramp;\n float dwave = (0.014 * 34.0 * cos(ph) + 0.005 * 71.0 * cos(ph2)) * ramp;\n float h = (hs + wave) * drain;\n float slope = (dhs + dwave) * drain;\n\n float d = h - uv.y;\n float inside = smoothstep(-1e-5, 0.003 * min(t * 20.0, 1.0) + 1e-5, d);\n vec2 src = vec2(mix(u, M / Mt, e), uv.y / max(h, 1e-4));\n vec4 img = getFromColor(clamp((leftward != 0) ? vec2(1.0 - src.x, src.y) : src, 0.0, 1.0));\n\n float steep = clamp(-dhs * drain * 1.5, 0.0, 1.0);\n float lit = clamp(slope * 2.5 + 0.6, 0.0, 1.0);\n float dd = max(d, 0.0);\n float near = exp(-dd / 0.08);\n img.rgb *= 1.0 - moving * (0.3 * (1.0 - src.y) + 0.2 * steep) - 0.25 * moving * near * (1.0 - lit);\n\n float fast = min(moving * 2.0, 1.0);\n vec2 fq = vec2((x - 0.9 * t) * 16.0, d * 30.0);\n float froth = vnoise(fq) * 0.6 + vnoise(fq * vec2(2.3, 2.7) + 5.1) * 0.4;\n float foamDepth = (0.006 + 0.05 * fast) * (0.5 + froth);\n float fm = foam * fast * smoothstep(0.0, 0.003, d) * (1.0 - smoothstep(0.6, 1.0, d / foamDepth));\n fm *= smoothstep(0.25, 0.55, froth + 0.3 * fast - 0.15);\n img.rgb = mix(img.rgb, vec3(0.94, 0.97, 1.0), fm);\n\n float streak = 0.5 + 0.5 * vnoise(vec2((x - 1.2 * t) * 8.0, 0.5));\n float spec = gloss * fast * (0.2 + 0.8 * lit) * streak;\n float band = exp(-abs(d - 0.03 - 0.03 * fast) / 0.012);\n img.rgb += spec * (0.8 * exp(-dd / 0.008) * smoothstep(0.0, 0.003, d) + 0.35 * band * (1.0 - fm) + 0.1 * near);\n img.rgb = min(img.rgb, 1.0);\n\n vec4 bg = getToColor(uv);\n float above = -d;\n float shadow = exp(-max(above, 0.0) / 0.05) * smoothstep(-0.002, 0.0, above) * min(moving * 3.0, 1.0);\n bg.rgb *= 1.0 - 0.35 * shadow * smoothstep(0.0, 0.3, drain) * smoothstep(0.0, 0.05, t);\n return mix(bg, img, 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","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","Deinterleave":"// Deinterleave — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Deinterleave.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image comes apart like interlaced lines of data: its even rows slide up and its odd rows slide down into two half-height copies, each copy splits again into four, then eight; the copies flip over to the incoming image, whose rows interleave back into one picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 stages; \n\nuniform vec4 gap; \n\nconst float PI = 3.14159265;\n\nfloat ease3(float x) {\n x = clamp(x, 0.0, 1.0);\n float y = 2.0 - 2.0 * x;\n return x < 0.5 ? 4.0 * x * x * x : 1.0 - 0.5 * y * y * y;\n}\n\nfloat unweave(float z, float B, float a, inout float lit) {\n float bo = floor(z / B) * B;\n float lz = z - bo;\n float c = 1.0 - 0.5 * a;\n float off = a * (B - 1.0) * 0.5;\n \n float io = floor((lz - off) / c);\n float ko = io - mod(io + 1.0, 2.0);\n float f = lz - ko * c - off;\n if (ko >= 1.0 && ko < B && f < 1.0) return bo + ko + f;\n float ie = floor(lz / c);\n float ke = ie - mod(ie, 2.0);\n f = lz - ke * c;\n if (ke >= 0.0 && ke < B && f < 1.0) {\n \n lit *= 1.0 - 0.25 * sin(PI * a);\n return bo + ke + f;\n }\n lit = -1.0;\n return z;\n}\n\nvec4 transition(vec2 uv) {\n float S = clamp(float(stages), 1.0, 4.0);\n \n float copies = 1.0;\n for (int i = 0; i < 4; i++) {\n if (float(i) < S) copies *= 2.0;\n }\n \n float rows = max(6.0, 48.0 / copies);\n float M = rows * copies;\n float z = (1.0 - uv.y) * M;\n float band = floor(z / rows);\n float th = PI * ease3((progress - 0.43 - 0.07 * band / (copies - 1.0)) / 0.07);\n float ca = cos(th);\n bool inc = ca < 0.0;\n \n float kp = sin(th) * sign(ca) / (2.5 * copies);\n float ys = fract(z / rows) - 0.5;\n float v = ys / max(abs(ca) - ys * kp, 1e-4);\n float x = 0.5 + (uv.x - 0.5) * (1.0 + v * kp);\n z = (band + 0.5 + clamp(v, -0.5, 0.4999)) * rows;\n float q = clamp((inc ? 1.0 - progress : progress) / 0.43, 0.0, 1.0);\n \n float w = 1.0 / (0.6 * (S - 1.0) + 1.0);\n float lit = 1.0;\n float B = 2.0 * rows;\n for (int i = 4; i >= 1; i--) {\n if (float(i) > S) continue;\n z = unweave(z, B, ease3((q - 0.6 * w * float(i - 1)) / w), lit);\n if (lit < 0.0) break;\n B *= 2.0;\n }\n vec2 p = vec2(x, 1.0 - z / M);\n vec4 c = inc ? getToColor(p) : getFromColor(p);\n c.rgb *= max(lit, 0.0) * (0.55 + 0.45 * abs(ca));\n float aa = 400.0 / copies;\n float edge = clamp((0.5 - abs(v)) * aa + 1.0, 0.0, 1.0) * clamp((0.5 - abs(x - 0.5)) * 400.0 * ratio + 1.0, 0.0, 1.0);\n return mix(gap, c, step(0.0, lit) * 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","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 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","DiffuseDissolve":"// DiffuseDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DiffuseDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image diffuses into a shimmering, grainy haze, as if its pixels were scattered further and further from where they belong, and the incoming image condenses back out of the haze as they settle 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 radius; \n\nuniform float grainSize; \n\nuniform float shimmer; \n\nconst float PI = 3.14159265;\n\nvec4 hash42(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * vec4(0.1031, 0.1030, 0.0973, 0.1099));\n p4 += dot(p4, p4.wzxy + 33.33);\n return fract((p4.xxyz + p4.yzzw) * p4.zywx);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n float a = 1.0 - abs(2.0 * progress - 1.0);\n float amount = a * a * (3.0 - 2.0 * a);\n vec2 cell = floor(uv * vec2(ratio, 1.0) / max(grainSize, 1e-4));\n vec4 h = hash42(cell);\n float angle = 2.0 * PI * (h.x + shimmer * (2.0 * h.w - 1.0) * progress);\n float dist = radius * amount * 0.5 * (h.y + h.z);\n vec2 offset = dist * vec2(cos(angle) / ratio, sin(angle));\n vec2 suv = mirror(uv + offset);\n \n float when = 0.3 + 0.4 * hash42(cell + vec2(0.5, 0.25)).x;\n float m = smoothstep(when - 0.1, when + 0.1, progress);\n \n if (m <= 0.0) return getFromColor(suv);\n if (m >= 1.0) return getToColor(suv);\n return mix(getFromColor(suv), getToColor(suv), 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 straight wipe in any direction, diagonal and soft-edged by default; a smoothness of 0 gives a hard 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 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","DiscCascade":"// DiscCascade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DiscCascade.glsl\n// Author: gre\n// License: MIT\n// Description: A disc cut from the middle of the outgoing image makes a half turn, then the four discs inscribed in the quarters of the frame, then sixteen smaller ones; the smallest discs spin a full turn while the image changes to the incoming one, whose larger discs then turn back one size at a time until it is whole\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 levels; \n\nuniform float shadow; \n\nconst float PI = 3.14159265;\n\nconst float D = 1.5;\n\nfloat ease3(float x) {\n x = clamp(x, 0.0, 1.0);\n float y = 2.0 - 2.0 * x;\n return x < 0.5 ? 4.0 * x * x * x : 1.0 - 0.5 * y * y * y;\n}\n\nfloat bump(float x) { return sin(PI * clamp(x, 0.0, 1.0)); }\n\nvec4 transition(vec2 uv) {\n float N = clamp(float(levels), 2.0, 4.0);\n float q = progress * (2.0 * N - 1.0 + D);\n vec2 asp = vec2(ratio, 1.0);\n vec2 p = uv;\n float lit = 1.0;\n float n = 8.0;\n for (int i = 3; i >= 0; i--) {\n float k = float(i);\n if (k >= N) {\n n *= 0.5;\n continue;\n }\n float a, m;\n if (k == N - 1.0) {\n float t = (q - k) / (1.0 + D);\n \n a = 2.0 * PI * fract(ease3(t));\n m = bump(t);\n } else {\n float t0 = (q - k) / D, t1 = (q - (2.0 * N - 1.0 - k)) / D;\n a = PI * (ease3(t0) - ease3(t1));\n m = bump(t0) + bump(t1);\n }\n m = clamp(m, 0.0, 1.0);\n a *= mod(k, 2.0) < 0.5 ? 1.0 : -1.0;\n vec2 cc = (floor(p * n) + 0.5) / n;\n vec2 d = (p - cc) * asp;\n float R = 0.5 * min(ratio, 1.0) / n;\n float l = length(d);\n float aa = 0.002;\n float seam = 1.0 - smoothstep(0.0, aa, abs(l - R));\n lit *= 1.0 - seam * (0.2 * abs(sin(a * 0.5)) + 0.35 * m);\n \n vec2 cell = 0.5 * asp / n - abs(d);\n float ls = length(d - vec2(0.4, -0.6) * 0.06 * R);\n lit *= 1.0 - shadow * 0.6 * m * smoothstep(R - aa, R, l) * (1.0 - smoothstep(R * 0.85, R * 1.12, ls)) * smoothstep(0.0, 0.1 * R, min(cell.x, cell.y));\n if (l < R) {\n \n float b = a * (1.0 - smoothstep(R - aa, R, l));\n float c = cos(b), s = sin(b);\n p += (mat2(c, s, -s, c) * d - d) / asp;\n lit *= 1.0 + 0.12 * m * smoothstep(R * 0.8, R, l) * dot(normalize(d + 1e-6), vec2(-0.6, 0.8));\n }\n n *= 0.5;\n }\n float x = smoothstep(N - 0.9, N + D - 0.1, q);\n vec4 col = mix(getFromColor(p), getToColor(p), x);\n col.rgb *= lit;\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","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;\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 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 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 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 float travel = reach * (0.4 + 0.6 * r2) * t * (0.2 + 0.8 * t);\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","DominoFall":"// DominoFall — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DominoFall.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is cut into standing slats that topple backward like dominoes in a chain reaction across the frame, each one leaning onto the next and knocking it over, until they all lie flat 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 int count; \n\nuniform int reverse; \n\nuniform float knock; \n\nuniform float lean; \n\nuniform float perspective; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\nconst float EDGE = 0.0015;\n\nfloat knockPart() {\n return clamp(knock, 0.05, 1.0);\n}\n\nfloat fallTime(float j, float n) {\n float k = knockPart();\n float d = 1.0 / (1.0 + (n - 1.0) * k);\n return clamp((progress - j * k * d) / d, 0.0, 1.0);\n}\n\nfloat fallAngle(float t) {\n return 0.5 * PI * t * (0.2 + 0.8 * t);\n}\n\nvec4 slatPoint(float j, float n, float w, float xc, float y) {\n vec4 none = vec4(0.0, 0.0, -1.0, 0.0);\n if (j < 0.0 || j > n - 1.0) return none;\n float t = fallTime(j, n);\n if (t >= 1.0) return none;\n float a = fallAngle(t);\n float c = cos(a), s = sin(a);\n \n \n vec3 eye = vec3((j + 0.5) * w, 0.5 * c, -1.0 / max(perspective, 0.01));\n vec3 dir = vec3(xc, y, 0.0) - eye;\n float den = dir.z * c - dir.y * s;\n if (den <= 0.0) return none;\n float r = (eye.y * s - eye.z * c) / den;\n vec3 hit = eye + r * dir;\n float h = hit.y * c + hit.z * s;\n if (r <= 0.0 || h < 0.0) return none;\n float side = clamp(lean, 0.0, 1.0) * w * min(t / knockPart(), 1.0) * h;\n return vec4(hit.x - side - j * w, h, t, a);\n}\n\nvec4 drawSlat(vec4 color, float j, vec4 pt, vec4 front, float w) {\n float t = pt.z;\n if (t < 0.0) return color;\n float s = sin(pt.w);\n float d = min(pt.x, w - pt.x);\n float m;\n if (t <= 0.0) {\n \n m = d >= 0.0 && pt.y <= 1.0 ? 1.0 : 0.0;\n } else {\n float e = EDGE * min(10.0 * t, 1.0) * (1.0 + max(perspective, 0.0) * pt.y * s);\n m = clamp(d / e + 0.5, 0.0, 1.0) * clamp((1.0 - pt.y) * max(cos(pt.w), 0.05) / e + 0.5, 0.0, 1.0);\n }\n if (m <= 0.0) return color;\n float sx = (j * w + clamp(pt.x, 0.0, w)) / ratio;\n vec4 img = getFromColor(vec2((reverse != 0) ? 1.0 - sx : sx, min(pt.y, 1.0)));\n float shade = 1.0 - shading * s * (0.4 + 0.6 * pt.y);\n if (front.z >= 0.0 && front.z < t && front.x < 0.0) {\n float reach = clamp(1.0 - (front.y - 1.0) / 0.05, 0.0, 1.0);\n shade *= 1.0 - 0.6 * shading * exp(front.x / (0.15 * w)) * reach * min((t - front.z) / knockPart(), 1.0);\n }\n img.rgb *= shade;\n return mix(color, img, m);\n}\n\nvec4 transition (vec2 uv) {\n float n = float(count < 1 ? 1 : count);\n float w = ratio / n;\n float xc = ((reverse != 0) ? 1.0 - uv.x : uv.x) * ratio;\n float col = clamp(floor(xc / w), 0.0, n - 1.0);\n\n vec4 color = getToColor(uv);\n float t0 = fallTime(col, n);\n color.rgb *= 1.0 - 2.4 * shading * t0 * (1.0 - t0) * exp(-40.0 * uv.y);\n\n \n \n vec4 cur = slatPoint(col, n, w, xc, uv.y);\n color = drawSlat(color, col - 1.0, slatPoint(col - 1.0, n, w, xc, uv.y), cur, w);\n color = drawSlat(color, col, cur, slatPoint(col + 1.0, n, w, xc, uv.y), w);\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","Donut":"// Donut — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Donut.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image curls back into a tube along its longer side, then the tube bends round until its two ends meet in a ring, which rolls away out of the frame like a wheel, 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\nconst float PI = 3.14159265;\nconst float CAM = 3.0;\n\nfloat k1, k2, ang, shiftX, lift, seamA, seamB;\nvec2 size, wrap;\nbool portrait;\n\nvec2 toLocal(vec2 q) { return portrait ? vec2(q.y, -q.x) : q; }\n\nfloat angleOf(vec2 q) {\n if (q.y > 0.0 && abs(q.x) < 0.25 * q.y) {\n float w = q.x / q.y;\n float w2 = w * w;\n return w * (1.0 - w2 * (1.0 / 3.0 - w2 * (0.2 - w2 / 7.0)));\n }\n return atan(q.x + 1e-7, q.y);\n}\n\nvec3 unbend(vec3 p) {\n p.x -= shiftX;\n float c = cos(ang), s = sin(ang);\n p.xy = mat2(c, s, -s, c) * p.xy;\n p.xy = toLocal(p.xy);\n p.y += lift;\n vec2 st = p.xy;\n if (k2 > 1e-3) {\n float R = 1.0 / k2;\n vec2 q = vec2(p.x, R - p.y);\n st = vec2(angleOf(q) * R, R - length(q));\n }\n vec2 vn = vec2(st.y, p.z);\n if (k1 > 1e-3) {\n float R = 1.0 / k1;\n vec2 q = vec2(st.y, p.z + R);\n vn = vec2(angleOf(q) * R, length(q) - R);\n }\n return vec3(st.x, vn.x, vn.y);\n}\n\nfloat sdf(vec3 p) {\n vec3 u = unbend(p);\n vec2 o = max(abs(u.xy) - 0.5 * size, 0.0);\n return length(vec3(o, u.z));\n}\n\nvec4 sheet(vec2 l) {\n \n vec2 sw = vec2(seamB, seamA);\n vec2 inset = 0.5 * mix(size, wrap, sw) - 0.012 * sw;\n l = clamp(l, -inset, inset);\n vec2 q = portrait ? vec2(-l.y, l.x) : l;\n return getFromColor(q / vec2(ratio, 1.0) + 0.5);\n}\n\nvec4 sheetSeamless(vec2 l) {\n vec2 d = 0.5 * wrap - abs(l);\n vec2 w = 0.5 * (1.0 - smoothstep(0.0, 0.06, d)) * vec2(seamB, seamA);\n vec2 o = l - sign(l) * wrap;\n return mix(\n mix(sheet(l), sheet(vec2(o.x, l.y)), w.x),\n mix(sheet(vec2(l.x, o.y)), sheet(o), w.x), w.y);\n}\n\nvec4 transition(vec2 uv) {\n portrait = ratio < 1.0;\n size = portrait ? vec2(1.0, ratio) : vec2(ratio, 1.0);\n \n wrap = vec2(size.x, min(size.y, 0.6 * size.x));\n float t = progress;\n float a1 = smoothstep(0.0, 0.38, t);\n float a2 = smoothstep(0.28, 0.62, t);\n float a3 = smoothstep(0.58, 1.0, t);\n \n float c1 = min(1.0, 1.06 * a1);\n float c2 = min(1.0, 1.06 * a2);\n seamA = smoothstep(0.8, 1.0, c1);\n seamB = smoothstep(0.8, 1.0, c2);\n k1 = 2.0 * PI / wrap.y * c1;\n k2 = 2.0 * PI / size.x * c2;\n float R = (size.x + wrap.y) / (2.0 * PI);\n shiftX = a3 * a3 * (0.5 * ratio + 1.15 * R + 0.06);\n ang = shiftX / R;\n lift = c2 * size.x / (2.0 * PI);\n\n vec3 ro = vec3(0.0, 0.0, CAM);\n vec3 rd = normalize(vec3((uv - 0.5) * vec2(ratio, 1.0), 0.0) - ro);\n float h = CAM - 0.5;\n float minD = 1e3;\n bool hit = false;\n for (int i = 0; i < 90; i++) {\n float d = sdf(ro + rd * h);\n minD = min(minD, d);\n if (d < 4e-4) { hit = true; break; }\n h += d * 0.6;\n if (h > CAM + 1.5) break;\n }\n\n vec4 bg = getToColor(uv);\n bg.rgb *= 1.0 - 0.5 * (1.0 - smoothstep(0.0, 0.12, minD)) * (1.0 - a3 * a3);\n if (!hit) return bg;\n \n for (int j = 0; j < 3; j++) h += sdf(ro + rd * h);\n\n vec3 p = ro + rd * h;\n vec3 u = unbend(p);\n vec2 e = vec2(1e-3, 0.0);\n vec3 n = normalize(vec3(\n unbend(p + e.xyy).z - unbend(p - e.xyy).z,\n unbend(p + e.yxy).z - unbend(p - e.yxy).z,\n unbend(p + e.yyx).z - unbend(p - e.yyx).z));\n vec4 c = sheetSeamless(u.xy);\n bool front = dot(n, rd) < 0.0;\n if (!front) n = -n;\n vec3 L = normalize(vec3(-0.4, 0.6, 1.0));\n float diff = max(dot(n, L), 0.0);\n float spec = pow(max(dot(reflect(-L, n), -rd), 0.0), 30.0);\n float bendAmt = max(a1, a2);\n float shade = mix(1.0, 0.4 + 0.75 * diff, bendAmt);\n if (front) c.rgb = c.rgb * shade + 0.3 * spec * bendAmt;\n else c.rgb *= 0.35 * shade;\n float aa = 1.5 / 200.0;\n \n float ex = mix(1.0, smoothstep(0.0, aa, 0.5 * size.x - abs(u.x)), c2 * (1.0 - c2) * 4.0);\n float ey = mix(1.0, smoothstep(0.0, aa, 0.5 * size.y - abs(u.y)), c1 * (1.0 - c1) * 4.0);\n return mix(bg, c, min(ex, ey));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 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 swinging toward the viewer, as the incoming one comes forward from the dark room behind, 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; \n\nuniform float depth; \n\nconst float PI = 3.141592653589793;\n\nvec2 leafHit (float x, float w, float eye, float a) {\n float c = cos(a), s = sin(a);\n float t = (eye * c - 0.5 * w * s) / (s * (x - 0.5 * w) + eye * c);\n vec2 hit = vec2(0.5 * w + t * (x - 0.5 * w), eye * (t - 1.0));\n return vec2(t, hit.x * c - hit.y * s);\n}\n\nfloat project (vec2 p, float w, float eye) {\n return 0.5 * w + (p.x - 0.5 * w) * eye / (eye + p.y);\n}\n\nfloat easeInOut (float t) {\n return t < 0.5 ? 4.0 * t * t * t : 1.0 - 4.0 * (1.0 - t) * (1.0 - t) * (1.0 - t);\n}\n\nvec4 room (vec2 uv, float x, float edgeL, float edgeR, float close, float dolly) {\n float size = mix(max(depth, 1.0), 1.0, dolly);\n vec2 p = (uv - 0.5) * size + 0.5;\n \n float soft = 0.004 * (size - 1.0) + 1e-6;\n vec2 m = smoothstep(-soft, soft, p) * smoothstep(-soft, soft, 1.0 - p);\n vec4 c = getToColor(clamp(p, 0.0, 1.0)) * (m.x * m.y);\n if (p.y < 0.0) {\n vec2 r = vec2(p.x, -1.2 * p.y - 0.02);\n float f = reflection * (1.0 - r.y) * m.x * smoothstep(0.0, 0.01, r.y);\n c += getToColor(clamp(r, 0.0, 1.0)) * f * (1.0 - m.y);\n }\n float wl = 0.03 + 0.12 * close;\n float shadow = (1.0 - smoothstep(0.0, wl, x - edgeL)) + (1.0 - smoothstep(0.0, wl, edgeR - x));\n float light = (1.0 + 0.6 * close * close) * (1.0 - 0.7 * close * min(shadow, 1.0));\n return vec4(min(c.rgb * light, vec3(c.a)), c.a);\n}\n\nvec4 transition (vec2 uv) {\n float w = ratio;\n float x = uv.x * w;\n \n float eye = max(w, 1.0) * (0.5 + 0.2 / max(perspective, 0.01));\n float swing = progress * progress * (3.0 - 2.0 * progress);\n float a = min(atan(2.0 * eye / w) + 0.1, 0.5 * PI) * swing;\n float dolly = mix(easeInOut(progress), progress, 0.3);\n float hw = 0.5 * w;\n vec2 front = hw * vec2(cos(a), -sin(a));\n float thick = 0.02 * w * (1.0 - smoothstep(0.8, 1.0, swing));\n float edgeL = project(front, w, eye);\n float backL = project(front + thick * vec2(sin(a), cos(a)), w, eye);\n float close = 1.0 - swing;\n vec4 back = room(uv, x, backL, w - backL, close, dolly);\n \n bool left = x < hw;\n float lx = left ? x : w - x;\n vec2 hit = leafHit(lx, w, eye, a);\n float s = clamp(hit.y, 0.0, hw);\n float v = 0.5 + (uv.y - 0.5) * hit.x;\n vec4 leaf = getFromColor(clamp(vec2(left ? s / w : 1.0 - s / w, v), 0.0, 1.0));\n leaf.rgb *= 1.0 - 0.5 * (1.0 - cos(a)) - 0.25 * sin(a) * (s / hw);\n vec4 side = getFromColor(clamp(vec2(left ? 0.499 : 0.501, v), 0.0, 1.0));\n side.rgb = min(side.rgb * 1.5, vec3(side.a));\n \n float aa = 0.003 * min(1.0, 20.0 * min(a, close)) + 1e-6;\n vec4 c = mix(back, side, smoothstep(-aa, aa, backL - lx));\n return mix(c, leaf, smoothstep(-aa, aa, edgeL - lx));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Drape":"// Drape — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Drape.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image hangs like a sheet of fabric that is let go at the top: it collapses into soft, uneven folds that hide one another as the cloth bunches up and slides down 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 folds; \n\nuniform float depth; \n\nuniform float sway; \n\nuniform float shadow; \n\nconst float PI = 3.141592653589793;\nconst int STEPS = 24;\nconst float DEPTH = 0.8; \n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat hash11(float p) {\n p = fract(p * 0.1031);\n p *= p + 33.33;\n p *= p + p;\n return fract(p);\n}\n\nfloat noise1(float x) {\n float i = floor(x);\n float f = x - i;\n return mix(hash11(i), hash11(i + 1.0), f * f * (3.0 - 2.0 * f));\n}\n\nfloat topEdge(float x, vec4 m) {\n float c = 2.0 * x - 1.0;\n return m.y - 0.08 * m.x * (1.0 - c * c);\n}\n\nfloat sidePull(float sy, float gT) {\n return 0.035 * gT * (0.3 + 0.7 * clamp(sy, 0.0, 1.0));\n}\n\nvec4 cloth(vec2 p, vec4 m, float foldN) {\n float gT = m.x;\n float botY = m.z;\n float x = p.x - m.w;\n float top = topEdge(x, m);\n float sy = (p.y - botY) / max(top - botY, 1e-4); \n float pull = sidePull(sy, gT);\n float xc = (x - pull) / (1.0 - 2.0 * pull);\n float wander = (noise1(0.5 * foldN * xc + 2.5 * sy + 5.3) - 0.5) * 2.4 * (1.0 - sy);\n float ph = 2.0 * PI * (foldN * xc + 0.6 * noise1(0.7 * foldN * xc + 1.7)) + wander;\n float d = 0.15 + 0.85 * noise1(1.1 * foldN * xc + 1.4 * sy + 7.0);\n float amp = DEPTH * depth * gT * (0.3 + 0.7 * sy * sqrt(max(sy, 0.0))) / max(foldN, 2.0);\n float w = 0.6 / foldN;\n amp *= smoothstep(0.0, w, xc) * smoothstep(0.0, w, 1.0 - xc);\n float prof = 0.5 - 0.5 * cos(ph); \n float dt = (1.0 - sy) * (top - botY);\n float crease = exp(-30.0 * dt) * (0.5 + 0.5 * sin(80.0 * dt + 0.7 * ph));\n bool on = sy >= 0.0 && sy <= 1.0 && xc >= 0.0 && xc <= 1.0;\n return on ? vec4(amp * (d * prof + 0.15 * crease), xc, sy, ph) : vec4(-1.0);\n}\n\nvec4 transition (vec2 uv) {\n float t = progress;\n float topY = 1.0 - 1.06 * t * (0.35 + 0.65 * t);\n float botY = -0.75 * t * t * t;\n float f = 1.0 - (1.0 - t) * (1.0 - t) * (1.0 - t);\n float foldN = max(1.0, floor(folds * min(ratio, 1.0) + 0.5));\n float shiftX = sway * 0.035 * sin(2.0 * PI * t) * f;\n \n vec2 view = vec2(0.75 + 0.5 * sway * sin(PI * t) * f, -0.35);\n float zMax = 1.15 * DEPTH * depth * f / max(foldN, 2.0); \n vec4 m = vec4(f, topY, botY, shiftX);\n \n float zA = zMax; \n float zB = 0.0; \n bool found = false;\n float dA = 0.0;\n float dB = 0.0;\n bool onA = false; \n for (int i = 0; i < STEPS; i++) {\n if (!found) {\n float z = max(zMax * (1.0 - float(i) / float(STEPS - 1)), 0.0);\n vec4 s = cloth(uv - view * z, m, foldN);\n float dz = s.x - z;\n if (s.x >= 0.0 && dz >= 0.0) {\n found = true;\n zB = z;\n dB = dz;\n } else {\n zA = z;\n dA = dz;\n onA = s.x >= 0.0;\n }\n }\n }\n float zHit = zB;\n if (found && zA > zB) {\n if (onA) {\n zHit = mix(zA, zB, dA / (dA - dB));\n } else {\n \n \n float za = zA;\n for (int j = 0; j < 5; j++) {\n float zm = 0.5 * (za + zHit);\n if (cloth(uv - view * zm, m, foldN).x >= zm) zHit = zm;\n else za = zm;\n }\n }\n }\n vec2 hp = uv - view * zHit;\n vec4 hit = found ? cloth(hp, m, foldN) : vec4(-1.0);\n if (found && hit.x < 0.0) {\n zHit = zB;\n hp = uv - view * zB;\n hit = cloth(hp, m, foldN);\n }\n vec4 col = vec4(0.0);\n float cover = 0.0;\n if (hit.x >= 0.0) {\n float xc = hit.y;\n float sy = hit.z;\n float ph = hit.w;\n \n float slope = PI * zMax * foldN;\n \n float mu = min(0.25 * slope * slope / (1.0 + 0.25 * slope * slope), 0.5);\n float u = xc - mu * sin(2.0 * ph) / (4.0 * PI * foldN);\n float h = max(topY - botY, 1e-4);\n float comp = max(1.0 - h, 0.0);\n float v = sy * (1.0 - comp) + comp * sy * sy * sy;\n vec4 tex = getFromColor(mirror(vec2(u, v)));\n float span = topEdge(hp.x - shiftX, m) - botY;\n float e = 0.002;\n float hx = cloth(hp + vec2(e, 0.0), m, foldN).x;\n float hy = cloth(hp + vec2(0.0, e), m, foldN).x;\n float hx0 = hx >= 0.0 ? hx : hit.x;\n float hy0 = hy >= 0.0 ? hy : hit.x;\n vec3 nrm = normalize(vec3(-(hx0 - hit.x) / e, -(hy0 - hit.x) / e, 1.0));\n vec3 light = normalize(vec3(-0.45, 0.35, 1.0));\n float diffuse = mix(1.0, max(dot(nrm, light), 0.0) / light.z, min(1.0, 3.0 * f));\n float valley = 1.0 - (0.5 - 0.5 * cos(ph));\n float ao = 1.0 - 0.6 * depth * f * valley * valley * (0.35 + 0.65 * sy);\n float rim = exp(-(1.0 - sy) * span * 70.0) * 0.35 * f;\n \n float under = max(hit.x - zHit, 0.0);\n float back = min(1.0, under / max(0.1 * zMax, 1e-6));\n tex.rgb *= diffuse * ao * (1.0 - rim) * (1.0 - 0.6 * back);\n col = tex;\n \n float aa = 0.003 * f;\n float inside = min((1.0 - sy) * span - view.y * under, min(xc, 1.0 - xc));\n cover = aa > 0.0 ? clamp(inside / aa, 0.0, 1.0) : 1.0;\n if (cover >= 1.0) return col;\n }\n vec4 to = getToColor(uv);\n float x = uv.x - shiftX;\n float pull = sidePull((uv.y - botY) / max(topEdge(x, m) - botY, 1e-4), f);\n float outside = max(uv.y - topEdge(x, m), max(-x, x - 1.0) - pull);\n float sh = shadow * exp(-max(outside, 0.0) * 16.0) * f * clamp(8.0 * (1.0 - t), 0.0, 1.0);\n return mix(vec4(to.rgb * (1.0 - 0.8 * sh), to.a), col, 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","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 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 vec2 assumedCenter = vec2(0.5, 0.5);\n vec2 p = (uv.xy - vec2(0.5, 0.5)) / newScale * vec2(ratio, 1.0);\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 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","DropHop":"// DropHop — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DropHop.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture beads up into a glossy drop resting on a pool of the incoming picture; it drains into the pool with a ring of ripples but leaves a smaller drop that hops up and lands a little further on, again and again, until the last drop melts into the pool\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 steps; \n\nuniform float gloss; \n\nconst float PI = 3.14159265;\n\nconst float SHRINK = 0.65;\n\nfloat sdBox(vec2 p, vec2 h, float r) {\n vec2 q = abs(p) - h + r;\n return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - r;\n}\n\nfloat stageEnd(float k, float n) {\n \n return 0.94 * (1.0 - pow(max(1.0 - k / n, 0.0), 1.4));\n}\n\nvec2 spot(float k, float rr, float r0) {\n vec2 c = vec2(0.3 * rr * cos(2.2 * k + 0.6), 0.16 * sin(2.2 * k + 0.6)) * (1.0 - 0.1 * k);\n float xmax = max(0.5 * ratio - 1.3 * r0 * pow(SHRINK, k), 0.0);\n return k < 0.5 ? vec2(0.0) : vec2(clamp(c.x, -xmax, xmax), c.y);\n}\n\nvec2 mirrored(vec2 v) {\n return 1.0 - abs(1.0 - abs(v));\n}\n\nvec4 transition(vec2 uv) {\n float n = floor(clamp(steps, 2.0, 5.0));\n vec2 frame = vec2(ratio, 1.0) * 0.5;\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n float aa = 1.5 / 200.0;\n float rr = min(ratio, 1.0);\n float r0 = 0.45 * rr;\n\n float s = 1.0, rnd = 0.0, hgt = 0.0, fade = 0.0;\n vec2 c = vec2(0.0);\n vec2 ripple = vec2(0.0);\n float glint = 0.0;\n for (int i = 0; i < 5; i++) {\n float k = float(i);\n if (k >= n) break;\n float t0 = stageEnd(k, n), t1 = stageEnd(k + 1.0, n);\n float t = clamp((progress - t0) / (t1 - t0), 0.0, 1.0);\n bool last = k + 1.0 >= n;\n float s0 = pow(SHRINK, k), s1 = s0 * SHRINK;\n vec2 c0 = spot(k, rr, r0), c1 = spot(k + 1.0, rr, r0);\n float drain = smoothstep(i == 0 ? 0.36 : 0.15, 0.58, t);\n float v = smoothstep(0.55, 1.0, t);\n if (progress >= t0) {\n float dip = 1.0 - 0.3 * sin(PI * clamp((t - 0.35) / 0.25, 0.0, 1.0));\n if (last) {\n \n float melt = smoothstep(0.3, 0.9, t);\n s = s0 * (1.0 + 0.35 * melt) * mix(dip, 1.0, melt);\n fade = melt;\n hgt = 0.0;\n c = c0;\n } else {\n float h = sin(PI * v);\n s = mix(s0, s1, drain * drain) * dip * (1.0 + 0.3 * h);\n hgt = h * s1 * 2.0;\n c = mix(c0, c1, v);\n }\n if (i == 0) rnd = smoothstep(0.0, 0.4, t);\n }\n float age = progress - mix(t0, t1, last ? 0.6 : 0.5);\n float d = length(p - c0) - (s0 * r0 * 0.9 + age * 0.9);\n float amp = 0.03 * sqrt(s0) * smoothstep(0.0, 0.03, age) * exp(-age * 4.0) * min(1.0, 8.0 * (1.0 - progress));\n float env = exp(-d * d / 0.003);\n ripple += normalize(p - c0 + 1e-5) * amp * env * sin(d * 60.0);\n glint += amp * 12.0 * env * cos(d * 60.0);\n }\n\n vec2 hb = s * mix(frame + 3.0 * aa, vec2(r0), rnd) - 2.0 * aa;\n float cr = rnd * min(hb.x, hb.y);\n vec2 lp = p - c;\n float sd = sdBox(lp, hb, cr);\n float inside = smoothstep(aa, -aa, sd) * (1.0 - fade);\n\n vec4 pool = getToColor(mirrored(uv + ripple * gloss / vec2(ratio, 1.0)));\n pool.rgb *= 1.0 + glint * gloss;\n vec2 sp = lp - vec2(0.12, -0.16) * (hgt + 0.08 * s * rnd);\n float ssd = sdBox(sp, hb, cr);\n float soft = 0.02 + 0.06 * hgt;\n pool.rgb *= 1.0 - 0.45 * gloss * rnd * (1.0 - fade) * smoothstep(soft, -soft, ssd) / (1.0 + 3.0 * hgt);\n\n vec4 col = getFromColor(clamp(lp / max(s, 1e-3) / vec2(ratio, 1.0) + 0.5, 0.0, 1.0));\n float rim = 0.07 * max(s, 0.15);\n float h = clamp(-sd / rim, 0.0, 1.0);\n float edge = (1.0 - sqrt(1.0 - (1.0 - h) * (1.0 - h))) * rnd;\n float lit = dot(normalize(lp + 1e-5), normalize(vec2(-0.6, 0.8)));\n col.rgb *= 1.0 - 0.45 * gloss * edge * (0.6 - 0.4 * lit);\n col.rgb += gloss * edge * smoothstep(0.4, 1.0, lit) * 0.6;\n vec2 hp = (lp - hb * vec2(-0.45, 0.45)) / max(min(hb.x, hb.y), 1e-3);\n col.rgb += gloss * rnd * 0.5 * (1.0 - smoothstep(0.0, 0.35, length(hp) * 2.5));\n return mix(pool, col, 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","DuotoneFade":"// DuotoneFade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/DuotoneFade.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is printed in two inks, shadows first, as a bold high-contrast duotone; the incoming image is printed over it in the same two inks, its dark tones landing before its highlights, then its own colors come back, highlights first\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 shadowInk; \n\nuniform vec4 highlightInk; \n\nuniform float contrast; \n\nuniform float grain; \n\nfloat dfHash(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 dfLuma(vec4 c) {\n return clamp(dot(c.rgb, vec3(0.299, 0.587, 0.114)), 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n float la = dfLuma(a);\n float lb = dfLuma(b);\n \n vec2 q = uv * 360.0 * vec2(max(ratio, 1.0), max(1.0 / ratio, 1.0));\n float g = dfHash(floor(q)) - 0.5;\n\n float inks = smoothstep(0.0, 0.35, progress);\n float lift = smoothstep(0.65, 1.0, progress);\n float amount = min(\n clamp(inks * 1.35 - 0.35 * la, 0.0, 1.0),\n clamp((1.0 - lift) * 1.35 - 0.35 * lb, 0.0, 1.0)\n );\n amount = amount * amount * (3.0 - 2.0 * amount);\n\n float x = smoothstep(0.25, 0.75, progress) * 1.6 - 0.3;\n float t = lb + 0.2 * grain * g;\n float s = smoothstep(t - 0.15, t + 0.15, x);\n\n float c = 0.4 * contrast;\n float tone = smoothstep(c + 0.03, 1.03 - c, mix(la, lb, s) + 0.08 * grain * g);\n vec4 ink = mix(shadowInk, highlightInk, tone);\n\n \n vec4 base = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), s);\n if (base.a <= 0.0) return vec4(0.0);\n return vec4(mix(base.rgb / base.a, ink.rgb, amount * ink.a), 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","EchoSlide":"// EchoSlide — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/EchoSlide.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image slides away leaving a trail of discrete fading copies of itself, a stroboscopic echo, and the incoming image's echoes converge 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 vec2 direction; \n\nuniform int echoes; \n\nuniform float trail; \n\nuniform float decay; \n\nconst float EDGE = 0.002;\nconst int MAX_ECHOES = 7;\n\nfloat easeInOut(float t) {\n return t * t * (3.0 - 2.0 * t);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat past(float s, float x) {\n return x <= 0.0 ? 1.0 : x >= 1.0 ? 0.0 : clamp((s - x) / EDGE + 0.5, 0.0, 1.0);\n}\n\nfloat edgeAt(float t) {\n return easeInOut(clamp(t, 0.0, 1.0));\n}\n\nvec4 echoStep(vec2 uv, float s, vec2 shift, float j, float t0, float lag, float n) {\n float e0 = edgeAt(t0 + j * lag);\n float e1 = edgeAt(t0 + (j + 1.0) * lag);\n vec4 a = getFromColor(mirror(uv - shift * e0));\n vec4 b = getToColor(mirror(uv - shift * (e1 - 1.0)));\n vec4 c = mix(b, a, pow((j + 0.5) / n, 0.5 + 2.0 * clamp(decay, 0.0, 1.0)));\n c.rgb *= 1.0 - 0.25 * exp(-max(e1 - s, 0.0) / 0.02) * min((e1 - e0) / 0.02, 1.0);\n return c;\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 \n float ext = abs(d.x) + abs(d.y);\n vec2 shift = d * ext;\n float s = 0.5 + dot(uv - 0.5, d) / ext;\n\n float n = clamp(float(echoes), 1.0, float(MAX_ECHOES));\n float tr = clamp(trail, 0.05, 0.6);\n float lag = tr / n;\n \n \n \n float t0 = progress >= 1.0 ? 1.0 : progress * (1.0 + tr) - tr;\n float eIn = edgeAt(t0);\n float eOut = edgeAt(t0 + tr);\n\n float wIn = 1.0 - past(s, eIn);\n float wOut = past(s, eOut);\n float wGap = max(1.0 - wIn - wOut, 0.0);\n vec4 c = vec4(0.0);\n if (wGap > 0.0) {\n float jf = 0.0;\n for (int k = 1; k < MAX_ECHOES; k++) {\n float m = float(k);\n if (m >= n) break;\n jf += past(s, edgeAt(t0 + m * lag));\n }\n float j = floor(jf);\n c = echoStep(uv, s, shift, j, t0, lag, n);\n if (jf > j) c = mix(c, echoStep(uv, s, shift, j + 1.0, t0, lag, n), jf - j);\n c *= wGap;\n }\n if (wIn > 0.0) c += wIn * getToColor(mirror(uv - shift * (eIn - 1.0)));\n if (wOut > 0.0) c += wOut * getFromColor(mirror(uv - shift * eOut));\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","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","EqualizerWipe":"// EqualizerWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/EqualizerWipe.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image rises from the bottom of the frame in vertical bars that bounce up and down like an audio equalizer, lit in segments and each topped by a floating peak cap that falls back slowly, their average level climbing until they 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 int bars; \n\nuniform float bounce; \n\nuniform int segments; \n\nuniform vec4 capColor; \n\nconst float PI = 3.141592653589793;\nconst float AA = 0.0015;\nconst float CAP = 0.012;\nconst float CAP_GAP = 0.008;\n\nfloat hash11(float n) {\n n = fract(n * 0.1031);\n n *= n + 33.33;\n n *= n + n;\n return fract(n);\n}\n\nfloat level(float i, vec4 k, float lead, float t, float amp) {\n t = clamp(t, 0.0, 1.0);\n float env = sin(PI * t);\n float ramp = t * t * (3.0 - 2.0 * t);\n float base = mix(-0.03, 1.04, mix(t, ramp, 0.3));\n float w = 2.0 * PI * t;\n float osc = 0.5 * sin(w * k.x + k.y) + 0.3 * sin(w * k.z + k.w) + 0.2 * sin(w * 2.2 - 0.55 * i);\n return base + amp * env * (osc + lead);\n}\n\nvec4 transition(vec2 uv) {\n float n = float(bars < 1 ? 1 : bars);\n float amp = max(bounce, 0.0);\n float x = uv.x * n;\n float i = min(floor(x), n - 1.0);\n float fx = x - i;\n float aaX = AA * n / ratio;\n\n vec4 k = vec4(\n 3.0 + 1.5 * hash11(i + 3.0), 2.0 * PI * hash11(i),\n 5.5 + 2.0 * hash11(i + 7.0), 2.0 * PI * hash11(i + 11.0)\n );\n float lead = 0.35 * (hash11(i + 19.0) - 0.5);\n float h = level(i, k, lead, progress, amp);\n \n float peak = h;\n for (int j = 1; j < 12; j++) {\n float dt = float(j) * 0.012;\n float fall = max(dt - 0.03, 0.0);\n peak = max(peak, level(i, k, lead, progress - dt, amp) - 60.0 * fall * fall);\n }\n float capY = peak + CAP_GAP;\n\n \n float open = 1.0 - smoothstep(0.72, 0.97, progress);\n float gap = 0.09 * open;\n float side = min(fx, 1.0 - fx);\n float inGap = clamp((gap - side) / (2.0 * aaX) + 0.5, 0.0, 1.0) * min(gap / aaX, 1.0);\n float barX = 1.0 - inGap;\n\n vec4 b = getToColor(uv);\n float fill;\n float lit;\n if (segments > 0) {\n float segs = float(segments);\n float above = h * segs - floor(uv.y * segs);\n fill = clamp(above, 0.0, 1.0);\n lit = 1.0 - clamp(above - 1.0, 0.0, 1.0);\n float seam = abs(fract(uv.y * segs) - 0.5) * 2.0;\n float aaS = AA * segs * 2.0;\n b.rgb *= 1.0 - 0.38 * open * smoothstep(0.78 - aaS, 0.78 + aaS, seam);\n } else {\n fill = 1.0 - smoothstep(h - AA, h + AA, uv.y);\n lit = 1.0 - smoothstep(0.0, 0.04, h - uv.y);\n }\n b.rgb += 0.2 * open * lit * (1.0 - b.rgb);\n float across = 2.0 * fx - 1.0;\n b.rgb *= 1.0 - 0.15 * open * across * across;\n float m = barX * fill;\n\n vec4 a = getFromColor(uv);\n float beside = (1.0 - smoothstep(0.0, gap, gap - side)) * (1.0 - smoothstep(h - 0.01, h + 0.01, uv.y));\n float under = barX * smoothstep(capY - 0.025, capY, uv.y) * (1.0 - smoothstep(capY - AA, capY + AA, uv.y));\n a.rgb *= 1.0 - open * (0.35 * inGap * beside + 0.4 * under);\n\n \n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n\n float cap = barX * smoothstep(capY - AA, capY + AA, uv.y) * (1.0 - smoothstep(capY + CAP - AA, capY + CAP + AA, uv.y));\n cap *= capColor.a * smoothstep(0.0, 0.05, progress) * (1.0 - smoothstep(0.95, 1.0, progress));\n c = mix(c, vec4(capColor.rgb, 1.0), cap);\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","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 float cut = two ? 0.3 : 0.42;\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 float y = uv.y - MEET;\n float d = rim - max(y / (1.0 - MEET), -y / MEET);\n float s = 1.0 - smoothstep(0.0, soft, d);\n float lid = s * s;\n if (lid >= 1.0) return color;\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 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 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","FacetedGlass":"// FacetedGlass — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FacetedGlass.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is seen through a pane of irregular cut-glass facets, each one showing its own shifted, zoomed and tilted view of the image, with bright beveled edges and thin dark seams; the facets turn to the incoming image one by one, then the glass flattens out 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 facets; \n\nuniform float refraction; \n\nuniform float bevel; \n\nuniform vec4 highlight; \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\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n float h = 1.0 - abs(2.0 * progress - 1.0);\n float amount = h * h * (3.0 - 2.0 * h);\n\n float n = max(facets, 1.0);\n vec2 aspect = vec2(ratio, 1.0);\n \n vec2 p = uv * aspect * n;\n vec2 i = floor(p);\n vec2 f = p - i;\n vec2 offset = vec2(17.31, 41.97) * seed;\n float bw = 0.18 * amount;\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 + 0.1 + 0.8 * 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 vec2 normal = vec2(0.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 + 0.1 + 0.8 * hash22(i + g + offset) - f;\n vec2 dr = r - mr;\n if (dot(dr, dr) > 0.00001) {\n vec2 dn = normalize(dr);\n float e = dot(0.5 * (mr + r), dn);\n edge = min(edge, e);\n float w = max(1.0 - e / bw, 0.0);\n normal += dn * w * w;\n }\n }\n }\n float nl = length(normal);\n normal = nl > 0.0 ? normal / nl : vec2(0.0);\n\n vec2 id = i + mg + offset;\n vec2 h1 = hash22(id + 31.7);\n vec2 h2 = hash22(id + 59.3);\n vec2 h3 = hash22(id + 97.1);\n float angle = 6.2831853 * h1.x;\n vec2 dir = vec2(cos(angle), sin(angle));\n vec2 shift = dir * (0.4 + 0.6 * h1.y) * refraction;\n float zoom = (h2.x - 0.5) * 6.0 * refraction;\n float tilt = (h2.y - 0.5) * 2.0 * refraction;\n\n vec2 q = -mr / n;\n vec2 view = -q * zoom + vec2(-q.y, q.x) * sin(tilt) + q * (cos(tilt) - 1.0);\n\n float bv = 1.0 - smoothstep(0.0, bw, edge);\n bv *= bv;\n vec2 bend = normal * bv * 0.4 * refraction;\n\n float start = 0.15 + 0.5 * h3.x;\n float m = smoothstep(start, start + 0.2, progress);\n vec2 d = amount * (view + bend);\n vec2 s = amount * shift;\n vec4 ca = getFromColor(mirror(uv + (s + d) / aspect));\n vec4 cb = getToColor(mirror(uv + (d - s) / aspect));\n \n vec4 c = mix(vec4(ca.rgb * ca.a, ca.a), vec4(cb.rgb * cb.a, cb.a), m);\n\n vec2 light = normalize(vec2(-0.6, 0.8));\n vec2 slope = dir * (0.4 + 0.6 * h1.y);\n float facetLight = 0.12 * amount * dot(slope, light);\n float lit = dot(normal, light);\n float k = clamp(bevel, 0.0, 1.0);\n float glow = k * bv * max(lit, 0.0) * 1.1 * amount;\n float shade = k * bv * max(-lit, 0.0) * 0.6 * amount;\n float turn = sin(3.14159265 * m);\n glow += k * 0.15 * amount * turn * turn;\n float seam = 0.6 * amount * (1.0 - smoothstep(0.0, 2.0 * AA, edge / n - 0.5 * AA));\n\n c.rgb *= (1.0 + facetLight) * (1.0 - shade) * (1.0 - seam);\n c.rgb += highlight.rgb * highlight.a * glow * c.a;\n return c.a > 0.0 ? vec4(clamp(c.rgb / c.a, 0.0, 1.0), 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","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","Faint":"// Faint — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Faint.glsl\n// Author: gre\n// License: MIT\n// Description: The viewer faints: the outgoing image splits into two swaying copies of itself and blurs while the edges of the view darken and close in, in two heartbeat throbs, down to a last pinpoint of light; the incoming image comes back blurred and doubled through a narrow tunnel, which widens again in throbs as the two copies drift together and lock\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 separation; \n\nuniform float blur; \n\nuniform vec4 color; \n\nconst int TAPS = 8;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 image(vec2 uv, bool incoming) {\n vec4 c = incoming ? getToColor(mirror(uv)) : getFromColor(mirror(uv));\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 soft(vec2 uv, float r, bool incoming) {\n vec4 s = 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 s += image(uv + sqrt(k / float(TAPS)) * vec2(cos(a) / ratio, sin(a)) * r, incoming);\n }\n return s / float(TAPS);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n bool incoming = p >= 0.5;\n \n float a = incoming ? 2.0 - 2.0 * p : 2.0 * p;\n float g = incoming ? a * sqrt(a) : a;\n \n float closing = g - sin(12.566371 * g) / 12.566371;\n float sway = sin(9.0 * p + 1.3);\n vec2 off = separation * smoothstep(0.0, 0.5, a) * vec2(1.0, 0.25 * sway) * vec2(1.0 / ratio, 1.0);\n float r = 0.03 * blur * a;\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float d = length(q) / (0.5 * length(vec2(ratio, 1.0)));\n \n \n float R = mix(1.8, 0.05, closing);\n float v = smoothstep(0.6 * R - 0.02, R + 0.001, d);\n if (v >= 1.0) return color;\n vec4 c;\n if (a <= 0.0) c = image(uv, incoming);\n else {\n c = 0.5 * (soft(uv + off, r, incoming) + soft(uv - off, r, incoming));\n \n float w = smoothstep(0.46, 0.54, p);\n if (w > 0.0 && w < 1.0) {\n vec4 other = 0.5 * (soft(uv + off, r, !incoming) + soft(uv - off, r, !incoming));\n c = incoming ? mix(other, c, w) : mix(c, other, w);\n }\n }\n c = c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n float lum = dot(c.rgb, vec3(0.2126, 0.7152, 0.0722));\n c.rgb = mix(c.rgb, vec3(lum), 0.5 * a) * (1.0 - 0.3 * a);\n return mix(c, color, v);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 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 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","FalseReflection":"// FalseReflection — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FalseReflection.glsl\n// Author: gre\n// License: MIT\n// Description: The lower half of the outgoing picture turns to rippling water that reflects the incoming one instead; the whole world then turns upside down around the waterline, the reflection becomes real and the old picture is left shimmering in the water, until the water clears and goes still\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 ripples; \n\nuniform float tint; \n\nuniform int clockwise; \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 pm(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 float near = smoothstep(0.0, 0.22, p) * (1.0 - smoothstep(0.78, 1.0, p));\n float a = PI * smoothstep(0.2, 0.8, p) * ((clockwise != 0) ? -1.0 : 1.0);\n float ca = cos(a), sa = sin(a);\n \n float zoom = sqrt(ca * ca + 0.02 * sa * sa) + abs(sa) * max(ratio, 1.0 / ratio);\n vec2 q = (uv - 0.5) * asp / zoom;\n \n vec2 s = vec2(ca * q.x + sa * q.y, ca * q.y - sa * q.x);\n\n float d = abs(s.y);\n float low = 1.0 - smoothstep(-0.0015, 0.0015, s.y);\n float upright = smoothstep(-0.4, 0.4, ca);\n float wet = near * mix(1.0 - upright, upright, low);\n \n float lz = log(d + 0.04);\n float w1 = sin(lz * 17.0 + p * 34.0 + 2.5 * sin(s.x * 4.0 + p * 6.0));\n float w2 = sin(lz * 31.0 + p * 47.0 - s.x * 9.0 + 2.0 * sin(s.x * 7.0 - p * 5.0));\n float wave = w1 + 0.6 * w2;\n s += vec2(0.012, 0.02) * wave * wet * ripples * smoothstep(0.0, 0.2, d);\n\n float field = 0.5 * sin(lz * 9.0 + p * 10.0 + 2.0 * sin(s.x * 3.5 + 1.0)) + 0.35 * sin(lz * 15.0 - p * 9.0 + s.x * 8.0) + 0.15 * w2;\n vec2 x = clamp(vec2(1.0 - p, p) / 0.3, 0.0, 1.0);\n \n vec2 t = x * (1.0 + x - x * x);\n t.x = 1.0 - t.x;\n vec2 shown = smoothstep(-0.25, 0.25, field - 1.26 + 2.52 * t);\n float m = mix(shown.x, shown.y, low);\n\n vec4 c = mix(pm(getFromColor(mirror(s / asp + 0.5))), pm(getToColor(mirror(0.5 - s / asp))), m);\n c.rgb *= mix(vec3(1.0), vec3(0.66, 0.84, 0.95), wet * tint);\n c.rgb *= 1.0 - 0.5 * wet * tint * exp(-d * 25.0);\n c.rgb += 0.12 * c.a * wet * ripples * smoothstep(0.8, 1.5, wave) * smoothstep(0.0, 0.1, d);\n c.rgb += 0.5 * c.a * ripples * near * exp(-d * 180.0);\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","FieldReversal":"// FieldReversal — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FieldReversal.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture combs itself into thousands of small colored needles lined up on the field between two magnetic poles; the poles wheel round half a turn, every needle swings with the field and rolls over to the incoming picture's color as it reverses, and the needles sharpen back into the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 needles; \n\nuniform float stretch; \n\nuniform float relief; \n\nconst float PI = 3.141592653589793;\nconst float START = 0.35;\nconst float POLE = 0.3;\nconst vec2 LIGHT = vec2(0.5547, 0.8321);\n\nvec2 hash2(vec2 p) {\n vec3 q = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n q += dot(q, q.yzx + 33.33);\n return fract((q.xx + q.yz) * q.zy);\n}\n\nvec2 pole(float a) {\n return POLE * vec2(cos(a), sin(a));\n}\n\nvec2 field(vec2 x, vec2 d) {\n vec2 u = x - d, v = x + d;\n vec2 f = u / (dot(u, u) + 0.004) - v / (dot(v, v) + 0.004);\n return f / max(length(f), 1e-4);\n}\n\nfloat hold(vec2 x, vec2 d) {\n float far = min(length(x - d), length(x + d));\n float late = 0.08 * far / (far + 0.4);\n float y = clamp((min(progress, 1.0 - progress) - late) / 0.2, 0.0, 1.0);\n \n return y * (1.0 + y - y * y);\n}\n\nvec4 pm(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nstruct Needle {\n float rank;\n float cover;\n float side;\n float lit;\n vec2 at;\n};\n\nvec4 over(vec4 col, Needle k, vec2 s) {\n vec2 uv = clamp(k.at / s + 0.5, 0.0, 1.0);\n vec4 c = pm(k.side > 0.0 ? getFromColor(uv) : getToColor(uv));\n c.rgb *= 1.0 + k.lit;\n return mix(col, c, k.cover);\n}\n\nvec4 transition(vec2 uv) {\n vec2 s = vec2(ratio, 1.0) / min(ratio, 1.0);\n vec2 x = (uv - 0.5) * s;\n float n = max(needles, 1.0);\n float e = smoothstep(0.09, 0.91, progress);\n vec2 d0 = pole(START), d1 = pole(START + PI * (e + 0.03 * sin(2.0 * PI * e)));\n vec2 cell = floor(x * n);\n float px = 0.04 + 0.002 * n;\n\n \n Needle k1 = Needle(-1.0, 0.0, 1.0, 0.0, x), k2 = k1, k3 = k1;\n for (int j = -2; j <= 2; j++) {\n for (int i = -2; i <= 2; i++) {\n vec2 id = cell + vec2(float(i), float(j));\n vec2 h = hash2(id + 107.0);\n if (h.x <= k3.rank) continue;\n vec2 c = (id + 0.15 + 0.7 * h) / n;\n vec2 b = field(c, d1);\n vec2 d = (x - c) * n;\n float u = dot(d, b) / clamp(stretch, 0.1, 2.0);\n float v = b.x * d.y - b.y * d.x;\n if (abs(u) >= 1.0 || abs(v) >= 0.5) continue;\n float turned = dot(b, field(c, d0));\n \n float w = 0.5 * mix(0.45, 1.0, smoothstep(0.0, 0.5, abs(turned)));\n float cov = clamp((w * sqrt(1.0 - u * u) - abs(v)) / px, 0.0, 1.0);\n if (cov <= 0.0) continue;\n float g = hold(c, d0);\n float sheen = 1.0 - dot(b, LIGHT) * dot(b, LIGHT);\n float lit = g * relief * ((0.28 * sheen * sheen + 0.1) * (1.0 - 2.0 * abs(v / w)) + 0.35 * v / w * b.x + 0.1 * u - 0.06);\n Needle k = Needle(h.x, cov, turned, lit, mix(x, c, g));\n if (h.x > k1.rank) {\n k3 = k2;\n k2 = k1;\n k1 = k;\n } else if (h.x > k2.rank) {\n k3 = k2;\n k2 = k;\n } else {\n k3 = k;\n }\n }\n }\n\n float g = hold(x, d0);\n vec4 col = mix(pm(getToColor(uv)), pm(getFromColor(uv)), smoothstep(-0.15, 0.15, dot(field(x, d1), field(x, d0))));\n col.rgb *= 1.0 - 0.65 * g;\n k2.lit -= 0.35 * g * relief;\n k3.lit -= 0.5 * g * relief;\n col = over(over(over(col, k3, s), k2, s), k1, s);\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","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\n float t = mix(progress, smoothstep(0.0, 1.0, progress), smoothness);\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","FilmLeader":"// FilmLeader — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FilmLeader.glsl\n// Author: gre\n// License: MIT\n// Description: A clock hand sweeps the outgoing image away to reveal a scratched film countdown, with crosshair rings and big numbers counting down, each sweep wiping in the next one, and the last sweep reveals the incoming image in its wake\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 float wear; \n\nuniform vec4 leaderColor; \n\nuniform vec4 inkColor; \n\nconst float PI = 3.141592653589793;\nconst float TAU = 6.283185307179586;\nconst float AA = 0.0015;\n\nfloat hash11(float n) {\n n = fract(n * 0.1031);\n n *= n + 33.33;\n n *= n + n;\n return fract(n);\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 segment(vec2 p, vec2 a, vec2 b) {\n vec2 pa = p - 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 arc(vec2 p, vec2 c, float r, float mid, float halfAngle) {\n vec2 q = p - c;\n float t = PI * 0.5 - mid;\n q = vec2(q.x * cos(t) - q.y * sin(t), q.x * sin(t) + q.y * cos(t));\n q.x = abs(q.x);\n vec2 sc = vec2(sin(halfAngle), cos(halfAngle));\n return sc.y * q.x > sc.x * q.y ? length(q - sc * r) : abs(length(q) - r);\n}\n\nfloat numeral(vec2 p, float n) {\n float w = 0.14;\n float top = 1.0 - w;\n float bottom = -1.0 + w;\n if (n < 1.5) {\n return min(segment(p, vec2(0.08, bottom), vec2(0.08, top)), segment(p, vec2(0.08, top), vec2(-0.32, 0.62)));\n }\n if (n < 2.5) {\n float d = arc(p, vec2(0.0, 0.42), 0.44, 1.05, 1.75);\n d = min(d, segment(p, vec2(0.337, 0.137), vec2(-0.46, bottom)));\n return min(d, segment(p, vec2(-0.46, bottom), vec2(0.5, bottom)));\n }\n if (n < 3.5) {\n float d = arc(p, vec2(0.0, 0.47), 0.40, 0.6, 2.35);\n return min(d, arc(p, vec2(0.0, -0.42), 0.46, -0.6, 2.35));\n }\n if (n < 4.5) {\n float d = segment(p, vec2(0.26, bottom), vec2(0.26, top));\n d = min(d, segment(p, vec2(0.26, top), vec2(-0.52, -0.36)));\n return min(d, segment(p, vec2(-0.52, -0.36), vec2(0.56, -0.36)));\n }\n float d = segment(p, vec2(-0.36, top), vec2(0.46, top));\n d = min(d, segment(p, vec2(-0.36, top), vec2(-0.40, 0.06)));\n return min(d, arc(p, vec2(0.0, -0.40), 0.52, -0.09, 2.5));\n}\n\nvec3 leaderFrame(vec2 q, float n, float px) {\n float tone = mod(n, 2.0) < 0.5 ? 0.86 : 1.0;\n vec3 c = leaderColor.rgb * tone;\n float r = length(q);\n float aa = AA * px;\n float ink = 1.0 - smoothstep(0.003 - aa, 0.003 + aa, abs(r - 0.31));\n ink = max(ink, 1.0 - smoothstep(0.0045 - aa, 0.0045 + aa, abs(r - 0.37)));\n ink = max(ink, 1.0 - smoothstep(0.0015 - aa, 0.0015 + aa, min(abs(q.x), abs(q.y))));\n float d = numeral(q / 0.21, n) * 0.21 - 0.031;\n float num = 1.0 - smoothstep(-aa, aa, d);\n float disc = 1.0 - smoothstep(0.31 - 0.003 - aa, 0.31 - 0.003, r);\n ink = max(ink * (1.0 - disc), num);\n c *= 1.0 + 0.06 * disc;\n return mix(c, inkColor.rgb, ink * inkColor.a);\n}\n\nvec4 transition(vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n\n float n = clamp(float(count), 1.0, 5.0);\n float sweeps = n + 1.0;\n float e = progress - 0.35 * sin(TAU * progress) / TAU;\n float t = e * sweeps;\n float k = min(floor(t), sweeps - 1.0);\n float f = t - k;\n\n float frame = floor(progress * 12.0 * sweeps);\n float weave = wear * 0.0015;\n vec2 jitter = vec2(hash11(frame * 1.3 + 0.7) - 0.5, hash11(frame * 2.1 + 5.3) - 0.5) * weave;\n float s = min(ratio, 1.0);\n vec2 p = vec2((uv.x - 0.5) * ratio, uv.y - 0.5);\n vec2 q = (p + jitter) / s;\n float px = 1.0 / s;\n\n \n float ha = f * TAU;\n vec2 dir = vec2(sin(ha), cos(ha));\n float along = dot(p, dir);\n \n float across = dot(p, vec2(-dir.y, dir.x));\n \n \n \n \n float dWedge = f <= 0.5 ? min(p.x, across) : max(p.x, across);\n dWedge += AA * (smoothstep(0.9, 1.0, f) - 1.0 + smoothstep(0.0, 0.1, f));\n float behind = clamp(dWedge / AA + 0.5, 0.0, 1.0);\n\n \n \n float ahead = k;\n float swept = k + 1.0;\n bool aheadLeader = ahead > 0.5;\n bool sweptLeader = swept < sweeps - 0.5;\n float ang = dot(p, p) > 0.0 ? fract(atan(p.x, p.y) / TAU + 1.0) : 0.0;\n float nearCenter = smoothstep(0.0, 0.05, length(p) / s);\n vec3 aheadColor = from.rgb;\n float aheadAlpha = from.a;\n if (behind < 1.0 && aheadLeader) {\n aheadColor = leaderFrame(q, n - ahead + 1.0, px) * (1.0 - 0.18 * exp(-(f + 1.0 - ang) * TAU * 2.5) * nearCenter);\n aheadAlpha = leaderColor.a;\n }\n vec3 sweptColor = to.rgb;\n float sweptAlpha = to.a;\n if (behind > 0.0 && sweptLeader) {\n sweptColor = leaderFrame(q, n - swept + 1.0, px) * (1.0 - 0.18 * exp(-max(f - ang, 0.0) * TAU * 2.5) * nearCenter);\n sweptAlpha = leaderColor.a;\n }\n vec3 c = mix(aheadColor, sweptColor, behind);\n float a = mix(aheadAlpha, sweptAlpha, behind);\n float onLeader = mix(aheadLeader ? 1.0 : 0.0, sweptLeader ? 1.0 : 0.0, behind);\n\n float env = smoothstep(0.0, 0.1, progress) * (1.0 - smoothstep(0.9, 1.0, progress));\n float amount = wear * mix(0.35 * env, 1.0, onLeader);\n vec2 cell = floor(uv * vec2(ratio, 1.0) * 300.0);\n c += (hash12(cell + frame * 37.0) - 0.5) * 0.09 * amount;\n for (int i = 0; i < 4; i++) {\n float fi = float(i);\n float seg = floor(frame / 3.0);\n float on = step(0.45, hash11(seg * 7.0 + fi * 13.0 + 1.0));\n float x = hash11(fi * 3.7 + 2.0) + 0.04 * (hash11(seg + fi * 5.1) - 0.5);\n float dx = abs(uv.x - x) * ratio;\n float line = 1.0 - smoothstep(0.0, 0.0008 + AA * 0.5, dx);\n float fade = 0.6 + 0.4 * sin(uv.y * (5.0 + fi) + fi * 2.0 + seg);\n c = mix(c, vec3(1.0), line * on * fade * 0.55 * amount);\n }\n vec2 grid = vec2(9.0, 6.0);\n vec2 dc = floor(uv * grid);\n float h = hash12(dc + frame * 17.0);\n vec2 center = (dc + 0.2 + 0.6 * vec2(h, hash12(dc.yx + frame * 11.0 + 3.0))) / grid;\n float speck = 1.0 - smoothstep(0.0015, 0.0015 + AA, length((uv - center) * vec2(ratio, 1.0)) - 0.002 * h);\n c *= 1.0 - speck * step(0.9, h) * 0.85 * amount;\n float lamp = 1.0 - 0.06 * (hash11(frame + 0.5) - 0.5) * wear;\n lamp *= 1.0 - 0.35 * smoothstep(0.35, 0.95, length(q));\n c *= mix(1.0, lamp, onLeader);\n\n float handOn = smoothstep(0.0, 0.03, progress) * (1.0 - smoothstep(0.97, 1.0, progress));\n float handW = 0.0022 * s;\n float hand = (1.0 - smoothstep(handW - AA, handW + AA, abs(across))) * step(0.0, along);\n float shadow = exp(-max(across, 0.0) / (0.012 * s)) * step(0.0, across) * step(0.0, along) * 0.35;\n c *= 1.0 - shadow * handOn;\n c = mix(c, inkColor.rgb, hand * handOn * inkColor.a);\n a = mix(a, max(a, inkColor.a), hand * handOn);\n return vec4(clamp(c, 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","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;\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 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 float n = max(float(frames), 1.0);\n float pitch = 1.0 + FRAME_LINE;\n float p = progress;\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 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 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 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 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 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;\nconst float PAD = 0.3;\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 float rise = height * dir.y;\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 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 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 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 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 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 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 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 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 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 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 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","FlowDissolve":"// FlowDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FlowDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: Both images ride one current full of eddies: a sharp front sweeps across it and is wound into curls by every eddy it crosses, the outgoing image carried downstream ahead of it while the incoming one pours in behind, until the incoming image settles 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 vec2 direction; \n\nuniform float travel; \n\nuniform float swirl; \n\nuniform float seed; \n\nconst int STEPS = 16;\nconst float PI = 3.141592653589793;\nconst float CELL = 0.5;\nconst float R = 0.17;\n\nconst float GAMMA = 9.0;\nconst float FRONT_TIME = 1.12;\n\nvec3 hash(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yxz + 33.33);\n return fract((p3.xxy + p3.yzz) * p3.zyx);\n}\n\nvec2 flow(vec2 x, vec2 drift) {\n vec2 q = x / CELL;\n vec2 i0 = floor(q);\n vec2 v = drift;\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n vec2 c = i0 + vec2(float(i), float(j));\n vec3 h = hash(c + 47.0 * seed);\n vec2 r = (q - c - 0.5 - 0.4 * (h.xy - 0.5)) * CELL;\n float g = (h.z < 0.5 ? -1.0 : 1.0) * (0.7 + 0.6 * abs(h.z - 0.5)) * exp(-dot(r, r) / (R * R));\n v += swirl * GAMMA * g * vec2(-r.y, r.x);\n }\n }\n return v;\n}\n\nvec2 fold(vec2 p, vec2 s) {\n vec2 u = p / s + 0.5;\n return 1.0 - abs(1.0 - mod(u, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n vec2 d = normalize(direction);\n vec2 s = vec2(ratio, 1.0) / min(ratio, 1.0);\n vec2 x = (uv - 0.5) * s;\n float e = progress * progress * (3.0 - 2.0 * progress);\n float ha = -travel * e / float(STEPS);\n float hb = travel * (1.0 - e) / float(STEPS);\n float hf = -FRONT_TIME / float(STEPS) * sin(PI * progress);\n vec2 xa = x, xb = x, xf = x;\n vec4 a = vec4(0.0), b = vec4(0.0);\n float wsum = 0.0;\n for (int i = 1; i <= STEPS; i++) {\n xa += ha * flow(xa, 0.5 * d);\n xb += hb * flow(xb, 0.5 * d);\n xf += hf * flow(xf + 0.5 * hf * flow(xf, vec2(0.0)), vec2(0.0));\n float t = float(i) / float(STEPS);\n \n float t2 = t * t, t4 = t2 * t2;\n float w = 0.02 + t4 * t4;\n vec4 ca = getFromColor(fold(xa, s));\n vec4 cb = getToColor(fold(xb, s));\n \n a += w * vec4(ca.rgb * ca.a, ca.a);\n b += w * vec4(cb.rgb * cb.a, cb.a);\n wsum += w;\n }\n \n float ext = 0.5 * dot(abs(d), s) + 0.02;\n float f = mix(-ext, ext, 0.5 * (progress + e)) - dot(xf, d);\n float m = smoothstep(-0.006, 0.006, f);\n vec4 c = mix(a, b, m) / wsum;\n c.rgb *= 1.0 - 0.3 * (1.0 - m) * exp(-abs(f) / 0.03) * sin(PI * progress);\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","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","Flutter":"// Flutter — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Flutter.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is let go and falls like a sheet of paper: it tips back and sinks while gliding from side to side, its leading edge dipping and rising at the end of each swing, until it drops out of the bottom of the frame, casting a shadow 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 swings; \n\nuniform float sway; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\nconst vec3 EYE = vec3(0.0, 0.0, -2.0);\nconst float TILT = 1.05;\nconst float BANK = 0.35;\nconst float YAW = 0.45;\nconst float BEND = 0.07;\nconst float DEPTH = 0.65;\n\nmat3 rotX(float a) { float c = cos(a), s = sin(a); return mat3(1.0, 0.0, 0.0, 0.0, c, s, 0.0, -s, c); }\nmat3 rotY(float a) { float c = cos(a), s = sin(a); return mat3(c, 0.0, -s, 0.0, 1.0, 0.0, s, 0.0, c); }\n\nmat3 pose(float env, float side, float vel) {\n return rotY(YAW * vel) * rotX(TILT * env) * rotY(BANK * side);\n}\n\nvec2 curl(float x, float env) {\n float w = 0.5 * ratio;\n float u = clamp(x / w, -1.0, 1.0);\n float a = BEND * env * min(ratio, 1.0);\n return vec2(a * (u * u - 1.0 / 3.0), 2.0 * a * u / w);\n}\n\nvec3 onSheet(vec3 o, vec3 d, vec3 C, mat3 R, float env) {\n vec3 n = R[2];\n float dn = dot(d, n);\n dn = abs(dn) < 1e-4 ? 1e-4 : dn;\n vec3 q = vec3(0.0);\n for (int i = 0; i < 3; i++) {\n float k = dot(C - n * curl(q.x, env).x - o, n) / dn;\n vec3 h = o + k * d - C;\n q = vec3(dot(h, R[0]), dot(h, R[1]), k);\n }\n return q;\n}\n\nfloat sheetMask(vec3 q, vec2 aa) {\n vec2 e = abs(q.xy) - vec2(0.5 * ratio, 0.5);\n return (1.0 - smoothstep(-aa.x, aa.x, e.x)) * (1.0 - smoothstep(-aa.y, aa.y, e.y)) * step(0.0, q.z);\n}\n\nvec4 sheetColor(vec3 q) {\n return getFromColor(clamp(vec2(q.x / ratio, q.y) + 0.5, 0.0, 1.0));\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n float env = smoothstep(0.0, 0.4, t);\n float ph = 2.0 * PI * swings * t;\n float side = sin(ph) * env;\n float vel = cos(ph) * env;\n \n float lift = 0.35 * sway;\n float focal = -EYE.z;\n\n \n mat3 R1 = pose(1.0, sin(2.0 * PI * swings), cos(2.0 * PI * swings));\n float drop = 0.0;\n for (int i = 0; i < 4; i++) {\n vec2 c = vec2(i < 2 ? -0.5 * ratio : 0.5 * ratio, mod(float(i), 2.0) - 0.5);\n vec3 o = R1 * vec3(c, 0.0) - R1[2] * BEND * min(ratio, 1.0);\n drop = max(drop, 0.51 * (focal + DEPTH + o.z) / focal + o.y);\n }\n drop += lift;\n\n vec3 C = vec3(\n sway * side,\n -drop * t * t * (0.3 + 0.7 * t) + lift * side * side,\n DEPTH * (0.45 * env + 0.55 * t * t)\n );\n mat3 R = pose(env, side, vel);\n\n vec2 p = vec2((uv.x - 0.5) * ratio, uv.y - 0.5);\n vec3 d = vec3(p, focal);\n vec3 q = onSheet(EYE, d, C, R, env);\n \n vec2 aa = (0.0001 + 0.0025 * env * (1.0 + C.z / focal)) * vec2(1.0, 1.0 / cos(TILT * env));\n float m = sheetMask(q, aa);\n\n float gap = 1.0 - 0.7 * t;\n vec3 qs = onSheet(EYE, vec3(p - vec2(0.07, -0.14) * gap * env, focal), C, R, env);\n float sh = sheetMask(qs, vec2(0.01 + 0.1 * gap)) * sheetColor(qs).a * env;\n vec4 bg = getToColor(uv);\n bg.rgb *= 1.0 - 0.75 * shading * sh;\n\n vec4 img = sheetColor(q);\n vec3 N = normalize(R * vec3(-curl(q.x, env).y, 0.0, -1.0));\n vec3 K = normalize(vec3(-0.4, 0.3, -1.0));\n float lit = min(max(dot(N, K), 0.0) / -K.z, 1.0);\n float spec = pow(max(dot(N, normalize(K + normalize(-d))), 0.0), 30.0);\n img.rgb = min(img.rgb * mix(1.0, lit, shading * env) + 0.3 * shading * env * spec, 1.0);\n return mix(bg, img, 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","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","FrostWipe":"// FrostWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FrostWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Ice crystals grow in from the edges of the frame with feathery, branching fronts, frosting the outgoing image white and blurry until it is covered, then thaw back out to the edges 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 spread; \n\nuniform float scale; \n\nuniform float blur; \n\nuniform vec4 color; \n\nconst int TAPS = 12;\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 ridged(vec2 v) {\n float sum = 0.0;\n float amp = 0.5;\n for (int i = 0; i < 4; i++) {\n float n = 1.0 - abs(2.0 * vnoise(v) - 1.0);\n sum += amp * n * n;\n v = mat2(1.6, 1.2, -1.2, 1.6) * v + 4.7;\n amp *= 0.5;\n }\n return sum / 0.9375;\n}\n\nvec4 grains(vec2 v) {\n vec2 i = floor(v);\n vec2 f = fract(v);\n float d1 = 8.0;\n float d2 = 8.0;\n vec3 seed = vec3(0.0);\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 c = vec2(float(x), float(y));\n vec2 o = c + vec2(hash12(i + c), hash12(i + c + 17.3)) - f;\n float d = dot(o, o);\n if (d < d1) {\n d2 = d1;\n d1 = d;\n seed = vec3(hash12(i + c + 41.9), -o);\n } else if (d < d2) {\n d2 = d;\n }\n }\n }\n return vec4(sqrt(d2) - sqrt(d1), seed);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 image(vec2 uv, float m) {\n if (m <= 0.0) return getFromColor(uv);\n if (m >= 1.0) return getToColor(uv);\n return mix(getFromColor(uv), getToColor(uv), m);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float h = 1.0 - abs(2.0 * p - 1.0);\n float a = clamp(h / 0.85, 0.0, 1.0);\n a = a * (1.6 - 0.6 * a);\n float m = smoothstep(0.47, 0.53, p);\n if (a <= 0.0) return image(uv, m);\n\n vec2 q = uv * vec2(ratio, 1.0);\n vec2 dEdge = min(uv, 1.0 - uv) * vec2(ratio, 1.0);\n float depth = min(dEdge.x, dEdge.y) / (0.5 * min(ratio, 1.0));\n depth = 1.0 - (1.0 - depth) * (1.0 - depth); \n\n \n \n float reach = 0.2 + 0.6 * clamp(spread, 0.0, 1.0);\n float front = mix(-0.1, 1.0 + reach + 0.2, a);\n if (depth > front + 0.08) return image(uv, m);\n\n vec2 gv = q * scale;\n vec4 gr = grains(gv + 0.35 * vec2(vnoise(gv * 1.7), vnoise(gv * 1.7 + 23.1)));\n \n float u = 2.0 * gr.y - 1.0;\n vec2 dir = vec2(1.0 - u * u, 2.0 * u) / (1.0 + u * u);\n float t = dot(gr.zw, dir) * 7.0;\n float needle = 1.0 - abs(2.0 * fract(t) - 1.0);\n float nh = fract(gr.y + 0.618034 * floor(t));\n float len = mix(0.15, 0.6, nh);\n float r = ridged(gv * 1.3);\n float rf = ridged(gv * 4.0 + 11.0);\n float grow = min(gr.x * 3.5, gr.x / len * 0.5 + (1.0 - needle) * 1.2 + 0.2 * fract(nh * 13.7));\n float field = depth + reach * (0.8 * min(grow, 1.0) + 0.2 * (1.0 - r)) + 0.1 * (1.0 - rf);\n float inside = front - field; \n float f = smoothstep(0.0, 0.03, inside);\n float haze = 0.4 * smoothstep(0.9, 1.0, rf) * smoothstep(-0.08, 0.0, inside);\n float frost = max(f, haze);\n if (frost <= 0.0) return image(uv, m);\n\n float thick = smoothstep(0.0, 0.5, inside);\n float full = smoothstep(0.75, 0.95, h); \n\n float radius = (0.004 + 0.03 * blur) * frost * (0.5 + 0.5 * thick);\n float rot = 6.2831853 * hash12(floor(q * 90.0));\n vec3 rgb = vec3(0.0);\n float alpha = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float k = (float(i) + 0.5) / float(TAPS);\n float th = rot + float(i) * 2.3999632;\n vec2 off = sqrt(k) * vec2(cos(th), sin(th)) * radius;\n vec4 c = image(mirror(uv + off / vec2(ratio, 1.0)), m);\n rgb += c.rgb * c.a;\n alpha += c.a;\n }\n alpha /= float(TAPS);\n rgb = alpha > 0.0 ? rgb / (alpha * float(TAPS)) : vec3(0.0);\n\n float stem = 1.0 - smoothstep(0.0, 0.03, gr.x);\n float needles = smoothstep(0.7, 1.0, needle) * (1.0 - smoothstep(0.0, len, gr.x));\n float glint = 0.4 + 0.6 * rf;\n float veins = clamp(glint * max(0.35 * stem, 0.55 * needles) + 0.3 * smoothstep(0.6, 0.95, r), 0.0, 1.0);\n float rim = smoothstep(0.0, 0.02, inside) * (1.0 - smoothstep(0.02, 0.07, inside));\n vec3 ice = clamp(color.rgb * (0.82 + 0.25 * veins), 0.0, 1.0);\n float cover = frost * (0.35 + 0.3 * thick + 0.25 * veins);\n cover = clamp(mix(cover, frost, full), 0.0, 1.0);\n vec4 under = vec4(rgb * mix(vec3(1.0), color.rgb, 0.5 * frost), alpha);\n \n vec4 res = mix(under, vec4(ice, color.a), cover);\n\n vec2 sq = q * 36.0;\n vec2 cell = floor(sq);\n vec2 d = abs(sq - cell - 0.25 - 0.5 * vec2(hash12(cell + 1.3), hash12(cell + 5.9)));\n float star = max(0.0, 1.0 - 9.0 * length(d)) + max(0.0, 1.0 - 4.0 * (d.x + d.y) - 30.0 * min(d.x, d.y));\n float tw = 0.5 + 0.5 * sin(6.2831853 * (hash12(cell + 9.1) + 2.0 * p));\n float sparkle = step(0.82, hash12(cell + 3.7)) * min(star, 1.0) * tw * f * (0.4 + 0.6 * veins);\n float light = clamp(0.4 * rim + 0.8 * sparkle, 0.0, 1.0);\n res = mix(res, vec4(mix(color.rgb, vec3(1.0), 0.6), color.a), light);\n return clamp(res, 0.0, 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","Funnel":"// Funnel — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Funnel.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image narrows into a curved funnel toward a point on the bottom edge and slides into it, its sides bending like a window minimized into a dock, 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 target; \n\nuniform float curvature; \n\nuniform float shadow; \n\nconst float NECK = 0.04;\n\nconst float OVERSHOOT = 0.03;\nconst float EDGE = 0.0015;\nconst float SOFT = 0.06;\n\nvec4 transition(vec2 uv) {\n float t = progress;\n float f = smoothstep(0.0, 1.0, 1.0 - (1.0 - t) * (1.0 - t) * (1.0 - t));\n float slide = (1.0 + OVERSHOOT) * t * t * (1.5 - 0.5 * t);\n\n float r = max(ratio, 1e-4);\n float nh = 0.5 * NECK / r;\n float tx = clamp(target, nh, 1.0 - nh);\n float c = clamp(curvature, 0.0, 1.0);\n\n \n float q = clamp(uv.y, 0.0, 1.0);\n float w = mix(q, q * q * (3.0 - 2.0 * q), c);\n float dw = mix(1.0, 6.0 * q * (1.0 - q), c);\n float L = f * mix(tx - nh, 0.0, w);\n float R = 1.0 - f * (1.0 - mix(tx + nh, 1.0, w));\n float dL = -f * (tx - nh) * dw;\n float dR = f * (1.0 - tx - nh) * dw;\n float v = uv.y + slide;\n\n \n float e = EDGE * min(1.0, 10.0 * t) + 1e-6;\n float left = L > 0.0 ? (uv.x - L) * r / sqrt(1.0 + dL * dL * r * r) : 1.0;\n float right = R < 1.0 ? (R - uv.x) * r / sqrt(1.0 + dR * dR * r * r) : 1.0;\n float cov = clamp(min(min(left, right), 1.0 - v) / e + 0.5, 0.0, 1.0);\n\n vec4 img = vec4(0.0);\n float s = clamp(shadow, 0.0, 1.0);\n if (cov > 0.0) {\n float width = R - L;\n vec2 src = clamp(vec2((uv.x - L) / width, v), 0.0, 1.0);\n img = getFromColor(src);\n float across = 2.0 * src.x - 1.0;\n img.rgb *= 1.0 - s * (1.0 - width) * (0.5 * across * across + 0.3 * (1.0 - w));\n if (cov >= 1.0) return img;\n }\n\n vec4 bg = getToColor(uv);\n float ox = max(L - uv.x, uv.x - R) * r;\n float oy = uv.y - (1.0 - slide);\n float dist = length(max(vec2(ox, oy), 0.0));\n bg.rgb *= 1.0 - s * 0.6 * f * (1.0 - t) * (1.0 - smoothstep(0.0, SOFT, dist));\n\n return mix(bg, img, cov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","FurShake":"// FurShake — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/FurShake.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture grows a thick coat of fur and shakes itself like a wet animal: the skin rolls from side to side, the long hair whips after it, and each lash leaves more of the coat in the colors of the incoming picture, which settles and grows smooth 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 float fur; \n\nuniform float density; \n\nuniform float shake; \n\nconst float TAU = 6.2831853;\nconst int LAYERS = 18;\n\nvec2 hash2(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n \n p3 += dot(p3, p3.yzx + 7.31);\n return fract((p3.xx + p3.yz) * p3.zy);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = p - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash2(i).x, hash2(i + vec2(1.0, 0.0)).x, f.x),\n mix(hash2(i + vec2(0.0, 1.0)).x, hash2(i + vec2(1.0, 1.0)).x, f.x), f.y);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 image(vec2 st, float s) {\n vec4 a = getFromColor(st);\n vec4 b = getToColor(st);\n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), s);\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 asp = vec2(ratio, 1.0);\n float g = smoothstep(0.0, 0.24, p) * (1.0 - smoothstep(0.74, 1.0, p));\n float e = smoothstep(0.14, 0.36, p) * (1.0 - smoothstep(0.6, 0.88, p));\n float ph = TAU * 2.5 * p;\n\n vec2 q = (uv - 0.5) * asp;\n \n float lag = 1.5 * q.y;\n float roll = shake * e * sin(ph + lag);\n float whip = shake * e * sin(ph + lag - 1.1);\n q.x -= 0.09 * roll;\n q.y -= 0.03 * shake * e * cos(ph + lag) * q.x;\n\n vec2 lie = vec2(1.1 * (noise(q * 2.3 + 11.0) - 0.5), -0.75 + 0.5 * (noise(q * 2.0 + 7.0) - 0.5));\n lie.x += 1.5 * whip;\n \n lie *= fur * mix(0.4, 1.0, g);\n\n float n = max(density, 10.0);\n float cover = 0.0;\n float hh = 0.0, across = 0.0, tuft = 0.0, id = 0.0;\n vec2 shift = vec2(0.0);\n for (int i = 0; i < LAYERS; i++) {\n float h = 1.0 - (float(i) + 0.5) / float(LAYERS);\n vec2 at = q - lie * h * sqrt(h);\n \n vec2 cl = floor(at * n / 7.0);\n vec2 dc = at - (cl + 0.25 + 0.5 * hash2(cl + 103.0)) * 7.0 / n;\n at += dc * 0.45 * h * h;\n vec2 g2 = at * n;\n float row = floor(g2.y);\n float slide = hash2(vec2(row, 57.0)).x;\n g2.x += slide;\n vec2 c = floor(g2);\n vec2 r2 = hash2(c + 31.0);\n vec2 o = g2 - c - 0.3 - 0.4 * r2;\n float len = 0.5 + 0.5 * fract(r2.x * 7.3 + r2.y * 3.1);\n float rad = 0.62 * (1.0 - h / len);\n if (rad > 0.0) {\n \n vec2 v = lie * n * 1.5 * sqrt(h) / float(LAYERS);\n o -= v * clamp(dot(o, v) / max(dot(v, v), 1e-5), -0.5, 0.5);\n float m = (1.0 - cover) * clamp(0.5 + (rad - length(o)) * 6.0, 0.0, 1.0) * smoothstep(0.0, 0.1, rad);\n cover += m;\n hh += m * h;\n across += m * o.x / rad;\n tuft += m * length(dc) * n / 7.0;\n id += m * r2.y;\n shift += m * ((c + 0.5 - vec2(slide, 0.0)) / n - q);\n }\n if (cover > 0.97) break;\n }\n id += 0.5 * (1.0 - cover);\n vec2 root = q + shift;\n vec2 st = mirror((q + g * shift) / asp + 0.5);\n float when = 0.34 + 0.32 * (0.65 * noise(root * 4.0 + 20.0) + 0.35 * id);\n \n float clock = p + 0.03 * shake * e * sin(2.0 * (ph + lag - 1.1));\n float s = smoothstep(when - 0.05, when + 0.05, clock + 0.06 * (hh - 0.5));\n vec4 col = image(st, s);\n\n float lit = mix(0.45, 1.12, smoothstep(0.0, 0.6, hh)) * mix(0.82, 1.12, id) * (1.0 - 0.35 * smoothstep(0.2, 0.8, tuft) * hh);\n lit *= 1.0 - 0.16 * roll * sin(q.x * 3.0);\n float sheen = max(0.0, 1.0 - abs(across + 0.35));\n vec3 furry = col.rgb * lit + 0.18 * sheen * sheen * hh * (0.3 * col.a + col.rgb);\n return vec4(mix(col.rgb, furry, g), 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","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 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 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 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 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 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 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","Gape":"// Gape — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Gape.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a rubber sheet with a short slit, pulled from its left and right sides: the slit gapes into an almond and then a wide oval hole, the picture around it stretching along the rim and squeezed across it, until the hole has swallowed the frame and shows the whole 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 slit; \n\nconst float WIDE = 1.8;\n\nfloat rim(vec2 p, vec2 A) {\n vec2 q = p / A;\n float r = length(q);\n vec2 n = r > 0.0 ? q / r : vec2(1.0, 0.0);\n return (r - 1.0) / length(n / A);\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n vec2 c = (center - 0.5) * vec2(ratio, 1.0);\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0) - c;\n float open = smoothstep(0.03, 0.55, t);\n \n float reach = 1.04 * length(vec2((0.5 * ratio + abs(c.x)) / WIDE, 0.5 + abs(c.y)));\n float ay = mix(0.5 * slit * smoothstep(0.0, 0.12, t), reach, pow(t, 2.2)) + 1e-4;\n \n float ax = ay * mix(0.04, WIDE, open);\n vec2 A = vec2(ax, ay);\n\n \n \n bool tall = ay > ax;\n vec2 pp = tall ? p.yx : p;\n float M = max(ax, ay), m = min(ax, ay);\n float F2 = M * M - m * m;\n float sq = dot(pp, pp) - F2;\n float D = sqrt(sq * sq + 4.0 * pp.y * pp.y * F2);\n \n float b2 = sq >= 0.0 ? 0.5 * (sq + D) : 2.0 * pp.y * pp.y * F2 / max(D - sq, 1e-8);\n float b = sqrt(b2), a = sqrt(b2 + F2);\n float k = max(a * b - M * m, 0.0);\n float b02 = 2.0 * k * k / max(F2 + sqrt(F2 * F2 + 4.0 * k * k), 1e-8);\n vec2 pp0 = pp * vec2(sqrt(b02 + F2) / max(a, 1e-6), sqrt(b02) / max(b, 1e-6));\n vec4 from = getFromColor(((tall ? pp0.yx : pp0) + c) / vec2(ratio, 1.0) + 0.5);\n\n float edge = rim(p, A);\n float grown = smoothstep(0.0, 0.02, ax);\n \n float cover = max(smoothstep(0.0, 0.003 * grown + 1e-6, edge), 1.0 - smoothstep(0.0, 0.01, t));\n float lip = grown * exp(-max(edge, 0.0) / 0.006);\n float up = normalize(p / A + vec2(0.0, 1e-6)).y;\n from.rgb *= 1.0 - 0.3 * lip * smoothstep(-0.2, 0.6, up);\n from.rgb += 0.18 * lip * from.a * (1.0 - from.rgb) * smoothstep(0.0, 0.6, -up);\n from.rgb *= 1.0 - 0.12 * grown * exp(-max(edge, 0.0) / 0.05) * smoothstep(0.0, 0.5, up);\n\n \n vec4 to = getToColor(uv);\n float depth = -rim(p - vec2(0.006, -0.01), A);\n float big = smoothstep(0.02, 0.15, min(ax, ay));\n to.rgb *= 1.0 - 0.3 * big * (1.0 - t) * (1.0 - smoothstep(0.0, 0.03, depth));\n return mix(to, from, 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","GeometricCollage":"// GeometricCollage — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GeometricCollage.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image arrives cut into a geometric poster of quarter discs, half discs, triangles and their complements: piece after piece swings in around a corner of its cell, a flat plate of color just ahead of it, and lands flat with a soft paper 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 int cells; \n\nuniform float stagger; \n\nuniform int plates; \n\nuniform vec4 color1; \n\nuniform vec4 color2; \n\nuniform vec4 color3; \n\nuniform float shadow; \n\nconst float PI = 3.141592653589793;\n\nconst float DUR = 0.24;\nconst float GAP = 0.07;\nconst float LEAD = 0.06;\n\nconst float SETTLE = 0.8;\nconst float EDGE = 0.002;\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 orient(vec2 l, float k) {\n vec2 c = l - 0.5;\n if (k < 0.5) return l;\n if (k < 1.5) return vec2(-c.y, c.x) + 0.5;\n if (k < 2.5) return 0.5 - c;\n return vec2(c.y, -c.x) + 0.5;\n}\n\nvec2 pivotCorner(float k) {\n if (k < 0.5) return vec2(0.0, 0.0);\n if (k < 1.5) return vec2(0.0, 1.0);\n if (k < 2.5) return vec2(1.0, 1.0);\n return vec2(1.0, 0.0);\n}\n\nfloat shapeDist(vec2 o, float type) {\n if (type < 0.5) return length(o) - 1.0; \n if (type < 1.5) return length(o - vec2(0.5, 0.0)) - 0.5; \n return (o.x + o.y - 1.0) * 0.70710678; \n}\n\nfloat pieceDist(vec2 l, vec2 cell, float piece) {\n float k = floor(hash12(cell + 1.7) * 4.0);\n \n float sd = shapeDist(orient(l, k), mod(cell.x + 2.0 * cell.y + 1.0, 3.0));\n return piece > 0.5 ? -sd : sd;\n}\n\nfloat boxDist(vec2 l) {\n return min(min(l.x, l.y), min(1.0 - l.x, 1.0 - l.y));\n}\n\nfloat easeOutCubic(float t) {\n float u = 1.0 - clamp(t, 0.0, 1.0);\n return 1.0 - u * u * u;\n}\n\nfloat lift(float t) {\n return 1.0 - smoothstep(0.3, 1.0, t);\n}\n\nfloat spread() {\n return (1.0 - DUR - GAP - LEAD - 0.02) * clamp(stagger, 0.0, 1.0);\n}\nfloat swing() {\n return 1.0 - GAP - LEAD - 0.02 - spread();\n}\n\nfloat startTime(vec2 cell, vec2 n) {\n float order = (cell.x + (n.y - 1.0 - cell.y)) / max(n.x + n.y - 2.0, 1.0);\n order = clamp(order * 0.75 + 0.25 * hash12(cell + 4.4), 0.0, 1.0);\n return LEAD + spread() * order;\n}\n\nvec3 swingPoint(vec2 p, vec2 cell, vec2 cs, float piece, float t) {\n vec2 pc = pivotCorner(floor(hash12(cell + 1.7) * 4.0));\n vec2 piv = (cell + (piece < 0.5 ? pc : 1.0 - pc)) * cs;\n float sgn = hash12(cell + vec2(piece * 3.3, 5.2)) < 0.5 ? -1.0 : 1.0;\n float s = smoothstep(0.0, 0.45, t) * (1.0 + 0.1 * lift(t));\n float a = sgn * 0.5 * PI * (1.0 - easeOutCubic(t / SETTLE));\n float ca = cos(a), sa = sin(a);\n vec2 d = p - piv;\n d = vec2(ca * d.x + sa * d.y, -sa * d.x + ca * d.y) / max(s, 0.001);\n return vec3((piv + d) / cs - cell, s);\n}\n\nvec3 layerCover(vec2 p, vec2 cell, vec2 cs, float piece, float t) {\n vec3 q = swingPoint(p, cell, cs, piece, t);\n if (q.z < 0.01) return vec3(0.0);\n float e = EDGE / (min(cs.x, cs.y) * q.z);\n float m = clamp(boxDist(q.xy) / e + 0.5, 0.0, 1.0) * clamp(-pieceDist(q.xy, cell, piece) / e + 0.5, 0.0, 1.0);\n return vec3(m, clamp(q.xy, 0.0, 1.0));\n}\n\nfloat layerShadow(vec2 p, vec2 cell, vec2 cs, float piece, float t) {\n float h = lift(t);\n vec3 q = swingPoint(p - vec2(0.07, -0.1) * h * cs.y, cell, cs, piece, t);\n if (q.z < 0.01) return 0.0;\n float soft = 0.02 + 0.05 * h;\n return h * (1.0 - smoothstep(-soft, soft, pieceDist(q.xy, cell, piece))) * smoothstep(-soft, soft, boxDist(q.xy));\n}\n\nvec4 plateColor(vec2 cell, float piece) {\n float c = mod(floor(hash12(cell * 1.3 + 0.7) * 3.0) + piece, 3.0);\n return c < 0.5 ? color1 : c < 1.5 ? color2 : color3;\n}\n\nvec4 premultiplied(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 transition(vec2 uv) {\n float kc = float(cells < 1 ? 1 : cells);\n vec2 n = ratio >= 1.0 ? vec2(max(1.0, floor(ratio * kc + 0.5)), kc) : vec2(kc, max(1.0, floor(kc / ratio + 0.5)));\n vec2 cs = vec2(ratio, 1.0) / n;\n vec2 p = uv * vec2(ratio, 1.0);\n vec2 cell0 = floor(p / cs);\n float sw = swing();\n\n \n \n vec2 l0 = p / cs - cell0;\n float t00 = startTime(cell0, n);\n float sd0 = pieceDist(l0, cell0, 0.0);\n float e0 = EDGE / min(cs.x, cs.y);\n float landed = (progress >= t00 + sw ? clamp(-sd0 / e0 + 0.5, 0.0, 1.0) : 0.0)\n + (progress >= t00 + GAP + sw ? clamp(sd0 / e0 + 0.5, 0.0, 1.0) : 0.0);\n \n \n vec4 top = vec4(-1.0, 0.0, 0.0, 0.0);\n vec4 topPos = vec4(0.0);\n vec4 und = vec4(-1.0, 0.0, 0.0, 0.0);\n vec4 undPos = vec4(0.0);\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cell = cell0 + vec2(float(dx), float(dy));\n if (cell.x < 0.0 || cell.y < 0.0 || cell.x >= n.x || cell.y >= n.y) continue;\n float tc = startTime(cell, n);\n for (int pc = 0; pc < 2; pc++) {\n float piece = float(pc);\n float t0 = tc + GAP * piece;\n float tp = (progress - t0) / sw;\n for (int ly = 0; ly < 2; ly++) {\n float isPlate = ly == 0 ? 1.0 : 0.0;\n if (isPlate > 0.5 && !(plates != 0)) continue;\n float ts = t0 - LEAD * isPlate;\n float t = (progress - ts) / sw;\n \n if (t <= 0.0 || tp >= 1.0 || (isPlate > 0.5 && tp >= SETTLE)) continue;\n vec3 L = layerCover(p, cell, cs, piece, min(t, 1.0));\n if (isPlate > 0.5) L.x *= 1.0 - smoothstep(SETTLE - 0.1, SETTLE, tp);\n if (L.x <= 0.0) continue;\n vec4 cur = vec4(ts, L.x, isPlate, piece);\n vec4 curPos = vec4(cell, L.yz);\n if (ts > top.x) {\n und = top;\n undPos = topPos;\n top = cur;\n topPos = curPos;\n } else if (ts > und.x) {\n und = cur;\n undPos = curPos;\n }\n }\n }\n }\n }\n \n if (top.z < 0.5 && und.x < 0.0 && topPos.x == cell0.x && topPos.y == cell0.y) {\n landed = top.y < 1.0 ? landed / (1.0 - top.y) : 1.0;\n }\n vec4 c = mix(premultiplied(getFromColor(uv)), premultiplied(getToColor(uv)), clamp(landed, 0.0, 1.0));\n if (und.x >= 0.0) {\n vec4 uc = und.z > 0.5 ? plateColor(undPos.xy, und.w) : getToColor((undPos.xy + undPos.zw) * cs / vec2(ratio, 1.0));\n c = mix(c, premultiplied(uc), und.y);\n }\n if (top.x >= 0.0) {\n vec4 tc = top.z > 0.5 ? plateColor(topPos.xy, top.w) : getToColor((topPos.xy + topPos.zw) * cs / vec2(ratio, 1.0));\n c = mix(c, premultiplied(tc), top.y);\n }\n\n float sh = 0.0;\n if (shadow > 0.0) {\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cell = cell0 + vec2(float(dx), float(dy));\n if (cell.x < 0.0 || cell.y < 0.0 || cell.x >= n.x || cell.y >= n.y) continue;\n float tc = startTime(cell, n);\n for (int pc = 0; pc < 2; pc++) {\n float piece = float(pc);\n float t0 = tc + GAP * piece;\n float tp = (progress - t0) / sw;\n for (int ly = 0; ly < 2; ly++) {\n float isPlate = ly == 0 ? 1.0 : 0.0;\n if (isPlate > 0.5 && (!(plates != 0) || tp >= SETTLE)) continue;\n float ts = t0 - LEAD * isPlate;\n float t = (progress - ts) / sw;\n if (ts <= top.x || t <= 0.0 || t >= 1.0) continue;\n sh = max(sh, layerShadow(p, cell, cs, piece, t));\n }\n }\n }\n }\n }\n c.rgb *= 1.0 - 0.7 * clamp(shadow, 0.0, 1.0) * sh;\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","GlassRelief":"// GlassRelief — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlassRelief.glsl\n// Author: gre\n// License: MIT\n// Description: The shapes of the incoming image rise through the outgoing one as clear molded glass, bending it and catching the light along their outlines; then the glass fills with the incoming image's colors, brightest parts first, and melts flat 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 refraction; \n\nuniform float shine; \n\nuniform vec2 light; \n\nconst int TAPS = 24;\n\nconst float RADIUS = 0.05;\n\nfloat luma(vec4 c) {\n return dot(c.rgb, vec3(0.299, 0.587, 0.114)) * c.a + 0.3 * (1.0 - c.a);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n float rise = smoothstep(0.0, 0.4, progress);\n float melt = smoothstep(0.35, 1.0, progress);\n float relief = rise * (1.0 - melt);\n\n \n mat2 turn = mat2(-0.73736, 0.67549, -0.67549, -0.73736);\n vec2 dir = vec2(1.0, 0.0);\n float sw = 0.0, sl = 0.0, sdd = 0.0;\n vec2 sd = vec2(0.0), sld = vec2(0.0);\n for (int i = 0; i < TAPS; i++) {\n float f = (float(i) + 0.5) / float(TAPS);\n vec2 d = RADIUS * sqrt(f) * dir;\n float w = exp(-4.0 * f);\n float l = luma(getToColor(mirror(uv + vec2(d.x / ratio, d.y))));\n sw += w;\n sl += w * l;\n sd += w * d;\n sld += w * l * d;\n sdd += w * dot(d, d);\n dir = turn * dir;\n }\n float h = sl / sw;\n vec2 g = 0.08 * (sld - h * sd) / (sdd - dot(sd, sd) / sw);\n \n g /= 1.0 + 1.5 * length(g);\n\n vec2 off = -g * 0.2 * refraction * relief / vec2(ratio, 1.0);\n vec4 behind = getFromColor(mirror(uv + off));\n float fringe = 0.08 * refraction * relief;\n vec4 cr = getFromColor(mirror(uv + off * (1.0 + fringe)));\n vec4 cb = getFromColor(mirror(uv + off * (1.0 - fringe)));\n behind.r = mix(behind.r, cr.r, cr.a);\n behind.b = mix(behind.b, cb.b, cb.a);\n\n vec3 n = normalize(vec3(-g * 4.0 * relief, 1.0));\n \n float a = 2.0 * (progress - 0.4);\n vec2 ld = mat2(cos(a), sin(a), -sin(a), cos(a)) * light;\n vec3 lt = normalize(vec3(ld, 0.9));\n float diff = dot(n, lt) - lt.z;\n float spec = pow(max(dot(reflect(-lt, n), vec3(0.0, 0.0, 1.0)), 0.0), 40.0);\n float rim = 1.0 - n.z;\n vec3 glass = behind.rgb * (1.0 + 0.6 * shine * diff) + shine * (0.9 * spec * relief * min(length(g) * 6.0, 1.0) + 0.4 * max(diff, 0.0) + 0.4 * rim);\n\n vec4 to = getToColor(uv);\n float lag = 0.7 * (1.0 - clamp(mix(h, luma(to), 0.3), 0.0, 1.0));\n float fill = smoothstep(lag, lag + 0.3, melt);\n return vec4(clamp(mix(glass, to.rgb, fill), 0.0, 1.0), mix(behind.a, to.a, fill));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","GlintDissolve":"// GlintDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlintDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The bright points of the outgoing image sparkle into crisp four-point star glints that swell and twinkle up to the cut, then shrink back into the highlights of the incoming image, which 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 size; \n\nuniform float threshold; \n\nuniform float intensity; \n\nuniform int diagonals; \n\nuniform float rotation; \n\nuniform float rainbow; \n\nuniform vec3 tint; \n\nconst float REACH = 6.0;\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 ray(vec2 d, float len, float width) {\n float a = abs(d.x) / len;\n if (a >= 1.0) return 0.0;\n float fall = (1.0 - a) * (1.0 - a);\n float w = width * (1.0 - 0.7 * a);\n return fall * exp(-d.y * d.y / (w * w));\n}\n\nvec3 spectrum(float a) {\n return 0.5 + 0.5 * cos(6.2831853 * (a + vec3(0.0, 0.33, 0.67)));\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n float t = 1.0 - abs(2.0 * p - 1.0);\n float amount = t * (2.0 - t);\n float m = smoothstep(0.42, 0.58, p);\n if (amount <= 0.0) return m < 0.5 ? getFromColor(uv) : getToColor(uv);\n\n vec4 fromColor = getFromColor(uv);\n vec4 toColor = getToColor(uv);\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 = c.rgb / c.a;\n\n \n float cell = size / REACH;\n float ang = radians(rotation);\n vec2 cs = vec2(cos(ang), sin(ang));\n vec2 aspect = vec2(ratio, 1.0);\n vec2 o = (uv - 0.5) * aspect;\n vec2 q = vec2(o.x * cs.x + o.y * cs.y, o.y * cs.x - o.x * cs.y) / cell;\n vec2 home = floor(q);\n \n float width = min(0.0022 / cell, 0.07);\n\n vec3 light = vec3(0.0);\n \n \n for (int k = 0; k < 29; k++) {\n float fk = float(k);\n vec2 off = vec2(0.0);\n if (k >= 1 && k <= 12) off = vec2(fk < 7.0 ? fk - 7.0 : fk - 6.0, 0.0);\n else if (k >= 13 && k <= 24) off = vec2(0.0, fk < 19.0 ? fk - 19.0 : fk - 18.0);\n else if (k >= 25) off = vec2(mod(fk, 2.0) * 2.0 - 1.0, fk < 27.0 ? -1.0 : 1.0);\n \n if (max(abs(off.x), abs(off.y)) > REACH * amount + 1.0) continue;\n vec2 id = home + off;\n if (hash12(id + 89.5) > 0.55) continue;\n float h0 = hash12(id + 0.5);\n float h1 = hash12(id + 19.5);\n float h2 = hash12(id + 41.5);\n float h3 = hash12(id + 67.5);\n \n vec2 center = id + 0.5 + 0.6 * (vec2(h0, h1) - 0.5);\n vec2 cw = center * cell;\n vec2 st = vec2(cw.x * cs.x - cw.y * cs.y, cw.x * cs.y + cw.y * cs.x) / aspect + 0.5;\n if (st.x < 0.0 || st.x > 1.0 || st.y < 0.0 || st.y > 1.0) continue;\n float turn = 0.15 + 0.7 * h3;\n vec4 src = m < turn ? getFromColor(st) : getToColor(st);\n float lum = dot(src.rgb, vec3(0.2126, 0.7152, 0.0722)) * src.a;\n float knee = threshold + 0.8 * (1.0 - threshold) * h2;\n float b = smoothstep(knee, knee + 0.2 * (1.0 - threshold) + 1e-3, lum);\n if (b <= 0.0) continue;\n float twinkle = (0.6 + 0.4 * sin(6.2831853 * (h2 + (1.5 + h0) * p))) * smoothstep(0.0, 0.12, abs(m - turn));\n float len = REACH * amount * (0.45 + 0.55 * b) * (0.3 + 0.7 * h1 * h1) * (0.85 + 0.15 * twinkle);\n vec2 d = q - center;\n float r = length(d);\n float star = ray(d, len, width) + ray(d.yx, len, width);\n if ((diagonals != 0)) {\n vec2 e = vec2(d.x + d.y, d.x - d.y) * 0.70710678;\n star += 0.5 * (ray(e, 0.25 * len, width) + ray(e.yx, 0.25 * len, width));\n }\n float cr = r / (0.08 * len);\n star += exp(-cr * cr) + 0.3 * exp(-r / 0.2);\n float along = r / len;\n vec3 hue = mix(vec3(1.0), spectrum(1.3 * along + h0), rainbow * smoothstep(0.05, 0.4, along));\n vec3 col = mix(src.rgb / max(max(src.r, max(src.g, src.b)), 1e-3), vec3(1.0), 0.6);\n light += b * twinkle * star * hue * col;\n }\n light *= tint * intensity * amount * amount;\n \n light = 1.0 - exp(-light);\n return vec4(clamp(base + light - base * light, 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","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\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 float f = floor(progress * frameRate);\n \n float step24 = f * 24.0 / max(frameRate, 1.0);\n float reveal = frameReveal(step24);\n float glitch = frameGlitch(step24) * (1.0 - smoothstep(0.96, 1.0, progress));\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 = (fract(uv_noise) - 0.5) * 0.3 * (1.0 - progress) * smoothstep(0.0, 0.05, progress);\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","GlitterDissolve":"// GlitterDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GlitterDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The image becomes a shimmering field of tiny diamond sequins that flip over in 3D at random moments, each lifting and tilting on its own axis and flashing a glint of light, and land 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 tiles; \n\nuniform int hexagons; \n\nuniform float sparkle; \n\nuniform vec3 glint; \n\nuniform float seed; \n\nuniform vec4 backColor; \n\nconst float FLIP = 0.28;\nconst float LIFT = 0.3;\nconst float EDGE = 0.04;\n\nconst vec2 SHIFT = vec2(0.37, 0.21);\nconst float PI = 3.14159265;\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\nvec2 mirrored(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nfloat flipOf(vec2 id) {\n float t = clamp((progress - hash12(id) * (1.0 - FLIP)) / FLIP, 0.0, 1.0);\n return t * t * (3.0 - 2.0 * t);\n}\n\nvec2 axisOf(vec2 id) {\n float a = 2.0 * PI * hash12(id + 41.7);\n return vec2(cos(a), sin(a));\n}\n\nvec2 unproject(vec2 s, vec2 n, float f) {\n float c = abs(cos(PI * f));\n float along = dot(s, n);\n return (s + n * (along / max(c, 1e-4) - along)) / (1.0 + LIFT * sin(PI * f));\n}\n\nfloat shape(vec2 v) {\n v = abs(v);\n return (hexagons != 0) ? max(v.y, dot(v, vec2(0.8660254, 0.5))) : v.x + v.y;\n}\n\nvec2 idOf(vec2 center) {\n \n vec2 grid = (hexagons != 0) ? vec2(1.1547005, 2.0) : vec2(2.0);\n return floor(center * grid + 0.5) + vec2(13.0, 7.0) * floor(seed) + 3.0;\n}\n\nfloat coverOf(vec2 p, vec2 center) {\n vec2 id = idOf(center);\n float f = flipOf(id);\n if (f <= 0.0 || f >= 1.0) return 0.0;\n float z = sin(PI * f);\n float onScreen = (1.0 + LIFT * z) * max(abs(cos(PI * f)), 0.15);\n \n float edge = EDGE * min(1.0, 4.0 * z) + 1e-4;\n return clamp((0.5 - shape(unproject(p - center, axisOf(id), f))) * onScreen / edge, 0.0, 1.0);\n}\n\nvec4 tileColor(vec2 p, vec2 center) {\n vec2 id = idOf(center);\n float f = flipOf(id);\n vec2 n = axisOf(id);\n float c = cos(PI * f);\n float z = sin(PI * f);\n vec2 s0 = unproject(p - center, n, f);\n vec2 suv = mirrored((center + s0 - SHIFT) / tiles / vec2(ratio, 1.0) + 0.5);\n vec4 col = c > 0.0 ? getFromColor(suv) : getToColor(suv);\n vec3 nrm = normalize(vec3(n * z * (c < 0.0 ? -1.0 : 1.0) + 0.5 * s0, abs(c)));\n vec3 L = normalize(vec3(-0.3, 0.4, 1.0));\n float shade = 0.45 + 0.55 * clamp(dot(nrm, L) / L.z, 0.0, 1.6);\n vec3 H = normalize(vec3(-0.45, 0.55, 1.0));\n float spec = smoothstep(0.94, 0.995, dot(nrm, H)) * 2.0 + pow(1.0 - abs(c), 6.0) * 0.6;\n vec3 light = clamp(glint * sparkle * spec * z, 0.0, 1.0);\n vec3 base = clamp(col.rgb * mix(1.0, shade, z), 0.0, 1.0);\n return vec4(base + light - base * light, col.a);\n}\n\nvec4 transition(vec2 uv) {\n \n vec2 p = (uv - 0.5) * vec2(ratio, 1.0) * tiles + SHIFT;\n vec2 home;\n if ((hexagons != 0)) {\n vec2 s = vec2(1.7320508, 1.0);\n vec2 a = mod(p, s) - 0.5 * s;\n vec2 b = mod(p - 0.5 * s, s) - 0.5 * s;\n home = dot(a, a) < dot(b, b) ? p - a : p - b;\n } else {\n vec2 q = floor(vec2(p.x + p.y, p.y - p.x)) + 0.5;\n home = vec2(q.x - q.y, q.x + q.y) * 0.5;\n }\n\n \n float fHome = flipOf(idOf(home));\n vec4 under = fHome <= 0.0 ? getFromColor(uv) : fHome >= 1.0 ? getToColor(uv) : backColor;\n\n \n \n float z1 = -1.0;\n float z2 = -1.0;\n float cover1 = 0.0;\n float cover2 = 0.0;\n vec2 center1 = home;\n vec2 center2 = home;\n for (int k = 0; k < 9; k++) {\n float fk = float(k);\n vec2 off;\n if ((hexagons != 0)) {\n if (k > 6) break;\n off = k == 0 ? vec2(0.0) : k < 3 ? vec2(0.0, fk * 2.0 - 3.0) : vec2(mod(fk, 2.0) * 1.7320508 - 0.8660254, fk < 5.0 ? -0.5 : 0.5);\n } else {\n vec2 o = vec2(mod(fk, 3.0) - 1.0, floor(fk / 3.0) - 1.0);\n off = vec2(o.x - o.y, o.x + o.y) * 0.5;\n }\n vec2 center = home + off;\n float cover = coverOf(p, center);\n if (cover <= 0.0) continue;\n float z = sin(PI * flipOf(idOf(center)));\n if (z > z1) {\n z2 = z1;\n cover2 = cover1;\n center2 = center1;\n z1 = z;\n cover1 = cover;\n center1 = center;\n } else if (z > z2) {\n z2 = z;\n cover2 = cover;\n center2 = center;\n }\n }\n if (z1 < 0.0) return under;\n vec4 c = under;\n if (z2 >= 0.0 && cover1 < 1.0) c = mix(c, tileColor(p, center2), cover2);\n return mix(c, tileColor(p, center1), 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","Globe":"// Globe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Globe.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image curls round into a shaded globe like a world map over a soft blurred backdrop; the globe spins half a turn to bring the incoming image round from its far side, which then unrolls flat 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 size; \n\nuniform float shading; \n\nconst float PI = 3.14159265;\nconst float D = 2.0;\nconst vec3 LIGHT = vec3(-0.45, 0.5, -0.74) / 1.00005;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat arc(float y, float x) {\n float q = y / max(x, 1e-7);\n float q2 = q * q;\n return abs(q) < 0.25 ? q * (1.0 - q2 * (1.0 / 3.0 - q2 * (0.2 - q2 / 7.0))) : atan(y, max(x, 1e-7));\n}\n\nfloat lat(float s) {\n float s2 = s * s;\n return abs(s) < 0.25 ? s * (1.0 + s2 * (1.0 / 6.0 + s2 * (0.075 + s2 * 0.0446429))) : asin(clamp(s, -1.0, 1.0));\n}\n\nvec4 backdrop(vec2 uv, float w, float s) {\n vec2 q = 0.5 + (uv - 0.5) * (1.0 - 0.1 * w);\n vec4 c = vec4(0.0);\n vec2 g = vec2(1.0, 0.0);\n \n mat2 turn = mat2(-0.73736887, 0.67549029, -0.67549029, -0.73736887);\n for (int i = 0; i < 24; i++) {\n vec2 o = 0.04 * w * sqrt((float(i) + 0.5) / 24.0) * g * vec2(1.0 / ratio, 1.0);\n vec4 x = mix(getFromColor(mirror(q + o)), getToColor(mirror(q + o)), s);\n c += vec4(x.rgb * x.a, x.a);\n g = turn * g;\n }\n return vec4(c.rgb / max(c.a, 1e-6) * (1.0 - 0.4 * w), c.a / 24.0);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float w = min(smoothstep(0.0, 0.48, p), 1.0 - smoothstep(0.52, 1.0, p));\n float spin = smoothstep(0.2, 0.8, p);\n float r1 = size * min(ratio, 1.0);\n float wc = max(w, 1e-4);\n float R = r1 / wc;\n \n float ax = mix(1.0, ratio / (PI * r1), w);\n float a = PI * spin;\n \n float closed = smoothstep(0.0, 0.6, min(a, PI - a));\n float L = mix(0.5 * ratio * wc / (r1 * ax), 0.5 * PI, closed);\n float ay = mix(1.0, 1.0 / (PI * r1), w);\n\n vec2 sc = (uv - 0.5) * vec2(ratio, 1.0);\n vec3 d = normalize(vec3(sc, D));\n \n float b = -(D + R) * d.z;\n float cc = D * D + 2.0 * D * R;\n float disc = max(b * b - cc, 0.0);\n float t = cc / (-b + sqrt(disc));\n vec3 h = d * t;\n vec3 n = vec3(h.xy, h.z - D - R) / R;\n float cs = cos(a), sn = sin(a);\n vec3 m = vec3(cs * n.x + sn * n.z, n.y, -sn * n.x + cs * n.z);\n bool back = m.z > 0.0;\n float lon = back ? -arc(m.x, m.z) : arc(m.x, -m.z);\n vec2 tuv = vec2(0.5 * lon / L, R * lat(m.y) * ay) + 0.5;\n\n float rs = D * R / sqrt(cc);\n float ds = length(sc);\n float aa = 0.003 * min(1.0, 20.0 * w) + 1e-6;\n \n vec2 e = min(tuv, 1.0 - tuv) * vec2(ratio, 1.0) + vec2(closed * aa, 0.0);\n float cov = clamp(0.5 + min(e.x, e.y) / aa, 0.0, 1.0) * clamp(0.5 + (rs - ds) / aa, 0.0, 1.0);\n\n vec4 bg = cov < 1.0 ? backdrop(uv, w, spin) : vec4(0.0);\n float shadow = 1.0 - smoothstep(0.85 * rs, 1.3 * rs, length(sc - vec2(0.03, -0.05) * rs));\n bg.rgb *= 1.0 - 0.45 * w * shadow;\n\n vec4 col = back ? getToColor(clamp(tuv, 0.0, 1.0)) : getFromColor(clamp(tuv, 0.0, 1.0));\n float diff = max(dot(n, LIGHT), 0.0) / -LIGHT.z;\n float k = shading * w;\n float seam = 1.0 - 0.6 * k * (1.0 - smoothstep(0.0, 0.03, abs(m.z)));\n float spec = pow(max(dot(reflect(-LIGHT, n), -d), 0.0), 30.0);\n col.rgb = col.rgb * mix(1.0, 0.2 + 0.85 * diff, k) * seam + 0.3 * k * spec;\n vec4 o = mix(vec4(bg.rgb * bg.a, bg.a), vec4(col.rgb * col.a, col.a), cov);\n return vec4(o.rgb / max(o.a, 1e-6), o.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","GoldenSpiral":"// GoldenSpiral — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GoldenSpiral.glsl\n// Author: gre\n// License: MIT\n// Description: Thin guide lines divide the outgoing image like a golden rectangle into ever smaller squares; a hand sweeps a quarter turn through the biggest one, then the next and the next, faster and faster into the eye of the spiral, revealing the incoming image and tracing the golden spiral 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 lines; \n\nuniform vec4 lineColor; \n\nconst int PIECES = 12;\nconst float PHI = 1.618034;\nconst float HALF_PI = 1.5707963;\n\nconst float DECAY = 0.64;\n\nconst float DUR0 = 0.35086;\n\nconst float PX = 0.004;\n\nvec4 transition(vec2 uv) {\n float s = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.5);\n vec2 asp = vec2(ratio, 1.0);\n vec2 P = uv * asp;\n vec2 lo = vec2(0.0);\n vec2 hi = asp;\n \n vec2 e = ratio >= 1.0 ? vec2(-1.0, 0.0) : vec2(0.0, 1.0);\n float dur = DUR0;\n float t0 = 0.0;\n float mask = smoothstep(0.97, 1.0, s);\n float ink = 0.0;\n float shade = 0.0;\n for (int i = 0; i < PIECES; i++) {\n vec2 ax = abs(e);\n vec2 sz = hi - lo;\n float L = dot(sz, ax);\n float S = dot(sz, 1.0 - ax);\n \n float rn = max(PHI - 0.4 * (L / S - PHI), 1.2);\n float cut = L - S / rn;\n vec2 bl = lo;\n vec2 tr = hi;\n if (e.x + e.y < 0.0) {\n tr = mix(hi, lo + cut, ax);\n lo = mix(lo, lo + cut, ax);\n } else {\n bl = mix(lo, hi - cut, ax);\n hi = mix(hi, hi - cut, ax);\n }\n vec2 f = vec2(e.y, -e.x);\n if (all(greaterThanEqual(P, bl)) && all(lessThanEqual(P, tr))) {\n vec2 psz = tr - bl;\n vec2 pivot = 0.5 * (bl + tr) - 0.5 * psz * (e + f);\n vec2 q = vec2(dot(P - pivot, e), dot(P - pivot, f));\n vec2 ext = vec2(dot(psz, ax), dot(psz, 1.0 - ax));\n float a = clamp((s - t0) / dur, 0.0, 1.0);\n float th = a * HALF_PI;\n vec2 h = vec2(cos(th), sin(th));\n float dist = q.x * h.y - q.y * h.x;\n mask = smoothstep(-PX, PX, dist + PX * (2.0 * a - 1.0));\n float busy = 4.0 * a * (1.0 - a);\n shade = busy * exp(min(dist, 0.0) * 25.0) * (1.0 - mask);\n float hand = (1.0 - smoothstep(0.0, PX, abs(dist))) * step(0.0, dot(q, h)) * busy;\n vec2 l = q / ext;\n float g = length(l);\n float arcDist = (g - 1.0) * g / max(length(l / ext), 1e-4);\n float arc = (1.0 - smoothstep(0.0, PX, abs(arcDist))) * smoothstep(-PX, PX, dist);\n \n vec2 inner = min(P - bl + step(bl, vec2(1e-4)), tr - P + step(asp - 1e-4, tr));\n float grid = 0.6 * (1.0 - smoothstep(0.0, PX, min(inner.x, inner.y)));\n ink = max(max(grid, arc), hand);\n break;\n }\n e = f;\n t0 += dur;\n dur *= DECAY;\n }\n vec4 c = mix(getFromColor(uv) * vec4(vec3(1.0 - 0.4 * shade), 1.0), getToColor(uv), mask);\n float w = ink * lines * lineColor.a * 4.0 * s * (1.0 - s);\n float alpha = mix(c.a, 1.0, w);\n return vec4(mix(c.rgb, lineColor.rgb, w / max(alpha, 1e-6)), 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","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 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 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 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","GravityLens":"// GravityLens — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GravityLens.glsl\n// Author: gre\n// License: MIT\n// Description: A black disk appears and grows, bending the outgoing image around it like a heavy mass bends light: the image is stretched into a bright ring at the disk's edge and swallowed until the frame is black, then the disk shrinks back, unbending 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 strength; \n\nuniform float glow; \n\nuniform vec4 hole; \n\nconst float OVERSHOOT = 0.12;\n\nconst float PEAK = 0.55;\nconst float AA = 0.002;\nconst vec3 WARM = vec3(1.0, 0.86, 0.68);\n\nvec2 mirrored(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nvec4 transition(vec2 uv) {\n \n bool swallowing = progress < PEAK;\n float u = swallowing ? progress / PEAK : (1.0 - progress) / (1.0 - PEAK);\n float u2 = u * u;\n float k = u2 * (0.6 + 0.4 * u2);\n\n vec2 aspect = vec2(ratio, 1.0);\n vec2 far = max(center, 1.0 - center) * aspect;\n float rh = length(far) * (1.0 + OVERSHOOT) * k;\n \n float re = rh * (1.0 + max(strength, 0.0));\n\n vec2 d = (uv - center) * aspect;\n float r = max(length(d), 1e-5);\n \n vec2 q = mirrored(center + d * (1.0 - re * re / (r * r)) / aspect);\n vec4 c = swallowing ? getFromColor(q) : getToColor(q);\n \n float amount = smoothstep(0.0, 0.04, rh);\n float inner = clamp((r - rh) / (re - rh + 1e-4), 0.0, 1.0);\n c.rgb *= 1.0 - 0.7 * amount * (1.0 - inner * inner * (3.0 - 2.0 * inner));\n\n float g = max(glow, 0.0) * amount;\n float einstein = (r - re) / (0.3 * (re - rh) + 0.01);\n float photon = max(r - rh, 0.0) / (0.006 + 0.012 * rh);\n float light = g * (0.7 * exp(-einstein * einstein) + 1.6 * exp(-photon * photon));\n c.rgb = min(c.rgb * (1.0 + light) + WARM * (0.35 * light * c.a), vec3(1.0));\n\n \n float cov = clamp((rh - r) / (2.0 * AA), 0.0, 1.0);\n return mix(c, hole, cov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 cards that lift apart and turn over in perspective one after another, each one showing its part of the incoming image on its 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 ivec2 size; \n\nuniform float pause; \n\nuniform float dividerWidth; \n\nuniform vec4 bgcolor; \n\nuniform float randomness; \n\nconst float PI = 3.141592653589793;\nconst float EDGE = 0.0012;\n\nconst float EYE = 2.2;\n\nconst float STAGGER = 0.55;\n\nconst vec2 LIGHT = vec2(-0.45, 0.3);\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 easeInOut(float t) {\n return mix(t, t * t * (3.0 - 2.0 * t), 0.7);\n}\n\nfloat pausePart() {\n return clamp(pause, 0.05, 0.4);\n}\n\nfloat flipTime(vec2 cell, vec2 grid, float q, float stagger) {\n float wave = (cell.x + (grid.y - 1.0 - cell.y)) / max(grid.x + grid.y - 2.0, 1.0);\n float order = mix(wave, hash12(cell + 7.31), clamp(randomness, 0.0, 1.0));\n return easeInOut(clamp((q - order * stagger) / (1.0 - stagger), 0.0, 1.0));\n}\n\nfloat gapAmount() {\n float pp = pausePart();\n return smoothstep(0.0, pp, progress) * (1.0 - smoothstep(1.0 - pp, 1.0, progress));\n}\n\nfloat aa(float d, float e) {\n return clamp(d / max(2.0 * e, 1e-6) + 0.5, 0.0, 1.0);\n}\n\nfloat boxShadow(vec2 p, vec2 halfSize, float blur) {\n vec2 d = abs(p) - halfSize;\n float dist = length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);\n return 1.0 - smoothstep(-blur, blur, dist);\n}\n\nvec4 transition(vec2 uv) {\n vec2 grid = max(vec2(size), 1.0);\n vec2 frame = vec2(ratio, 1.0);\n vec2 tileSize = frame / grid;\n vec2 cell = clamp(floor(uv * grid), vec2(0.0), grid - 1.0);\n vec2 pos = uv * frame;\n float gapOpen = gapAmount();\n float minSide = min(tileSize.x, tileSize.y);\n float gap = clamp(dividerWidth, 0.0, 0.4) * minSide * gapOpen;\n vec2 halfTile = 0.5 * tileSize - gap;\n float eye = EYE * max(tileSize.x, tileSize.y);\n \n float pp = 0.6 * pausePart();\n float q = clamp((progress - pp) / (1.0 - 2.0 * pp), 0.0, 1.0);\n \n float stagger = grid.x * grid.y > 1.5 ? STAGGER : 0.0;\n\n vec4 c1 = vec4(0.0);\n vec4 c2 = vec4(0.0);\n float m1 = 0.0;\n float m2 = 0.0;\n float z1 = 1e9;\n float z2 = 1e9;\n bool rest1 = true;\n bool rest2 = true;\n float shadowBg = 0.0;\n float shadowFlip = 0.0;\n\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n vec2 nc = cell + vec2(float(i), float(j));\n if (nc.x < 0.0 || nc.y < 0.0 || nc.x > grid.x - 1.0 || nc.y > grid.y - 1.0) continue;\n float t = flipTime(nc, grid, q, stagger);\n float a = PI * t;\n float ca = cos(a);\n float sa = sin(a);\n bool rest = t <= 0.0 || t >= 1.0;\n if (rest) {\n ca = t <= 0.0 ? 1.0 : -1.0;\n sa = 0.0;\n }\n vec2 center = (nc + 0.5) * tileSize;\n vec2 q = pos - center;\n\n float lift = 0.05 * gapOpen * minSide + 0.35 * halfTile.x * sa;\n vec2 shOffset = -LIGHT * lift;\n vec2 shHalf = vec2(halfTile.x * abs(ca) + 0.5 * lift, halfTile.y);\n float sh = boxShadow(q - shOffset, shHalf, 0.01 * minSide + 0.5 * lift);\n shadowBg = 1.0 - (1.0 - shadowBg) * (1.0 - 0.45 * gapOpen * sh);\n shadowFlip = max(shadowFlip, 0.45 * sa * sa * sh);\n\n \n float den = eye * ca - q.x * sa;\n if (abs(den) < 1e-6) continue;\n float s = eye * ca / den;\n if (s <= 0.0) continue;\n vec3 hit = vec3(s * q.x, s * q.y, eye * (1.0 - s));\n float u = hit.x * ca - hit.z * sa;\n float xa = halfTile.x * ca * eye / (eye + halfTile.x * sa);\n float xb = -halfTile.x * ca * eye / (eye - halfTile.x * sa);\n float dx = min(q.x - min(xa, xb), max(xa, xb) - q.x);\n float dy = (halfTile.y - abs(hit.y)) / s;\n \n float e = max(min(EDGE, gap), EDGE * min(8.0 * sa, 1.0));\n float m = aa(min(dx, dy), e);\n if (m <= 0.0) continue;\n\n bool front = ca > 0.0;\n vec2 src = (center + vec2(front ? u : -u, hit.y)) / frame;\n vec4 col = front ? getFromColor(src) : getToColor(src);\n if (!rest) {\n float nx = front ? sa : -sa;\n float lit = abs(ca) + nx * LIGHT.x;\n col.rgb *= mix(0.35, 1.0, clamp(lit, 0.0, 1.0)) + 0.25 * max(lit - 1.0, 0.0);\n col.rgb += 0.12 * sa * (1.0 - smoothstep(0.0, 3.0 * EDGE, min(dx, dy)));\n }\n\n if (s < z1) {\n c2 = c1; m2 = m1; z2 = z1; rest2 = rest1;\n c1 = col; m1 = m; z1 = s; rest1 = rest;\n } else if (s < z2) {\n c2 = col; m2 = m; z2 = s; rest2 = rest;\n }\n }\n }\n\n vec4 color = bgcolor;\n color.rgb *= 1.0 - clamp(max(shadowBg, shadowFlip), 0.0, 1.0);\n if (rest2) c2.rgb *= 1.0 - shadowFlip;\n if (rest1) c1.rgb *= 1.0 - shadowFlip;\n color = mix(color, c2, m2);\n color = mix(color, c1, m1);\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","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 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 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 grows from the center with a little heartbeat 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\nuniform float pulse; \n\nuniform vec3 glowColor; \n\nuniform float glow; \n\nfloat dot2(vec2 v) { return dot(v, v); }\n\nfloat sdHeart(vec2 p) {\n p.x = abs(p.x);\n if (p.x + p.y > 1.0) return sqrt(dot2(p - vec2(0.25, 0.75))) - 0.35355339;\n return sqrt(min(dot2(p - vec2(0.0, 1.0)), dot2(p - 0.5 * max(p.x + p.y, 0.0)))) * sign(p.x - p.y);\n}\n\nfloat heartScale(vec2 p) {\n float l = length(p);\n if (l < 1e-6) return 0.0;\n vec2 d = vec2(abs(p.x), p.y) / l;\n vec2 m = vec2(0.0, 0.55) - vec2(0.25, 0.75);\n float b = dot(m, d);\n float tDisk = -b + sqrt(b * b - dot2(m) + 0.35355339 * 0.35355339);\n float tSide = d.x > d.y ? vec2(0.0, 0.55).y / (d.x - d.y) : 1e6;\n float tTop = d.x + d.y > 0.0 ? (1.0 - vec2(0.0, 0.55).y) / (d.x + d.y) : 1e6;\n return l / max(tDisk, min(tSide, tTop));\n}\n\nvec4 transition (vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n vec2 asp = vec2(ratio, 1.0);\n vec2 c = center * asp;\n \n \n float cx = clamp(center.x, 0.0, 1.0) * ratio;\n float full = max(\n max(max(heartScale(vec2(0.0, 0.0) - c), heartScale(vec2(ratio, 0.0) - c)),\n max(heartScale(vec2(0.0, 1.0) - c), heartScale(vec2(ratio, 1.0) - c))),\n heartScale(vec2(cx, 1.0) - c));\n float sm = max(smoothness, 0.001);\n \n full += 4.0 * sm;\n\n float p = progress;\n float e = p * p * (2.0 - p);\n float env = max(sin(3.14159265 * p), 0.0);\n float beat = sin(6.28318531 * 2.0 * p) * env * env;\n float s = full * clamp(e + 0.09 * pulse * beat, 0.0, 1.0);\n if (s <= 0.0) return a;\n\n vec2 q = uv * asp - c;\n float d = s * sdHeart(q / s + vec2(0.0, 0.55));\n float m = smoothstep(0.0, sm, -d);\n vec4 col = mix(a, b, m);\n \n float light = exp(-max(d, 0.0) / (0.008 + sm)) * (1.0 - m) * glow * min(1.0, 4.0 * env);\n return col + vec4(glowColor * light, 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","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 const float PI = 3.141592653589793;\n float p = progress;\n float amount = sin(PI * p);\n float t = p * speed;\n vec2 q = vec2(uv.x * ratio, uv.y * 2.5) * scale;\n q.y -= t * scale;\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 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 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","HerringboneFold":"// HerringboneFold — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HerringboneFold.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image collapses along a herringbone of zigzag creases like a folded map: in one motion it pleats in both directions at once, its facets lit and shaded in alternation, into a small compact packet that drops out of the frame, 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 float rows; \n\nuniform float shadow; \n\nconst float GAMMA = 1.2;\nconst float WIDTH = 0.65;\nconst vec3 LIGHT = vec3(-0.4, 0.3, 0.866); \n\nfloat tri(float x) {\n return 1.0 - abs(mod(x, 2.0) - 1.0);\n}\n\nfloat slope(float x, float e) {\n float m = mod(x, 2.0);\n float d = min(min(m, abs(m - 1.0)), 2.0 - m);\n return (m < 1.0 ? 1.0 : -1.0) * smoothstep(0.0, e, d);\n}\n\nvec4 pleats(float t, float b, float a) {\n float V = a * cos(GAMMA) / cos(t);\n return vec4(b * cos(t), b * sin(t), V, sqrt(max(a * a - V * V, 1e-6)));\n}\n\nvec4 unfold(vec2 P, vec4 g, vec2 frame, float b, float c, float n) {\n float y = P.y / g.w;\n \n float z = g.z - c * g.x / b;\n float w = (P.x + 0.5 * z - g.z * tri(y)) / g.x;\n vec2 fp = vec2(w * b + c * tri(y), y / n) + 0.5 * frame;\n vec2 e = min(fp, frame - fp) * vec2(g.x / b / sqrt(1.0 + z * z / (g.w * g.w)), g.w * n);\n return vec4(fp / frame, min(e.x, e.y), w);\n}\n\nvec4 transition(vec2 uv) {\n float n = max(rows, 1.0);\n float b = WIDTH / n;\n float a = 1.0 / (n * sin(GAMMA));\n float c = a * cos(GAMMA);\n vec2 frame = vec2(ratio, 1.0);\n float f = smoothstep(0.0, 0.7, progress);\n float d = smoothstep(0.5, 1.0, progress);\n float t = f * GAMMA * 0.985;\n vec4 g = pleats(t, b, a);\n \n vec2 P = (uv * frame - 0.5 * frame + vec2(0.0, 0.75 * d * d * d)) * (1.0 + 0.6 * d);\n\n vec4 m = unfold(P, g, frame, b, c, n);\n float aa = 0.0025 * (1.0 + 0.6 * d);\n \n float cov = clamp(0.5 + (m.z + 0.004 * (1.0 - f)) / aa, 0.0, 1.0);\n\n float s1 = slope(m.w, 0.003 / g.x);\n float s2 = slope(P.y / g.w, 0.003 / g.w);\n float k = g.y / g.x;\n vec3 nrm = normalize(vec3(-k * s1, k * s1 * g.z * s2 / g.w, 1.0));\n float lit = clamp(dot(nrm, LIGHT) / LIGHT.z, 0.0, 1.06);\n float spec = pow(max(reflect(-LIGHT, nrm).z, 0.0), 40.0) - pow(LIGHT.z, 40.0);\n float valley = 1.0 - smoothstep(0.0, 0.004 / g.x, abs(mod(m.w + 1.0, 2.0) - 1.0));\n vec4 sheet = getFromColor(clamp(m.xy, 0.0, 1.0));\n sheet.rgb = min(sheet.rgb * (0.3 + 0.7 * lit) * (1.0 - 0.3 * sin(t) * valley) + 0.08 * max(spec, 0.0), 1.0);\n\n \n vec4 r = unfold(P + vec2(0.0, 0.005 * f), g, frame, b, c, n);\n float rim = clamp(0.5 + r.z / aa, 0.0, 1.0);\n vec4 edge = getFromColor(clamp(r.xy, 0.0, 1.0));\n edge.rgb *= 0.45;\n\n vec4 next = getToColor(uv);\n float soft = 0.02 + 0.06 * d;\n float sd = unfold(P - vec2(0.02, -0.04) * (0.3 + f + 2.0 * d), g, frame, b, c, n).z;\n next.rgb *= 1.0 - shadow * (1.0 - 0.5 * d) * smoothstep(-soft, soft, sd) * smoothstep(0.0, 0.15, f);\n\n return mix(mix(next, edge, rim), sheet, cov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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","HingedSquares":"// HingedSquares — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HingedSquares.glsl\n// Author: gre\n// License: MIT\n// Description: The image is cut into squares that turn in alternate directions while staying hinged at their corners, so the sheet opens into a checkerboard of diamonds showing the incoming image; those diamonds then turn back into place and close the sheet\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 cells; \n\nuniform float shading; \n\nuniform float zoom; \n\nconst float PI = 3.141592653589793;\nconst float EDGE = 0.0012;\n\nvec2 rot(vec2 v, vec2 cs) {\n return vec2(cs.x * v.x + cs.y * v.y, -cs.y * v.x + cs.x * v.y);\n}\n\nvec2 node(float i) {\n return vec2(mod(i, 2.0), floor(i * 0.5));\n}\n\nfloat parity(vec2 n) {\n return mod(n.x + n.y, 2.0) < 0.5 ? 1.0 : -1.0;\n}\n\nvec4 nearest(vec2 w, vec2 g, float spacing, vec2 off, vec2 cs) {\n vec4 best = vec4(0.0, 0.0, 1e5, 0.0);\n for (int i = 0; i < 4; i++) {\n vec2 n = g + node(float(i));\n vec2 l = rot(w - (n + off) * spacing, vec2(cs.x, parity(n) * cs.y));\n vec2 q = abs(l) - 0.5;\n float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0);\n if (d < best.z) best = vec4(l, d, float(i));\n }\n return best;\n}\n\nvec3 gap(vec2 w, vec2 g, float spacing, vec2 off, vec2 cs) {\n vec3 best = vec3(0.0, 0.0, 0.0);\n float r = 1e5;\n for (int i = 0; i < 4; i++) {\n vec2 n = g + node(float(i));\n vec2 v = w - (n + off) * spacing;\n vec2 h = parity(n) > 0.0 ? cs.yx : cs;\n \n float ri = abs(v.x) * h.y + abs(v.y) * h.x;\n if (ri < r) {\n r = ri;\n best = vec3(rot(v, vec2(0.7071068, parity(n) * 0.7071068)), float(i));\n }\n }\n return best;\n}\n\nvec2 toUV(vec2 c, float n) {\n vec2 uv = c / (n * vec2(ratio, 1.0)) + 0.5;\n return abs(mod(uv + 1.0, 2.0) - 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float n = max(float(cells), 1.0);\n float e = progress * progress * (3.0 - 2.0 * progress);\n float a = 0.5 * PI * e;\n \n float th = min(a, 0.5 * PI - a);\n vec2 cs = vec2(cos(th), sin(th));\n float spacing = cs.x + cs.y;\n float scale = n * mix(1.0, spacing, clamp(zoom, 0.0, 1.0));\n vec2 w = (uv - 0.5) * vec2(ratio, 1.0) * scale;\n bool first = a < 0.25 * PI;\n vec2 offF = first ? vec2(0.0) : vec2(0.5);\n vec2 offB = vec2(0.5) - offF;\n vec2 gF = floor(w / spacing - offF);\n vec2 gB = floor(w / spacing - offB);\n \n vec4 f = nearest(w, gF, spacing, offF, cs);\n vec3 b = gap(w, gB, spacing, offB, cs);\n vec2 nf = gF + node(f.w);\n vec2 nb = gB + node(b.z);\n vec2 uvF = toUV(nf + offF + f.xy, n);\n vec2 uvB = toUV(nb + offB + b.xy, n);\n vec4 colF = first ? getFromColor(uvF) : getToColor(uvF);\n vec4 colB = first ? getToColor(uvB) : getFromColor(uvB);\n\n float depth = clamp(shading, 0.0, 1.0) * sin(4.0 * th);\n if (depth > 0.0) {\n vec2 ws = w - vec2(0.12, -0.12) * depth;\n vec4 sh = nearest(ws, floor(ws / spacing - offF), spacing, offF, cs);\n colB.rgb *= 1.0 - 0.75 * depth * (1.0 - smoothstep(-0.12, 0.25, sh.z));\n }\n vec2 side = abs(f.x) > abs(f.y) ? vec2(sign(f.x), 0.0) : vec2(0.0, sign(f.y));\n float facing = dot(rot(side, vec2(cs.x, -parity(nf) * cs.y)), vec2(-0.7071, 0.7071));\n float rim = smoothstep(-0.07, -0.01, f.z);\n colF.rgb *= 1.0 + 0.35 * depth * rim * facing;\n\n \n float aa = EDGE * scale;\n float seal = aa * (1.0 - smoothstep(0.0, 3.0 * aa, cs.y));\n float cover = 1.0 - smoothstep(-aa, aa, f.z - seal);\n return mix(colB, colF, 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","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;\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 float p = progress;\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 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 float m = step(hash(vec2(floor(uv.y * 24.0), 7.0)), (p - 0.35) / 0.3);\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 vec3 holo = tint * (0.06 + 1.25 * g) + 0.45 * g * g * g;\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 float inside = step(0.0, q.x) * step(q.x, 1.0);\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 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 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","HoneyDrip":"// HoneyDrip — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HoneyDrip.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image sags like honey hanging from the top of the frame: its bottom gathers into one heavy amber drop that pulls the middle into a thinning glossy thread, the thread snaps, the drop falls out of the frame and the rest springs back up, 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 snap; \n\nuniform float gloss; \n\nconst vec3 AMBER = vec3(1.0, 0.6, 0.18);\n\nfloat smin(float a, float b, float k) {\n float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0);\n return mix(b, a, h) - k * h * (1.0 - h);\n}\n\nfloat capsule(vec2 p, float y0, float y1, float r) {\n return length(vec2(p.x, p.y - clamp(p.y, y0, y1))) - r;\n}\n\nfloat dropSd(vec2 p, vec3 d) {\n vec2 q = (p - vec2(0.0, d.x)) / d.yz;\n \n q.x /= 1.0 + 0.22 * clamp(q.y, -1.0, 1.0);\n return (length(q) - 1.0) * min(d.y, d.z);\n}\n\nfloat honey(vec2 p, vec4 b, vec3 d, float k, float kc) {\n float upper = smin(p.y - b.x, capsule(p, min(b.x + b.w, b.y), b.y, b.w), k);\n float lower = smin(capsule(p, b.z, d.x, b.w), dropSd(p, d), k);\n return smin(upper, lower, kc);\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n float W = 0.5 * ratio;\n float sn = clamp(snap, 0.05, 0.95);\n float u = min(t, sn) / sn;\n float s = u * (2.0 - u);\n float after = max(t - sn, 0.0) / (1.0 - sn);\n float rel = smoothstep(0.0, 1.0, after * 2.5);\n\n float aPre = mix(1.06, 0.2, s);\n \n float a = mix(aPre, -0.12, smoothstep(0.0, 1.0, after * 1.25)) - aPre * 0.25 * sin(after * 9.0) * exp(-after * 5.0);\n float rx = mix(W + 0.15, min(0.5 * W, 0.22), s);\n float ry = mix(0.55, min(1.25 * rx + 0.04, 0.3), s);\n float c0 = mix(0.58, 0.95 - ry, s * s);\n \n float fall = (1.06 - c0 + ry) * after * (0.15 + 0.85 * after);\n float c = c0 + fall;\n float rn = mix(W, 0.013, pow(s, 0.6)) * (1.0 + 0.6 * rel);\n float k = mix(0.32, 0.09, s * s);\n float ys = mix(aPre, c0 - ry, 0.45);\n float yu = mix(ys, a, smoothstep(0.0, 1.0, after * 3.0));\n float yl = mix(ys, c0 - 0.8 * ry, smoothstep(0.0, 1.0, after * 1.2)) + fall;\n float kc = k * (1.0 - smoothstep(0.0, 1.0, after * 12.0)) + 1e-4;\n vec4 b = vec4(a, yu, yl, rn);\n vec3 d = vec3(c, rx, ry);\n\n vec2 p = vec2((uv.x - 0.5) * ratio, 1.0 - uv.y);\n float sd = honey(p, b, d, k, kc);\n vec2 e = vec2(0.002, 0.0);\n vec2 g = vec2(\n honey(p + e.xy, b, d, k, kc) - honey(p - e.xy, b, d, k, kc),\n honey(p + e.yx, b, d, k, kc) - honey(p - e.yx, b, d, k, kc)) / (2.0 * e.x);\n\n \n float top = max(c - ry, a);\n float vTop = aPre + 0.1 * (1.0 - aPre) * clamp((top - a) / 0.1, 0.0, 1.0);\n float v = p.y < a ? p.y + aPre - a\n : p.y < top ? mix(aPre, vTop, (p.y - a) / max(top - a, 1e-4))\n : mix(vTop, 1.0, clamp((p.y - top) / (c + ry - top), 0.0, 1.0));\n \n float lo = 0.0;\n float hi = W;\n for (int i = 0; i < 10; i++) {\n float m = 0.5 * (lo + hi);\n if (honey(vec2(m, p.y), b, d, k, kc) < 0.0) lo = m; else hi = m;\n }\n \n float wb = 0.5 * (lo + hi);\n float w = mix(W, wb, smoothstep(a, a + 1.5 * k, p.y));\n \n float sx = clamp(p.x / max(mix(w, max(w, min(rx, W)), 0.6), 1e-3), -1.0, 1.0);\n\n float env = s * (1.0 - smoothstep(0.0, 1.0, after));\n float depth = clamp(-sd / clamp(0.6 * wb, 0.012, 0.18), 0.0, 1.0);\n float h = sqrt(depth * (2.0 - depth));\n \n vec2 nOut = vec2(g.x * smoothstep(0.0, 0.3 * w + 1e-3, abs(p.x)), -g.y) / max(length(g), 1e-3);\n vec3 n = normalize(vec3(nOut * (1.0 - depth) * s * gloss, mix(1.0, max(h, 0.05), s * gloss)));\n vec2 src = vec2(0.5 + 0.5 * sx, 1.0 - v) - n.xy * 0.03;\n vec4 img = getFromColor(clamp(mix(uv, src, s), 0.0, 1.0));\n\n vec3 l = normalize(vec3(-0.4, 0.55, 0.73));\n float dif = 1.0 + 0.45 * (dot(n, l) / l.z - 1.0);\n float rs = max(dot(reflect(-l, n), vec3(0.0, 0.0, 1.0)), 0.0);\n float bulk = smoothstep(0.02, 0.12, wb) * smoothstep(a, a + k, p.y);\n float thick = depth * bulk;\n \n float glow = bulk * smoothstep(0.0, 0.3, depth) * (1.0 - smoothstep(0.3, 1.0, depth)) * max(dot(nOut, -l.xy), 0.0);\n float amt = gloss * s;\n vec3 col = img.rgb * mix(1.0, dif, amt);\n col *= exp(-amt * (0.08 + thick) * vec3(0.0, 0.45, 1.2));\n col *= mix(vec3(1.0), vec3(0.55, 0.32, 0.1), 0.7 * amt * (1.0 - h) * (1.0 - h));\n col += amt * (1.3 * glow * AMBER + pow(rs, 50.0) + 0.12 * pow(rs, 8.0) * AMBER);\n img.rgb = col;\n\n float aa = 0.006;\n float inside = clamp(0.5 - sd / aa, 0.0, 1.0);\n vec4 bg = getToColor(uv);\n bg.rgb *= 1.0 - 0.45 * env * exp(-max(sd, 0.0) * 16.0);\n return mix(bg, img, 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","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 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 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","HorizontalHold":"// HorizontalHold — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HorizontalHold.glsl\n// Author: gre\n// License: MIT\n// Description: The picture loses its horizontal hold like an old TV: it shears into diagonal bands that slide sideways and wrap around, separated by a slanted blanking bar that carries the incoming image in, then the shear straightens, wobbles and locks\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 slips; \n\nuniform float shear; \n\nuniform float barWidth; \n\nuniform vec4 barColor; \n\nfloat slipCount() {\n return max(float(slips), 1.0);\n}\n\nvec4 stream(float x, float y, float unsync) {\n float period = 1.0 + barWidth;\n float n = floor(x / period);\n float xm = x - n * period;\n vec2 q = vec2(min(xm, 1.0), y);\n vec4 c = n >= floor(0.5 * slipCount() + 0.5) ? getToColor(q) : getFromColor(q);\n \n float d = min(xm, 1.0 - xm);\n float g = max(1.0 - d / 0.05, 0.0);\n c.rgb += 0.3 * unsync * g * g * c.a;\n float soft = min(0.012 * unsync, 0.5 * barWidth) + 1e-5;\n return mix(barColor, c, clamp(d / soft, 0.0, 1.0));\n}\n\nvec4 transition(vec2 uv) {\n float period = 1.0 + barWidth;\n \n float t = min(progress / 0.88, 1.0);\n float err = 16.0 * t * t * (1.0 - t) * (1.0 - t);\n float slip = t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\n float u = clamp((progress - 0.74) / 0.26, 0.0, 1.0);\n float lock = u * (1.0 - u) * (1.0 - u);\n float tilt = -0.5 * max(shear, 0.5) * lock * sin(9.42478 * u);\n float unsync = min(err + 3.0 * lock, 1.0);\n float ripple = 0.012 * sin(uv.y * 9.0 + progress * 40.0) + 0.005 * sin(uv.y * 31.0 - progress * 70.0);\n float x = uv.x + period * (slipCount() * slip + shear * err * (1.0 - uv.y) + tilt * (1.0 - uv.y)) + err * ripple;\n float blur = 0.002 * err * slipCount();\n vec4 c = stream(x, uv.y, unsync);\n if (blur > 0.0) {\n for (int i = 0; i < 4; i++) {\n c += stream(x + blur * (float(i) - 1.5), uv.y, unsync);\n }\n c /= 5.0;\n }\n c.rgb *= 1.0 - unsync * (0.1 + 0.08 * sin(uv.y * 480.0));\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","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","HyperbolicMosaic":"// HyperbolicMosaic — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HyperbolicMosaic.glsl\n// Author: gre\n// License: MIT\n// Description: The camera pulls back and the outgoing image turns out to be one tile of a curved mosaic on a hyperbolic plane, six tiles meeting at every corner and shrinking endlessly toward a round rim, alternating between the two images; the mosaic glides one tile over and the camera pushes 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 joints; \n\nconst float C = 0.57735;\n\nconst float PK = 0.36603;\n\nconst float A = 0.65848;\n\nfloat ease(float x) {\n x = clamp(x, 0.0, 1.0);\n return x * x * (3.0 - 2.0 * x);\n}\n\nvec3 boost(vec3 v, float r) {\n float e = exp(r), ch = 0.5 * (e + 1.0 / e), sh = 0.5 * (e - 1.0 / e);\n return vec3(v.x * ch + v.z * sh, v.y, v.x * sh + v.z * ch);\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n float w = ease(t / 0.4) * ease((1.0 - t) / 0.4);\n float g = 2.0 * A * ease((t - 0.25) / 0.5);\n\n vec2 s = (uv - 0.5) * vec2(ratio, 1.0);\n \n vec2 p = s / (0.51 * length(vec2(ratio, 1.0)));\n \n vec2 k0 = (uv - 0.5) * 2.0 * C;\n vec2 pz = mix(k0 / (1.0 + sqrt(1.0 - dot(k0, k0))), p, w);\n\n \n \n bool past = g > A;\n vec3 v = boost(vec3(2.0 * pz, 1.0 + dot(pz, pz)), past ? g - 2.0 * A : g);\n if (past) v.x = -v.x;\n\n \n mat3 P = mat3(1.0);\n float n = past ? 1.0 : 0.0;\n for (int i = 0; i < 24; i++) {\n vec2 k = v.xy / v.z;\n vec3 wall;\n if (k.x > C) wall = vec3(1.0, 0.0, C);\n else if (k.x < -C) wall = vec3(1.0, 0.0, -C);\n else if (k.y > C) wall = vec3(0.0, 1.0, C);\n else if (k.y < -C) wall = vec3(0.0, 1.0, -C);\n else break;\n \n vec3 jw = vec3(wall.xy, -wall.z) * (2.0 / (1.0 - C * C));\n v -= dot(v, jw) * wall;\n vec3 pw = P * wall;\n P -= mat3(pw * jw.x, pw * jw.y, pw * jw.z);\n n += 1.0;\n }\n vec2 k = v.xy / v.z;\n\n \n vec3 o = boost(P * vec3(0.0, 0.0, 1.0), -A);\n vec3 ox = boost(P * vec3(0.1, 0.0, 1.0), -A);\n vec3 oy = boost(P * vec3(0.0, 0.1, 1.0), -A);\n vec2 ex = ox.xy / ox.z - o.xy / o.z;\n vec2 ey = oy.xy / oy.z - o.xy / o.z;\n if (past) { ex.x = -ex.x; ey.x = -ey.x; }\n if (ex.x * ey.y - ex.y * ey.x < 0.0) { k.x = -k.x; ex = -ex; }\n \n if (abs(ex.x) >= abs(ex.y)) { if (ex.x < 0.0) k = -k; }\n else if (ex.y > 0.0) k = vec2(-k.y, k.x);\n else k = vec2(k.y, -k.x);\n\n vec2 pk = k / (1.0 + sqrt(max(1.0 - dot(k, k), 0.0)));\n \n vec2 crop = vec2(min(1.0 / ratio, 1.0), min(ratio, 1.0));\n vec2 q = clamp(0.5 + mix(k / C, pk / PK, w) * 0.5 * mix(vec2(1.0), crop, w), 0.0, 1.0);\n vec4 c = mod(n, 2.0) > 0.5 ? getToColor(q) : getFromColor(q);\n\n vec2 e = 1.0 - abs(k) / C;\n float edge = 0.5 * min(e.x, e.y);\n \n float j = joints * w * smoothstep(0.02, 0.2, 1.0 - dot(pz, pz));\n c.rgb *= 1.0 - j * (1.0 - smoothstep(0.0, 0.03, edge));\n c.rgb *= 1.0 - w * smoothstep(0.8, 1.0, length(p));\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","Inchworm":"// Inchworm — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Inchworm.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image crawls out of the frame like an inchworm: its back edge creeps forward and the picture humps up into a tall shaded arch, then its front edge reaches ahead and the arch flattens, two strides, uncovering the incoming image behind\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 arch; \n\nconst float PI = 3.14159265;\nconst float STRIDE = 0.5;\nconst float AA = 0.002;\nconst vec3 LIGHT = vec3(-0.5847, 0.3118, 0.7484);\n\nfloat iwEase(float x) {\n x = clamp(x, 0.0, 1.0);\n return x * x * (3.0 - 2.0 * x);\n}\n\nfloat iwHump(float x, float a, float span, float h) {\n float u = clamp((x - a) / span, 0.0, 1.0);\n float s = sin(PI * pow(u, 0.8));\n return h * s * s;\n}\n\nvec4 transition(vec2 uv) {\n float t = progress * 3.0;\n \n float g = iwEase(t / 1.2) + iwEase((t - 1.8) / 1.2);\n float reach = iwEase((t - 0.8) / 1.4);\n \n float a = STRIDE * g * ratio + 0.003 * g;\n float span = (1.0 + STRIDE * reach) * ratio - a;\n \n float h = arch * 0.55 * (ratio - span) * sqrt((ratio + span) / ratio);\n h = min(h / (1.0 + 0.5 * h), 1.2);\n\n \n vec3 eye = vec3(0.5 * ratio, -1.0, 1.8);\n vec3 ray = vec3(uv.x * ratio, uv.y, 0.0) - eye;\n\n float s0 = 1.0 - (h + 0.001) / eye.z;\n float sl = s0;\n float fl = eye.z * (1.0 - s0) - iwHump(eye.x + s0 * ray.x, a, span, h);\n float sr = 1.0;\n int side = 0;\n for (int i = 1; i <= 40; i++) {\n float s = mix(s0, 1.0, float(i) / 40.0);\n float f = eye.z * (1.0 - s) - iwHump(eye.x + s * ray.x, a, span, h);\n float y = eye.y + s * ray.y;\n if ((fl > 0.0) != (f > 0.0) && y > -2.0 * AA && y < 1.0 + 2.0 * AA) {\n sr = s;\n side = fl > 0.0 ? 1 : 2;\n break;\n }\n sl = s;\n fl = f;\n }\n float fr = eye.z * (1.0 - sr) - iwHump(eye.x + sr * ray.x, a, span, h);\n for (int i = 0; i < 5; i++) {\n float sm = 0.5 * (sl + sr);\n float fm = eye.z * (1.0 - sm) - iwHump(eye.x + sm * ray.x, a, span, h);\n if ((fm > 0.0) == (fl > 0.0)) {\n sl = sm;\n fl = fm;\n } else {\n sr = sm;\n fr = fm;\n }\n }\n \n float sh = abs(fl - fr) > 1e-6 ? sl + (sr - sl) * fl / (fl - fr) : sr;\n vec3 hit = eye + sh * ray;\n\n float len = 0.0;\n float tot = 0.0;\n float prev = 0.0;\n for (int i = 1; i <= 24; i++) {\n float x = a + span * float(i) / 24.0;\n float z = iwHump(x, a, span, h);\n float seg = sqrt(span * span / 576.0 + (z - prev) * (z - prev));\n tot += seg;\n len += seg * clamp((hit.x - x) * 24.0 / span + 1.0, 0.0, 1.0);\n prev = z;\n }\n\n float e = 0.002 * ratio;\n float dz = (iwHump(hit.x + e, a, span, h) - iwHump(hit.x - e, a, span, h)) / (2.0 * e);\n vec3 n = normalize(vec3(-dz, 0.0, 1.0));\n float light = (0.45 + 0.55 * max(dot(n, LIGHT), 0.0)) / (0.45 + 0.55 * LIGHT.z);\n \n light = side == 2 ? 0.35 : light;\n vec4 sheet = getFromColor(vec2(len / max(tot, 1e-6), clamp(hit.y, 0.0, 1.0)));\n sheet.rgb *= light;\n float cov = side > 0 ? smoothstep(-2.0 * AA, 0.0, hit.y) * smoothstep(-2.0 * AA, 0.0, 1.0 - hit.y) * smoothstep(a - 2.0 * AA, a, hit.x) : 0.0;\n\n float occ = 0.0;\n for (int i = 1; i <= 8; i++) {\n float z = h * float(i) / 8.0;\n float x = uv.x * ratio + z * LIGHT.x / LIGHT.z;\n float y = uv.y + z * LIGHT.y / LIGHT.z;\n float inside = smoothstep(-0.02, 0.0, y) * smoothstep(-0.02, 0.0, 1.0 - y);\n occ = max(occ, inside * smoothstep(0.0, 0.04, iwHump(x, a, span, h) - z));\n }\n vec4 floorColor = getToColor(uv);\n float ao = smoothstep(0.0, 0.3, iwHump(uv.x * ratio, a, span, h));\n floorColor.rgb *= (1.0 - 0.5 * occ) * (1.0 - 0.3 * ao);\n\n return mix(floorColor, sheet, cov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 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 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 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 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","InsetWipe":"// InsetWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/InsetWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A rectangle anchored in a corner, on an edge or in the center grows until the incoming image fills the frame, revealing it in place without scaling it; in reverse, the outgoing image shrinks into the rectangle\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 anchor; \n\nuniform float smoothness; \n\nuniform float borderWidth; \n\nuniform vec4 borderColor; \n\nuniform int reverse; \n\nconst float AA = 0.001;\n\nvec4 premultiplied(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n\n vec2 an = clamp(anchor, 0.0, 1.0);\n vec2 sq = vec2(ratio, 1.0);\n \n \n vec2 ext = max(an, 1.0 - an) * sq;\n vec2 d = abs(uv - an) * sq;\n float s = max(smoothness, AA);\n float bw = max(borderWidth, 0.0);\n\n \n \n float t = (reverse != 0) ? 1.0 - progress : progress;\n float p = mix(t, t * t * (3.0 - 2.0 * t), 0.3);\n vec2 size = p * ext + mix(-(bw + s), s, p);\n \n float e = max(d.x - size.x, d.y - size.y);\n\n vec4 inside = (reverse != 0) ? a : b;\n vec4 c = premultiplied((reverse != 0) ? b : a);\n if (bw > 0.0) {\n \n float m = 1.0 - smoothstep(bw - s, bw + s, e);\n c = premultiplied(borderColor) * m + c * (1.0 - borderColor.a * m);\n }\n c = mix(c, premultiplied(inside), 1.0 - smoothstep(-s, s, e));\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","InsideCube":"// InsideCube — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/InsideCube.glsl\n// Author: gre\n// License: MIT\n// Description: The camera stands inside a cube: the outgoing image covers the wall in front of it and the view turns toward the next inner wall, so the outgoing image swings away in perspective as the incoming one turns into view, the walls darkening into the shaded inner corner 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 vec2 direction; \n\nuniform float fov; \n\nuniform float shading; \n\nuniform vec4 background; \n\nconst float PI = 3.141592653589793;\nconst float EDGE = 0.002;\n\nvec4 premultiply(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nfloat cornerShadow(float dist, float size) {\n float k = 1.0 - smoothstep(0.0, size, dist);\n return k * k;\n}\n\nvec4 wallColor(vec2 l, bool incoming, bool vertical, float s) {\n vec2 h = vec2(l.x * s, l.y);\n vec2 p = vertical ? h.yx : h;\n vec2 st = clamp(p / vec2(ratio, 1.0) + 0.5, 0.0, 1.0);\n return premultiply(incoming ? getToColor(st) : getFromColor(st));\n}\n\nvec4 transition(vec2 uv) {\n bool vertical = abs(direction.y) > abs(direction.x);\n float s = (vertical ? direction.y : direction.x) < 0.0 ? -1.0 : 1.0;\n \n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n vec2 q = vertical ? p.yx : p;\n q.x *= s;\n float A = vertical ? 0.5 : 0.5 * ratio;\n float B = vertical ? 0.5 * ratio : 0.5;\n \n \n float F = A / tan(radians(clamp(fov, 55.0, 170.0)) * 0.5);\n\n float e = smoothstep(0.0, 1.0, progress);\n float th = 0.5 * PI * e;\n float c = cos(th);\n float sn = sin(th);\n float amount = max(sin(PI * e), 0.0); \n float aa = EDGE * min(1.0, 40.0 * amount) + 1e-6;\n float shadow = shading * min(1.0, 4.0 * amount);\n\n \n \n \n vec2 cam = (A - F) * e * vec2(1.0, -1.0);\n vec2 d = vec2(q.x * c + F * sn, F * c - q.x * sn);\n\n vec2 P = vec2(A, F) - cam;\n float sc = F * (P.x * c - P.y * sn) / max(P.x * sn + P.y * c, 1e-6);\n\n float tf = d.y > 1e-6 ? (F - cam.y) / d.y : 1e6;\n float af = cam.x + tf * d.x;\n vec2 lf = vec2(af, q.y * tf);\n float ti = d.x > 1e-6 ? (A - cam.x) / d.x : 1e6;\n float ai = (F - A) - (cam.y + ti * d.y);\n vec2 li = vec2(ai, q.y * ti);\n\n float size = 0.8 * min(A, B);\n float edgeF = cornerShadow(A - af, size) + 0.5 * cornerShadow(B - abs(lf.y), size);\n float edgeI = cornerShadow(ai + A, size) + 0.5 * cornerShadow(B - abs(li.y), size);\n float shadeF = (1.0 - shading * 0.8 * (1.0 - c)) * (1.0 - 0.7 * shadow * min(edgeF, 1.0));\n float shadeI = (1.0 - shading * 0.8 * (1.0 - sn)) * (1.0 - 0.7 * shadow * min(edgeI, 1.0));\n\n \n \n \n float wF = clamp(0.5 + (sc - q.x) / aa, 0.0, 1.0);\n float covF = wF * clamp(0.5 + (B / tf - abs(q.y)) / aa, 0.0, 1.0)\n * clamp(0.5 + (af + A) * d.y / (tf * F * aa), 0.0, 1.0);\n float covI = (1.0 - wF) * clamp(0.5 + (B / ti - abs(q.y)) / aa, 0.0, 1.0)\n * clamp(0.5 + (A - ai) * d.x / (ti * F * aa), 0.0, 1.0);\n vec4 colF = covF > 0.0 ? wallColor(lf, false, vertical, s) : vec4(0.0);\n vec4 colI = covI > 0.0 ? wallColor(li, true, vertical, s) : vec4(0.0);\n colF.rgb *= shadeF;\n colI.rgb *= shadeI;\n\n vec4 bg = premultiply(background);\n float cov = covF + covI;\n if (cov < 1.0) {\n float tb = min(B / max(abs(q.y), 1e-6), min(tf, ti));\n vec2 fl = cam + tb * d;\n float edgeB = cornerShadow(F - fl.y, size) + cornerShadow(A - fl.x, size);\n bg.rgb *= 1.0 - 0.5 * shadow * min(edgeB, 1.0);\n }\n vec4 col = colF * covF + colI * covI + bg * (1.0 - cov);\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","InterlaceWipe":"// InterlaceWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/InterlaceWipe.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image loads over the outgoing one like an interlaced picture on a slow connection: a first pass sweeps down drawing it in big blocky rows, then each new pass sweeps down again at twice the detail until the picture is 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 rows; \n\nuniform int passes; \n\nuniform float glow; \n\nvec4 transition(vec2 uv) {\n float lines = max(floor(rows), 1.0);\n float cols = max(floor(lines * ratio + 0.5), 1.0);\n \n float n = max(min(clamp(float(passes), 2.0, 6.0), 1.0 + floor(log2(lines) + 0.01)), 2.0);\n float row = min(floor((1.0 - uv.y) * lines), lines - 1.0);\n float col = min(floor(uv.x * cols), cols - 1.0);\n\n float p = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.5);\n \n float T = 1.5 / (n + 0.5);\n\n \n float bestB = 0.0;\n float light = 0.0;\n for (int i = 0; i < 6; i++) {\n float k = n - 1.0 - float(i); \n if (k < 0.0) break;\n float b = floor(exp2(float(i)) + 0.5); \n float u = clamp((p - (1.0 - T) * k / (n - 1.0)) / T, 0.0, 1.0);\n \n \n \n float glowRows = max(1.5 * b, 0.05 * lines);\n float blockRows = ceil(lines / b);\n float sweep = u * (blockRows + glowRows / b);\n float behind = sweep - floor(row / b) - (floor(col / b) + 1.0) / ceil(cols / b);\n if (behind >= -1e-4) {\n bestB = b;\n light = 1.0 - smoothstep(0.0, glowRows, behind * b);\n break;\n }\n }\n\n if (bestB == 0.0) return getFromColor(uv);\n vec4 c;\n if (bestB <= 1.0) {\n c = getToColor(uv);\n } else {\n float top = floor(row / bestB) * bestB;\n float left = floor(col / bestB) * bestB;\n c = getToColor(vec2((left + 0.5) / cols, 1.0 - (top + 0.5) / lines));\n }\n c.rgb += 0.5 * glow * light * (1.0 - c.rgb);\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","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.4;\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 return behindSurface(p,yc, point, rrotation);\n }\n\n if (yc > cylinderRadius)\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","IrisFold":"// IrisFold — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/IrisFold.glsl\n// Author: gre\n// License: MIT\n// Description: Folded paper strips of the incoming image slide in one after another around a shrinking polygonal hole, each turned a little from the last so their creased edges spiral inward, until the hole closes on 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 sides; \n\nuniform int rounds; \n\nuniform float twist; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\nconst float AA = 0.004;\n\nconst float D = 1.8;\n\nvec4 transition(vec2 uv) {\n vec2 aspect = vec2(ratio, 1.0);\n vec2 q = (uv - 0.5) * aspect;\n float R = 0.5 * length(aspect);\n float ns = clamp(float(sides), 3.0, 6.0);\n float N = ns * clamp(float(rounds), 2.0, 5.0);\n float L = N - ns;\n \n float tt = pow(clamp(progress / 0.9, 0.0, 1.0), 0.85) * (L + 0.4 * (ns - 1.0) + D);\n float deco = shading * (1.0 - smoothstep(0.88, 1.0, progress));\n float w0 = 0.6 * R;\n float turn = 2.0 * PI / ns + twist;\n vec2 rot = vec2(cos(turn), sin(turn));\n vec2 n = vec2(cos(0.3), sin(0.3));\n\n vec4 col = getFromColor(uv);\n vec4 to = getToColor(uv);\n for (int i = 0; i < 30; i++) {\n float k = float(i);\n if (k >= N) break;\n float s = clamp((tt - min(k, L + 0.4 * (k - L))) / D, 0.0, 1.0);\n if (s <= 0.0) break;\n float lift = 1.0 - s;\n float e = 1.0 - lift * lift * lift;\n \n float target = mix(0.68 * R, -0.03, min((k + 1.0) / (L + 1.0), 1.0));\n float d = dot(q, n) - target - (R + 0.06 - target) * (1.0 - e);\n \n float landed = k < ns ? 1.0 : smoothstep(0.7, 1.0, s);\n float m = smoothstep(-AA, AA, d) * mix(1.0 - smoothstep(w0 - AA, w0 + AA, d), 1.0, landed);\n float reach = 0.025 + 0.03 * lift;\n float sh = (1.0 - smoothstep(0.0, reach, -d)) * step(d, 0.0) + (1.0 - landed) * (1.0 - smoothstep(0.0, 0.6 * reach, d - w0)) * step(w0, d);\n col.rgb *= 1.0 - (0.4 + 0.2 * lift) * deco * sh * sh;\n vec4 b = to;\n b.rgb = mix(b.rgb, vec3(1.0), 0.35 * deco * b.a * exp(-max(d, 0.0) / 0.005));\n b.rgb *= 1.0 - deco * (0.12 * smoothstep(0.0, w0, d) * (mod(k, 2.0) < 0.5 ? 1.0 : 0.5) + 0.1 * lift);\n col = mix(col, b, m);\n n = vec2(n.x * rot.x - n.y * rot.y, n.x * rot.y + n.y * rot.x);\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","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","KeyholeWipe":"// KeyholeWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/KeyholeWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A keyhole grows steadily from the center until the incoming image fills the frame, its bevelled rim and inner shadow making it read as a hole cut in a plate\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 rim; \n\nuniform float smoothness; \n\nconst float SLOT_HE = 0.23;\nconst float SLOT_TOP = 0.085;\nconst float SLOT_BOTTOM = 0.165;\nconst float SLOT_ROUND = 0.025;\n\nconst float GROW_Y = 0.1;\nconst float BEVEL = 0.028;\nconst float SHADE = 0.05;\n\nfloat dot2(vec2 v) { return dot(v, v); }\n\nfloat sdSlot(vec2 p) {\n p.y -= -0.17;\n float r1 = SLOT_BOTTOM - SLOT_ROUND;\n float r2 = SLOT_TOP - SLOT_ROUND;\n float he = SLOT_HE - SLOT_ROUND;\n vec2 k1 = vec2(r2, he);\n vec2 k2 = vec2(r2 - r1, 2.0 * he);\n p.x = abs(p.x);\n vec2 ca = vec2(p.x - min(p.x, p.y < 0.0 ? r1 : r2), abs(p.y) - he);\n vec2 cb = p - k1 + k2 * clamp(dot(k1 - p, k2) / dot2(k2), 0.0, 1.0);\n float s = (cb.x < 0.0 && ca.y < 0.0) ? -1.0 : 1.0;\n return s * sqrt(min(dot2(ca), dot2(cb))) - SLOT_ROUND;\n}\n\nfloat sdKeyhole(vec2 p) {\n return min(length(p - vec2(0.0, 0.2)) - 0.25, sdSlot(p));\n}\n\nfloat reach(vec2 p) {\n vec2 h = vec2(0.0, 0.2) - vec2(0.0, GROW_Y);\n float k = 0.25 * 0.25 - dot2(h);\n float b = dot(p, h);\n return (sqrt(b * b + k * dot2(p)) - b) / k;\n}\n\nvec4 transition (vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n vec2 asp = vec2(ratio, 1.0);\n vec2 c = center * asp;\n float sm = max(smoothness, 0.0005);\n\n \n \n vec2 o = c;\n vec2 lo = -o - 2.5 * sm;\n vec2 hi = asp - o + 2.5 * sm;\n float full = max(max(reach(lo), reach(hi)), max(reach(vec2(lo.x, hi.y)), reach(vec2(hi.x, lo.y))));\n\n float p = progress;\n float s = full * p;\n if (s <= 0.0) return a;\n\n vec2 q = (uv * asp - o) / s + vec2(0.0, GROW_Y);\n float d = sdKeyhole(q);\n \n float hole = 1.0 - smoothstep(-sm, sm, d * s + sm);\n\n float fade = smoothstep(0.0, 0.08, p) * (1.0 - smoothstep(0.7, 1.0, p));\n float rimA = rim * fade;\n if (rimA > 0.0) {\n vec2 e = vec2(0.002, 0.0);\n vec2 n = vec2(sdKeyhole(q + e) - sdKeyhole(q - e), sdKeyhole(q + e.yx) - sdKeyhole(q - e.yx));\n float lit = -dot(n / max(length(n), 1e-6), vec2(-0.35, 0.94));\n float bevel = 1.0 - smoothstep(0.0, BEVEL, d);\n float shade = exp(-max(d, 0.0) / SHADE);\n a.rgb *= 1.0 - rimA * (0.35 * shade + bevel * 0.4 * max(-lit, 0.0));\n a.rgb += rimA * bevel * bevel * 0.3 * max(lit, 0.0) * a.a;\n\n float wall = smoothstep(-0.03, 0.03, sdKeyhole(q + vec2(0.0, 0.05)));\n float vign = exp(min(d, 0.0) / SHADE);\n b.rgb *= 1.0 - rimA * (0.5 * wall + 0.3 * vign);\n }\n\n return mix(a, b, hole);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Kite":"// Kite — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Kite.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture pinches by its corners into a diamond kite with a taped hem and a ribbon tail of bows; it catches the wind, tugs on its string and swoops from side to side as it climbs away, fluttering and shrinking, into the sky of the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 flutter; \n\nuniform float shading; \n\nuniform vec4 ribbon; \n\nuniform vec4 lineColor; \n\nconst float PI = 3.14159265;\n\nvec2 rot(vec2 v, float a) {\n float c = cos(a), s = sin(a);\n return vec2(c * v.x - s * v.y, s * v.x + c * v.y);\n}\n\nfloat cross2(vec2 a, vec2 b) { return a.x * b.y - a.y * b.x; }\n\nfloat segDist(vec2 q, vec2 a, vec2 b) {\n vec2 ab = b - a;\n float h = clamp(dot(q - a, ab) / dot(ab, ab), 0.0, 1.0);\n return length(q - a - ab * h);\n}\n\nvec2 kiteVertex(vec2 k, float tilt, float roll, vec2 c, float s, vec2 wob) {\n k += wob;\n \n vec3 k3 = vec3(k.x, k.y * cos(tilt), k.y * sin(tilt));\n return c + rot(s * k3.xy / (1.0 + 0.7 * k3.z), roll);\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 float pin = smoothstep(0.0, 0.26, p);\n \n float u = clamp((p - 0.16) / 0.84, 0.0, 1.0);\n float t = u * u * (1.7 - 0.7 * u);\n float env = pin * (1.0 - t * 0.5);\n\n vec2 c = vec2(0.28 * ratio * sin(2.0 * PI * 1.1 * t) * (1.0 - 0.4 * t), 0.12 * pin + 0.3 * t + 0.42 * t * t * t);\n float s = 0.72 * min(1.0, 1.1 * ratio) * mix(1.0, 0.1, t);\n float roll = 0.5 * sin(2.0 * PI * 1.25 * t + 0.6) * pin * (1.0 - 0.5 * t);\n float tilt = 0.55 * pin + 0.2 * sin(2.0 * PI * 2.5 * t);\n float w = 0.025 * flutter * pin;\n float ph = 34.0 * p;\n\n vec2 hr = 0.5 * asp;\n vec2 p0 = mix(vec2(-hr.x, -hr.y), kiteVertex(vec2(-0.4, 0.1), tilt, roll, c, s, w * vec2(sin(ph), cos(ph * 1.3))), pin);\n vec2 p1 = mix(vec2(hr.x, -hr.y), kiteVertex(vec2(0.0, -0.62), tilt, roll, c, s, w * vec2(sin(ph * 1.7 + 1.0), 0.0)), pin);\n vec2 p2 = mix(vec2(hr.x, hr.y), kiteVertex(vec2(0.4, 0.1), tilt, roll, c, s, w * vec2(sin(ph + 2.0), cos(ph * 1.1 + 2.0))), pin);\n vec2 p3 = mix(vec2(-hr.x, hr.y), kiteVertex(vec2(0.0, 0.44), tilt, roll, c, s, w * vec2(0.0, sin(ph * 0.9 + 3.0))), pin);\n\n \n float dx1 = p1.x - p2.x, dx2 = p3.x - p2.x, dx3 = p0.x - p1.x + p2.x - p3.x;\n float dy1 = p1.y - p2.y, dy2 = p3.y - p2.y, dy3 = p0.y - p1.y + p2.y - p3.y;\n float den = dx1 * dy2 - dx2 * dy1;\n float g = (dx3 * dy2 - dx2 * dy3) / den;\n float h = (dx1 * dy3 - dx3 * dy1) / den;\n float a = p1.x - p0.x + g * p1.x, b = p3.x - p0.x + h * p3.x;\n float d = p1.y - p0.y + g * p1.y, e = p3.y - p0.y + h * p3.y;\n float cx = p0.x, fy = p0.y;\n vec3 r0 = vec3(e - fy * h, cx * h - b, b * fy - cx * e);\n vec3 r1 = vec3(fy * g - d, a - cx * g, cx * d - a * fy);\n vec3 r2 = vec3(d * h - e * g, b * g - a * h, a * e - b * d);\n vec3 Q = vec3(q, 1.0);\n \n vec2 k = clamp(vec2(dot(r0, Q), dot(r1, Q)) / max(dot(r2, Q), 1e-4), -1.0, 2.0);\n\n float sd = min(min(cross2(p1 - p0, q - p0) / length(p1 - p0), cross2(p2 - p1, q - p1) / length(p2 - p1)),\n min(cross2(p3 - p2, q - p2) / length(p3 - p2), cross2(p0 - p3, q - p3) / length(p0 - p3)));\n float cov = clamp(0.5 + sd / (0.0025 * pin + 1e-5), 0.0, 1.0);\n\n vec4 bg = getToColor(0.5 + (uv - 0.5) / (1.0 + 0.08 * (1.0 - p)));\n bg.rgb *= bg.a;\n\n float den2 = cross2(p2 - p0, p3 - p1);\n vec2 hub = p0 + (p2 - p0) * cross2(p1 - p0, p3 - p1) / den2;\n vec2 anchor = vec2(-0.3 * ratio, -0.9);\n float str = (1.0 - smoothstep(0.0025 * s + 0.0006, 0.0025 * s + 0.002, segDist(q, hub, anchor)))\n * smoothstep(0.15, 0.35, p) * (1.0 - smoothstep(0.5, 0.66, c.y));\n bg = mix(bg, vec4(lineColor.rgb, 1.0), str * lineColor.a);\n\n vec2 dn = normalize(p1 - hub + vec2(0.0, -0.4 * length(p1 - hub)));\n vec2 pr = vec2(-dn.y, dn.x);\n float L = 0.95 * s;\n vec2 tq = q - p1;\n float al = dot(tq, dn) / L;\n float wav = (0.08 * s) * sin(10.0 * al - 22.0 * p - 1.0) * al * (0.12 + 1.2 * flutter);\n float slope = (0.8 * s / L) * cos(10.0 * al - 22.0 * p - 1.0) * al * (0.12 + 1.2 * flutter);\n float ac = (dot(tq, pr) - wav) / sqrt(1.0 + slope * slope);\n float tail = (1.0 - smoothstep(0.004 * s, 0.004 * s + 0.0015, abs(ac))) * step(0.0, al) * (1.0 - smoothstep(0.97, 1.0, al));\n float bw = 0.055 * s;\n float bows = 0.0, fold = 0.0;\n for (int i = 0; i < 5; i++) {\n float bt = 0.2 + 0.18 * float(i);\n float ba = (al - bt) * L;\n float m = (1.0 - smoothstep(bw - 0.0015, bw, abs(ac))) * (1.0 - smoothstep(0.0, 0.0015, abs(ba) - 0.35 * bw * (0.25 + abs(ac) / bw)));\n fold = mix(fold, ac / bw, m);\n bows = max(bows, m);\n }\n tail = max(tail, bows) * pin * ribbon.a;\n bg = mix(bg, vec4(ribbon.rgb * (1.0 + 0.2 * bows * fold), 1.0), tail);\n\n vec4 col = getFromColor(clamp(k, 0.0, 1.0));\n float d1 = abs(k.x - k.y), d2 = abs(k.x + k.y - 1.0);\n float panel = sign(k.x - k.y) * 0.6 + sign(k.x + k.y - 1.0) * 0.4;\n float sh = 1.0 + shading * env * (0.13 * panel * cos(roll * 3.0 + tilt) - 0.4 * (1.0 - smoothstep(0.004, 0.01 + 0.002 / s, min(d1, d2))));\n float rim = min(min(k.x, 1.0 - k.x), min(k.y, 1.0 - k.y));\n \n float bulge = smoothstep(0.0, 0.18, min(min(d1, d2), rim));\n sh += shading * env * 0.1 * (bulge - 0.6);\n col.rgb *= sh;\n float hem = (1.0 - smoothstep(0.012, 0.018, rim)) * env;\n col.rgb = mix(col.rgb, ribbon.rgb * (0.85 + 0.15 * panel), 0.85 * hem * ribbon.a);\n vec4 o = mix(bg, vec4(col.rgb * col.a, col.a), cov);\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","Knead":"// Knead — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Knead.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is kneaded like dough: its two halves squeeze and slide past each other into two rows, again and again, until the picture is drawn out into thin layers; the layers of the incoming image are pressed in between them, then the incoming image is unkneaded back into one picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 kneads; \n\nuniform float shadow; \n\nuniform vec4 backColor; \n\nvec4 img(vec2 q, bool incoming) {\n return incoming ? getToColor(q) : getFromColor(q);\n}\n\nvec2 unknead(vec2 q, int n) {\n for (int i = 0; i < 5; i++) {\n if (i >= n) break;\n q = q.y < 0.5 ? vec2(0.5 * q.x, 2.0 * q.y) : vec2(0.5 + 0.5 * q.x, 2.0 * q.y - 1.0);\n }\n return q;\n}\n\nvec2 unkneadRow(float x, float row, float t, int n) {\n float h = exp2(float(n));\n for (int i = 0; i < 5; i++) {\n if (i >= n) break;\n h *= 0.5;\n float hi = step(h, row);\n row -= hi * h;\n x = 0.5 * x + 0.5 * hi;\n }\n return vec2(x, t);\n}\n\nfloat box(vec2 p, vec2 lo, vec2 hi, vec2 soft) {\n vec2 d = min(p - lo, hi - p) / soft;\n return clamp(min(d.x, d.y), 0.0, 1.0);\n}\n\nfloat layerShade(float t, float amount) {\n float c = 2.0 * t - 1.0;\n float c2 = c * c;\n return 1.0 + amount * (0.25 * c * (1.0 - c2) - 0.55 * c2 * c2);\n}\n\nfloat creases(float y, float rows, float amount) {\n return layerShade(fract(y * rows), amount);\n}\n\nvec4 kneaded(vec2 uv, int n, float s, bool incoming, float g) {\n float env = 4.0 * s * (1.0 - s);\n float rows = exp2(float(n));\n float amount = shadow * g;\n \n vec2 st = vec2(smoothstep(0.0, 0.75, s), smoothstep(0.25, 1.0, s));\n \n vec2 soft = vec2(0.004 / ratio, 0.004) * smoothstep(0.0, 0.3, st.x) * smoothstep(0.0, 0.3, 1.0 - st.y) + 1e-6;\n vec2 hiL = vec2(0.5 + 0.5 * st.x, 1.0 - 0.5 * st.y);\n vec2 loR = vec2(0.5 - 0.5 * st.x, 0.5 * st.y);\n vec2 l = uv / hiL;\n vec2 r = (uv - loR) / (1.0 - loR);\n vec2 xs = vec2(0.1 / ratio, 0.1);\n \n float lift = env * smoothstep(0.0, 0.3, st.x);\n\n vec4 bottom = img(unknead(vec2(0.5 * l.x, l.y), n), incoming);\n bottom.rgb *= creases(l.y, rows, amount) * (1.0 - 0.7 * shadow * lift * (1.0 - smoothstep(0.0, xs.x, hiL.x - uv.x)));\n vec4 c = mix(backColor, bottom, box(uv, vec2(-1.0), hiL + soft, soft));\n\n vec2 off = vec2(0.02 / ratio, -0.03) * lift;\n float sh = 1.0 - smoothstep(0.0, 0.05, -min(ratio * min(uv.x - off.x - loR.x, 1.0 - uv.x + off.x), min(uv.y - off.y - loR.y, 1.0 - uv.y + off.y)));\n c.rgb *= 1.0 - shadow * 0.6 * lift * sh;\n\n vec4 top = img(unknead(vec2(0.5 + 0.5 * r.x, r.y), n), incoming);\n top.rgb *= creases(r.y, rows, amount) * (1.0 + 0.08 * lift) * (1.0 - 0.7 * shadow * lift * (1.0 - smoothstep(0.0, xs.x, uv.x - loR.x)));\n return mix(c, top, box(uv, loR, vec2(2.0), soft));\n}\n\nvec4 interleave(vec2 uv, int n, float w, float g) {\n float rows = exp2(float(n));\n float amount = shadow * g;\n float y = uv.y * rows;\n float row = floor(y);\n float t = y - row;\n float side = mod(row, 2.0) < 1.0 ? uv.x : 1.0 - uv.x;\n float f = smoothstep(0.0, 1.0, clamp(1.7 * w - 0.7 * side, 0.0, 1.0));\n float tIn = clamp(t / max(f, 1e-4), 0.0, 1.0);\n float tOut = clamp((t - f) / max(1.0 - f, 1e-4), 0.0, 1.0);\n vec4 a = getToColor(unkneadRow(uv.x, row, tIn, n));\n vec4 b = getFromColor(unkneadRow(uv.x, row, tOut, n));\n a.rgb *= layerShade(tIn, amount);\n b.rgb *= layerShade(tOut, amount);\n \n a.rgb *= 1.0 - 0.4 * shadow * (1.0 - smoothstep(0.0, 0.5, f));\n b.rgb *= 1.0 - 0.4 * shadow * (1.0 - smoothstep(0.0, 0.5, 1.0 - f));\n \n float edge = 0.0015 * min(1.0, 8.0 * f * (1.0 - f)) + 1e-6;\n return mix(a, b, smoothstep(-edge, edge, (t - f) / rows + edge * (1.0 - 2.0 * f)));\n}\n\nvec4 transition(vec2 uv) {\n int kn = int(clamp(float(kneads), 1.0, 5.0));\n float n = float(kn);\n const float SWAP = 1.2;\n float g = smoothstep(0.0, 0.12, progress) * smoothstep(0.0, 0.12, 1.0 - progress);\n float u = progress * (2.0 * n + SWAP);\n if (u < n) {\n float k = floor(u);\n return kneaded(uv, int(k), smoothstep(0.0, 1.0, u - k), false, g);\n }\n float v = 2.0 * n + SWAP - u;\n if (v < n) {\n float k = floor(v);\n return kneaded(uv, int(k), smoothstep(0.0, 1.0, v - k), true, g);\n }\n return interleave(uv, kn, (u - n) / SWAP, g);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LayoutGrid":"// LayoutGrid — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LayoutGrid.glsl\n// Author: gre\n// License: MIT\n// Description: The frame splits into an asymmetric magazine grid as paper gutters open between the panels; panel after panel in reading order, the incoming image pushes the outgoing one out of its panel from a different side, a colored accent band between them, then the gutters close over the full 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 gutter; \n\nuniform float overlap; \n\nuniform float band; \n\nuniform float shadow; \n\nuniform vec4 paper; \n\nuniform vec4 accent; \n\nconst int PANELS = 6;\n\nconst float OPEN = 0.28;\n\nconst float START = 0.1;\nconst float EDGE = 0.0025;\n\nvec4 panelRect(int i, bool portrait) {\n if (portrait) {\n if (i == 0) return vec4(0.0, 0.68, 0.62, 1.0);\n if (i == 1) return vec4(0.62, 0.68, 1.0, 1.0);\n if (i == 2) return vec4(0.0, 0.36, 1.0, 0.68);\n if (i == 3) return vec4(0.0, 0.0, 0.46, 0.36);\n if (i == 4) return vec4(0.46, 0.17, 1.0, 0.36);\n return vec4(0.46, 0.0, 1.0, 0.17);\n }\n if (i == 0) return vec4(0.0, 0.42, 0.4, 1.0);\n if (i == 1) return vec4(0.4, 0.64, 1.0, 1.0);\n if (i == 2) return vec4(0.4, 0.0, 0.7, 0.64);\n if (i == 3) return vec4(0.7, 0.32, 1.0, 0.64);\n if (i == 4) return vec4(0.7, 0.0, 1.0, 0.32);\n return vec4(0.0, 0.0, 0.4, 0.42);\n}\n\nvec2 panelDir(int i, bool portrait) {\n if (portrait) {\n if (i == 0) return vec2(1.0, 0.0);\n if (i == 1) return vec2(0.0, -1.0);\n if (i == 2) return vec2(-1.0, 0.0);\n if (i == 3) return vec2(0.0, 1.0);\n if (i == 4) return vec2(1.0, 0.0);\n return vec2(-1.0, 0.0);\n }\n if (i == 0) return vec2(0.0, -1.0);\n if (i == 1) return vec2(-1.0, 0.0);\n if (i == 2) return vec2(0.0, 1.0);\n if (i == 3) return vec2(1.0, 0.0);\n if (i == 4) return vec2(-1.0, 0.0);\n return vec2(1.0, 0.0);\n}\n\nfloat easeInOut(float t) {\n return t < 0.5 ? 4.0 * t * t * t : 1.0 - 4.0 * (1.0 - t) * (1.0 - t) * (1.0 - t);\n}\n\nfloat span1(float x, float lo, float hi, float aa) {\n return smoothstep(lo - aa, lo + aa, x) * (1.0 - smoothstep(hi - aa, hi + aa, x));\n}\n\nfloat boxDist(vec2 p, vec2 lo, vec2 hi) {\n vec2 d = abs(p - 0.5 * (lo + hi)) - 0.5 * (hi - lo);\n return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);\n}\n\nvec4 transition(vec2 uv) {\n bool portrait = ratio < 1.0;\n vec2 aspect = vec2(ratio, 1.0) / min(ratio, 1.0);\n vec2 p = uv * aspect;\n float open = smoothstep(0.0, OPEN, progress) * (1.0 - smoothstep(1.0 - OPEN, 1.0, progress));\n float g = gutter * open;\n float ov = clamp(overlap, 0.0, 0.9);\n float span = (1.0 - 2.0 * START) / (1.0 + float(PANELS - 1) * (1.0 - ov));\n\n vec4 color = vec4(0.0);\n float cover = 0.0;\n float shade = 0.0;\n for (int i = 0; i < PANELS; i++) {\n vec4 r = panelRect(i, portrait);\n vec2 lo = r.xy * aspect + 0.5 * g;\n vec2 hi = r.zw * aspect - 0.5 * g;\n \n lo = mix(lo, vec2(-1.0), step(r.xy, vec2(0.0)));\n hi = mix(hi, aspect + 1.0, step(vec2(1.0), r.zw));\n float t = clamp((progress - START - float(i) * span * (1.0 - ov)) / span, 0.0, 1.0);\n float lift = 1.0 + 1.2 * sin(3.141592653589793 * t);\n float sd = boxDist(p - vec2(0.2, -0.35) * g * lift, lo, hi);\n shade = max(shade, (1.0 - smoothstep(-0.2 * g, 0.6 * g * lift + 1e-4, sd)) / sqrt(lift));\n \n float inside = span1(p.x, lo.x, hi.x, EDGE) * span1(p.y, lo.y, hi.y, EDGE);\n if (inside > 0.0) {\n vec2 dir = panelDir(i, portrait);\n vec4 c;\n if (t <= 0.0) {\n c = getFromColor(uv);\n } else if (t >= 1.0) {\n c = getToColor(uv);\n } else {\n float e = easeInOut(t);\n \n float len = abs(dot(r.zw - r.xy, dir));\n float w = band * len;\n vec2 q = uv - dir * e * (len + w);\n \n float a = dot(q - (dir.x + dir.y < 0.0 ? r.zw : r.xy), dir);\n float af = a * abs(dot(aspect, dir));\n float wf = w * abs(dot(aspect, dir));\n float fromW = smoothstep(-EDGE, 0.0, af);\n float toW = 1.0 - smoothstep(-wf, -wf + EDGE, af);\n float bandShade = 1.0 - shadow * 0.5 * (1.0 - smoothstep(-wf, -wf + 0.35 * wf + 1e-4, af));\n vec4 b = vec4(accent.rgb * bandShade, accent.a);\n c = mix(b, getFromColor(clamp(q, r.xy, r.zw)), fromW);\n c = mix(c, getToColor(clamp(q + dir * (len + w), r.xy, r.zw)), toW);\n }\n color += c * inside;\n cover += inside;\n }\n }\n color /= max(cover, 1.0);\n cover = min(cover, 1.0);\n vec4 bg = vec4(paper.rgb * (1.0 - shadow * shade * open), paper.a);\n return color + bg * (1.0 - 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","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 vec2 leaf_uv = (uv - vec2(0.5))/10./max(pow(progress,3.5), 1e-6);\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","LedWall":"// LedWall — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LedWall.glsl\n// Author: gre\n// License: MIT\n// Description: The picture zooms into a giant LED screen of round glowing diodes on a dark panel; a refresh wave sweeps across it, each diode flicking with a bright pop as it switches to the incoming image, then the diodes melt back into the plain picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 glow; \n\nuniform float flash; \n\nuniform float zoom; \n\nuniform int triads; \n\nuniform vec2 direction; \n\nuniform vec4 panel; \n\nconst float RADIUS = 0.36;\nconst float EDGE = 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\nvec2 mirrored(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nfloat disc(float d, float r) {\n return 1.0 - smoothstep(r - EDGE, r + EDGE, d);\n}\n\nvec4 transition(vec2 uv) {\n float led = smoothstep(0.0, 0.3, progress) * (1.0 - smoothstep(0.7, 1.0, progress));\n float z = 1.0 + max(zoom, 0.0) * smoothstep(0.0, 0.45, progress) * (1.0 - smoothstep(0.55, 1.0, progress));\n vec2 p = 0.5 + (uv - 0.5) / z;\n\n vec2 aspect = vec2(ratio, 1.0);\n vec2 toCells = aspect * max(cells, 1.0) / min(ratio, 1.0);\n vec2 q = (p - 0.5) * toCells;\n vec2 id = floor(q + 0.5);\n vec2 local = q - id;\n vec2 side = vec2(local.x < 0.0 ? -1.0 : 1.0, local.y < 0.0 ? -1.0 : 1.0);\n\n vec2 dir = length(direction) > 1e-4 ? normalize(direction) : vec2(1.0, 0.0);\n float extent = abs(dir.x) * ratio + abs(dir.y);\n\n vec4 own = vec4(0.0);\n float ownSwitch = 0.0;\n vec4 halo = vec4(0.0);\n float haloWeight = 0.0;\n \n for (int i = 0; i < 4; i++) {\n if (i > 0 && glow * led <= 0.0) break;\n vec2 o = vec2(mod(float(i), 2.0), floor(float(i) / 2.0)) * side;\n vec2 c = id + o;\n vec2 cuv = c / toCells + 0.5;\n \n float s = clamp(dot((cuv - 0.5) * z * aspect, dir) / extent + 0.5, 0.0, 1.0);\n float when = 0.2 + 0.52 * s + 0.05 * (hash12(c + 71.0) - 0.5);\n float sw = smoothstep(when - 0.012, when + 0.012, progress);\n float x = (progress - when) / 0.018;\n float pop = exp(-x * x) - 0.5 * exp(-(x + 1.6) * (x + 1.6));\n vec2 suv = mirrored(cuv);\n vec4 col = mix(getFromColor(suv), getToColor(suv), sw);\n col.rgb = col.rgb * (1.0 + 1.4 * flash * pop) + 0.2 * flash * max(pop, 0.0);\n if (i == 0) {\n own = col;\n ownSwitch = sw;\n }\n float d = length(local - o);\n float w = 0.9 * glow * exp(-6.0 * max(d - RADIUS, 0.0)) * (1.0 + 0.8 * flash * max(pop, 0.0));\n \n if (o.x != 0.0) w *= smoothstep(0.0, 0.2, abs(local.x));\n if (o.y != 0.0) w *= smoothstep(0.0, 0.2, abs(local.y));\n halo += w * col;\n haloWeight += w;\n }\n\n vec4 plain = mix(getFromColor(p), getToColor(p), ownSwitch);\n float d = length(local);\n \n \n float r = mix(0.8, RADIUS, smoothstep(0.0, 0.6, led));\n vec4 gap = vec4(panel.rgb, panel.a * own.a);\n if (haloWeight > 0.0) {\n gap = mix(gap, halo / haloWeight, clamp(haloWeight * led, 0.0, 1.0));\n }\n vec4 body = own;\n if ((triads != 0)) {\n vec3 sub = vec3(\n disc(length(local - vec2(0.0, 0.15)), 0.2),\n disc(length(local - vec2(-0.13, -0.075)), 0.2),\n disc(length(local - vec2(0.13, -0.075)), 0.2));\n float m = max(sub.r, max(sub.g, sub.b));\n body = vec4(gap.rgb * (1.0 - m) + own.rgb * 1.5 * sub, mix(gap.a, own.a, m));\n r = max(r, 0.45);\n } else {\n float k = clamp(d / RADIUS, 0.0, 1.0);\n body.rgb *= 0.8 + 0.45 * (1.0 - k * k);\n }\n float lit = smoothstep(0.0, 0.8, led);\n body = mix(plain, body, lit * mix(1.0, lit, smoothstep(0.0, 0.7, d)));\n vec4 color = mix(gap, body, disc(d, r));\n return clamp(color, 0.0, 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","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\n float env = 4.0 * p * (1.0 - p);\n float peak = pow(env, 24.0);\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 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 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 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 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 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 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","LensPush":"// LensPush — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LensPush.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image pushes the outgoing one out of frame as if seen through a wide-angle lens: the frame bulges and bends the seam while the images speed past, with motion blur, color fringes toward the edges and a light vignette, then flattens back as the push lands\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 strength; \n\nuniform float fringe; \n\nuniform float blur; \n\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 return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 strip(vec2 q, vec2 d) {\n if (q.x >= 0.0 && q.x <= 1.0 && q.y >= 0.0 && q.y <= 1.0) {\n return getFromColor(q);\n }\n return getToColor(mirror(q + d));\n}\n\nvec4 transition(vec2 uv) {\n \n vec2 ad = abs(direction);\n vec2 d = sign(direction) * step(0.4142 * max(ad.x, ad.y), ad);\n if (dot(d, d) == 0.0) d = vec2(-1.0, 0.0);\n float p = progress;\n \n float pos = p * p * p * (p * (p * 6.0 - 15.0) + 10.0);\n float speed = 30.0 * p * p * (1.0 - p) * (1.0 - p) / 1.875;\n float len = clamp(blur, 0.0, 1.0) * 0.25 * speed;\n float h = 1.0 - abs(2.0 * p - 1.0);\n float hs = h * h * (3.0 - 2.0 * h);\n float k = clamp(strength, 0.0, 1.0) * 0.75 * hs;\n float ca = clamp(fringe, 0.0, 1.0) * 0.06 * hs;\n\n \n vec2 aspect = vec2(ratio, 1.0);\n float r = length((uv - 0.5) * aspect) / length(0.5 * aspect);\n float r2 = r * r;\n\n \n \n float jitter = hash(uv * aspect * 731.0);\n vec3 col = vec3(0.0);\n vec3 wsum = vec3(0.0);\n float alpha = 0.0;\n for (int i = 0; i < SAMPLES; i++) {\n float t = (float(i) + 0.5) / float(SAMPLES);\n vec3 w = vec3(t, 1.0 - abs(2.0 * t - 1.0), 1.0 - t);\n vec2 q = 0.5 + (uv - 0.5) * (1.0 - k + k * r2) * (1.0 - ca * (1.0 - t) * r2);\n \n \n float b = fract((float(i) * 7.0 + jitter) / float(SAMPLES)) - 0.5;\n vec4 c = strip(q - d * clamp(pos + len * b, 0.0, 1.0), d);\n col += w * c.rgb * c.a;\n wsum += w * c.a;\n alpha += c.a;\n }\n col /= max(wsum, vec3(1e-5));\n col *= 1.0 - 0.45 * k * r2;\n return vec4(col, 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","LensWipe":"// LensWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LensWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A round glass lens grows from a point over the outgoing image, casting a soft shadow on it, and shows the incoming image magnified through it, with a bright bevelled rim and faint color fringes; as the lens fills the frame the magnification relaxes until the incoming image lies 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 vec2 center; \n\nuniform float strength; \n\nuniform float shading; \n\nconst float AA = 0.0015;\nconst float BEVEL = 0.07;\n\nconst float OPEN = 0.8;\n\nconst vec2 LIGHT = vec2(-0.6, 0.8);\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 aspect = vec2(ratio, 1.0);\n float sh = clamp(shading, 0.0, 1.0);\n\n vec2 far = max(center, 1.0 - center) * aspect;\n float full = length(far) / (1.0 - BEVEL) + 2.0 * AA;\n float t = clamp(p / OPEN, 0.0, 1.0);\n float radius = full * t * (0.5 + t * (2.0 - 1.5 * t));\n\n \n float k = clamp(strength, 0.0, 0.8) * (1.0 - smoothstep(0.35, 1.0, p));\n\n vec2 d = (uv - center) * aspect;\n float r = length(d);\n\n vec4 a = vec4(0.0);\n if (r > radius - 2.0 * AA) {\n a = getFromColor(uv);\n float sd = length(d + 0.1 * LIGHT * radius) / max(radius, 1e-5);\n float shadow = 0.55 * sh * (1.0 - smoothstep(0.85, 1.35, sd)) * smoothstep(0.0, 0.05, radius);\n a.rgb *= 1.0 - shadow;\n if (r >= radius) return a;\n }\n\n float s = r / radius;\n float f = 1.0 - k * (1.0 - s * s);\n vec2 n = r > 0.0 ? d / r : vec2(0.0);\n vec2 ca = n * (0.014 * k * s * s) / aspect;\n vec2 q = center + d * f / aspect;\n \n vec4 cr = getToColor(mirror(q + ca));\n vec4 cg = getToColor(mirror(q));\n vec4 cb = getToColor(mirror(q - ca));\n float alpha = (cr.a + cg.a + cb.a) / 3.0;\n vec4 b = vec4(vec3(cr.r * cr.a, cg.g * cg.a, cb.b * cb.a) / max(alpha, 1e-5), alpha);\n\n float bevel = smoothstep(1.0 - BEVEL, 1.0, s);\n float facing = dot(n, LIGHT);\n float lit = bevel * bevel;\n vec3 shade = vec3(1.0 - 0.35 * sh * lit * max(-facing, 0.0) - 0.12 * sh * bevel);\n float spec = sh * lit * (0.55 * max(facing, 0.0) + 0.12);\n vec2 g = (d / radius - 0.42 * LIGHT) / vec2(0.32, 0.2);\n float glint = 0.12 * sh * exp(-dot(g, g)) * (1.0 - smoothstep(0.6, 1.0, p));\n b.rgb = min(b.rgb * shade + (spec + glint) * b.a, vec3(1.0));\n\n \n float cov = clamp((radius - r) / (2.0 * AA), 0.0, 1.0);\n return mix(a, b, cov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LichtenbergBurn":"// LichtenbergBurn — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LichtenbergBurn.glsl\n// Author: gre\n// License: MIT\n// Description: A branching discharge figure burns slowly into the outgoing picture from one point: a glowing ember front creeps out along fern-like channels, singeing the picture just ahead of it, and the burnt-through channels fill in between onto the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 origin; \n\nuniform int branches; \n\nconst float TAU = 6.2831853;\nconst float PI = 3.14159265;\n\nfloat h11(float n) { n = fract(mod(n, 251.0) * 0.1031); n *= n + 33.33; n *= n + n; return fract(n); }\nfloat h21(vec2 p) {\n vec3 q = fract(vec3(p.xyx) * 0.1031);\n q += dot(q, q.yzx + 33.33);\n return fract((q.x + q.y) * q.z);\n}\nfloat zz(float x) { float i = floor(x); return mix(h11(i), h11(i + 1.0), x - i) - 0.5; }\nfloat vn(vec2 p) {\n vec2 i = floor(p), f = p - i;\n f *= f * (3.0 - 2.0 * f);\n return mix(mix(h21(i), h21(i + vec2(1.0, 0.0)), f.x), mix(h21(i + vec2(0.0, 1.0)), h21(i + 1.0), f.x), f.y);\n}\n\nfloat target(float n, float j, float k) { return (j + 0.5 + 0.7 * (h11(j * 7.0 + k * 31.0 + 3.0) - 0.5)) / n * TAU; }\nfloat wobble(float r, float sc, float j, float k) {\n float x = r / sc * (14.0 + 8.0 * k) + j * 13.0 + k * 50.0;\n return sc * (0.03 - 0.004 * k) * (zz(x) + 0.4 * zz(x * 3.1));\n}\n\nfloat tree(float a, float r, float sc) {\n float best = 9.0, n = float(branches), rk = 0.0;\n for (int k = 0; k < 5; k++) {\n float fk = float(k);\n if (r > rk) {\n float ci = floor(a / TAU * n);\n for (int o = -1; o <= 1; o++) {\n float j = mod(ci + float(o), n);\n float tA = target(n, j, fk);\n float pA = k == 0 ? tA : target(n * 0.5, floor(j * 0.5), fk - 1.0);\n tA = pA + mod(tA - pA + PI, TAU) - PI;\n float fork = k == 0 ? 1.0 : smoothstep(rk, rk + 0.08 * sc, r);\n float sa = mix(pA, tA, fork);\n float da = mod(a - sa + PI, TAU) - PI;\n float lat = wobble(r, sc, j, fk);\n if (k > 0) lat = mix(wobble(r, sc, floor(j * 0.5), fk - 1.0), lat, fork);\n best = min(best, abs(da * r - lat) * (1.0 + 0.5 * fk));\n }\n }\n n *= 2.0;\n rk += sc * (0.08 + 0.05 * fk);\n }\n return best;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress, R = ratio;\n vec2 c = vec2(origin.x * R, origin.y);\n vec2 P = vec2(uv.x * R, uv.y) - c;\n \n float r = length(P), a = atan(P.y, P.x + 1e-6) + PI;\n float reach = length(max(c, vec2(R, 1.0) - c));\n vec4 A = getFromColor(uv), B = getToColor(uv);\n float d = tree(a, r, reach);\n float luma = dot(A.rgb, vec3(0.299, 0.587, 0.114));\n \n float T = 0.5 * r / reach + 0.6 * (sqrt(clamp(d / (0.12 * reach), 0.0, 0.36) + 0.03) - 0.1732) + 0.05 * luma + 0.03 * vn(P * 30.0);\n float e = T - (p * 1.04 - 0.02 + 0.05 * sin(PI * p));\n float on = smoothstep(0.0, 0.05, p) * (1.0 - smoothstep(0.85, 1.0, p));\n \n float lag = 0.13;\n float hole = 1.0 - smoothstep(-lag - 0.004, -lag + 0.004, e);\n float singe = (1.0 - smoothstep(0.0, 0.07, e)) * on;\n float charred = 1.0 - smoothstep(-0.01, 0.004, e);\n vec3 col = mix(A.rgb, A.rgb * vec3(0.7, 0.5, 0.32), singe * 0.6);\n col = mix(col, A.rgb * 0.12 + vec3(0.06, 0.03, 0.015), charred * 0.92);\n float front = exp(-abs(e) * 90.0) * on;\n float tip = exp(-d / reach * 45.0);\n float edge = exp(-abs(e + lag) * 90.0) * on;\n col += 1.4 * front * mix(vec3(1.0, 0.4, 0.06), vec3(1.0, 0.85, 0.55), tip);\n col += edge * vec3(0.9, 0.3, 0.04) * (0.6 + 0.4 * vn(P * 90.0 + p * 20.0));\n vec3 b = B.rgb * (1.0 - 0.5 * exp((e + lag) * 60.0) * on) + 0.5 * edge * vec3(0.9, 0.3, 0.04);\n return vec4(clamp(mix(col, b, hole), 0.0, 1.0), mix(A.a, B.a, hole));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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;\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 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 vec2 origin = center + vec2(drift * (p - 0.5), 0.0);\n float len = reach * amount;\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 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 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 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 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 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 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 float d = exp(0.14 * (float(k) + 0.8 * jitter)) - 1.0;\n float span = 0.14 * (d + 1.0);\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 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 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 float env = smoothstep(0.0, 0.2, progress) * (1.0 - smoothstep(0.8, 1.0, progress));\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 float glow = (core + glint) * env * intensity;\n\n vec4 c = frame(uv, m);\n\n vec3 bloom = vec3(0.0);\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 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 bloom /= 0.5 * float(TAPS);\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","LightningFlash":"// LightningFlash — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LightningFlash.glsl\n// Author: gre\n// License: MIT\n// Description: Forked lightning bolts crack down from the top of the frame, the screen flashes white in a few stuttering strobes, and the incoming image appears lit by the last flickers as they fade out\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 bolts; \n\nuniform float strike; \n\nuniform float seed; \n\nuniform vec3 color; \n\nuniform float glow; \n\nuniform int flashes; \n\nconst float LEADER = 0.3;\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 jag(float s, float k) {\n float i = floor(s);\n return mix(hash(vec2(i, k)), hash(vec2(i + 1.0, k)), fract(s)) - 0.5;\n}\n\nfloat zigzag(float y, float k) {\n return min(ratio, 1.0) * (0.15 * jag(y * 5.0, k) + 0.06 * jag(y * 13.0, k + 1.0) + 0.03 * jag(y * 31.0, k + 2.0) + 0.012 * jag(y * 67.0, k + 3.0));\n}\n\nfloat boltX(float y, float x0, float x1, float y1, float z0, float z1, float k) {\n float t = (1.0 - y) / (1.0 - y1);\n return mix(x0 - z0, x1 - z1, t) + zigzag(y, k);\n}\n\nfloat branchX(float y, float xb, float yb, float zb, float dir, float k) {\n return xb + dir * (yb - y) + 0.6 * (zigzag(y, k) - zb);\n}\n\nfloat curveDist(vec2 q, float x, float slope, float outside) {\n float dx = abs(q.x - x);\n float d = dx * mix(inversesqrt(1.0 + slope * slope), 1.0, smoothstep(0.0, 0.08, dx));\n return length(vec2(d, max(outside, 0.0)));\n}\n\nfloat pulse(float p, float t0, float hold, float decay) {\n float x = p - t0;\n if (x < 0.0) return smoothstep(-0.012, 0.0, x);\n return exp(-max(x - hold, 0.0) / decay);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 q = vec2(uv.x * ratio, uv.y);\n \n float k0 = floor(seed) * 61.0;\n int nb = bolts < 1 ? 1 : (bolts > 3 ? 3 : bolts);\n int nf = flashes < 1 ? 1 : (flashes > 4 ? 4 : flashes);\n \n int cut = nf > 1 ? 1 : 0;\n\n float flash = 0.0;\n float lit = 0.0;\n float tCut = LEADER;\n float tLast = LEADER;\n float t = LEADER;\n for (int i = 0; i < 4; i++) {\n if (i < nf) {\n bool isCut = i == cut;\n float amp = isCut ? 1.0 : (i < cut ? 0.55 : 0.7 * pow(0.75, float(i - cut - 1)));\n float s = amp * pulse(p, t, isCut ? 0.025 : 0.004, isCut ? 0.03 : 0.022);\n flash = max(flash, s);\n lit = max(lit, pulse(p, t, 0.01, 0.045));\n if (isCut) tCut = t;\n tLast = t;\n t += (isCut ? 0.12 : 0.08) + 0.04 * hash(vec2(float(i), k0 + 5.0));\n }\n }\n float stutter = mix(0.7, 1.0, hash(vec2(floor(p * 70.0), k0 + 9.0)));\n flash *= stutter;\n float whiteout = pulse(p, tCut, 0.025, 0.02);\n float tail = p > tLast ? exp(-(p - tLast) / 0.1) * smoothstep(0.03, 0.06, p - tLast) : 0.0;\n flash = max(flash, 0.35 * tail * step(0.45, hash(vec2(floor(p * 40.0), k0 + 13.0))));\n\n float grow = clamp(p / LEADER, 0.0, 1.0);\n grow = (floor(grow * 7.0) + smoothstep(0.0, 1.0, fract(grow * 7.0))) / 7.0;\n float faint = 0.5 * mix(0.6, 1.0, hash(vec2(floor(p * 50.0), k0 + 11.0)));\n float boltLight = p < LEADER ? faint * smoothstep(0.0, 0.06, p) : max(lit * stutter, faint * exp(-(p - LEADER) / 0.12));\n boltLight = max(boltLight, 0.6 * flash * tail);\n boltLight *= 1.0 - smoothstep(tLast + 0.1, tLast + 0.3, p);\n\n float core = 0.0;\n float halo = 0.0;\n float near = 10.0;\n bool lightsOn = boltLight > 0.0 || flash > 0.0;\n for (int b = 0; b < 3; b++) {\n if (b < nb && lightsOn) {\n float fb = float(b);\n float kb = k0 + fb * 17.0;\n float x1 = strike * ratio;\n float y1 = -0.05;\n float bright = 1.0;\n if (b > 0) {\n float roomy = strike < 0.5 ? 1.0 : -1.0;\n bool cramped = min(strike, 1.0 - strike) < 0.25;\n float side = b == 1 || cramped ? roomy : -roomy;\n float dist = b == 2 && cramped ? 0.5 : 0.22;\n x1 = clamp(x1 + side * ratio * (dist + 0.12 * hash(vec2(fb, kb))), 0.08 * ratio, 0.92 * ratio);\n y1 = 0.25 + 0.25 * hash(vec2(fb, kb + 1.0));\n bright = 0.7;\n }\n float x0 = clamp(x1 + (hash(vec2(fb, kb + 2.0)) - 0.5) * 0.5 * min(ratio, 1.0), 0.1 * ratio, 0.9 * ratio);\n float tip = mix(1.02, y1, grow);\n \n float e = 0.01;\n float z0 = zigzag(1.0, kb);\n float z1 = zigzag(y1, kb);\n float x = boltX(q.y, x0, x1, y1, z0, z1, kb);\n float slope = (boltX(q.y + e, x0, x1, y1, z0, z1, kb) - boltX(q.y - e, x0, x1, y1, z0, z1, kb)) / (2.0 * e);\n float d = curveDist(q, x, slope, max(max(y1, tip) - q.y, q.y - 1.05));\n near = min(near, d);\n float w = 0.003 * mix(1.0, 0.7, fb / 2.0);\n core += bright * exp(-d * d / (w * w));\n halo += bright * (0.7 * exp(-d * 24.0) + 0.25 * exp(-d * 6.0));\n for (int j = 0; j < 3; j++) {\n float fj = float(j);\n float kj = kb + 3.0 + fj * 5.0;\n float tb = 0.12 + 0.2 * fj + 0.15 * hash(vec2(fj, kj));\n float yb = mix(1.0, y1, tb);\n float len = (0.3 + 0.25 * hash(vec2(fj, kj + 1.0))) * (1.0 - tb) * (1.0 - y1);\n float dir = (j == 1 ? -1.0 : 1.0) * (0.2 + 0.45 * hash(vec2(fj, kj + 2.0))) * min(ratio, 1.0);\n float xb = boltX(yb, x0, x1, y1, z0, z1, kb);\n float zb = zigzag(yb, kj);\n float bx = branchX(q.y, xb, yb, zb, dir, kj);\n float bs = (branchX(q.y + e, xb, yb, zb, dir, kj) - branchX(q.y - e, xb, yb, zb, dir, kj)) / (2.0 * e);\n float bd = curveDist(q, bx, bs, max(max(yb - len, tip) - q.y, q.y - yb));\n near = min(near, bd);\n float along = clamp((yb - q.y) / len, 0.0, 1.0);\n float fade = bright * (1.0 - 0.8 * along);\n float bw = w * mix(0.8, 0.4, along);\n core += fade * exp(-bd * bd / (bw * bw));\n halo += fade * 0.6 * (0.7 * exp(-bd * 24.0) + 0.25 * exp(-bd * 6.0));\n }\n }\n }\n\n float m = smoothstep(tCut, tCut + 0.025, p);\n vec4 c = vec4(0.0);\n if (m < 1.0) {\n vec4 a = getFromColor(uv);\n c += (1.0 - m) * vec4(a.rgb * a.a, a.a);\n }\n if (m > 0.0) {\n vec4 a = getToColor(uv);\n c += m * vec4(a.rgb * a.a, a.a);\n }\n if (c.a <= 0.0) return vec4(0.0);\n vec3 col = c.rgb / c.a;\n\n float live = smoothstep(0.0, 0.03, p) * (1.0 - smoothstep(0.85, 1.0, p));\n float dim = 0.4 * smoothstep(0.0, LEADER, p) * (1.0 - smoothstep(tCut, tLast + 0.15, p));\n float f = flash * mix(0.6 + 0.4 * exp(-near * 4.0), 1.0, smoothstep(0.6, 1.0, flash));\n col *= 1.0 - dim * live;\n col = col * (1.0 + 2.5 * f * live) + color * (1.1 * f * live);\n float g = 0.4 + 1.2 * glow;\n vec3 light = mix(color, vec3(1.0), 0.75) * min(core, 1.5) * 1.6 + color * g * halo;\n col += light * boltLight * live;\n col = mix(col, vec3(1.0), 0.92 * whiteout * live);\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","LightningRift":"// LightningRift — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LightningRift.glsl\n// Author: gre\n// License: MIT\n// Description: Lightning strikes the outgoing picture a few times: each forked bolt cracks down as a white-hot slit through which the incoming picture already shows, and the slits widen from their channels until they swallow 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 int strikes; \n\nuniform float jag; \n\nfloat h11(float n) { n = fract(n * 0.1031); n *= n + 33.33; n *= n + n; return fract(n); }\n\nfloat zz(float x) { float i = floor(x); return mix(h11(i), h11(i + 1.0), x - i) - 0.5; }\nfloat vn(vec2 p) {\n vec2 i = floor(p), f = p - i;\n f *= f * (3.0 - 2.0 * f);\n float a = h11(i.x + i.y * 57.0), b = h11(i.x + 1.0 + i.y * 57.0);\n float c = h11(i.x + (i.y + 1.0) * 57.0), d = h11(i.x + 1.0 + (i.y + 1.0) * 57.0);\n return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);\n}\n\nfloat boltX(float y, float s, float x0, float fine) {\n float a = 0.4 + jag;\n return x0 + (h11(s * 3.7) - 0.5) * 0.35 * (1.0 - y)\n + a * (0.07 * zz(y * 5.0 + s * 11.0) + fine * (0.03 * zz(y * 16.0 + s * 7.0) + 0.01 * zz(y * 47.0 + s * 5.0)));\n}\n\nfloat bolt(vec2 P, float s, float x0, float age, float far) {\n float yf = 1.02 - age * 22.0;\n float fine = 1.0 - far;\n float fy = boltX(P.y, s, x0, fine);\n float h = mix(0.004, 0.1, far);\n float sl = (boltX(P.y + h, s, x0, fine) - boltX(P.y - h, s, x0, fine)) / (2.0 * h);\n float d = max(abs(P.x - fy) / sqrt(1.0 + sl * sl), yf - P.y);\n for (int k = 0; k < 3; k++) {\n float fk = float(k), sk = s * 13.0 + fk;\n float yb = 0.82 - 0.24 * fk - 0.08 * h11(sk);\n float side = h11(sk * 1.7) < 0.5 ? -1.0 : 1.0;\n float th = side * (0.45 + 0.5 * h11(sk * 2.3));\n vec2 dir = vec2(sin(th), -cos(th));\n float L = (0.42 - 0.08 * fk) * (0.7 + 0.5 * h11(sk * 3.1));\n float Lg = L * clamp((yb - yf) / (L * cos(th)), 0.0, 1.0);\n vec2 q = P - vec2(boltX(yb, s, x0, fine), yb);\n float u = dot(q, dir);\n float v = dot(q, vec2(-dir.y, dir.x)) - (0.4 + jag) * (0.04 * zz(u * 12.0 + sk * 5.0) + 0.012 * zz(u * 40.0 + sk)) * clamp(u * 8.0, 0.0, 1.0);\n float db = length(vec2(max(-u, 0.0) + max(u - Lg, 0.0), v));\n \n d = min(d, yb < yf ? 9.0 : db * 1.7 + 0.004);\n }\n return d;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress, R = ratio;\n vec2 P = vec2(uv.x * R, uv.y);\n float n = clamp(float(strikes), 1.0, 5.0);\n float x = clamp((p - 0.3) / 0.7, 0.0, 1.0);\n \n float grow = x * x * (0.55 * R / n + 0.04 * R + 0.04) + 0.12 * smoothstep(0.85, 1.0, p);\n float far = smoothstep(0.0, 0.08, grow);\n float rn = vn(P * 40.0) - 0.5 + 0.5 * (vn(P * 110.0) - 0.5);\n float e = 9.0, heat = 0.0;\n for (int i = 0; i < 5; i++) {\n float fi = float(i);\n if (fi < n) {\n float t0 = 0.05 + 0.3 * fi / max(n - 1.0, 1.0);\n float age = p - t0;\n if (age > 0.0) {\n float slot = floor((n - 1.0) * 0.5) + (mod(fi, 2.0) > 0.5 ? (fi + 1.0) * 0.5 : -fi * 0.5);\n float x0 = R * (slot + 0.5 + 0.5 * (h11(fi * 9.1 + 2.0) - 0.5)) / n;\n float d = bolt(P, fi + 1.0, x0, age, far);\n float w = 0.003 + 0.03 * sqrt(age);\n e = min(e, d - w * (1.0 + 0.9 * rn));\n heat += smoothstep(0.0, 0.008, age) * exp(-age * 14.0) * (0.75 + 0.5 * zz(age * 300.0 + fi * 7.0)) * exp(-max(d - w, 0.0) * 40.0);\n }\n }\n }\n e = e - grow + 0.012 * rn * smoothstep(0.0, 0.05, grow);\n float hole = 1.0 - smoothstep(-0.0025, 0.0025, e);\n float fade = 1.0 - smoothstep(0.7, 1.0, p);\n float rim = exp(-abs(e) * 260.0);\n float singe = exp(-max(e, 0.0) * 70.0) * smoothstep(0.0, 0.004, -e + 0.02) * fade;\n vec4 A = getFromColor(uv), B = getToColor(uv);\n vec3 a = A.rgb * (1.0 - 0.55 * singe * (1.0 - rim));\n a += heat * vec3(0.55, 0.62, 0.75);\n a += rim * fade * mix(vec3(1.0, 0.55, 0.25), vec3(0.85, 0.92, 1.0), clamp(heat * 2.0, 0.0, 1.0));\n vec3 b = B.rgb + (heat * 0.8 + 0.6 * rim) * fade * vec3(0.8, 0.88, 1.0) * exp(min(e, 0.0) * 80.0);\n return vec4(clamp(mix(a, b, hole), 0.0, 1.0), mix(A.a, B.a, hole));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","LineFeed":"// LineFeed — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LineFeed.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is printed like text on a terminal: line after line, the whole frame jolts up one row, pushing the outgoing image up, and a block cursor types the new row in cell by cell from left to right over a dimmed preview of the line\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 rows; \n\nuniform int cells; \n\nuniform vec4 cursor; \n\nconst float FEED = 0.3;\n\nvec4 transition(vec2 uv) {\n float n = float(rows);\n float u = progress * n;\n float k = min(floor(u), n - 1.0);\n float f = u - k;\n float s = clamp(f / FEED, 0.0, 1.0);\n \n float feed = s < 0.55 ? 1.06 * smoothstep(0.0, 0.55, s) : 1.06 - 0.06 * smoothstep(0.55, 1.0, s);\n float y = 1.0 - uv.y + (k + feed) / n;\n if (y < 1.0) return getFromColor(vec2(uv.x, 1.0 - y));\n\n \n vec4 b = getToColor(vec2(uv.x, abs(2.0 - y)));\n float row = min(floor((y - 1.0) * n), n - 1.0);\n float c = float(cells);\n float typed = clamp((f - FEED) / (1.0 - FEED), 0.0, 1.0);\n float head = row < k ? c + 1.0 : (row > k ? -1.0 : floor(typed * (c + 1.0)));\n float cell = floor(uv.x * c);\n vec4 col = cell < head ? b : vec4(b.rgb * 0.16, b.a);\n float ly = fract((y - 1.0) * n);\n float lit = step(0.5, s);\n float box = (cell == head ? 1.0 : 0.0) * step(0.1, ly) * step(ly, 0.9) * lit;\n return mix(col, cursor, 0.9 * box * cursor.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","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;\nconst float AA = 0.0015;\nconst float LINE = 0.006;\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\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 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 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 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 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 c.x += 0.08 * sin(6.0 * t + 6.28 * hs);\n float dist = length(bq - c);\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 glow = max(rim * 0.6, glint) * smoothstep(0.0, 0.05, depth) * stir;\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 vec2 i = floor(v + dot(v, C.yy) );\n vec2 x0 = v - i + dot(i, C.xx);\n\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\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 {\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","MarblingDissolve":"// MarblingDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MarblingDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image floats onto the outgoing one in thin bands of ink that a rake drags into zigzags and a fine comb pulls into feathers, like marbled paper; the bands widen until they cover the frame and the combs pull back out, leaving the incoming image clean\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 tines; \n\nuniform float pull; \n\nuniform float bands; \n\nuniform float veins; \n\nconst float CUSP = 0.12;\n\nconst float COMB = 9.0;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat drag(float t) {\n float far = CUSP / (1.0 + CUSP);\n return (CUSP / (t + CUSP) - far) / (1.0 - far);\n}\n\nfloat ease(float x) {\n x = clamp(x, 0.0, 1.0);\n return x * x * (3.0 - 2.0 * x);\n}\n\nvec2 unrake(vec2 p, float rake, float comb) {\n \n float c = p.y * COMB;\n float t = fract(c);\n p.x -= comb * drag(2.0 * min(t, 1.0 - t));\n \n \n float s = max(ratio, 1.0) / max(tines, 1.0);\n float k = (p.x - 0.5 * ratio) / s;\n float u = fract(k);\n float side = mod(floor(k), 2.0) < 0.5 ? 1.0 : -1.0;\n p.y -= rake * side * (drag(u) - drag(1.0 - u));\n return p;\n}\n\nfloat bandPhase(vec2 q) {\n return q.y * bands + 0.35 * sin(q.x * 2.3 + 1.0) + 0.2 * sin(q.x * 5.1 - q.y * 3.0);\n}\n\nvec4 transition(vec2 uv) {\n float rake = pull * ease(progress / 0.35) * ease((1.0 - progress) / 0.35);\n float comb = 0.6 * pull * ease((progress - 0.15) / 0.3) * ease((0.85 - progress) / 0.3);\n vec2 p = vec2(uv.x * ratio, uv.y);\n vec2 q = unrake(p, rake, comb);\n \n float e = 0.001;\n float ph = bandPhase(q);\n float gx = bandPhase(unrake(p + vec2(e, 0.0), rake, comb)) - ph;\n float gy = bandPhase(unrake(p + vec2(0.0, e), rake, comb)) - ph;\n float aa = max(length(vec2(gx, gy)), 0.002);\n float cover = ease((progress - 0.08) / 0.84);\n \n float w = cover * (0.5 + 2.0 * aa) - aa;\n float d = abs(fract(ph) - 0.5); \n float m = 1.0 - smoothstep(w - aa, w + aa, d);\n vec2 suv = mirror(vec2(q.x / ratio, q.y));\n vec4 col = mix(getFromColor(suv), getToColor(suv), m);\n float line = 1.0 - smoothstep(0.0, 2.5 * aa + 0.02, abs(d - w));\n float show = veins * 4.0 * cover * (1.0 - cover); \n col.rgb *= 1.0 - 0.6 * show * line;\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","MicroBrickCascade":"// MicroBrickCascade — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MicroBrickCascade.glsl\n// Author: Gilad Levi\n// License: MIT\n// Description: The outgoing image fractures into a dense wall of tiny square tiles. A diagonal cascade releases the tiles in staggered waves, causing them to fall and drift aside while the incoming image is revealed beneath.\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 tileSize; \n\nuniform float fall; \n\nuniform float drift; \n\nuniform float diagonal; \n\nuniform float stagger; \n\nuniform float softness; \n\nuniform float glow; \n\nfloat hash12(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvec4 transition(vec2 uv) {\n float s = max(tileSize, 0.004);\n vec2 gridCount = max(vec2(1.0), floor(vec2(ratio, 1.0) / s));\n vec2 tile = floor(uv * gridCount);\n vec2 tileUV = fract(uv * gridCount);\n vec2 tileCenter = (tile + 0.5) / gridCount;\n\n float waveCoord = mix(\n tileCenter.x,\n 0.65 * tileCenter.x + 0.35 * (1.0 - tileCenter.y),\n clamp(diagonal, 0.0, 1.0)\n );\n\n \n float r1 = hash12(tile);\n float r2 = hash12(tile + vec2(19.1, 7.3));\n float r3 = hash12(tile + vec2(41.7, 13.9));\n\n float start = 0.08 + 0.60 * waveCoord + stagger * 0.12 * (r1 - 0.5);\n float t = clamp((progress - start) / 0.28, 0.0, 1.0);\n\n float sideways = (r2 * 2.0 - 1.0) * drift * t;\n float downward = fall * t * t;\n\n vec2 movedTileUV = tileUV - vec2(sideways, -downward);\n\n float inside =\n step(0.0, movedTileUV.x) *\n step(movedTileUV.x, 1.0) *\n step(0.0, movedTileUV.y) *\n step(movedTileUV.y, 1.0);\n\n float fadeStart = mix(0.40, 0.15, softness);\n float fadeEnd = mix(0.95, 0.65, softness);\n float visibility = inside * (1.0 - smoothstep(fadeStart, fadeEnd, t));\n\n \n vec2 shiftedUV = uv - vec2(sideways, -downward) / gridCount;\n vec4 fromColor = getFromColor(clamp(shiftedUV, 0.0, 1.0));\n\n vec4 toColor = getToColor(uv);\n\n vec4 color = mix(toColor, fromColor, visibility);\n\n float edgeDistance = min(\n min(movedTileUV.x, 1.0 - movedTileUV.x),\n min(movedTileUV.y, 1.0 - movedTileUV.y)\n );\n\n float edge = (1.0 - smoothstep(0.0, 0.08, edgeDistance)) * inside;\n float sparkle = sin(t * 3.14159265) * glow * visibility;\n\n vec3 edgeColor = mix(\n vec3(0.12, 0.90, 1.0),\n vec3(1.0, 0.35, 0.65),\n r3\n );\n\n color.rgb += edgeColor * edge * sparkle * 0.45;\n color.rgb = clamp(color.rgb, 0.0, 1.0);\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","MoireWipe":"// MoireWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/MoireWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Two sets of fine concentric rings, centered on two points that drift toward each other, overlay the image and interfere into a shifting moire of wide bands; the bands open onto the incoming image and widen until it fills the frame, while the thin dark and light ring lines fade 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\nuniform float density; \n\nuniform float bands; \n\nuniform float drift; \n\nuniform float lines; \n\nconst float PI = 3.141592653589793;\nconst float AA = 0.0012;\n\nconst float LINE = 0.1;\n\nconst float EDGE = 0.05;\nconst float START = 0.35;\n\nconst float INK = 0.7;\n\nfloat ringLines(float r, float f) {\n float q = abs(fract(r * f + 0.5) - 0.5);\n float aa = AA * f;\n float c = clamp((LINE - q) / (2.0 * aa) + 0.5, 0.0, 1.0);\n return mix(c, 2.0 * LINE, clamp(10.0 * aa - 0.5, 0.0, 1.0));\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n\n float t = progress * progress * (3.0 - 2.0 * progress);\n float f = max(density, 1.0);\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n\n float ang = 2.0 * PI * drift * t + START;\n float k = max(bands, 1.0) * (1.0 - 0.75 * t);\n vec2 axis = vec2(cos(ang), sin(ang)) * 0.5 * k / f;\n float r1 = length(p - axis);\n float r2 = length(p + axis);\n \n float f2 = f + 1.2 * k;\n\n \n \n float beat = abs(fract(f2 * r2 - f * r1 + 0.5) - 0.5);\n vec2 grad = f2 * (p + axis) / max(r2, AA) - f * (p - axis) / max(r1, AA);\n float s = min(AA * length(grad) + 0.004, EDGE);\n float w = mix(-EDGE, 0.5 + EDGE, t);\n float m = 1.0 - smoothstep(w - s, w + s, beat);\n\n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n\n float o = INK * clamp(lines, 0.0, 1.0) * sin(PI * t);\n float l = 1.0 - (1.0 - o * ringLines(r1, f)) * (1.0 - o * ringLines(r2, f2));\n c.rgb = mix(c.rgb, vec3(c.a * m), l);\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","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","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","Nightfall":"// Nightfall — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Nightfall.glsl\n// Author: gre\n// License: MIT\n// Description: Night crosses the frame like the shadow line of a turning globe: a warm dusk glows along its curved edge and dims the outgoing image into blue moonlight that keeps it legible, then a second curved edge glows rose as dawn and brings up the daylight 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 vec2 direction; \n\nuniform float night; \n\nuniform float darkness; \n\nuniform float bow; \n\nuniform vec3 dusk; \n\nuniform vec3 dawn; \n\nuniform vec3 moon; \n\nconst float TW = 0.16;\n\nfloat bent(vec2 q, vec2 dir) {\n float y = dot(q, vec2(-dir.y, dir.x));\n return dot(q, dir) - bow * y * y;\n}\n\nvec4 transition(vec2 uv) {\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n vec2 a = vec2(0.5 * ratio, 0.5);\n vec2 b = vec2(a.x, -a.y);\n float x = bent((uv - 0.5) * vec2(ratio, 1.0), dir);\n float e = a.x * abs(dir.x) + a.y * abs(dir.y);\n float n = max(night, 0.05);\n \n \n float lo = min(-e, min(min(bent(a, dir), bent(-a, dir)), min(bent(b, dir), bent(-b, dir)))) - 0.09;\n float hi = max(e, max(max(bent(a, dir), bent(-a, dir)), max(bent(b, dir), bent(-b, dir)))) + 0.09;\n float t = mix(progress, smoothstep(0.0, 1.0, progress), 0.25);\n float d = mix(lo, hi + n, t);\n float mid = d - 0.5 * n;\n\n float ahead = smoothstep(mid - 0.12 * n, mid + 0.12 * n, x);\n vec4 c = mix(getToColor(uv), getFromColor(uv), ahead);\n float l = dot(c.rgb, vec3(0.299, 0.587, 0.114));\n \n float into = min(d - x, x - d + n) - 0.06 * l;\n float dark = smoothstep(-0.25 * TW, TW, into) * mix(0.75, 1.0, smoothstep(0.0, 0.5 * n, into));\n float gi = (into - 0.1 * TW) / (0.6 * TW);\n float rim = max(1.0 - gi * gi, 0.0);\n \n float env = smoothstep(0.0, 0.2, progress) * (1.0 - smoothstep(0.8, 1.0, progress));\n float wide = env * exp(-max(-into, 0.0) / 0.3) * (1.0 - dark);\n vec3 sun = mix(dawn, dusk, ahead);\n\n vec3 lit = mix(c.rgb, vec3(l), 0.7) * moon * 1.2 * (0.12 + 0.6 * l * l);\n vec3 col = mix(c.rgb, lit, dark * darkness);\n col = mix(col, col * sun * 1.25, clamp(0.6 * rim * rim + 0.35 * wide, 0.0, 1.0));\n return vec4(col, 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","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 = step(0.001 + 0.998 * 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","OutlineCrumble":"// OutlineCrumble — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/OutlineCrumble.glsl\n// Author: gre\n// License: MIT\n// Description: Thin cracks run through the outgoing image along its own outlines, then the pieces they cut sag loose and fall away one after another from the top, tumbling and shrinking into the incoming image beneath\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 follow; \n\nvec2 hash22(vec2 p) {\n vec3 p3 = fract(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}\nvec2 toUV(vec2 q) { return vec2(q.x / ratio, q.y) / cells; }\nvec2 seedOf(vec2 c) { return c + 0.5 + 0.6 * (hash22(c) - 0.5); }\n\nvec3 soft(vec2 q, float r) {\n vec2 u = clamp(toUV(q), 0.0, 1.0), ex = vec2(r / (cells * ratio), 0.0), ey = vec2(0.0, r / cells);\n return (getFromColor(u + ex).rgb + getFromColor(u - ex).rgb + getFromColor(u + ey).rgb + getFromColor(u - ey).rgb) * 0.25;\n}\n\nvec3 owner(vec2 q) {\n \n vec3 col = soft(q, 0.25);\n vec2 base = floor(q), best = base, s1 = q, s2 = q;\n float d1 = 1e9, d2 = 1e9;\n for (int j = -1; j <= 1; j++) for (int i = -1; i <= 1; i++) {\n vec2 c = base + vec2(float(i), float(j));\n vec2 s = seedOf(c), dq = q - s;\n vec3 dc = col - getFromColor(clamp(toUV(s), 0.0, 1.0)).rgb;\n float d = dot(dq, dq) + follow * min(dot(dc, dc), 0.04);\n if (d < d1) { d2 = d1; s2 = s1; d1 = d; s1 = s; best = c; } else if (d < d2) { d2 = d; s2 = s; }\n }\n return vec3(best, (d2 - d1) / (2.0 * length(s2 - s1) + 1e-3));\n}\n\nbool mayOwn(vec2 q, vec2 c) {\n vec2 base = floor(q);\n if (abs(c.x - base.x) > 1.0 || abs(c.y - base.y) > 1.0) return false;\n float dmin = 1e9;\n for (int j = -1; j <= 1; j++) for (int i = -1; i <= 1; i++) {\n vec2 dq = q - seedOf(base + vec2(float(i), float(j)));\n dmin = min(dmin, dot(dq, dq));\n }\n vec2 dc = q - seedOf(c);\n return dot(dc, dc) <= dmin + follow * 0.04;\n}\n\nfloat localTime(vec2 c, vec2 s) {\n float y = clamp(s.y / cells, 0.0, 1.0);\n float d = 0.75 * (1.0 - y) + 0.25 * hash22(c + 7.0).x;\n return (progress - 0.2 - 0.46 * d) / 0.32;\n}\nmat2 rot(float a) { return mat2(cos(a), -sin(a), sin(a), cos(a)); }\n\nvec4 transition(vec2 uv) {\n vec2 P = vec2(uv.x * ratio, uv.y) * cells;\n vec3 own = owner(P);\n float px = cells / 200.0; \n float crack = smoothstep(0.0, 0.1, progress - 0.1 * (1.0 - uv.y));\n float core = 1.0 - smoothstep(0.6 * px, 1.6 * px, own.z);\n float rim = (1.0 - smoothstep(1.6 * px, 3.2 * px, own.z)) - core;\n vec4 from = getFromColor(uv);\n vec4 col = vec4(from.rgb * (1.0 - 0.85 * core * crack) * (1.0 + 0.2 * rim * crack), from.a);\n if (localTime(own.xy, seedOf(own.xy)) > 0.0) {\n vec4 to = getToColor(uv);\n col = vec4(to.rgb * (1.0 - 0.5 * (1.0 - smoothstep(0.45, 1.0, progress))), to.a);\n }\n \n float top = 2.0;\n for (int j = -1; j <= 3; j++) for (int i = -1; i <= 1; i++) {\n vec2 c = floor(P) + vec2(float(i), float(j));\n vec2 s = seedOf(c);\n float t = localTime(c, s);\n if (t <= 0.0 || t >= 1.0 || t >= top) continue;\n float loose = smoothstep(0.0, 0.18, t);\n float f = max(t - 0.15, 0.0) / 0.85;\n float g = f * f;\n float spin = hash22(c + 3.0).x - 0.5;\n float a = spin * (0.12 * loose + 1.6 * g);\n float scale = 1.0 - 0.6 * g;\n vec2 d = rot(a) * (P - s - vec2(0.0, -0.06 * loose - 1.7 * g)) / scale;\n vec2 q = s + d;\n vec2 qu = toUV(q);\n if (qu.x < 0.0 || qu.x > 1.0 || qu.y < 0.0 || qu.y > 1.0 || !mayOwn(q, c)) continue;\n vec3 o = owner(q);\n if (any(notEqual(o.xy, c))) continue;\n float bev = 1.0 - smoothstep(0.0, 0.1, o.z);\n vec2 n = rot(-a) * normalize(q - s + 1e-4);\n vec4 fc = getFromColor(qu);\n vec3 pc = fc.rgb * (1.0 + bev * 0.35 * n.y) * (1.0 - 0.5 * g);\n float edge = smoothstep(0.0, 1.5 * px / scale, o.z);\n col = mix(col, vec4(pc, fc.a), (1.0 - smoothstep(0.8, 1.0, t)) * edge);\n \n if (edge > 0.5) top = t;\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","OutlineFill":"// OutlineFill — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/OutlineFill.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is colored in from its own outlines: they appear first as thin lines over the outgoing image, then its colors spread out from every outline with a soft, darker wet edge, and the widest plain areas fill in last\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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\nconst int TAPS = 30;\n\nfloat luma(vec4 c) {\n return dot(c.rgb, vec3(0.299, 0.587, 0.114)) * c.a + 0.3 * (1.0 - c.a);\n}\n\nfloat hash(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(mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x), mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), f.x), f.y);\n}\n\nvec2 fold(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n vec4 b = getToColor(uv);\n float l0 = luma(b);\n float th = mix(0.02, 0.24, clamp(threshold, 0.0, 1.0));\n float e = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.5);\n float front = mix(-0.1, 1.12, e);\n float m = smoothstep(0.88, 1.12, front);\n float wet = smoothstep(0.88, 1.12, front - 0.12);\n float diff = 0.0;\n float spin = 3.1416 * vnoise(uv * vec2(ratio, 1.0) * 6.0);\n vec2 dir = vec2(cos(spin), sin(spin));\n \n mat2 turn = mat2(-0.73736, 0.67549, -0.67549, -0.73736);\n for (int i = 0; i < TAPS; i++) {\n float f = (float(i) + 0.5) / float(TAPS);\n float r = 0.01 + 0.99 * f * sqrt(f);\n float l = luma(getToColor(fold(uv + reach * r * vec2(dir.x / ratio, dir.y))));\n dir = turn * dir;\n diff = mix(diff, abs(l - l0), 0.2);\n float hit = smoothstep(th * 0.3, th, diff);\n m = max(m, hit * smoothstep(r - 0.1, r + 0.1, front));\n wet = max(wet, hit * smoothstep(r - 0.1, r + 0.1, front - 0.12));\n }\n float rim = max(m - wet, 0.0) * (1.0 - smoothstep(0.8, 1.0, progress));\n b.rgb *= 1.0 - 0.25 * rim;\n return mix(getFromColor(uv), b, 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","OutlineTear":"// OutlineTear — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/OutlineTear.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image tears across along its own strongest outline, such as a horizon, showing white paper fibers; the torn top is pulled up and the bottom drops down, casting soft shadows 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 rim; \n\nuniform float roughness; \n\nuniform vec4 paper; \n\nuniform vec4 shadow; \n\nconst float SPACING = 0.2;\nconst float LO = 0.15;\nconst float HI = 0.85;\n\nfloat luma(vec2 p) {\n return dot(getFromColor(p).rgb, vec3(0.299, 0.587, 0.114));\n}\n\nfloat knot(float i) {\n float x = clamp(i * SPACING / ratio, 0.0, 1.0);\n float prev = luma(vec2(x, LO));\n \n float sw = 1e-4, sy = 0.5e-4;\n for (int j = 1; j < 9; j++) {\n float y = mix(LO, HI, float(j) / 8.0);\n float cur = luma(vec2(x, y));\n float m = y - 0.5 * (HI - LO) / 8.0;\n float d = 4.0 * abs(cur - prev) * (1.0 - 1.2 * abs(m - 0.5));\n float w = d * d * d * d;\n sw += w;\n sy += w * m;\n prev = cur;\n }\n return sy / sw;\n}\n\nfloat tri(float x) {\n return abs(fract(x) - 0.5) - 0.25;\n}\n\nfloat outline(float x) {\n float u = x * ratio / SPACING;\n float i = floor(u + 0.5);\n float f = u - i + 0.5;\n float a = knot(i - 1.0), b = knot(i), c = knot(i + 1.0);\n return 0.5 * (1.0 - f) * (1.0 - f) * a + (0.5 + f - f * f) * b + 0.5 * f * f * c;\n}\n\nfloat jag(float x) {\n return roughness * (0.2 * sin(x * 13.0 + 1.1) + 0.5 * tri(x * 23.0 + sin(x * 7.0)) + 0.25 * tri(x * 61.0 + 0.6 * sin(x * 17.0)));\n}\n\nfloat fibers(float x, float seed) {\n return rim * (0.7 + 0.3 * sin(x * 41.0 + seed) + 0.4 * tri(x * 89.0 + seed));\n}\n\nvec4 torn(vec4 bg, vec4 col, float e, float limit, float aa, float fiber) {\n vec4 c = vec4(mix(col.rgb, paper.rgb, clamp(0.5 + e / aa, 0.0, 1.0) * paper.a * fiber), 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 xr = uv.x * ratio;\n float y0 = outline(uv.x);\n float edge = y0 + jag(xr);\n \n float reach = HI + 0.5 * roughness + 2.0 * rim + 0.02;\n \n float move = reach * p * p * (0.2 + 0.8 * p);\n float up = move * (1.0 + 0.12 * (1.0 - uv.x) * (1.0 - p));\n float down = move * (1.0 + 0.12 * uv.x * (1.0 - p));\n float fiber = smoothstep(0.0, 0.15, p);\n float aa = 0.0015;\n\n float ty = uv.y - up;\n float by = uv.y + down;\n vec4 to = getToColor(uv);\n float d = min(0.7 * (y0 - ty), 1.5 * (by - y0));\n float sh = shadow.a * fiber * (1.0 - smoothstep(0.7, 1.0, p)) * (1.0 - smoothstep(-0.02, 0.07, d));\n vec4 c = vec4(mix(to.rgb, shadow.rgb, sh), to.a);\n \n c = torn(c, getFromColor(vec2(uv.x, min(by, 1.0))), by - edge, fibers(xr, 2.0) * 1.4 * fiber + 0.003, aa, fiber);\n c = torn(c, getFromColor(vec2(uv.x, max(ty, 0.0))), edge - ty, fibers(xr, 0.0) * fiber, aa, fiber);\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","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 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","PaintBucket":"// PaintBucket — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PaintBucket.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is poured in like a paint-bucket fill from two points: the areas of its picture that match the paint's colour flood in almost at once and stop at their outlines, then the bucket's tolerance widens and the other shapes fill in one after another, a light sheen running along the advancing fill\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 seedA; \n\nuniform vec2 seedB; \n\nuniform float hold; \n\nconst float W = 0.025;\n\nvec3 smoothTo(vec2 uv) {\n vec2 px = vec2(0.008 / ratio, 0.008);\n vec3 c = getToColor(clamp(uv, 0.0, 1.0)).rgb;\n vec2 g = vec2(1.0, 0.0);\n mat2 turn = mat2(0.5, 0.8660254, -0.8660254, 0.5);\n for (int i = 0; i < 6; i++) {\n c += getToColor(clamp(uv + g * px, 0.0, 1.0)).rgb;\n g = turn * g;\n }\n return c / 7.0;\n}\n\nfloat dist(vec2 p, vec2 seed) {\n return length((p - seed) * vec2(ratio, 1.0));\n}\n\nfloat gap(vec2 p) {\n return min(dist(p, seedA), dist(p, seedB));\n}\n\nfloat reach(float d, vec3 here, vec3 paint) {\n \n \n float lh = dot(here, vec3(1.0)), lp = dot(paint, vec3(1.0));\n float t = 2.5 * length(here / (lh + 0.15) - paint / (lp + 0.15)) + 0.2 * abs(lh - lp);\n t = max(t - 0.05, 0.0);\n float c = min(1.3 * t / (t + 0.3), 1.0);\n float a = 0.85 * (0.4 * d + hold * max(c - 0.4 * d, 0.0)) + 0.15 * d;\n \n return a / (0.49 + 0.51 * hold);\n}\n\nvec4 transition(vec2 uv) {\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n vec3 here = smoothTo(uv);\n \n float far = max(max(gap(vec2(0.0)), gap(vec2(1.0))), max(gap(vec2(0.0, 1.0)), gap(vec2(1.0, 0.0))));\n float dA = dist(uv, seedA) / far, dB = dist(uv, seedB) / far;\n float arrive = min(reach(dA, here, smoothTo(seedA)), reach(dB, here, smoothTo(seedB)));\n \n float d = min(min(dA, dB), 1.0);\n arrive = min(arrive, mix(d, 0.5 + 0.5 * d, hold));\n \n float front = mix(-W, 1.0 + W, progress + 0.07 * sin(6.2831853 * progress));\n float m = 1.0 - smoothstep(front - W, front, arrive);\n float rim = m * (1.0 - smoothstep(0.0, 0.04, front - arrive)) * (1.0 - progress);\n return mix(a, vec4(mix(b.rgb, vec3(1.0), 0.4 * rim), b.a), 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","PaintDissolve":"// PaintDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PaintDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is painted over the outgoing one in layers of brush strokes, broad flat strokes of its colors first, then smaller and smaller ones, until the last fine strokes lay down its full detail\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 brushSize; \n\nuniform float angle; \n\nuniform float crossing; \n\nuniform float impasto; \n\nconst float PI = 3.141592653589793;\n\nconst float ROW = 0.4;\n\nfloat pdHash(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 pdHash4(vec2 p) {\n vec4 p4 = fract(vec4(p.xyxy) * vec4(0.1031, 0.1030, 0.0973, 0.1099));\n p4 += dot(p4, p4.wzxy + 33.33);\n return fract((p4.xxyz + p4.yzzw) * p4.zywx);\n}\n\nfloat pdNoise(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(pdHash(i), pdHash(i + vec2(1.0, 0.0)), f.x),\n mix(pdHash(i + vec2(0.0, 1.0)), pdHash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nvec2 pdFold(vec2 p) {\n return 1.0 - abs(1.0 - mod(p, 2.0));\n}\n\nconst float MIN_SIZE = 0.042;\n\nvec2 pdCenter(vec2 cell, float shift, vec4 h) {\n return vec2(cell.x + 0.5 + shift + (h.x - 0.5) * 0.16, cell.y + 0.5 + (h.y - 0.5) * 0.1);\n}\n\nvec2 pdToUv(vec2 p, vec2 off, float size, vec2 dir) {\n vec2 l = (p - off) * vec2(size, size * ROW);\n vec2 q = dir * l.x + vec2(-dir.y, dir.x) * l.y;\n return q / vec2(ratio, 1.0) + 0.5;\n}\n\nvec4 pdStroke(vec2 p, vec2 c, vec2 cell, vec4 h, float size, float k, vec2 off, float t0, float spread, float dur, float dry, vec2 dir) {\n vec2 d = (p - c) * vec2(1.0, ROW); \n float tilt = (h.z - 0.5) * 0.12;\n float a = d.x + tilt * d.y; \n float b = d.y - tilt * d.x - (h.w - 0.5) * 0.12 * a * a; \n float L = 0.66 + 0.1 * h.w;\n float W = 0.17 + 0.03 * h.z;\n vec2 world = (c - off) * vec2(size, size * ROW);\n float order = 0.55 * pdNoise(world * 3.0 + k * 5.0) + 0.45 * pdHash(cell * 1.7 + vec2(k * 9.0, 3.0));\n float start = t0 + spread * clamp((order - 0.15) / 0.7, 0.0, 1.0); \n float s = clamp((progress - start) / dur, 0.0, 1.0);\n s = 1.0 - (1.0 - s) * (1.0 - s);\n float seed = h.x * 37.0 + k * 11.0;\n float bw = b / W; \n \n float hairs = clamp(size * 50.0, 3.0, 16.0);\n float br = 0.6 * pdNoise(vec2(bw * 0.4 * hairs + seed, a * 2.0)) + 0.4 * pdNoise(vec2(bw * 0.8 * hairs - seed, a * 1.2 + 5.0));\n float aa = 0.0025 / size;\n float u = clamp(a / L, -1.0, 1.0);\n float width = (0.8 + 0.2 * (1.0 - u * u)) * (0.92 + 0.08 * pdNoise(vec2(a * 6.0, seed))) - 0.1 * br;\n float side = 1.0 - smoothstep(width - aa / W, width + aa / W, abs(bw));\n float tail = smoothstep(-aa, aa, a + L - 0.12 * bw * bw);\n float head = mix(-L - 0.1, L + 0.2, s);\n float lay = smoothstep(0.0, 0.25, (head - a) / 0.2 - 0.6 * br);\n float lift = smoothstep(-aa, aa, L + 0.12 * (br - 0.5) - a);\n float fb = pdNoise(vec2(bw * hairs + seed, a * 0.9 - seed));\n float dryness = dry * smoothstep(0.1, 1.0, u);\n float cover = side * tail * lay * lift * (1.0 - dryness * (1.0 - smoothstep(0.3, 0.6, fb)));\n float ridge = bw * (1.0 - 0.5 * abs(bw)) * 0.8 + (br - 0.5) + 0.7 * (fb - 0.5);\n float facing = dot(vec2(-dir.y, dir.x), vec2(-0.6, 0.8));\n return vec4(cover, -ridge * facing, start, br);\n}\n\nfloat pdUnder(vec4 x, vec4 y) {\n return y.z > x.z ? 1.0 - y.x : 1.0;\n}\n\nvec4 pdLayer(vec4 below, vec2 q, float size, float k, float th, float t0, float spread, float dur, bool solid, vec4 detail) {\n size = max(size, MIN_SIZE);\n vec2 dir = vec2(cos(th), sin(th));\n vec2 off = vec2(k * 0.37, k * 0.61);\n vec2 p = vec2(dot(q, dir), dot(q, vec2(-dir.y, dir.x))) / vec2(size, size * ROW) + off;\n float r = floor(p.y - 0.5);\n float sh0 = pdHash(vec2(r, 7.3));\n float sh1 = pdHash(vec2(r + 1.0, 7.3));\n float x0 = floor(p.x - sh0 - 0.5);\n float x1 = floor(p.x - sh1 - 0.5);\n vec2 c0 = vec2(x0, r);\n vec2 c1 = vec2(x0 + 1.0, r);\n vec2 c2 = vec2(x1, r + 1.0);\n vec2 c3 = vec2(x1 + 1.0, r + 1.0);\n vec2 kk = vec2(k * 41.0, k * 17.0);\n vec4 h0 = pdHash4(c0 + kk);\n vec4 h1 = pdHash4(c1 + kk);\n vec4 h2 = pdHash4(c2 + kk);\n vec4 h3 = pdHash4(c3 + kk);\n vec2 m0 = pdCenter(c0, sh0, h0);\n vec2 m1 = pdCenter(c1, sh0, h1);\n vec2 m2 = pdCenter(c2, sh1, h2);\n vec2 m3 = pdCenter(c3, sh1, h3);\n float dry = solid ? 0.85 : 0.4;\n vec4 s0 = pdStroke(p, m0, c0, h0, size, k, off, t0, spread, dur, dry, dir);\n vec4 s1 = pdStroke(p, m1, c1, h1, size, k, off, t0, spread, dur, dry, dir);\n vec4 s2 = pdStroke(p, m2, c2, h2, size, k, off, t0, spread, dur, dry, dir);\n vec4 s3 = pdStroke(p, m3, c3, h3, size, k, off, t0, spread, dur, dry, dir);\n float v0 = s0.x * pdUnder(s0, s1) * pdUnder(s0, s2) * pdUnder(s0, s3);\n float v1 = s1.x * pdUnder(s1, s0) * pdUnder(s1, s2) * pdUnder(s1, s3);\n float v2 = s2.x * pdUnder(s2, s0) * pdUnder(s2, s1) * pdUnder(s2, s3);\n float v3 = s3.x * pdUnder(s3, s0) * pdUnder(s3, s1) * pdUnder(s3, s2);\n vec4 k0 = detail;\n vec4 k1 = detail;\n vec4 k2 = detail;\n vec4 k3 = detail;\n \n if (solid) {\n if (v0 > 0.0) k0 = getToColor(pdFold(pdToUv(m0, off, size, dir)));\n if (v1 > 0.0) k1 = getToColor(pdFold(pdToUv(m1, off, size, dir)));\n if (v2 > 0.0) k2 = getToColor(pdFold(pdToUv(m2, off, size, dir)));\n if (v3 > 0.0) k3 = getToColor(pdFold(pdToUv(m3, off, size, dir)));\n }\n float relief = impasto * (solid ? 0.18 : 0.12) * (1.0 - smoothstep(0.7, 0.95, progress));\n k0.rgb *= 1.0 + relief * (s0.y + 0.5 * (s0.w - 0.5));\n k1.rgb *= 1.0 + relief * (s1.y + 0.5 * (s1.w - 0.5));\n k2.rgb *= 1.0 + relief * (s2.y + 0.5 * (s2.w - 0.5));\n k3.rgb *= 1.0 + relief * (s3.y + 0.5 * (s3.w - 0.5));\n float vis = v0 + v1 + v2 + v3;\n return below * (1.0 - vis) + k0 * v0 + k1 * v1 + k2 * v2 + k3 * v3;\n}\n\nvec4 transition(vec2 uv) {\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n vec4 to = getToColor(uv);\n vec4 col = getFromColor(uv);\n float sz = brushSize;\n float th = angle * PI / 180.0;\n float x = crossing * 0.6;\n col = pdLayer(col, q, sz, 0.0, th, 0.0, 0.3, 0.12, true, to);\n col = pdLayer(col, q, sz * 0.6, 1.0, th + x, 0.2, 0.28, 0.1, true, to);\n col = pdLayer(col, q, sz * 0.36, 2.0, th - x * 0.7, 0.38, 0.26, 0.09, true, to);\n col = pdLayer(col, q, sz * 0.22, 3.0, th + x * 0.4, 0.56, 0.22, 0.08, false, to);\n col = pdLayer(col, q, sz * 0.2, 4.0, th - x * 0.3, 0.68, 0.2, 0.08, false, to);\n col = mix(col, to, smoothstep(0.92, 1.0, progress));\n return clamp(col, 0.0, 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","PaperFold":"// PaperFold — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PaperFold.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a sheet of paper that folds in half in 3D along a vertical crease, then in half again along a horizontal one, its lit and shaded faces turning to show the back of the paper, and the small folded packet flies off the frame, leaving its shadow on 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 vec2 direction; \n\nuniform float tilt; \n\nuniform float shading; \n\nuniform vec4 paper; \n\nconst float PI = 3.141592653589793;\nconst float EDGE = 0.0015;\nconst float SHOW = 0.1;\nconst float CREASE = 0.02;\nconst vec3 LIGHT = vec3(-0.3995, 0.4494, 0.799);\n\nvec4 front(vec2 st) {\n return getFromColor(st / vec2(ratio, 1.0));\n}\n\nvec4 back(vec2 st) {\n vec4 c = front(st);\n return vec4(mix(paper.rgb, c.rgb, SHOW), c.a * paper.a);\n}\n\nvec4 topFace(vec2 st, bool second) {\n return second ? back(vec2(ratio - st.x, st.y)) : front(st);\n}\n\nfloat inside(vec2 p, float h, float k) {\n return min(min(p.x, h - p.x), min(p.y, k - p.y));\n}\n\nvec3 hitFlap(vec3 o, vec3 v, float h, vec3 n, vec3 along) {\n float den = dot(n, v);\n if (abs(den) < 1e-5) return vec3(-1.0, 0.0, 0.0);\n vec3 hinge = vec3(h, 0.0, 0.0);\n float t = dot(n, hinge - o) / den;\n vec3 q = o + t * v;\n return vec3(t, dot(q - hinge, along), q.y);\n}\n\nfloat shadowAt(vec3 q, vec3 l, float h, float k, vec3 n, vec3 along) {\n float sh = 0.0;\n if (q.z < -1e-4) {\n float soft = 0.004 - 0.4 * q.z;\n sh = smoothstep(-soft, soft, inside(q.xy - q.z / l.z * l.xy, h, k));\n }\n vec3 hit = hitFlap(q, l, h, n, along);\n if (hit.x > 0.0) {\n float height = hit.x * l.z;\n float soft = 0.004 + 0.3 * height;\n sh = max(sh, min(4.0 * n.x * n.x, 1.0) * smoothstep(-soft, soft, inside(hit.yz, h, k)) / (1.0 + 3.0 * height));\n }\n return sh;\n}\n\nvec3 toSheet(vec3 v, vec2 yaw, vec2 pitch, vec2 spin) {\n v = vec3(yaw.x * v.x + yaw.y * v.z, v.y, yaw.x * v.z - yaw.y * v.x);\n v = vec3(v.x, pitch.x * v.y + pitch.y * v.z, pitch.x * v.z - pitch.y * v.y);\n return vec3(spin.x * v.x + spin.y * v.y, spin.x * v.y - spin.y * v.x, v.z);\n}\n\nvec4 transition(vec2 uv) {\n float w = ratio;\n float shade = clamp(shading, 0.0, 1.0);\n float s = 2.0 * smoothstep(0.0, 0.62, progress);\n bool second = s > 1.0;\n float x = second ? s - 1.0 : s;\n float a = PI * mix(x, x * x * (3.0 - 2.0 * x), 0.6);\n float f = clamp((progress - 0.5) / 0.47, 0.0, 1.0);\n\n float turn = clamp(tilt, 0.0, 1.0) * (smoothstep(0.0, 0.25, progress) - smoothstep(0.4, 0.8, progress));\n vec2 yaw = vec2(cos(0.45 * turn), sin(0.45 * turn));\n vec2 pitch = vec2(cos(0.55 * turn), -sin(0.55 * turn));\n float dist = 2.5 * max(w, 1.0);\n float recede = dist * 0.35 * turn;\n\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n \n vec2 c = vec2(0.5 * w - 0.25 * w * min(s, 1.0), 0.5 - 0.25 * max(s - 1.0, 0.0));\n float reach = 0.5 * (abs(dir.x) * w + abs(dir.y)) + length(vec2(0.25 * w, 0.25)) + 0.4;\n float lift = 0.3 * smoothstep(0.0, 0.5, f);\n float turned = (dir.x < 0.0 ? 0.7 : -0.7) * f * f;\n vec2 spin = vec2(cos(turned), sin(turned));\n\n \n \n vec3 center = vec3(vec2(0.5 * w, 0.5) + dir * reach * f * f, -recede);\n vec3 eye = vec3(0.5 * w, 0.5, dist);\n vec3 e = toSheet(eye - center, yaw, pitch, spin) + vec3(c, 0.0);\n vec3 d = toSheet(vec3(uv.x * w, uv.y, 0.0) - eye, yaw, pitch, spin);\n vec3 l = toSheet(LIGHT, yaw, pitch, spin);\n if (second) {\n e.xy = e.yx;\n d.xy = d.yx;\n l.xy = l.yx;\n }\n float h = second ? 0.5 : 0.5 * w;\n float k = second ? 0.5 * w : 1.0;\n float creased = sin(a);\n vec3 n = vec3(-creased, 0.0, cos(a));\n vec3 along = vec3(cos(a), 0.0, creased);\n\n vec4 col = getToColor(uv);\n if (d.z < 0.0) {\n vec3 g = e + d * (e.z + lift) / -d.z;\n col.rgb *= 1.0 - 0.7 * shade * (1.0 - f * f) * shadowAt(g, l, h, k, n, along);\n }\n\n float t = d.z < 0.0 ? e.z / -d.z : -1.0;\n vec3 p = e + t * d;\n float m = clamp(inside(p.xy, h, k) / (EDGE * t) + 1.0, 0.0, 1.0);\n if (t > 0.0 && m > 0.0) {\n vec4 img = topFace(second ? p.yx : p.xy, second);\n float sh = shadowAt(p, l, h, k, n, along);\n img.rgb *= (1.0 - 0.7 * shade * sh) * (1.0 - 0.5 * shade * creased * exp(-abs(h - p.x) / CREASE));\n col = mix(col, img, m);\n }\n\n vec3 hit = hitFlap(e, d, h, n, along);\n if (hit.x > 0.0) {\n float r = hit.y;\n \n float dr = dot(along, normalize(d));\n float fore = sqrt(max(1.0 - dr * dr, 0.0025));\n float mf = clamp(min(min(r, h - r) * fore, min(hit.z, k - hit.z)) / (EDGE * hit.x) + 1.0, 0.0, 1.0);\n if (mf > 0.0) {\n bool up = dot(n, e - vec3(h, 0.0, 0.0)) > 0.0;\n vec2 st = vec2(h + r, hit.z);\n if (second) st = st.yx;\n vec4 img = up ? topFace(st, second) : back(st);\n \n float lit = dot(up ? n : -n, l) - l.z;\n img.rgb *= max(1.0 + 0.6 * shade * lit, 0.0) * (1.0 - 0.5 * shade * creased * exp(-abs(r) / CREASE));\n col = mix(col, img, mf);\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","PaperLayers":"// PaperLayers — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PaperLayers.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is rebuilt as a stack of cut paper sheets, one per band of brightness: from the darkest to the lightest, each sheet slides in lifted above the stack, drops into place with a soft shadow on the sheets below, then the paper flattens into the photo\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 layers; \n\nuniform float colorful; \n\nuniform float shadow; \n\nuniform vec4 paper; \n\nconst float MAX_LAYERS = 8.0;\n\nconst float STACKED = 0.74;\nconst float SLIDE = 0.2;\n\nconst float LIFT = 3.0;\nconst vec2 SHADOW = vec2(0.012, -0.018);\n\nconst float CUT = 0.012;\nconst float SHADOW_CUT = 0.05;\n\nconst float BLUR = 0.004;\nconst float SHADOW_BLUR = 0.01;\nconst float EDGE = 0.0015;\n\nfloat luma(vec4 c) {\n return dot(c.rgb, vec3(0.299, 0.587, 0.114));\n}\n\nfloat plHash(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 grain(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(plHash(i), plHash(i + vec2(1.0, 0.0)), f.x),\n mix(plHash(i + vec2(0.0, 1.0)), plHash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat softLuma(vec2 p, vec4 c, float radius, vec2 aspect) {\n vec2 r = radius / aspect;\n float l = luma(c);\n l += luma(getToColor(mirror(p + r * vec2(0.0, 1.0))));\n l += luma(getToColor(mirror(p + r * vec2(0.866, -0.5))));\n l += luma(getToColor(mirror(p + r * vec2(-0.866, -0.5))));\n return l / 4.0;\n}\n\nfloat cut(float k, float n, float l, float soft) {\n if (k < 0.5) return 1.0;\n float thr = k / n;\n return smoothstep(thr - soft, thr + soft, l);\n}\n\nvec4 transition(vec2 uv) {\n float n = clamp(float(layers), 2.0, MAX_LAYERS);\n float sh = clamp(shadow, 0.0, 1.0);\n vec2 aspect = vec2(ratio, 1.0);\n vec2 shadowOffset = SHADOW / aspect;\n float toPhoto = smoothstep(STACKED - 0.03, 1.0, progress);\n\n \n \n vec4 rest = getToColor(uv);\n float restLuma = 0.0;\n vec4 restShadowColor = vec4(0.0);\n float restShadow = 0.0;\n float n1 = n - 1.0;\n \n float slide = min(SLIDE, 2.0 * STACKED / (n1 + 2.0));\n float spacing = (STACKED - slide) / n1;\n if (progress >= slide) {\n restLuma = softLuma(uv, rest, BLUR, aspect);\n vec2 ps = uv - shadowOffset;\n restShadowColor = getToColor(mirror(ps));\n restShadow = softLuma(ps, restShadowColor, SHADOW_BLUR, aspect);\n }\n\n vec4 color = getFromColor(uv);\n for (float k = 0.0; k < MAX_LAYERS; k += 1.0) {\n if (k < n) {\n float t = clamp((progress - k * spacing) / slide, 0.0, 1.0);\n if (t > 0.0) {\n float e = 1.0 - (1.0 - t) * (1.0 - t) * (1.0 - t);\n float lift = 1.0 - smoothstep(0.5, 1.0, t);\n vec2 q = (uv - 0.5) / (1.0 + 0.03 * lift) + 0.5;\n q.y -= (1.0 - e) * 1.15;\n vec2 so = shadowOffset * (1.0 + LIFT * lift);\n vec4 src = rest;\n float l = restLuma;\n float ls = restShadow;\n float shadowAlpha = restShadowColor.a;\n if (t < 1.0) {\n src = getToColor(mirror(q));\n l = softLuma(q, src, BLUR, aspect);\n vec4 cs = getToColor(mirror(q - so));\n ls = softLuma(q - so, cs, SHADOW_BLUR, aspect);\n shadowAlpha = cs.a;\n }\n float m = cut(k, n, l, CUT) * src.a * smoothstep(-EDGE, EDGE, q.y);\n float s = cut(k, n, ls, SHADOW_CUT) * shadowAlpha * smoothstep(-EDGE, EDGE, q.y - so.y);\n color.rgb *= 1.0 - sh * (1.0 - toPhoto) * (0.7 - 0.35 * lift) * s * (1.0 - m);\n \n \n float level = 0.25 + 0.75 * k / n1;\n vec3 plain = paper.rgb * level;\n vec3 tinted = clamp(level + 1.25 * (src.rgb - luma(src)), 0.0, 1.0);\n vec3 sheet = mix(plain, tinted, 0.9 * clamp(colorful, 0.0, 1.0));\n sheet *= 0.975 + 0.05 * grain(q * aspect * 160.0 + k * 37.0);\n color = mix(color, vec4(sheet, paper.a), m);\n }\n }\n }\n return mix(color, rest, toPhoto);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","PaperPlane":"// PaperPlane — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PaperPlane.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is folded into a paper plane: its two left corners fold back to the middle, it folds in half behind itself, the wings fold out, and the plane banks and glides away into the distance over 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 shading; \n\nuniform vec4 paper; \n\nconst float PI = 3.141592653589793;\nconst float K = 0.1;\n\nconst float HINGE = 0.75;\nconst float CAM = 2.6;\nconst vec3 LIGHT = vec3(-0.36, 0.48, 0.8);\n\nfloat W, af, ah, aw, roll, yaw;\nbool portrait;\nvec2 hu;\nvec3 shift;\n\nvec3 rot(vec3 p, vec3 a, vec3 d, float ang) {\n p -= a;\n float c = cos(ang), s = sin(ang);\n return a + p * c + cross(d, p) * s + d * dot(d, p) * (1.0 - c);\n}\n\nvec3 place(vec3 p, bool top, bool flap, bool wing) {\n if (flap) p = rot(p, vec3(0.0), vec3(hu.x, top ? hu.y : -hu.y, 0.0), top ? -af : af);\n if (!top) p = rot(p, vec3(0.0), vec3(1.0, 0.0, 0.0), ah);\n if (wing) p = rot(p, vec3(0.0), normalize(vec3(1.0, K, 0.0)), top ? aw : -aw);\n vec3 pivot = vec3(0.5 * W, 0.1, 0.0);\n p = rot(p, pivot, vec3(1.0, 0.0, 0.0), roll);\n p = rot(p, pivot, vec3(0.0, 0.0, 1.0), yaw);\n return p - vec3(0.5 * W, 0.0, 0.0) + shift;\n}\n\nvec2 inside(vec2 s, bool top, bool flap, bool wing) {\n float d = min(min(s.x, W - s.x), min(s.y + 0.5, 0.5 - s.y));\n vec2 m = vec2(s.x, top ? s.y : -s.y);\n float hinge = m.x * hu.y - m.y * hu.x;\n \n \n vec2 f = flap ? 2.0 * dot(m, hu) * hu - m : m;\n float n = inversesqrt(1.0 + K * K);\n float crease = (K * f.x - f.y) * n;\n float c = min(min(m.y, flap ? -hinge : hinge), wing ? -crease : crease);\n if (flap && af > 0.6 * PI) c = min(c, f.y);\n return vec2(d, c);\n}\n\nvec4 shadeFace(vec2 s, vec3 n, bool front) {\n float lit = clamp(dot(n, LIGHT), 0.0, 1.0);\n vec2 t = vec2(s.x / W, s.y + 0.5);\n vec4 c = front ? getFromColor(portrait ? vec2(t.y, 1.0 - t.x) : t) : paper;\n \n c.rgb *= lit < LIGHT.z ? 1.0 - shading * (LIGHT.z - lit) / LIGHT.z : 1.0 + 0.3 * shading * (lit - LIGHT.z) / (1.0 - LIGHT.z);\n return c;\n}\n\nvec4 transition(vec2 uv) {\n \n portrait = ratio < 1.0;\n W = portrait ? 1.0 / ratio : ratio;\n vec2 st = portrait ? vec2(1.0 - uv.y, uv.x) : uv;\n hu = normalize(vec2(HINGE * W, 0.5));\n float p = progress;\n float e1 = smoothstep(0.0, 0.24, p);\n float e2 = smoothstep(0.2, 0.42, p);\n float e3 = smoothstep(0.4, 0.62, p);\n float e4 = smoothstep(0.55, 1.0, p);\n af = PI * e1 * 0.999;\n ah = PI * e2 * 0.999;\n \n aw = 0.4 * PI * e3;\n roll = -0.9 * e3 + 0.35 * sin(PI * e4);\n yaw = -0.25 * e3 - 0.2 * e4;\n float f = e4 * e4;\n shift = vec3(0.35 * e3 - 3.3 * f, 0.15 * e3 + 2.2 * f, -1.2 * e3 - 5.5 * f);\n\n vec3 O[8], EX[8], EY[8];\n for (int i = 0; i < 8; i++) {\n bool top = i < 4;\n bool flap = mod(float(i), 4.0) > 1.5;\n bool wing = mod(float(i), 2.0) > 0.5;\n O[i] = place(vec3(0.0), top, flap, wing);\n EX[i] = place(vec3(1.0, 0.0, 0.0), top, flap, wing) - O[i];\n EY[i] = place(vec3(0.0, 1.0, 0.0), top, flap, wing) - O[i];\n }\n\n vec3 ro = vec3(0.0, 0.0, CAM);\n vec3 rd = normalize(vec3((st - 0.5) * vec2(W, 1.0), 0.0) - ro);\n float px = 0.003;\n\n \n float t1 = 1e4, t2 = 1e4, k1 = -1.0, k2 = -1.0;\n vec2 s1 = vec2(0.0), s2 = vec2(0.0);\n vec3 n1 = vec3(0.0), n2 = vec3(0.0);\n float a1 = 0.0, a2 = 0.0;\n bool f1 = true, f2 = true;\n for (int i = 0; i < 8; i++) {\n bool top = i < 4;\n bool flap = mod(float(i), 4.0) > 1.5;\n bool wing = mod(float(i), 2.0) > 0.5;\n vec3 n = cross(EX[i], EY[i]);\n float den = dot(rd, n);\n if (abs(den) < 1e-4) continue;\n float t = dot(O[i] - ro, n) / den;\n vec3 q = ro + t * rd - O[i];\n vec2 s = vec2(dot(q, EX[i]), dot(q, EY[i]));\n vec2 dd = inside(s, top, flap, wing);\n \n \n float d = min(dd.x, dd.y) + px;\n if (t <= 0.0 || d <= -px) continue;\n \n float a = smoothstep(-px, px, d) * smoothstep(0.0, 0.1, abs(den));\n vec3 nf = den < 0.0 ? n : -n;\n \n if (abs(t - t1) < 0.01) {\n bool take = abs(t - t1) < 1e-4 ? dd.y > k1 : (t < t1 ? dd.y > 0.0 || dd.y > k1 : k1 < 0.0 && dd.y > k1);\n if (take) { t1 = t; s1 = s; n1 = nf; k1 = dd.y; f1 = den < 0.0; }\n a1 = max(a1, a);\n } else if (t < t1) {\n t2 = t1; s2 = s1; n2 = n1; a2 = a1; f2 = f1; k2 = k1;\n t1 = t; s1 = s; n1 = nf; a1 = a; k1 = dd.y; f1 = den < 0.0;\n } else if (abs(t - t2) < 0.01) {\n bool take = abs(t - t2) < 1e-4 ? dd.y > k2 : (t < t2 ? dd.y > 0.0 || dd.y > k2 : k2 < 0.0 && dd.y > k2);\n if (take) { t2 = t; s2 = s; n2 = nf; k2 = dd.y; f2 = den < 0.0; }\n a2 = max(a2, a);\n } else if (t < t2) {\n t2 = t; s2 = s; n2 = nf; a2 = a; f2 = den < 0.0; k2 = dd.y;\n }\n }\n\n vec4 bg = getToColor(uv);\n \n vec3 g = ro + rd * (CAM - shift.z + 0.6) / -rd.z;\n float sh = 0.0;\n for (int i = 0; i < 8; i++) {\n if (a1 >= 1.0) break;\n bool top = i < 4;\n bool flap = mod(float(i), 4.0) > 1.5;\n bool wing = mod(float(i), 2.0) > 0.5;\n vec3 n = cross(EX[i], EY[i]);\n float den = dot(LIGHT, n);\n if (abs(den) < 1e-4) continue;\n float t = dot(O[i] - g, n) / den;\n vec3 q = g + t * LIGHT - O[i];\n vec2 dd = inside(vec2(dot(q, EX[i]), dot(q, EY[i])), top, flap, wing);\n \n float w = 0.005 + 0.03 * t;\n if (t > 0.0) sh = max(sh, smoothstep(-w, w, min(dd.x, dd.y + 2.0 * w)) / (1.0 + t));\n }\n bg.rgb *= 1.0 - 0.6 * shading * sh * (1.0 - e4);\n\n vec4 col = bg;\n if (a2 > 0.0) col = mix(col, shadeFace(s2, n2, f2), a2);\n if (a1 > 0.0) col = mix(col, shadeFace(s1, n1, f1), a1);\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","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 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 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","ParallaxPush":"// ParallaxPush — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ParallaxPush.glsl\n// Author: gre\n// License: MIT\n// Description: The camera tracks sideways past a dark, out-of-focus pillar standing close to the lens: the pillar rushes across the frame while the images far behind it drift slowly the same way with a slight push in, and the cut to the incoming image happens hidden 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 parallax; \n\nuniform float width; \n\nuniform float blur; \n\nuniform vec4 pillar; \n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n \n vec2 d = abs(direction.x) >= abs(direction.y)\n ? vec2(direction.x > 0.0 ? 1.0 : -1.0, 0.0)\n : vec2(0.0, direction.y > 0.0 ? 1.0 : -1.0);\n \n float len = d.x != 0.0 ? ratio : 1.0;\n float u = (dot(uv - 0.5, d) + 0.5) * len;\n \n float v = d.x != 0.0 ? uv.y : uv.x;\n\n float p = progress;\n \n float e = 0.7 * p * p * (3.0 - 2.0 * p) + 0.3 * p;\n float speed = 0.7 * 6.0 * p * (1.0 - p) + 0.3;\n\n \n \n \n float drift = clamp(parallax, 0.0, 0.25);\n float da = drift * e;\n float db = drift * (1.0 - e);\n vec4 a = getFromColor(mirror(0.5 + (uv - 0.5) * (1.0 - 2.0 * da) - d * da));\n vec4 b = getToColor(mirror(0.5 + (uv - 0.5) * (1.0 - 2.0 * db) + d * db));\n\n \n \n float w = clamp(width, 0.1, 1.0) * min(ratio, 1.0);\n float bl = clamp(blur, 0.0, 1.0);\n float defocus = w * (0.02 + 0.08 * bl);\n \n float smear = 0.035 * bl * (len + w);\n float soft = min(defocus + smear * speed, 0.8 * w);\n \n float reach = 0.5 * w + 0.5 * min(defocus + smear * 0.3, 0.8 * w) + 0.001;\n float c = -reach + (len + 2.0 * reach) * e;\n \n float x = (c - u) / (0.5 * w);\n float edge = soft / w;\n float cover = 1.0 - smoothstep(1.0 - edge, 1.0 + edge, abs(x));\n if (cover <= 0.0) return u < c ? b : a;\n\n \n \n vec4 bg = mix(a, b, smoothstep(-0.8, 0.8, x));\n\n \n \n float xs = clamp(x, -1.0, 1.0);\n float n = sqrt(max(1.0 - xs * xs, 0.0));\n float lambert = max(0.5 * n - 0.85 * xs, 0.0);\n float spec = pow(max(0.6 * n - 0.8 * xs, 0.0), 12.0);\n float rim = smoothstep(0.6, 1.0, abs(xs)) * (1.0 - cover);\n vec4 side = xs < 0.0 ? a : b;\n vec3 lit = pillar.rgb * (0.35 + 1.1 * lambert) * (0.6 + 0.5 * v) + 0.12 * spec;\n lit += 0.25 * rim * side.rgb * side.a;\n\n \n float pa = pillar.a * cover;\n vec4 col = vec4(lit * pa + bg.rgb * bg.a * (1.0 - pa), pa + bg.a * (1.0 - pa));\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","Perforate":"// Perforate — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Perforate.glsl\n// Author: gre\n// License: MIT\n// Description: A row of perforation holes is punched across the outgoing picture along a gentle wave; the lower half tears away along the holes from left to right, bending down behind the tear and dropping off, then the upper half tears off the top edge from right to left and falls the same way, revealing the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 wave; \n\nconst float SPACING = 0.03;\nconst float HOLE = 0.0065;\nconst float RIM = 0.0025;\nconst vec2 SHADOW = vec2(0.02, -0.03);\n\nfloat aa(float d) { return clamp(d * 400.0 + 1.0, 0.0, 1.0); }\nfloat frameDist(vec2 S) { vec2 d = min(S, vec2(ratio, 1.0) - S); return min(d.x, d.y); }\nfloat line(float x) { return 0.5 + wave * sin(x * 4.0 + 1.0); }\nfloat drop(float t) { t = clamp(t, 0.0, 1.0); return t * t; }\n\nvec3 bend(vec2 Q, vec2 T, float an, float dir) {\n vec2 d = Q - T;\n d.x *= dir;\n float r = length(d);\n float a = an * smoothstep(0.0, 0.25, r) * smoothstep(-0.2, 2.2, atan(d.x, -d.y));\n float c = cos(a), s = sin(a);\n return vec3(T + vec2(dir * (d.x * c - d.y * s), d.y * c + d.x * s), a);\n}\n\nfloat punch(float x) {\n float t = 0.12 * x / ratio;\n return smoothstep(t, t + 0.05, progress);\n}\n\nfloat lineDist(vec2 S, float side) { return side * (S.y - line(S.x)); }\n\nvec4 drawPiece(vec4 col, vec3 B, float side, float tornX) {\n vec2 S = B.xy;\n float dl = lineDist(S, side);\n float cx = (floor(S.x / SPACING) + 0.5) * SPACING;\n float h = length(vec2(S.x - cx, dl)) - HOLE * punch(cx);\n float m = aa(dl) * aa(h) * aa(frameDist(S));\n if (m <= 0.0) return col;\n vec4 c = getFromColor(clamp(vec2(S.x / ratio, S.y), 0.0, 1.0));\n c.rgb *= 1.0 - 0.22 * sin(min(B.z, 1.5));\n float rim = max((1.0 - smoothstep(0.0, RIM, h)) * punch(cx), (1.0 - smoothstep(0.0, RIM, dl)) * smoothstep(0.0, 0.02, tornX - S.x));\n c.rgb = mix(c.rgb, vec3(0.93, 0.91, 0.87), 0.6 * rim);\n return mix(col, c, m);\n}\n\nfloat shadowOf(vec3 B, float side) {\n return smoothstep(-0.03, 0.03, min(lineDist(B.xy, side), frameDist(B.xy))) * smoothstep(0.0, 0.25, B.z);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress, R = ratio;\n vec2 Q = vec2(uv.x * R, uv.y);\n float k1 = smoothstep(0.06, 0.44, p);\n float k2 = smoothstep(0.44, 0.82, p);\n \n float d1 = drop((p - 0.4) / 0.3);\n float d2 = drop((p - 0.78) / 0.22);\n float fall1 = 2.4 * d1, fall2 = 2.6 * d2;\n float an1 = 1.1 * k1 + 0.5 * d1;\n float an2 = 1.1 * k2 + 0.5 * d2;\n float x1 = R * (k1 * 1.1 - 0.05);\n vec2 T1 = vec2(x1, line(x1));\n vec2 T2 = vec2(R * (1.05 - 1.1 * k2), 1.0);\n\n vec4 col = getToColor(uv);\n float sh = max(\n shadowOf(bend(Q - SHADOW + vec2(0.0, fall1), T1, an1, -1.0), -1.0),\n shadowOf(bend(Q - SHADOW + vec2(0.0, fall2), T2, an2, 1.0), 1.0));\n col.rgb *= 1.0 - 0.5 * sh;\n\n col = drawPiece(col, bend(Q + vec2(0.0, fall1), T1, an1, -1.0), -1.0, T1.x);\n col = drawPiece(col, bend(Q + vec2(0.0, fall2), T2, an2, 1.0), 1.0, T1.x);\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","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 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\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\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 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 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 float dev = clamp((d - 0.45 * lum) / 0.55, 0.0, 1.0);\n dev = dev * dev * (3.0 - 2.0 * dev);\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","PinchLift":"// PinchLift — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PinchLift.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is pinched at one point like a handkerchief: its sides drop and swing in under the pinch, gathering into hanging pleats, then it is let go and falls down out of the frame, revealing the incoming image behind 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 center; \n\nuniform float pleats; \n\nuniform float depth; \n\nuniform float swing; \n\nuniform float shadow; \n\nconst float PI = 3.14159265;\n\nfloat fanWidth(float t, float r) {\n \n float a = clamp((t - 0.03 - 0.1 * r) / 0.45, 0.0, 1.0);\n float s = a * a * (3.0 - 2.0 * a) + 0.15 * sin(PI * a) * a * a;\n float m = smoothstep(0.5, 1.0, t);\n return mix(1.0, 0.3, s) + 0.12 * m * min(r, 1.0);\n}\n\nfloat pleatPhase(float th) {\n return floor(pleats + 0.5) * th + 0.8 * sin(3.0 * th + 1.0) + 0.5 * sin(5.0 * th + 2.0);\n}\n\nfloat hangAngle(vec2 d, float sway) {\n float th = abs(d.x) + abs(d.y) > 0.0 ? atan(d.x, -d.y) : 0.0;\n return mod(th - sway + PI, 2.0 * PI) - PI;\n}\n\nvec4 cloth(vec2 d, float t, vec2 P, float sway) {\n float r = length(d);\n float th = hangAngle(d, sway);\n float w = fanWidth(t, r);\n float th0 = th / w;\n float A = clamp((1.0 - w) / 0.7, 0.0, 1.0);\n \n \n float k = pleatPhase(th0);\n float th1 = th0 + 0.9 * A * sin(k) * smoothstep(0.0, 0.3, PI - abs(th0)) / floor(pleats + 0.5);\n float r0 = r * (1.0 + 0.12 * A * (0.5 - 0.5 * cos(k)));\n vec2 o = P + r0 * vec2(sin(th1), -cos(th1));\n return vec4(o, A, (PI * w - abs(th)) * r);\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n vec2 asp = vec2(ratio, 1.0);\n vec2 P = center * asp;\n float m = clamp((t - 0.52) / 0.48, 0.0, 1.0);\n vec2 C = P - vec2(0.0, m * m * (P.y + 0.25));\n float a = clamp((t - 0.1) / 0.45, 0.0, 1.0);\n float sway = swing * (0.22 * sin(2.6 * PI * a) * (1.0 - a) * a * 3.0 - 0.08 * m);\n\n vec2 d = uv * asp - C;\n float r = length(d);\n vec4 c = cloth(d, t, P, sway);\n vec2 src = c.xy / asp;\n vec2 bd = min(src, 1.0 - src) * asp;\n \n float e = 0.002 * (1.0 + 2.0 * c.z) * min(1.0, 30.0 * t) + 1e-5;\n float cov = clamp(min(bd.x, bd.y) / e + 0.5, 0.0, 1.0);\n \n \n float w = fanWidth(t, r);\n float h = PI * (1.0 - w) * r;\n float x = c.w + h;\n cov *= 1.0 - clamp((min(x + 0.5 * e, h) - max(x - 0.5 * e, -h)) / e, 0.0, 1.0);\n\n vec4 img = vec4(0.0);\n if (cov > 0.0) {\n img = getFromColor(clamp(src, 0.0, 1.0));\n float th = hangAngle(d, sway) / w;\n float N = floor(pleats + 0.5);\n float k = pleatPhase(th);\n float amp = 0.6 + 0.4 * sin(2.0 * th + 2.5) * sin(3.0 * th + 0.7);\n float A = sqrt(c.z) * depth * amp * smoothstep(0.0, 0.25, r);\n float aw = 0.003 * N / max(r * w, 1e-3) + 0.05;\n float face = clamp(sin(k) / aw, -1.0, 1.0);\n float valley = pow(0.5 - 0.5 * cos(k), 3.0);\n float shade = 1.0 + A * (0.45 * face * (0.4 + 0.6 * abs(sin(k))) - 0.55 * valley);\n shade += 0.2 * depth * c.z * (1.0 - smoothstep(0.0, 0.06, r));\n shade -= 0.15 * depth * c.z * smoothstep(0.2, 1.0, r);\n shade -= 0.35 * depth * sqrt(c.z) * exp(-c.w / 0.025);\n img.rgb *= max(shade, 0.0);\n if (cov >= 1.0) return img;\n }\n\n vec4 bg = getToColor(uv);\n float lift = sin(PI * t);\n if (lift > 0.0) {\n vec4 cs = cloth(d - vec2(0.03, -0.035), t, P, sway);\n vec2 ss = cs.xy / asp;\n vec2 sb = min(ss, 1.0 - ss) * asp;\n float sh = smoothstep(-0.05, 0.04, min(min(sb.x, sb.y), cs.w));\n \n float edge = (hangAngle(d, sway) < 0.0 ? -PI : PI) * w * 0.999 + sway;\n vec2 es = cloth(r * vec2(sin(edge), -cos(edge)), t, P, sway).xy / asp;\n vec2 eb = min(es, 1.0 - es) * asp;\n float gap = (1.0 - m * m) * smoothstep(-0.01, 0.0, -c.w) * (1.0 - smoothstep(0.0, 0.05, -c.w));\n gap *= smoothstep(-0.01, 0.01, min(eb.x, eb.y));\n bg.rgb *= (1.0 - shadow * 0.55 * sh * lift) * (1.0 - shadow * 0.55 * gap);\n }\n return mix(bg, img, cov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 \n float signed = sign(progress * (3.1415 / 4. + 0.01) - 0.01 - 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 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 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 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\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 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 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 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 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","PointCharges":"// PointCharges — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PointCharges.glsl\n// Author: gre\n// License: MIT\n// Description: Charges appear in the outgoing picture, each holding a small view of the incoming one in a glass bead; they orbit and grow while the outgoing picture bends and pours around them, then one of them takes the center and opens onto the incoming picture as the others are pushed out of 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 charges; \n\nuniform float turns; \n\nuniform float rim; \n\nconst float TAU = 6.283185307;\n\nvec2 mirrorUv(vec2 u) {\n return 1.0 - abs(1.0 - mod(u, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 asp = vec2(ratio, 1.0);\n float m = min(ratio, 1.0);\n \n float R = 0.5 * m;\n \n float L = log(0.53 * length(asp) / R);\n float n = clamp(floor(charges + 0.5), 2.0, 6.0);\n float enter = smoothstep(0.0, 0.28, p);\n float g0 = mix(mix(L, 0.45, enter), -L, smoothstep(0.4, 1.0, p));\n float world = exp(-(L + 0.2) * enter) * (1.0 - smoothstep(0.35, 1.0, p));\n float s = smoothstep(0.34, 0.95, p);\n float left = 1.0 - smoothstep(0.45, 0.9, p);\n float turn = TAU * turns * smoothstep(0.0, 1.0, p);\n float e = rim * smoothstep(0.0, 0.15, p) * (1.0 - smoothstep(0.8, 1.0, p));\n float aa = 0.001 * smoothstep(0.0, 0.1, p) * (1.0 - smoothstep(0.9, 1.0, p));\n vec2 spread = min(asp, 1.35 * m) / R;\n float push = 2.0 * max(ratio, 1.0) / m;\n\n \n vec2 z = ((uv - 0.5) * asp + 1e-5) / R;\n vec4 zx = z.x + aa / R * vec4(1.5, 0.5, -0.5, -1.5);\n vec4 zy = z.y + aa / R * vec4(0.5, -1.5, 1.5, -0.5);\n vec4 wx = world * zx, wy = world * zy;\n for (int i = 0; i < 6; i++) {\n float k = float(i);\n if (k >= n) break;\n float x = clamp((p - 0.03 * k) / 0.4, 0.0, 1.0);\n \n float q = min(1.0 / n, 0.4) * x * x * (2.0 - x) / (x + 0.03);\n float a = TAU * (k / n + 0.11) + turn;\n vec2 c = (0.31 - 0.05 * cos(TAU * k * 0.618)) * vec2(cos(a), sin(a)) * spread;\n if (i == 0) {\n q = mix(q, 1.0, s);\n c *= 1.0 - s;\n } else {\n q *= left;\n c *= 1.0 + push * s;\n }\n vec4 dx = zx - c.x, dy = zy - c.y;\n vec4 d = q / max(dx * dx + dy * dy, 1e-12);\n wx += d * dx;\n wy -= d * dy;\n }\n\n vec4 sum = vec4(0.0);\n for (int j = 0; j < 4; j++) {\n vec2 w = j == 0 ? vec2(wx.x, wy.x) : j == 1 ? vec2(wx.y, wy.y) : j == 2 ? vec2(wx.z, wy.z) : vec2(wx.w, wy.w);\n float l = max(dot(w, w), 1e-9);\n float g = 0.5 * log(l) - g0;\n vec4 f = getFromColor(mirrorUv(w * R / asp + 0.5));\n vec4 t = getToColor(mirrorUv(vec2(w.x, -w.y) / l * R / asp + 0.5));\n vec4 col = mix(vec4(f.rgb * f.a, f.a), vec4(t.rgb * t.a, t.a), smoothstep(-0.02, 0.02, g));\n col.rgb *= 1.0 - 0.5 * e * exp(-abs(g) * 6.0);\n col.rgb += 0.45 * e * exp(-(g - 0.12) * (g - 0.12) * 200.0) * col.a;\n sum += col;\n }\n return sum.a > 0.0 ? vec4(sum.rgb / sum.a, 0.25 * sum.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","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 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 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 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","PosterPaste":"// PosterPaste — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PosterPaste.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is pasted over the outgoing one as a poster, sheet after sheet: each wet sheet drops onto the wall hanging loose from its top edge with a soft shadow, then a brush smooths it on from top to bottom, leaving wrinkles and air bubbles that flatten out and seams that fade as the paste dries\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 sheets; \n\nuniform float wrinkles; \n\nconst float AA = 0.0015;\n\nconst float ARC = 0.18;\n\nconst float END = 0.86;\n\nconst float STAGGER = 0.45;\n\nconst float UNFOLD = 0.22;\n\nconst float FLAP = 0.34;\n\nconst float OVERLAP = 0.006;\n\nconst float PERSPECTIVE = 1.2;\n\nconst vec3 LIGHT = vec3(-0.25, 0.5, 0.83);\nconst float RELIEF = 2.5;\n\nfloat ppHash(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 ppNoise(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(ppHash(i), ppHash(i + vec2(1.0, 0.0)), f.x),\n mix(ppHash(i + vec2(0.0, 1.0)), ppHash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nvec2 ppFold(vec2 p) {\n return 1.0 - abs(1.0 - mod(p, 2.0));\n}\n\nvec4 ppSheet(float k, float n) {\n float dur = END / (1.0 + (n - 1.0) * STAGGER);\n float t = (progress - k * STAGGER * dur) / dur;\n float a = clamp(t / UNFOLD, 0.0, 1.0);\n a = a * a * (3.0 - 2.0 * a);\n float b = max((t - UNFOLD) / (1.0 - UNFOLD), 0.0);\n float f = b < 0.2 ? b * b * 2.5 : b - 0.1;\n float front = 1.0 + 2.0 * AA - f * 1.12 / 0.9;\n float theta = mix(1.35, 0.6, a) - 0.15 * smoothstep(0.0, 0.4, b) + 0.1 * sin(b * 10.0) * (1.0 - smoothstep(0.0, 0.6, b));\n return vec4(front, 0.035 * a, theta, FLAP * a);\n}\n\nfloat ppWrinkle(vec2 q, float k) {\n float a = 1.0 - abs(2.0 * ppNoise(q * vec2(12.0, 2.5) + vec2(k * 13.1, k * 5.7)) - 1.0);\n float b = ppNoise(q * vec2(22.0, 6.0) + vec2(k * 7.3 + 4.0, 2.0));\n return 0.004 * a * a + 0.0015 * b;\n}\n\nvec2 ppRelief(vec2 q, float k, float fresh, vec4 st, float x0, float x1) {\n float h0 = ppWrinkle(q, k);\n vec2 g = vec2(ppWrinkle(q + vec2(0.002, 0.0), k) - h0, ppWrinkle(q + vec2(0.0, 0.002), k) - h0) * (fresh / 0.002);\n for (int j = 0; j < 3; j++) {\n float fj = float(j);\n vec4 h = vec4(ppHash(vec2(k, fj)), ppHash(vec2(fj, k + 11.0)), ppHash(vec2(k + 5.0, fj + 3.0)), ppHash(vec2(fj + 7.0, k + 2.0)));\n vec2 c = vec2(mix(x0, x1, 0.2 + 0.6 * h.z) * ratio, 0.12 + 0.76 * h.w);\n float e = 0.6 * (2.0 * h.z - 1.0);\n float past = c.y - st.x - st.y * e * e;\n float swell = smoothstep(0.0, 0.08, past) * (1.0 - smoothstep(0.1, 0.55, past));\n float r = (0.03 + 0.03 * h.x) * (0.55 + 0.45 * swell);\n vec2 v = q - c;\n float u = max(1.0 - dot(v, v) / (r * r), 0.0);\n \n g -= v * (0.48 / r) * u * swell * step(0.5, h.y + 0.25 * fj);\n }\n return g;\n}\n\nvec4 ppLoose(vec2 p, vec4 st, float x0, float x1, float xl, float xr, float w, float topShift) {\n float th = st.z;\n float c = th / ARC;\n float sinT = sin(th);\n float cosT = cos(th);\n float d1 = sinT / c;\n float x = p.x;\n float h = 0.0;\n float d = 0.0;\n float s = 0.0;\n float z = 0.0;\n float y = p.y;\n \n for (int i = 0; i < 3; i++) {\n float e = clamp((x - x0) / (x1 - x0) * 2.0 - 1.0, -1.0, 1.0);\n h = st.x + st.y * e * e;\n d = h - y;\n s = (th - asin(clamp(sinT - c * clamp(d, 0.0, d1), -1.0, 1.0))) / c + max(d - d1, 0.0) + min(d, 0.0);\n z = (cos(th - c * clamp(s, 0.0, ARC)) - cosT) / c;\n x = 0.5 + (p.x - 0.5) * (1.0 - PERSPECTIVE * z);\n y = 0.5 + (p.y - 0.5) * (1.0 - PERSPECTIVE * z);\n }\n y = min(h, 1.0) - s;\n float wx = w / ratio;\n float cov = smoothstep(-AA, AA, d + topShift) * smoothstep(-w, w, y) * smoothstep(-w, w, st.w - s) * smoothstep(-wx, wx, x - xl) * smoothstep(-wx, wx, xr - x);\n return vec4(cov, x, y, z);\n}\n\nvec4 transition(vec2 uv) {\n float n = floor(clamp(sheets, 2.0, 8.0) + 0.5);\n float creases = clamp(wrinkles, 0.0, 1.0);\n float wet = 1.0 - smoothstep(END, 1.0, progress);\n float relief = creases * wet;\n float aax = AA / ratio;\n float cover = 0.0; \n float lit = 0.0; \n float wall = 1.0; \n vec2 tuv = uv;\n\n for (int i = 0; i < 8; i++) {\n float k = float(i);\n if (k >= n) break;\n float x0 = k / n;\n float x1 = (k + 1.0) / n;\n float xl = k < 0.5 ? -1.0 : x0 - OVERLAP;\n float xr = k > n - 1.5 ? 2.0 : x1;\n vec4 st = ppSheet(k, n);\n float e = clamp((uv.x - x0) / (x1 - x0) * 2.0 - 1.0, -1.0, 1.0);\n float past = uv.y - st.x - st.y * e * e;\n float inY = smoothstep(-AA, AA, past);\n float cov = inY * smoothstep(-aax, aax, uv.x - xl) * smoothstep(-aax, aax, xr - uv.x);\n float edge = (uv.x - xl) * ratio;\n float seam = 0.3 * wet * step(0.5, k) * inY * (1.0 - smoothstep(0.0, 0.005, -edge)) * step(edge, 0.0);\n lit *= 1.0 - seam;\n wall *= 1.0 - seam;\n if (cov <= 0.0) continue;\n float fresh = 1.0 - smoothstep(0.0, 0.6, past);\n vec2 g = relief > 0.0 ? ppRelief(vec2(uv.x * ratio, uv.y), k, fresh, st, x0, x1) * relief : vec2(0.0);\n float shade = 1.0 - RELIEF * dot(g, LIGHT.xy) / LIGHT.z;\n shade *= (1.0 - 0.08 * fresh * wet) * (1.0 + 0.06 * (1.0 - smoothstep(0.0, 0.2, past)) * wet);\n float overlap = 0.07 * (1.0 - smoothstep(OVERLAP * ratio, OVERLAP * ratio + 0.002, edge));\n float rim = 0.12 * (1.0 - smoothstep(0.0, 0.0025, edge));\n shade *= 1.0 - (overlap - rim) * wet * step(0.5, k);\n tuv = mix(tuv, uv - g * 0.004, cov);\n lit = lit * (1.0 - cov) + shade * cov;\n cover = cover * (1.0 - cov) + cov;\n }\n\n \n for (int i = 0; i < 8; i++) {\n float k = float(i);\n if (k >= n) break;\n vec4 st = ppSheet(k, n);\n if (st.w <= 0.0 || st.x + st.y < -0.01) continue;\n float x0 = k / n;\n float x1 = (k + 1.0) / n;\n float xl = k < 0.5 ? -1.0 : x0 - OVERLAP;\n float xr = k > n - 1.5 ? 2.0 : x1;\n float topShift = 2.0 * AA;\n float zMax = ARC * (1.0 - cos(st.z)) / st.z * smoothstep(0.0, ARC, st.w);\n vec4 sh = ppLoose(uv + LIGHT.xy / LIGHT.z * zMax * vec2(1.0 / ratio, 1.0), st, x0, x1, xl, xr, AA + 0.5 * zMax, topShift);\n float shadow = 0.5 * sh.x * smoothstep(0.0, 0.04, sh.w);\n lit *= 1.0 - shadow;\n wall *= 1.0 - shadow;\n vec4 l = ppLoose(uv, st, x0, x1, xl, xr, AA, topShift);\n if (l.x <= 0.0) continue;\n float th = acos(clamp(cos(st.z) + l.w * st.z / ARC, -1.0, 1.0));\n vec2 g = relief > 0.0 ? ppRelief(vec2(l.y * ratio, l.z), k, 1.0, st, x0, x1) * relief : vec2(0.0);\n float e = clamp((l.y - x0) / (x1 - x0) * 2.0 - 1.0, -1.0, 1.0);\n float s = min(st.x + st.y * e * e, 1.0) - l.z;\n g.x += 0.8 * creases * smoothstep(0.0, 0.3, s) * cos(l.y * n * 12.57 + k * 2.1 + st.z * 4.0);\n float fold = 1.0 - smoothstep(0.0, 0.035, st.w - s);\n float curl = 1.0 - smoothstep(0.0, 0.04, l.z);\n float shade = (LIGHT.y * sin(th) + LIGHT.z * cos(th)) / LIGHT.z;\n shade *= (1.0 - RELIEF * dot(g, LIGHT.xy) / LIGHT.z) * (1.0 - 0.8 * l.w) * (1.0 - 0.08 * wet) * (1.0 - 0.35 * fold * fold) * (1.0 + 0.15 * curl);\n tuv = mix(tuv, vec2(l.y, l.z) - g * 0.004, l.x);\n lit = lit * (1.0 - l.x) + shade * l.x;\n cover = cover * (1.0 - l.x) + l.x;\n }\n\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(ppFold(tuv));\n return vec4(a.rgb * wall * (1.0 - cover) + b.rgb * lit, mix(a.a, b.a, 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","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\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","PrimaryLights":"// PrimaryLights — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PrimaryLights.glsl\n// Author: gre\n// License: MIT\n// Description: The lights dim on the outgoing image and three round beams of red, green and blue light glide in from three sides, each showing the incoming image in its own color; where they overlap the colors add up, and where all three meet the incoming image appears in full color, until the merged beam 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 darkness; \n\nuniform float softness; \n\nuniform float glow; \n\nconst float PI = 3.1415927;\n\nvec3 beam(vec2 p, float k, float t, float size, float s, float g, float far) {\n \n float u = clamp((t - 0.06 * k) / 0.62, 0.0, 1.0);\n float v = 1.0 - u;\n float travel = 1.0 - v * v * v - 0.9 * sin(PI * u) * u * v;\n float a = PI * (0.5 + 2.0 * k / 3.0) + 0.6 * travel;\n vec2 c = vec2(0.5 * ratio, 0.5) + vec2(cos(a), sin(a)) * (far + 0.4 * size) * (1.0 - travel);\n float r = mix(0.38 * size * smoothstep(0.0, 0.25, u), far + 2.0 * s, g);\n float l = length(p - c);\n float d = l - r;\n float m = 1.0 - smoothstep(-s, s, d + s * (1.0 - 2.0 * smoothstep(0.9, 1.0, t)));\n float hot = 1.0 + 0.35 * (1.0 - smoothstep(0.0, 1.0, l / max(r, 1e-3)));\n float halo = exp(-max(d, 0.0) * 6.0 / size) * (1.0 - m) * smoothstep(0.0, 0.1, r);\n return vec3(m, m * hot, halo);\n}\n\nvec4 transition(vec2 uv) {\n vec2 p = vec2(uv.x * ratio, uv.y);\n \n float size = min(1.0, 1.25 * ratio);\n float s = max(softness * size, 0.002);\n float g = smoothstep(0.6, 0.97, progress);\n float far = 0.5 * length(vec2(ratio, 1.0));\n vec3 R = beam(p, 0.0, progress, size, s, g, far);\n vec3 G = beam(p, 1.0, progress, size, s, g, far);\n vec3 B = beam(p, 2.0, progress, size, s, g, far);\n vec3 m = vec3(R.x, G.x, B.x);\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n float lit = max(m.r, max(m.g, m.b));\n float env = sin(PI * progress);\n float dim = smoothstep(0.0, 0.25, progress) * (1.0 - smoothstep(0.75, 1.0, progress));\n float settle = smoothstep(0.85, 1.0, progress);\n \n vec3 base = a.rgb * (1.0 - darkness * dim) * (1.0 - 0.85 * lit);\n \n vec3 light = mix(vec3(R.y, G.y, B.y), m, settle);\n \n vec3 haze = env * (0.08 * light * b.a + 0.5 * glow * vec3(R.z, G.z, B.z) * a.a);\n float cover = mix((m.r + m.g + m.b) / 3.0, 1.0, settle);\n float alpha = mix(a.a, b.a, cover);\n \n vec3 pre = mix(base * a.a + light * b.rgb * b.a + haze, b.rgb * b.a, settle);\n vec3 c = alpha > 0.0 ? pre / alpha : mix(a.rgb, b.rgb, cover);\n return vec4(min(c, 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","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;\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 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 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 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","ProjectorThrow":"// ProjectorThrow — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ProjectorThrow.glsl\n// Author: gre\n// License: MIT\n// Description: The lights go down on the outgoing image and a projector throws the incoming one onto it: a small, blurred, keystoned picture of light lands on the scene, tinted by the colors it falls on, then grows, comes into focus and squares up until it fills the frame as the scene beneath it fades 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\nuniform float darkness; \n\nuniform float keystone; \n\nuniform float blur; \n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 projected(vec2 q, vec2 r) {\n vec4 c = vec4(0.0);\n for (int i = 0; i < 8; i++) {\n float a = float(i) * 2.39996;\n vec2 o = sqrt((float(i) + 0.5) / 8.0) * vec2(cos(a), sin(a));\n vec4 t = getToColor(mirror(q + o * r));\n c += vec4(t.rgb * t.a, t.a);\n }\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a / 8.0) : vec4(0.0);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec4 from = getFromColor(uv);\n\n float on = smoothstep(0.06, 0.26, p);\n float ambient = 1.0 - darkness * smoothstep(0.0, 0.2, p);\n float g = smoothstep(0.02, 1.0, p);\n float focus = 1.0 - smoothstep(0.15, 0.85, p);\n float size = mix(0.32, 1.0, g * (0.6 + 0.4 * g));\n float k = keystone * (1.0 - g);\n float cy = mix(0.58, 0.5, g);\n\n \n float y = (uv.y - cy) / size + 0.5;\n float wy = max(1.0 - 0.5 * k + k * y, 0.05);\n vec2 q = vec2((uv.x - 0.5) / (size * wy) + 0.5, y * (1.0 + 0.5 * k) / wy);\n\n \n float e = min((0.5 * size * wy - abs(uv.x - 0.5)) * ratio, size * min(y, 1.0 - y));\n float soft = 0.0015 + 0.035 * focus;\n float cov = mix(smoothstep(-soft, soft, e), 1.0, smoothstep(0.9, 1.0, p));\n float halo = 0.15 * focus * on * exp(-24.0 * max(-e, 0.0)) * (1.0 - cov);\n\n vec2 d = q - 0.5;\n float gain = on * mix(1.25, 1.0, g) * (1.0 + focus * (0.15 - 1.2 * dot(d, d)));\n \n vec2 r = blur * focus / (size * wy) * vec2(1.0 / ratio, (1.0 - 0.25 * k * k) / wy);\n vec4 pic = projected(q, r);\n vec3 light = pic.rgb * gain * cov + halo;\n\n float screen = smoothstep(0.35, 0.95, p);\n vec3 surface = mix(from.rgb, vec3(1.0), 0.35 + 0.65 * screen);\n vec3 col = from.rgb * ambient * (1.0 - cov * screen) + surface * light;\n \n return vec4(col, mix(max(from.a, pic.a * cov * on), pic.a, cov * screen));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Pupil":"// Pupil — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Pupil.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture turns out to be what an eye is looking at: the view backs out of the pupil, which shrinks to a pinpoint in a huge iris whose fibers take their colors from the picture; the eye stares, its colors turn, and the pupil dilates wide open on the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 float pinpoint; \n\nuniform float fibers; \n\nuniform vec4 sclera; \n\nconst float PI = 3.14159265;\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 noise(vec2 p, float n) {\n vec2 i = floor(p);\n vec2 f = p - i;\n f = f * f * (3.0 - 2.0 * f);\n \n float x0 = i.x - n * step(n, i.x);\n float x1 = i.x + 1.0 - n * step(n, i.x + 1.0);\n return mix(mix(hash(vec2(x0, i.y)), hash(vec2(x1, i.y)), f.x),\n mix(hash(vec2(x0, i.y + 1.0)), hash(vec2(x1, i.y + 1.0)), f.x), f.y);\n}\n\nfloat turn(vec2 v) {\n vec2 w = abs(v);\n float z = min(w.x, w.y) / max(max(w.x, w.y), 1e-6);\n float z2 = z * z;\n float a = z * (0.99997726 + z2 * (-0.33262347 + z2 * (0.19354346 + z2 * (-0.11643287 + z2 * (0.05265332 - 0.0117212 * z2)))));\n a = w.y > w.x ? 0.5 * PI - a : a;\n a = v.x < 0.0 ? PI - a : a;\n a = v.y < 0.0 ? 2.0 * PI - a : a;\n return a / (2.0 * PI);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 pictures(vec2 uv, float k) {\n vec4 a = getFromColor(mirror(uv));\n vec4 b = getToColor(mirror(uv));\n return mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), k);\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 float side = min(ratio, 1.0);\n float Rmax = 0.5 * length(asp) * 1.08;\n float sz = max(size, 0.1) * side;\n float pin = clamp(pinpoint, 0.01, 0.4) * side;\n\n float shut = smoothstep(0.0, 0.46, p) * (1.0 - smoothstep(0.5, 1.0, p));\n float mid = smoothstep(0.0, 0.3, p) * (1.0 - smoothstep(0.7, 1.0, p));\n float swap = smoothstep(0.4, 0.56, p);\n \n float R = exp(mix(log(Rmax), log(pin), shut));\n \n float tw = (p - 0.48) / 0.12;\n R *= 1.0 + 0.09 * mid * sin(p * 40.0) * exp(-tw * tw);\n\n vec2 gaze = side * vec2(0.07, 0.03) * sin(p * PI * vec2(2.0, 4.0)) * mid;\n vec2 d = q - gaze * (1.0 - smoothstep(0.3, 0.9, R / side));\n float r = length(d);\n vec2 dir = d / max(r, 1e-5);\n float th = turn(d);\n\n \n float ruff = noise(vec2(th * 54.0, 2.0), 54.0) + 0.5 * noise(vec2(th * 130.0, 5.0), 130.0) - 0.75;\n float Rp = R * (1.0 + 0.07 * mid * ruff);\n float Ri = sqrt(sz * sz + 1.9 * R * R);\n float s = clamp((r - Rp) / (Ri - Rp), 0.0, 1.0);\n float dilated = smoothstep(0.1, 0.5, R / side);\n\n vec4 tone4 = vec4(0.0);\n for (int i = 0; i < 4; i++) {\n float k = (float(i) + 0.5) / 4.0;\n tone4 += 0.25 * pictures(0.5 + dir * side / asp * (0.12 + 0.34 * k + 0.1 * s), swap);\n }\n vec3 tone = tone4.a > 0.0 ? tone4.rgb / tone4.a : vec3(0.0);\n\n float wob = 1.1 * noise(vec2(th * 20.0, s * 3.0), 20.0);\n float f1 = noise(vec2(th * 120.0 + wob * 1.6, s * 2.4), 120.0);\n float f2 = noise(vec2(th * 300.0 + wob * 2.5, s * 4.0 + 9.0), 300.0);\n float f3 = noise(vec2(th * 44.0 + wob, s * 1.5 + 4.0), 44.0);\n \n f1 = mix(0.5, f1, smoothstep(0.02, 0.08, r));\n f2 = mix(0.5, f2, smoothstep(0.04, 0.16, r));\n float strand = 1.0 - abs(2.0 * f1 - 1.0);\n float fib = 0.45 * strand * strand + 0.3 * f2 + 0.45 * f3;\n\n \n float coll = 0.28 + 0.11 * (noise(vec2(th * 30.0, 1.0), 30.0) - 0.5) + 0.04 * (f3 - 0.5);\n float cx = (s - coll) / 0.035;\n float ridge = exp(-cx * cx);\n float pit = noise(vec2(th * 42.0 + 0.5 * wob, s * 6.0 + 17.0), 42.0);\n float zone = smoothstep(coll, coll + 0.08, s) * (1.0 - smoothstep(0.55, 0.85, s));\n float crypt = smoothstep(0.6, 0.76, pit) * zone;\n float brink = smoothstep(0.48, 0.6, pit) * (1.0 - smoothstep(0.6, 0.7, pit)) * zone;\n float wave = 7.3 * (s + 0.03 * noise(vec2(th * 12.0, 8.0), 12.0));\n float furrow = sin(2.0 * PI * wave) * smoothstep(0.45, 0.62, s) * noise(vec2(th * 9.0, floor(wave) + 3.0), 9.0);\n\n float lum = dot(tone, vec3(0.299, 0.587, 0.114));\n vec3 iris = max(mix(vec3(lum), tone, 1.6), 0.0) / (0.75 + 0.45 * lum) + 0.05;\n iris *= 1.3;\n iris /= 1.0 + 0.6 * max(max(iris.r, iris.g), iris.b);\n float deep = fibers * (0.3 + 0.7 * mid);\n iris *= mix(1.0, 0.3 + 1.25 * fib, deep);\n iris *= 1.0 - 0.42 * deep * crypt;\n iris *= 1.0 + 0.35 * deep * brink;\n iris *= 1.0 - 0.22 * deep * furrow * (0.35 + 0.65 * dilated);\n iris = mix(iris, iris * vec3(1.3, 1.05, 0.75), 1.0 - smoothstep(coll - 0.05, coll + 0.1, s));\n iris += ridge * 0.22 * fib * (tone + 0.2);\n iris *= mix(0.22, 1.0, smoothstep(0.0, 0.13, s + 0.04 * (f1 - 0.5)));\n iris *= 1.0 - 0.8 * smoothstep(0.76, 1.0, s + 0.1 * (fib - 0.55));\n vec2 toLight = vec2(-0.5547, 0.8321);\n \n iris *= 1.0 - 0.4 * dot(dir, toLight) * smoothstep(0.1, 0.6, s);\n\n float out1 = (r - Ri) / side;\n vec3 white = sclera.rgb * mix(vec3(1.0), tone + 0.35, 0.25 * tone4.a) * (1.0 - vec3(0.0, 0.1, 0.1) * smoothstep(0.1, 0.6, out1));\n white *= 1.0 - 0.4 * smoothstep(0.1, 0.6, out1) - 0.4 * exp(-max(out1, 0.0) * 18.0);\n vec4 eye = mix(vec4(iris * tone4.a, tone4.a), vec4(white * sclera.a, sclera.a), smoothstep(-0.02, 0.05, out1));\n\n \n float f = 0.5 * side;\n float scale = pow(1.0 + pow(f / R, 8.0), 0.125) / pow(1.0 + pow(f / Rmax, 8.0), 0.125);\n float rr = min(r / R, 1.0);\n float bulge = 1.0 - 0.3 * (1.0 - rr * rr) * smoothstep(0.0, 0.5, shut);\n vec4 seen = pictures(0.5 + d / asp * scale * bulge, swap);\n seen.rgb *= 1.0 - 0.75 * smoothstep(0.0, 0.4, shut) * smoothstep(0.45, 1.0, rr);\n\n float soft = min(0.006, 0.1 * R);\n vec4 c = mix(seen, eye, smoothstep(-soft, soft, r - Rp));\n\n \n vec2 w = d + 0.6 * gaze;\n float wr = length(w);\n vec2 wd = w / max(wr, 1e-5);\n float across = wd.x * toLight.y - wd.y * toLight.x;\n vec2 box = vec2(across / 0.36, (wr / sz - 0.56) / 0.16);\n vec2 ab = abs(box);\n float corner = pow(ab.x * ab.x * ab.x * ab.x + ab.y * ab.y * ab.y * ab.y, 0.25);\n float win = (1.0 - smoothstep(0.55, 1.0, corner)) * step(0.0, dot(wd, toLight));\n float shown = mid * (1.0 - smoothstep(0.35, 0.9, R / sz));\n vec4 shine = pictures(0.5 + vec2(0.06, 0.42) * box, 1.0 - swap);\n float low = length((w + toLight * 0.68 * sz) / sz);\n vec3 light = win * (0.3 * shine.a + 0.55 * shine.rgb) * (0.75 + 0.25 * box.y);\n light += 0.14 * exp(-low * low * 26.0) * (tone4.rgb + 0.3 * tone4.a);\n c.rgb += shown * light * (c.a - 0.6 * c.rgb);\n \n vec2 lid = q / side;\n c.rgb *= 1.0 - 0.45 * mid * (1.0 - smoothstep(0.2, 0.6, R / side)) * smoothstep(0.12, 0.62, lid.y - 0.25 * lid.x * lid.x);\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","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 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 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 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 float lift = smoothstep(0.0, 0.25, t);\n boardSum += w * (1.0 - smoothstep(0.0, 0.1, 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 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 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 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 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","PuzzleCube":"// PuzzleCube — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/PuzzleCube.glsl\n// Author: gre\n// License: MIT\n// Description: The frame becomes the face of a twisty cube puzzle: dark gaps open between its cubies, then whole columns and rows of cubies turn a quarter turn around the cube one after another in 3D, each bringing the incoming image from the cube's side to the front, until the gaps close 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 size; \n\nuniform float gap; \n\nuniform float shading; \n\nuniform vec4 background; \n\nconst float PI = 3.141592653589793;\n\nconst float STAGGER = 0.45;\nconst float EDGE = 0.0012;\n\nfloat gridSize() {\n return float(size < 2 ? 2 : (size > 8 ? 8 : size));\n}\n\nfloat groupLength(float m) {\n return m > 0.0 ? 1.0 + (m - 1.0) * STAGGER : 0.0;\n}\n\nvec3 timeline(float n) {\n float lenEven = groupLength(floor((n + 1.0) * 0.5));\n float lenOdd = groupLength(floor(n * 0.5));\n float u = clamp((progress - 0.05) / 0.85, 0.0, 1.0) * (2.0 * lenEven + lenOdd);\n return vec3(u, lenEven, lenOdd);\n}\n\nfloat turnTime(vec3 tl, bool isCol, float idx, float n) {\n float k = isCol ? idx : n - 1.0 - idx;\n bool odd = mod(k, 2.0) > 0.5;\n \n if (odd && !isCol) return 0.0;\n float start = (odd ? 2.0 * tl.y : (isCol ? 0.0 : tl.y)) + floor(k * 0.5) * STAGGER;\n return clamp(tl.x - start, 0.0, 1.0);\n}\n\nfloat turnDir(bool isCol, float idx) {\n return mod(idx + (isCol ? 0.0 : 1.0), 2.0) < 0.5 ? 1.0 : -1.0;\n}\n\nfloat turnAngle(float t) {\n return 0.5 * PI * mix(t, t * t * (3.0 - 2.0 * t), 0.8);\n}\n\nfloat faceMask(vec2 fp, float n, float g) {\n if (g <= 0.0) return 1.0;\n vec2 cell = vec2(ratio, 1.0) / n;\n vec2 c = fp / cell;\n vec2 r = floor(c + 0.5);\n \n vec2 d = abs(c - r) * cell;\n d.x = (r.x < 0.5 || r.x > n - 0.5) ? 1.0 : d.x;\n d.y = (r.y < 0.5 || r.y > n - 0.5) ? 1.0 : d.y;\n float e = min(EDGE, 0.5 * g);\n return smoothstep(0.5 * g - e, 0.5 * g + e, min(d.x, d.y));\n}\n\nbool isDone(vec3 tl, vec2 fp, float n) {\n vec2 cell = clamp(floor(fp / (vec2(ratio, 1.0) / n)), 0.0, n - 1.0);\n return turnTime(tl, true, cell.x, n) >= 1.0 || turnTime(tl, false, cell.y, n) >= 1.0;\n}\n\nvec4 sticker(vec2 fp, bool incoming, float light, float n, float g) {\n vec2 uv = clamp(fp / vec2(ratio, 1.0), 0.0, 1.0);\n vec4 img = incoming ? getToColor(uv) : getFromColor(uv);\n vec4 body = vec4(background.rgb * light, background.a);\n return mix(body, vec4(img.rgb * light, img.a), faceMask(fp, n, g));\n}\n\nfloat lighting(vec3 nrm, bool isCol) {\n vec3 l = normalize(vec3(-0.35, 0.55, 1.0));\n if (isCol) l = l.yxz;\n return 1.0 - shading * (1.0 - clamp(dot(nrm, l) / l.z, 0.0, 1.0));\n}\n\nvec2 rot(vec2 v, float a) {\n float c = cos(a), s = sin(a);\n return vec2(c * v.x - s * v.y, s * v.x + c * v.y);\n}\n\nvec4 sliceHit(vec3 o, vec3 d, float a0, float w, float S, float a) {\n vec2 lo = rot(o.yz - vec2(0.5 * S, -0.5 * S), -a);\n vec2 ld = rot(d.yz, -a);\n ld = vec2(abs(ld.x) < 1e-6 ? 1e-6 : ld.x, abs(ld.y) < 1e-6 ? 1e-6 : ld.y);\n float dx = abs(d.x) < 1e-6 ? 1e-6 : d.x;\n vec3 t1 = vec3((a0 - o.x) / dx, (-0.5 * S - lo) / ld);\n vec3 t2 = vec3((a0 + w - o.x) / dx, (0.5 * S - lo) / ld);\n vec3 tn = min(t1, t2);\n vec3 tf = max(t1, t2);\n float tNear = max(tn.x, max(tn.y, tn.z));\n float tFar = min(tf.x, min(tf.y, tf.z));\n if (tNear > tFar || tNear <= 0.0) return vec4(-1.0);\n vec2 q = (lo + tNear * ld) / (0.5 * S);\n float across = o.x + tNear * d.x;\n if (tn.x >= tn.y && tn.x >= tn.z) return vec4(tNear, 4.0, across, sign(-dx));\n if (tn.y > tn.z) return vec4(tNear, ld.x < 0.0 ? 2.0 : 3.0, across, q.y);\n return vec4(tNear, ld.y < 0.0 ? 0.0 : 1.0, across, q.x);\n}\n\nvec4 sliceColor(vec4 hit, vec3 tl, bool isCol, float a, float dir, float S, float n, float g) {\n float f = hit.y;\n if (f > 3.5) return vec4(background.rgb * lighting(vec3(hit.w, 0.0, 0.0), isCol), background.a);\n vec2 nl = f < 0.5 ? vec2(0.0, 1.0) : f < 1.5 ? vec2(0.0, -1.0) : f < 2.5 ? vec2(1.0, 0.0) : vec2(-1.0, 0.0);\n float light = lighting(vec3(0.0, rot(nl, a)), isCol);\n \n \n bool front = f < 0.5;\n bool coming = nl.x * dir > 0.5;\n if (!front && !coming) return vec4(background.rgb * light, background.a);\n \n float r = 0.5 * S * (1.0 + (front ? hit.w : -dir * hit.w));\n vec2 fp = isCol ? vec2(hit.z, r) : vec2(r, hit.z);\n return sticker(fp, coming || isDone(tl, fp, n), light, n, g);\n}\n\nvec4 transition(vec2 uv) {\n float n = gridSize();\n vec3 tl = timeline(n);\n float g = gap * smoothstep(0.0, 0.1, progress) * (1.0 - smoothstep(0.9, 1.0, progress));\n vec2 P = vec2(uv.x * ratio, uv.y);\n\n \n bool isCol = tl.x < tl.y || tl.x >= 2.0 * tl.y;\n \n \n float w = (isCol ? ratio : 1.0) / n;\n float S = isCol ? 1.0 : ratio;\n vec2 pp = isCol ? P : P.yx;\n vec3 o = vec3(isCol ? vec2(0.5 * ratio, 0.5) : vec2(0.5, 0.5 * ratio), 1.2 + 0.6 * max(ratio, 1.0));\n \n vec3 d = vec3(pp, 0.0) - o;\n\n float k0 = clamp(floor(pp.x / w), 0.0, n - 1.0);\n float t0 = turnTime(tl, isCol, k0, n);\n\n float nearest = 1.0;\n vec4 color;\n if (t0 <= 0.0 || t0 >= 1.0) {\n color = isDone(tl, P, n) ? getToColor(uv) : getFromColor(uv);\n color = mix(background, color, faceMask(P, n, g));\n for (int j = -1; j <= 1; j += 2) {\n float k = k0 + float(j);\n if (k < 0.0 || k > n - 1.0) continue;\n float tk = turnTime(tl, isCol, k, n);\n if (tk <= 0.0 || tk >= 1.0) continue;\n float dist = abs(pp.x - (k + 0.5) * w) - 0.5 * w;\n color.rgb *= 1.0 - 0.5 * shading * sin(2.0 * turnAngle(tk)) * exp(-dist / (0.2 * w));\n }\n } else {\n float tw = abs(d.x) < 1e-6 ? 1e6 : (d.x < 0.0 ? k0 * w - o.x : (k0 + 1.0) * w - o.x) / d.x;\n float tb = (o.z + S) / -d.z;\n nearest = min(tw, tb);\n float along = o.y + nearest * d.y;\n float depth = (o.z + nearest * d.z) / -S;\n float light = tw < tb ? lighting(vec3(-sign(d.x), 0.0, 0.0), isCol) : 1.0;\n light *= 1.0 - shading * (0.5 + 0.4 * clamp(depth, 0.0, 1.0));\n color = along < 0.0 || along > S ? background : vec4(background.rgb * light, background.a);\n }\n\n for (int j = -1; j <= 1; j++) {\n float k = k0 + float(j);\n if (k < 0.0 || k > n - 1.0) continue;\n float tk = turnTime(tl, isCol, k, n);\n if (tk <= 0.0 || tk >= 1.0) continue;\n float dir = turnDir(isCol, k);\n float a = dir * turnAngle(tk);\n vec4 hit = sliceHit(o, d, k * w, w, S, a);\n if (hit.x > 0.0 && hit.x < nearest) {\n nearest = hit.x;\n color = sliceColor(hit, tl, isCol, a, dir, S, n, g);\n }\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","QuadTurn":"// QuadTurn — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/QuadTurn.glsl\n// Author: gre\n// License: MIT\n// Description: The image is cut into square tiles that turn in blocks of four like little turntables, a quarter turn at a time on two staggered grids, lifting over their neighbours and scrambling the outgoing image; a wave flips the tiles over to the incoming image, then the blocks turn back the same way until every tile is home\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 tiles; \n\nuniform float stagger; \n\nuniform float shadow; \n\nuniform vec4 backColor; \n\nconst float PI = 3.141592653589793;\nconst float FLIP = 1.3;\n\nconst float WAVE = 0.8;\nconst float EYE = 3.0;\nconst float AA = 0.015;\nconst vec2 SHADOW_OFFSET = vec2(0.1, -0.14);\n\nvec2 rot(vec2 v, float a) {\n float c = cos(a), s = sin(a);\n return vec2(c * v.x - s * v.y, s * v.x + c * v.y);\n}\n\nfloat offsetOf(float i) {\n return mod(i < 2.5 ? i : 4.0 - i, 2.0);\n}\n\nfloat dirOf(float i) {\n return i < 2.5 ? 1.0 : -1.0;\n}\n\nbool inside(vec2 lo, float size, vec2 dims) {\n return all(greaterThanEqual(lo, vec2(0.0))) && all(lessThanEqual(lo + size, dims));\n}\n\nvec2 turn(vec2 p, float i, float way, vec2 dims) {\n float o = offsetOf(i);\n vec2 lo = o + 2.0 * floor((p - o) / 2.0);\n if (!inside(lo, 2.0, dims)) return p;\n vec2 c = lo + 1.0;\n return c + rot(p - c, way * dirOf(i) * 0.5 * PI);\n}\n\nfloat smooth3(float f) {\n return f * f * (3.0 - 2.0 * f);\n}\n\nfloat turnAngle(float f, vec2 c, float o, vec2 dims) {\n vec2 last = o + 2.0 * floor((dims - o) / 2.0) - 1.0;\n float k = c.x + 0.3 * c.y - 1.3 * (o + 1.0);\n float d = stagger * k / max(last.x + 0.3 * last.y - 1.3 * (o + 1.0), 1.0);\n return 0.5 * PI * smooth3(clamp((f - d) / (1.0 - stagger), 0.0, 1.0));\n}\n\nfloat flipAngle(float f, vec2 c, vec2 dims) {\n float d = WAVE * (c.x + c.y - 1.0) / max(dims.x + dims.y - 2.0, 1.0);\n return PI * smooth3(smooth3(clamp((f - d) / (1.0 - WAVE), 0.0, 1.0)));\n}\n\nfloat liftOf(float a, bool flip) {\n return max(flip ? sin(a) : sin(2.0 * a), 0.0);\n}\n\nvec4 card(vec2 P, vec2 c, float a, bool flip, float dir) {\n if (flip) {\n float sa = sin(a), ca = cos(a);\n float s = 1.0 + 0.2 * sa;\n vec2 d = (P - c) / s;\n float den = EYE * ca + d.x * sa;\n den = abs(den) < 1e-5 ? (den < 0.0 ? -1e-5 : 1e-5) : den;\n float x = clamp(d.x * EYE / den, -0.5, 0.5);\n float y = d.y * (EYE - x * sa) / EYE;\n float u0 = -0.5 * ca * EYE / (EYE + 0.5 * sa);\n float u1 = 0.5 * ca * EYE / (EYE - 0.5 * sa);\n float wx = min(d.x - min(u0, u1), max(u0, u1) - d.x);\n return vec4(ca < 0.0 ? -x : x, y, liftOf(a, true), s * min(wx, 0.5 - abs(y)));\n }\n float lift = liftOf(a, false);\n float s = 1.0 + 0.06 * lift;\n vec2 l = rot(P - c, -dir * a) / s;\n return vec4(l, lift, s * (1.0 - max(abs(l.x), abs(l.y))));\n}\n\nvec4 layer(vec2 Q, float a, bool flip, float beat, vec2 dims) {\n bool incoming = flip ? cos(a) < 0.0 : beat > 2.5;\n vec2 H = Q;\n if (incoming) {\n for (int i = 3; i < 5; i++) {\n if (float(i) >= beat) H = turn(H, float(i), 1.0, dims);\n }\n } else {\n for (int i = 1; i >= 0; i--) {\n if (float(i) < beat) H = turn(H, float(i), -1.0, dims);\n }\n }\n vec2 st = clamp(H / dims, 0.0, 1.0);\n vec4 col = incoming ? getToColor(st) : getFromColor(st);\n float env = sin(PI * clamp(progress, 0.0, 1.0));\n vec2 tf = abs(fract(Q) - 0.5);\n float seam = smoothstep(0.485, 0.5, max(tf.x, tf.y)) * env;\n float light = 1.0;\n if (flip) {\n float sa = sin(a), ca = cos(a);\n light = 1.0 - 0.5 * sa * sa + 0.2 * abs(ca) * sa;\n }\n col.rgb *= (1.0 - 0.5 * seam) * light;\n return col;\n}\n\nvec4 transition(vec2 uv) {\n float n = float(tiles);\n vec2 dims = ratio >= 1.0 ? vec2(floor(n * ratio + 0.5), n) : vec2(n, floor(n / ratio + 0.5));\n vec2 P = uv * dims;\n float t = progress * (4.0 + FLIP);\n float beat = t < 2.0 ? floor(t) : t < 2.0 + FLIP ? 2.0 : min(floor(t - FLIP) + 1.0, 4.0);\n float start = beat < 2.5 ? beat : beat - 1.0 + FLIP;\n bool flip = beat == 2.0;\n float f = clamp((t - start) / (flip ? FLIP : 1.0), 0.0, 1.0);\n\n float size = flip ? 1.0 : 2.0;\n vec2 org = vec2(flip ? 0.0 : offsetOf(beat));\n vec2 b0 = floor((P - org) / size);\n float dir = dirOf(beat);\n\n \n vec2 q1 = P, q2 = P;\n float a1 = 0.0, a2 = 0.0, lift1 = -1.0, lift2 = -1.0, cov1 = 0.0, cov2 = 0.0;\n for (int j = 0; j < 9; j++) {\n vec2 lo = org + size * (b0 + vec2(mod(float(j), 3.0), floor(float(j) / 3.0)) - 1.0);\n if (inside(lo, size, dims)) {\n vec2 c = lo + 0.5 * size;\n float a = flip ? flipAngle(f, c, dims) : turnAngle(f, c, org.x, dims);\n vec4 k = card(P, c, a, flip, dir);\n if (k.w >= 0.0) {\n float cov = k.z > 1e-3 ? clamp(k.w / AA, 0.0, 1.0) : 1.0;\n if (k.z > lift1) {\n q2 = q1; a2 = a1; lift2 = lift1; cov2 = cov1;\n q1 = c + k.xy; a1 = a; lift1 = k.z; cov1 = cov;\n } else if (k.z > lift2) {\n q2 = c + k.xy; a2 = a; lift2 = k.z; cov2 = cov;\n }\n }\n }\n }\n \n if (!flip && !inside(org + 2.0 * b0, 2.0, dims)) {\n if (lift1 < 0.0) {\n q1 = P; a1 = 0.0; lift1 = 0.0; cov1 = 1.0;\n } else if (lift2 < 0.0) {\n q2 = P; a2 = 0.0; lift2 = 0.0; cov2 = 1.0;\n }\n }\n\n float shade = 0.0;\n for (int j = 0; j < 9; j++) {\n vec2 lo = org + size * (b0 + vec2(mod(float(j), 3.0), floor(float(j) / 3.0)) - 1.0);\n if (inside(lo, size, dims)) {\n vec2 c = lo + 0.5 * size;\n float a = flip ? flipAngle(f, c, dims) : turnAngle(f, c, org.x, dims);\n float lift = liftOf(a, flip);\n if (lift > lift1 + 0.01) {\n vec4 k = card(P - SHADOW_OFFSET * lift, c, a, flip, dir);\n shade = max(shade, (lift - max(lift1, 0.0)) * smoothstep(flip ? -0.08 : -0.25, 0.04, k.w));\n }\n }\n }\n\n vec4 col = flip ? layer(P, PI, true, beat, dims) : backColor;\n if (lift2 >= 0.0) col = mix(col, layer(q2, a2, flip, beat, dims), cov2);\n if (lift1 >= 0.0) col = mix(col, layer(q1, a1, flip, beat, dims), cov1);\n col.rgb *= 1.0 - shadow * 0.7 * shade;\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","QuadtreeBlocks":"// QuadtreeBlocks — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/QuadtreeBlocks.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image breaks into a quadtree of flat color blocks, small where it is detailed and large where it is plain; the blocks merge into a few big squares that change color one by one, then split again, finer and finer, 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 tolerance; \n\nuniform float seams; \n\nconst int LEVELS = 7;\nconst float AA = 0.0015;\nconst float SEAM = 0.0025;\n\nvec4 img(vec2 P, bool incoming) {\n vec2 uv = vec2(P.x / ratio, P.y);\n return incoming ? getToColor(uv) : getFromColor(uv);\n}\n\nfloat seamLine(vec2 P, vec2 s) {\n vec2 frame = vec2(ratio, 1.0);\n vec2 lo = floor(P / s) * s;\n vec2 hi = lo + s;\n vec2 q = vec2(1.0);\n if (lo.x > AA) q.x = P.x - lo.x;\n if (hi.x < frame.x - AA) q.x = min(q.x, hi.x - P.x);\n if (lo.y > AA) q.y = P.y - lo.y;\n if (hi.y < frame.y - AA) q.y = min(q.y, hi.y - P.y);\n return 1.0 - smoothstep(SEAM - AA, SEAM + AA, min(q.x, q.y));\n}\n\nvec4 tree(vec2 P, vec2 s0, bool incoming, float thr, float dmax, float seamFade) {\n vec2 s = s0;\n vec4 col = vec4(0.0);\n \n float acc = 1.0;\n float seam = 0.0;\n for (int l = 0; l < LEVELS; l++) {\n vec2 c = (floor(P / s) + 0.5) * s;\n vec2 h = 0.25 * s;\n vec4 a = img(c - h, incoming);\n vec4 b = img(c + vec2(h.x, -h.y), incoming);\n vec4 d = img(c + vec2(-h.x, h.y), incoming);\n vec4 e = img(c + h, incoming);\n vec4 mean = 0.25 * (a + b + d + e);\n vec4 v = abs(a - mean) + abs(b - mean) + abs(d - mean) + abs(e - mean);\n float spread = dot(v, vec4(0.0625));\n \n seam = max(seam, acc * smoothstep(0.008, 0.04, s.y) * seamLine(P, s));\n float split = smoothstep(thr, 1.35 * thr + 0.003, spread) * smoothstep(0.2, 0.8, dmax - float(l));\n if (l == LEVELS - 1) split = 0.0;\n col += acc * (1.0 - split) * mean;\n acc *= split;\n if (acc <= 0.0) break;\n s *= 0.5;\n }\n col.rgb *= 1.0 - seams * seamFade * seam;\n return col;\n}\n\nvec4 transition(vec2 uv) {\n \n vec2 P = clamp(vec2(uv.x * ratio, uv.y), vec2(0.0), vec2(ratio, 1.0) - 1e-4);\n \n float u = 1.0 - abs(2.0 * progress - 1.0);\n float coarse = mix(u, u * u * (3.0 - 2.0 * u), 0.5);\n float thr = tolerance * (0.08 + 4.0 * coarse * coarse);\n float dmax = float(LEVELS) * (1.0 - coarse) + 0.2;\n float seamFade = smoothstep(0.0, 0.25, u);\n\n vec2 s0 = ratio >= 1.0\n ? vec2(ratio / floor(2.0 * ratio + 0.5), 0.5)\n : vec2(0.5 * ratio, 1.0 / floor(2.0 / ratio + 0.5));\n float t = (progress - 0.4) / 0.2;\n vec2 cell = floor(P / s0);\n float h = fract((cell.y * floor(ratio / s0.x + 0.5) + cell.x) * 0.618034 + 0.31);\n float flip = smoothstep(0.75 * h, 0.75 * h + 0.25, t);\n vec4 col;\n if (flip <= 0.0) {\n col = tree(P, s0, false, thr, dmax, seamFade);\n } else if (flip >= 1.0) {\n col = tree(P, s0, true, thr, dmax, seamFade);\n } else {\n col = mix(tree(P, s0, false, thr, dmax, seamFade), tree(P, s0, true, thr, dmax, seamFade), flip);\n }\n vec4 real = progress < 0.5 ? getFromColor(uv) : getToColor(uv);\n return mix(real, col, smoothstep(0.0, 0.18, u));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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) + PI + smoothness - progress * (2.0 * PI + smoothness))\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","RainPuddle":"// RainPuddle — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RainPuddle.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture is the reflection in a puddle when a shower starts: drops land all over it, each sending out little rings that bend the reflection and catch the light, the rings crowd as the rain gets heavy and open onto the incoming picture, then the shower stops and the water settles calm\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 dropSize; \n\nuniform float refraction; \n\nuniform float shine; \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 float p = progress;\n vec2 asp = vec2(ratio, 1.0);\n vec2 q = (uv - 0.5) * asp;\n float size = max(dropSize, 0.1);\n float S = 0.17 * size;\n\n vec2 slope = vec2(0.0);\n float h = 0.0, opened = 0.0, splash = 0.0;\n for (int l = 0; l < 3; l++) {\n float fl = float(l);\n vec2 g = q / S + vec2(5.7, 1.3) * fl;\n vec2 gi = floor(g);\n for (int j = 0; j < 9; j++) {\n vec2 cell = gi + vec2(mod(float(j), 3.0) - 1.0, floor((float(j) + 0.5) / 3.0) - 1.0);\n vec2 h1 = hash22(cell + 17.0 * fl);\n vec2 h2 = hash22(cell + 53.0 + 29.0 * fl);\n \n float t0 = 0.01 + 0.82 * (mix(h2.x, 0.25 + 0.5 * h2.y, 0.45) - 0.11);\n float age = p - t0;\n if (age <= 0.0) continue;\n vec2 d = (g - cell - 0.2 - 0.6 * h1) * S;\n float dl = length(d);\n float R = S * 1.15 * (1.0 - exp(-age * 2.6));\n float w = 0.009 * size + 0.02 * age * size;\n float x = (dl - R) / w;\n float a = exp(-x * x * 0.45) * exp(-age * 7.0) * (0.55 + 0.45 * h2.y) * smoothstep(0.0, 0.025, age) * (1.0 - smoothstep(0.3, 0.4, age));\n float wave = cos(x * 2.2);\n slope += a * (-2.2 * sin(x * 2.2) - 0.9 * x * wave) / w * d / max(dl, 1e-4);\n h += a * wave;\n \n float soft = min(0.6 * w + 0.5 * age * S, 0.2 * S);\n float late = step(0.28, t0);\n opened = max(opened, late * (1.0 - smoothstep(-soft, soft, dl - min(R, 0.8 * S) + w)) * smoothstep(0.0, 0.04, age));\n float flash = smoothstep(0.0, 0.008, age) * (1.0 - smoothstep(0.01, 0.045, age));\n float crown = 0.004 * size + 0.2 * size * age;\n splash = max(splash, flash * (1.0 - smoothstep(0.0, 0.0035 * size, abs(dl - crown) - 0.001)));\n }\n }\n float calm = 1.0 - smoothstep(0.76, 1.0, p);\n float heavy = smoothstep(0.15, 0.45, p) * (1.0 - smoothstep(0.5, 0.8, p));\n slope *= calm * size;\n h *= calm;\n\n vec2 tuv = uv + slope * (0.00028 + 0.00022 * heavy) * refraction / asp;\n tuv = 1.0 - abs(1.0 - mod(tuv, 2.0));\n float m = max(opened, smoothstep(0.46, 0.68, p + 0.03 * h + 0.07 * sin(5.0 * q.x + 2.0) * sin(6.0 * q.y + 1.0)));\n vec4 a = getFromColor(tuv), b = getToColor(tuv);\n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), m);\n\n vec3 n = normalize(vec3(-slope * 0.012, 1.0));\n vec3 H = normalize(vec3(-0.35, 0.5, 1.9));\n float glint = pow(max(dot(n, H), 0.0), 60.0);\n \n float tilt = dot(n.xy, normalize(H.xy));\n c.rgb *= 1.0 + shine * 0.3 * tilt;\n float rest = pow(H.z, 60.0);\n float light = shine * (0.8 * clamp(glint - rest, 0.0, 1.0) * smoothstep(0.02, 0.2, length(n.xy)) + 0.7 * splash * calm);\n c.rgb += light * (c.a - 0.5 * c.rgb);\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","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","Reassemble":"// Reassemble — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Reassemble.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image cracks into irregular shards that burst apart toward the viewer, each one turning over in 3D at its own moment, then fly back together and lock into place as the incoming image carried on their backs\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 rows; \n\nuniform float depth; \n\nuniform float spread; \n\nuniform vec4 backColor; \n\nconst float PI = 3.141592653589793;\nconst float EYE = 2.5;\n\nconst float EDGE = 0.0015;\nconst float CRACK = 0.005;\n\nconst float START = 0.03;\nconst float DELAY = 0.08;\nconst float FLIGHT = 0.86;\n\nvec3 hash3(vec2 p) {\n vec3 q = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n q += dot(q, q.yxz + 33.33);\n return fract((q.xxy + q.yzz) * q.zyx);\n}\n\nvec2 seed(vec2 g, float size) {\n return (g + 0.5 + 0.7 * (hash3(g).xy - 0.5)) * size;\n}\n\nfloat shardDist(vec2 q, vec2 g, float size) {\n vec2 sj = seed(g, size);\n float d = 1e9;\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n if (x == 0 && y == 0) continue;\n vec2 sk = seed(g + vec2(float(x), float(y)), size);\n vec2 dir = sk - sj;\n d = min(d, dot(0.5 * (sj + sk) - q, dir) / length(dir));\n }\n }\n return d;\n}\n\nfloat ease(float t) {\n return t * t * (3.0 - 2.0 * t);\n}\n\nfloat burst(float t) {\n float u = clamp(t / 0.4, 0.0, 1.0);\n float v = clamp((t - 0.4) / 0.6, 0.0, 1.0);\n return t < 0.4 ? 1.0 - (1.0 - u) * (1.0 - u) : 1.0 - ease(v);\n}\n\nvec4 transition(vec2 uv) {\n vec2 aspect = vec2(ratio, 1.0);\n vec2 x = (uv - 0.5) * aspect;\n float size = 1.0 / clamp(float(rows), 1.0, 8.0);\n float E = clamp(spread, 0.0, 0.5);\n float Z = clamp(depth, 0.0, 1.0);\n float p = clamp(progress, 0.0, 1.0);\n vec3 L = normalize(vec3(-0.45, 0.55, 1.0));\n vec3 H = normalize(L + vec3(0.0, 0.0, 1.0));\n vec3 eye = vec3(0.0, 0.0, EYE);\n vec3 dir = vec3(x, -EYE);\n float act = smoothstep(0.0, START + DELAY, p) * (1.0 - smoothstep(START + FLIGHT, 1.0, p));\n\n \n float b0 = burst(clamp((p - START - 0.5 * DELAY) / FLIGHT, 0.0, 1.0));\n vec2 x0 = x * (EYE - 0.75 * Z * b0) / EYE / (1.0 + E * b0);\n vec2 cell0 = floor(x0 / size);\n\n \n float z1 = 1e9, z2 = 1e9;\n vec2 q1 = x, q2 = x;\n float f1 = 1.0, f2 = 1.0, m1 = 0.0, m2 = 0.0;\n float s1 = 1.0, s2 = 1.0, r1 = 0.0, r2 = 0.0;\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n vec2 g = cell0 + vec2(float(i), float(j));\n vec3 h = hash3(g + 17.0);\n float t = clamp((p - START - DELAY * h.x) / FLIGHT, 0.0, 1.0);\n float b = burst(t);\n float th = PI * ease(clamp((t - 0.1 - 0.48 * h.z) / 0.24, 0.0, 1.0));\n float ct = cos(th), st = sin(th);\n float phi = PI * h.y;\n float rz = 0.5 * (h.z - 0.5) * b;\n vec2 a0 = vec2(cos(phi), sin(phi));\n vec2 p0 = vec2(-a0.y, a0.x);\n vec3 a = vec3(cos(phi + rz), sin(phi + rz), 0.0);\n vec3 w = vec3(-a.y, a.x, 0.0) * ct + vec3(0.0, 0.0, st);\n vec2 c = seed(g, size);\n vec3 center = vec3(c * (1.0 + E * b), Z * b * (0.5 + 0.5 * h.x));\n vec3 nrm = cross(a, w);\n float den = dot(dir, nrm);\n if (abs(den) < 1e-6) continue;\n float lam = dot(center - eye, nrm) / den;\n if (lam <= 0.0) continue;\n vec3 hit = eye + lam * dir - center;\n float u = dot(hit, a), v = dot(hit, w);\n \n \n float front = den < 0.0 ? 1.0 : -1.0;\n vec2 q = c + u * a0 + front * v * p0;\n \n float k = EYE / (EYE - center.z);\n float e = shardDist(q, g, size) - CRACK * act;\n vec2 box = 0.5 * aspect - abs(q);\n e = min(e, min(box.x, box.y)) * k * mix(1.0, max(abs(ct), 0.2), min(b * 8.0, 1.0)) + 4.0 * EDGE * (1.0 - act);\n float m = clamp(e / (2.0 * EDGE) + 0.5, 0.0, 1.0);\n \n float zk = lam - 0.001 * m;\n if (m <= 0.0 || zk >= z2) continue;\n vec3 n = nrm * front;\n float lit = mix(0.45, 1.0, clamp(dot(n, L) / L.z, 0.0, 1.0));\n float glint = 0.2 * min(b * 4.0, 1.0) * pow(max(dot(n, H), 0.0), 24.0);\n float lock = sin(PI * clamp((t - 0.86) / 0.14, 0.0, 1.0));\n float rim = (0.3 * act * min(b * 4.0, 1.0) + 0.35 * lock) * (1.0 - smoothstep(0.0, 0.006, e));\n if (zk < z1) {\n z2 = z1; q2 = q1; f2 = f1; m2 = m1; s2 = s1; r2 = r1;\n z1 = zk; q1 = q; f1 = front; m1 = m; s1 = lit + glint; r1 = rim;\n } else {\n z2 = zk; q2 = q; f2 = front; m2 = m; s2 = lit + glint; r2 = rim;\n }\n }\n }\n\n vec4 col = backColor;\n if (m2 > 0.0) {\n vec2 src = q2 / aspect + 0.5;\n vec4 img = f2 > 0.0 ? getFromColor(src) : getToColor(src);\n img.rgb = mix(min(img.rgb * s2, vec3(img.a)), vec3(img.a), r2);\n col = mix(col, img, m2);\n }\n if (m1 > 0.0) {\n vec2 src = q1 / aspect + 0.5;\n vec4 img = f1 > 0.0 ? getFromColor(src) : getToColor(src);\n img.rgb = mix(min(img.rgb * s1, vec3(img.a)), vec3(img.a), r1);\n col = mix(col, img, m1);\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","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 vec2 bl = step(vec2(abs(1. - 2.*progress)), sq + .25);\n float dist = bl.x * bl.y;\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 vec2 bl = step(vec2(1.0 - 2.0*abs(progress - 0.5)), q + 0.25);\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","ReededGlass":"// ReededGlass — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ReededGlass.glsl\n// Author: gre\n// License: MIT\n// Description: A wide pane of reeded glass slides across the frame: behind its rounded vertical ribs the picture breaks into narrow, flipped and squeezed slices with faint color fringes, the outgoing image on the far side of the pane and the incoming one behind it, and where the pane has passed the incoming image is left clear\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 paneWidth; \n\nuniform float ribs; \n\nuniform float strength; \n\nuniform float shine; \n\nconst float AA = 0.002;\n\nconst float SHADOW = 0.03;\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 behind(float x, float y, float cut, float soft) {\n vec2 p = mirror(vec2(x, y));\n return mix(getToColor(p), getFromColor(p), smoothstep(cut - soft, cut + soft, x));\n}\n\nvec4 transition(vec2 uv) {\n float pw = clamp(paneWidth, 0.05, 1.0);\n float t = mix(progress, progress * progress * (3.0 - 2.0 * progress), 0.6);\n \n float margin = SHADOW / ratio + 0.005;\n float left = mix(-pw - margin, 1.0 + margin, t);\n float right = left + pw;\n float cut = left + 0.5 * pw;\n float x = uv.x;\n\n float rw = pw / max(floor(pw * ribs + 0.5), 1.0);\n float r = (x - left) / rw;\n float u = 2.0 * fract(r) - 1.0;\n \n float bend = rw * strength * (0.5 * u + 1.6 * u * sqrt(1.0 - 0.6 * u * u));\n float soft = 0.5 * rw;\n float disp = 0.05 * strength;\n vec4 g = behind(x - bend, uv.y, cut, soft);\n vec4 c = vec4(\n behind(x - bend * (1.0 + disp), uv.y, cut, soft).r,\n g.g,\n behind(x - bend * (1.0 - disp), uv.y, cut, soft).b,\n g.a\n );\n\n float seam = smoothstep(0.82, 1.0, abs(u));\n float hl = (u + 0.45) / 0.16;\n float rim = 1.0 - smoothstep(0.0, 0.006, min(x - left, right - x) * ratio);\n vec3 lit = c.rgb * (1.0 - shine * (0.08 * u + 0.45 * seam + 0.4 * rim));\n lit += shine * (0.22 * exp(-hl * hl) + 0.05) * c.a;\n c.rgb = mix(lit, vec3(0.93, 0.96, 0.97) * c.a, 0.05 * shine);\n\n float inside = smoothstep(left - AA, left + AA, x) * (1.0 - smoothstep(right - AA, right + AA, x));\n vec4 clear = x < cut ? getToColor(uv) : getFromColor(uv);\n float shadow = 0.2 * shine * smoothstep(right - AA, right + AA, x) * (1.0 - smoothstep(0.0, SHADOW, (x - right) * ratio));\n clear.rgb *= 1.0 - shadow;\n return mix(clear, c, 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","Reflow":"// Reflow — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Reflow.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image behaves like a paragraph in a text box that narrows from the right: thin gaps open between its lines and each row wraps its end onto the next line, while beside it the incoming image grows from fragments of its own top rows and unwraps back into one image as its box widens to the full 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 int lines; \n\nuniform vec4 paper; \n\nconst float EDGE = 0.002;\n\nfloat ease(float x) {\n return x < 0.5 ? 4.0 * x * x * x : 1.0 - 4.0 * (1.0 - x) * (1.0 - x) * (1.0 - x);\n}\n\nvec4 box(vec2 uv, float x0, float w, float env, bool incoming) {\n float n = max(float(lines), 1.0);\n float row = (1.0 - uv.y) * n;\n float line = floor(row);\n float yin = row - line;\n float space = 0.04 * env;\n float q = line * w + clamp(uv.x - x0, 0.0, w);\n float src = floor(q / (1.0 + space));\n float xin = q - src * (1.0 + space);\n \n if (xin > 1.0 + 0.5 * space) {\n src += 1.0;\n xin -= 1.0 + space;\n }\n vec2 s = vec2(clamp(xin, 0.0, 1.0), 1.0 - (src + yin) / n);\n vec4 c = incoming ? getToColor(s) : getFromColor(s);\n float lead = 0.06 * env;\n float d = min(yin, 1.0 - yin);\n \n float ink = clamp((d - lead) / (EDGE * n) + 1.0, 0.0, 1.0);\n ink *= clamp(min(xin, 1.0 - xin) / EDGE + 1.0, 0.0, 1.0);\n float inBox = clamp(min(uv.x - x0, x0 + w - uv.x) / EDGE + 1.0, 0.0, 1.0);\n ink *= inBox;\n c.rgb *= 1.0 - 0.2 * env * (1.0 - smoothstep(0.0, 0.2, d));\n \n float below = yin < 0.5 ? yin + lead : yin - (1.0 - lead);\n vec4 bg = paper;\n bg.rgb *= 1.0 - 0.3 * env * inBox * step(0.0, below) * step(0.5, row) * exp(-below / 0.04);\n return mix(bg, c, ink);\n}\n\nvec4 transition(vec2 uv) {\n float w = 1.0 - ease(progress);\n float env = 4.0 * w * (1.0 - w);\n float g = 0.012 * env;\n return uv.x < w ? box(uv, 0.0, w - g, env, false) : box(uv, w + g, 1.0 - w - g, env, true);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 float h = 1.0 - abs(2.0 * p - 1.0);\n float amount = h * h * (2.0 - h);\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 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 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 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 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","RibbonTwist":"// RibbonTwist — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RibbonTwist.glsl\n// Author: gre\n// License: MIT\n// Description: The image twists like a ribbon around its horizontal center line, the twist travelling smoothly across its width, the outgoing image on its front and the incoming one on its 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 spread; \n\nuniform float perspective; \n\nuniform float shading; \n\nuniform int vertical; \n\nuniform vec4 backColor; \n\nconst float PI = 3.141592653589793;\nconst float EDGE = 0.002;\n\nvec4 transition (vec2 uv) {\n \n vec2 q = (vertical != 0) ? vec2(1.0 - uv.y, uv.x) : uv;\n float halfSize = (vertical != 0) ? 0.5 * ratio : 0.5;\n float t = smoothstep(0.0, 1.0, (progress * (1.0 + spread) - q.x) / spread);\n \n bool front = t < 0.5;\n float angle = PI * (front ? t : t - 1.0);\n float c = cos(angle);\n float s = sin(angle);\n \n \n float w = 2.0 * q.y - 1.0;\n float den = c + perspective * w * s;\n if (den <= 0.0) return backColor;\n float v = w / den;\n if (abs(v) >= 1.0) return backColor;\n \n float edge = max(EDGE * min(1.0, 20.0 * abs(s)), 1e-4);\n float top = c / (1.0 - perspective * s);\n float bottom = -c / (1.0 + perspective * s);\n float cover = clamp(min(top - w, w - bottom) * halfSize / edge, 0.0, 1.0);\n vec2 p = vec2(q.x, 0.5 + 0.5 * v);\n p = (vertical != 0) ? vec2(p.y, 1.0 - p.x) : p;\n vec4 img = front ? getFromColor(p) : getToColor(p);\n float lambert = clamp(c - 0.25 * s, 0.0, 1.0);\n vec4 color = vec4(img.rgb * mix(1.0 - shading, 1.0, lambert), img.a);\n return mix(backColor, 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","RingSpin":"// RingSpin — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/RingSpin.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is cut into concentric rings that spin like the dials of a combination lock, in alternating directions and blurred with speed, one after another from the center outward; each ring overshoots a little and locks into place 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 rings; \n\nuniform int square; \n\nuniform int turns; \n\nuniform float stagger; \n\nuniform float blur; \n\nuniform float settle; \n\nconst float PI = 3.141592653589793;\n\nconst float SETTLE = 0.2;\n\nconst float GAP = 0.0035;\nconst float RIM = 0.012;\nconst float EDGE = 0.0015;\n\nvec2 mirrorUV(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec2 rotate(vec2 v, float a) {\n float c = cos(a), s = sin(a);\n return vec2(c * v.x + s * v.y, c * v.y - s * v.x);\n}\n\nfloat ringDelay(float n) {\n float m = max(n - 1.0, 1.0);\n return min(clamp(stagger, 0.0, 0.8) / m, 0.7 / (1.0 + 0.7 * m));\n}\n\nfloat ringTime(float i, float n) {\n float d = ringDelay(n);\n return progress >= 1.0 ? 1.0 : clamp((progress - d * i) / (1.0 - d * (n - 1.0)), 0.0, 1.0);\n}\n\nfloat activity(float i, float n) {\n float t = ringTime(i, n);\n return smoothstep(0.0, 0.08, t) * (1.0 - smoothstep(0.88, 1.0, t));\n}\n\nfloat spin(float t, float total) {\n float amp = 0.1 * settle * sign(total);\n float stopT = 1.0 - SETTLE;\n \n float v1 = amp * PI * stopT / (total * SETTLE);\n float u = clamp(t / stopT, 0.0, 1.0);\n float b = clamp((t - stopT) / SETTLE, 0.0, 1.0);\n return total * (u * u * (3.0 - 2.0 * u) + v1 * (u * u * u - u * u)) + amp * sin(PI * b) * (1.0 - b) * (1.0 - b);\n}\n\nvec4 transition(vec2 uv) {\n vec2 aspect = vec2(ratio, 1.0);\n vec2 c = (uv - 0.5) * aspect;\n float r = (square != 0) ? max(abs(c.x), abs(c.y)) : length(c);\n float n = clamp(float(rings), 1.0, 12.0);\n float w = ((square != 0) ? 0.5 * max(ratio, 1.0) : length(0.5 * aspect)) / n;\n float f = r / w;\n float i = min(floor(f), n - 1.0);\n float t = ringTime(i, n);\n\n vec4 col;\n if (t <= 0.0) col = getFromColor(uv);\n else if (t >= 1.0) col = getToColor(uv);\n else {\n float total = 2.0 * PI * max(float(turns), 1.0) * (mod(i, 2.0) < 0.5 ? 1.0 : -1.0);\n float a = spin(t, total);\n \n \n float u = min(t / (1.0 - SETTLE), 1.0);\n float omega = abs(total) * 6.0 * u * (1.0 - u) / ((1.0 - SETTLE) * (1.0 - ringDelay(n) * (n - 1.0)));\n float span = blur * min(omega * 0.015, 0.1 / max(r, 0.01));\n \n float m = smoothstep(0.3, 0.5, t);\n col = vec4(0.0);\n float ws = 0.0;\n for (int k = 0; k < 8; k++) {\n float x = float(k) / 7.0 - 0.5;\n vec2 q = mirrorUV(rotate(c, a + span * x) / aspect + 0.5);\n vec4 s = mix(getFromColor(q), getToColor(q), m);\n col += (1.0 - abs(x)) * s;\n ws += 1.0 - abs(x);\n }\n col /= ws;\n }\n\n float bj = clamp(floor(f + 0.5), 1.0, max(n - 1.0, 1.0));\n float act = n > 1.5 ? max(activity(bj - 1.0, n), activity(bj, n)) : 0.0;\n float d = (f - bj) * w;\n vec2 nr = (square != 0) ? (abs(c.x) > abs(c.y) ? vec2(sign(c.x), 0.0) : vec2(0.0, sign(c.y))) : c / max(r, 1e-4);\n \n float light = -sign(d) * dot(nr, vec2(-0.6, 0.8)) * (1.0 - smoothstep(GAP, GAP + RIM, abs(d))) * act;\n col.rgb = light > 0.0 ? mix(col.rgb, vec3(col.a), 0.35 * light) : col.rgb * (1.0 + 0.45 * light);\n col.rgb *= 1.0 - 0.85 * act * (1.0 - smoothstep(GAP - EDGE, GAP + EDGE, abs(d)));\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","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;\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\n float n = float(count < 1 ? 1 : count);\n \n vec2 p = (uv - center) * vec2(ratio, 1.0);\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","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","Runway":"// Runway — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Runway.glsl\n// Author: gre\n// License: MIT\n// Description: As the outgoing image falls over backward onto a glossy floor and becomes the ground, the camera rises with it, looks down on it and travels over it toward the incoming image, which stands at its far edge mirrored in its surface, and tilts back up as 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 lift; \n\nuniform float reflection; \n\nconst float F = 1.5;\nconst float PI = 3.14159265;\n\nvec4 haze(vec3 d, float w) {\n vec4 ca = vec4(0.0);\n vec4 cb = vec4(0.0);\n for (int i = 0; i < 4; i++) {\n float k = float(i);\n vec2 q = 0.5 + (0.15 + 0.07 * k) * vec2(cos(k * 2.4), sin(k * 2.4));\n vec4 fa = getFromColor(q);\n vec4 fb = getToColor(q);\n ca += vec4(fa.rgb * fa.a, fa.a);\n cb += vec4(fb.rgb * fb.a, fb.a);\n }\n vec4 c = mix(ca, cb, w);\n float e = d.y / length(d);\n return vec4(c.rgb / max(c.a, 1e-4) * (0.36 + 0.42 * exp(-8.0 * e * e)), c.a / 4.0);\n}\n\nvec3 hitTo(vec3 o, vec3 d) {\n float t = (1.0 - o.z) / d.z;\n vec3 h = o + d * t;\n return vec3(h.x / ratio + 0.5, h.y, d.z > 0.0 ? t : -1.0);\n}\n\nfloat cover(vec2 q, float t, float aa) {\n vec2 e = min(q, 1.0 - q) * vec2(ratio, 1.0);\n return t > 0.0 ? clamp(0.5 + min(e.x, e.y) * F / (t * aa), 0.0, 1.0) : 0.0;\n}\n\nvec3 mirrored(vec3 o, vec3 r) {\n vec3 h = hitTo(o, r);\n if (h.z <= 0.0 || h.x < 0.0 || h.x > 1.0 || h.y < 0.0 || h.y > 1.0) return vec3(0.0);\n vec4 c = getToColor(h.xy);\n return c.rgb * c.a * (1.0 - h.y);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n float s = clamp(p / 0.4, 0.0, 1.0);\n float b = clamp((p - 0.4) / 0.14, 0.0, 1.0);\n \n float a = 0.5 * PI * s * s - 0.24 * b * (1.0 - b);\n \n float x = 1.0 - (1.0 - p) * sqrt(1.0 - p);\n float env = sin(PI * x);\n env *= env;\n float m = smoothstep(0.05, 1.0, p);\n float pitch = 0.75 * lift * env;\n vec3 o = vec3(0.0, 0.5 + 1.1 * lift * env, -F + m);\n vec3 fw = vec3(0.0, -sin(pitch), cos(pitch));\n vec3 up = vec3(0.0, cos(pitch), sin(pitch));\n vec3 d = vec3((uv.x - 0.5) * ratio, 0.0, 0.0) + up * (uv.y - 0.5) + fw * F;\n float aa = max(0.0025 * min(1.0, 120.0 * p * (1.0 - p)), 1e-4);\n float w = smoothstep(0.2, 0.8, p);\n\n vec4 c = haze(d, w);\n if (d.y < 0.0) {\n vec3 hg = o - d * (o.y / d.y);\n \n c.rgb = c.rgb * 0.55 + 0.5 * reflection * sin(a) * mirrored(hg, vec3(d.x, -d.y, d.z));\n }\n\n vec3 ht = hitTo(o, d);\n c = mix(c, getToColor(ht.xy), cover(ht.xy, ht.z, aa));\n\n vec3 along = vec3(0.0, cos(a), sin(a));\n vec3 n = vec3(0.0, -sin(a), cos(a));\n float dn = dot(d, n);\n float tf = -dot(o, n) / (abs(dn) < 1e-4 ? (dn < 0.0 ? -1e-4 : 1e-4) : dn);\n vec3 hf = o + d * tf;\n vec2 qf = vec2(hf.x / ratio + 0.5, dot(hf, along));\n vec4 f = getFromColor(qf);\n float lie = sin(a);\n f.rgb *= (1.0 - 0.2 * lie) * (1.0 - 0.5 * lie * exp(-10.0 * abs(1.0 - qf.y)));\n f.rgb += reflection * lie * 0.6 * mirrored(hf, reflect(d, n));\n return mix(c, f, cover(qf, tf, aa));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SandDrift":"// SandDrift — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SandDrift.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture turns into a sand drawing on a glowing light table; gusts of wind lift the grains, which drift and curl in eddies all over the frame and settle again into the incoming picture's sand drawing, which then takes its colours 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 vec4 light; \n\nuniform vec4 sand; \n\nuniform float drift; \n\nuniform float swirl; \n\nfloat sdHash(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 = fract(p3 + dot(p3, p3.yzx + 33.33));\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat sdNoise(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(sdHash(i), sdHash(i + vec2(1.0, 0.0)), f.x),\n mix(sdHash(i + vec2(0.0, 1.0)), sdHash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nvec2 sdEddies(vec2 q, float k, mat2 r, vec2 phase) {\n vec2 x = k * (r * q) + phase;\n return vec2(sin(x.x) * cos(x.y), -cos(x.x) * sin(x.y)) * r;\n}\n\nvec2 sdWind(vec2 q, float time) {\n q -= vec2(0.55, 0.23) * time;\n return vec2(0.92, 0.38) + swirl * (1.1 * sdEddies(q, 4.3, mat2(0.8776, 0.4794, -0.4794, 0.8776), vec2(0.7, 2.1)) + 0.45 * sdEddies(q, 9.1, mat2(0.6967, -0.7174, 0.7174, 0.6967), vec2(4.0, 1.3)));\n}\n\nvec2 sdFold(vec2 q) {\n return 1.0 - abs(1.0 - mod(vec2(q.x / ratio, q.y), 2.0));\n}\n\nfloat sdLuma(vec3 c) {\n return dot(c, vec3(0.299, 0.587, 0.114));\n}\n\nfloat sdDark(vec4 c) {\n return (0.03 + 0.97 * smoothstep(0.95, 0.1, sdLuma(c.rgb))) * c.a;\n}\n\nfloat sdSand(vec2 q, float t, float swap, bool incoming) {\n float sum = 0.0;\n vec2 p = q;\n mat2 turn = mat2(-0.1288, -0.9917, 0.9917, -0.1288);\n for (int i = 0; i < 8; i++) {\n p -= sdWind(p, t * (1.0 - 0.125 * float(i))) * (t * 0.19);\n turn = turn * mat2(-0.1288, 0.9917, -0.9917, -0.1288);\n if (i >= 2) {\n float fi = float(i);\n float cells = 60.0 + 16.0 * fi;\n \n vec2 g = turn * p * cells;\n vec2 c = floor(g) + fi * 37.0 + (incoming ? 400.0 : 0.0);\n vec2 centre = floor(g) + 0.15 + 0.7 * vec2(sdHash(c), sdHash(c + 17.3));\n float r = 0.2 + 0.2 * sdHash(c + 5.9);\n float grain = 1.0 - smoothstep(r - 0.12, r + 0.04, length(g - centre));\n vec4 col = incoming ? getToColor(sdFold(p)) : getFromColor(sdFold(p));\n float lift = smoothstep(-0.1, 0.1, swap - 0.15 - 0.7 * sdNoise(p * 7.0 + fi * 5.3 + (incoming ? 9.0 : 0.0)));\n sum += sdDark(col) * (0.6 + 1.6 * grain) * (incoming ? lift : 1.0 - lift);\n }\n }\n return sum / 6.0;\n}\n\nvec4 transition(vec2 uv) {\n vec2 q = vec2(uv.x * ratio, uv.y);\n float u = smoothstep(0.06, 0.82, progress);\n float gust = 0.6 + 0.8 * sdNoise(q * 1.6 - vec2(1.4, 0.6) * u + vec2(3.1, 7.7));\n float swap = smoothstep(0.2, 0.8, u + 0.25 * (sdNoise(q * 2.3 + 11.0) - 0.5));\n float th = sdSand(q, drift * gust * u * u, swap, false) + sdSand(q, -drift * gust * (1.0 - u) * (1.0 - u), swap, true);\n\n float f = 1.0 - exp(-2.2 * th);\n \n float m1 = smoothstep(0.0, 0.1, progress - 0.05 * (1.0 - f));\n float m2 = smoothstep(0.0, 1.0, (progress - 0.8 - 0.08 * f) / 0.11);\n \n vec3 glow = mix(light.rgb, vec3(sdLuma(light.rgb)), 0.7 * m2) * (1.0 - 0.4 * dot(uv - 0.5, uv - 0.5));\n vec3 sandImg = mix(glow, sand.rgb, f) * (1.0 + 0.5 * f * (1.0 - f) * vec3(0.25, -0.05, -0.35));\n\n vec4 a = getFromColor(uv);\n vec4 b = getToColor(uv);\n float sandA = mix(a.a, b.a, swap);\n vec4 c = mix(mix(vec4(a.rgb * a.a, a.a), vec4(sandImg * sandA, sandA), m1), vec4(b.rgb * b.a, b.a), m2);\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","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\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 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","ScreenPrintWipe":"// ScreenPrintWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ScreenPrintWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A squeegee sweeps back and forth across the frame four times, pushing a bead of ink ahead of its blade and printing the incoming image one halftone ink at a time, yellow, magenta, cyan then black, slightly out of register and streaky, until the layers settle into register and the dots melt into the full picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 misregistration; \n\nuniform float grit; \n\nconst float PI = 3.141592653589793;\n\nconst float PRINTED = 0.8;\n\nconst float BLACK = 0.6;\n\nconst float BEAD = 0.03;\nconst float RUBBER = 0.009;\nconst float HOLDER = 0.075;\nconst float SHADOW = 0.018;\nconst float SHADOW_SOFT = 0.02;\nconst float AA = 0.0015;\n\nfloat spHash(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 spNoise(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(spHash(i), spHash(i + vec2(1.0, 0.0)), f.x),\n mix(spHash(i + vec2(0.0, 1.0)), spHash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nvec2 spMirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat separation(vec3 c, float i) {\n float k = BLACK * (1.0 - max(max(c.r, c.g), c.b));\n if (i > 2.5) return k;\n float channel = i < 0.5 ? c.b : (i < 1.5 ? c.g : c.r);\n return clamp((1.0 - channel - k) / (1.0 - k), 0.0, 1.0);\n}\n\nvec3 inkFilter(float i) {\n if (i < 0.5) return vec3(1.0, 1.0, 0.0);\n if (i < 1.5) return vec3(1.0, 0.0, 1.0);\n if (i < 2.5) return vec3(0.0, 1.0, 1.0);\n return vec3(0.0);\n}\n\nvec3 inkColor(float i) {\n if (i < 0.5) return vec3(1.0, 0.84, 0.05);\n if (i < 1.5) return vec3(0.86, 0.06, 0.48);\n if (i < 2.5) return vec3(0.0, 0.58, 0.86);\n return vec3(0.07, 0.07, 0.08);\n}\n\nvec4 transition(vec2 uv) {\n vec2 aspect = vec2(ratio, 1.0);\n vec2 p = (uv - 0.5) * aspect;\n float settle = smoothstep(PRINTED, 1.0, progress);\n float rough = clamp(grit, 0.0, 1.0) * (1.0 - settle);\n float cells = max(dots, 1.0);\n\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n vec3 col = from.rgb;\n float alpha = from.a;\n float shade = 1.0;\n vec4 tool = vec4(0.0);\n\n for (int n = 0; n < 4; n++) {\n float i = float(n);\n float t = clamp((progress - i * PRINTED / 4.0) / (PRINTED / 4.0), 0.0, 1.0);\n \n if (t <= 0.0) break;\n float dir = mod(i, 2.0) < 0.5 ? 1.0 : -1.0;\n float tilt = mod(i, 2.0) < 0.5 ? 0.05 : 0.07;\n float m = dir * p.x + tilt * p.y;\n float extent = 0.5 * ratio + 0.5 * abs(tilt);\n \n \n float e = mix(t, t * t * (3.0 - 2.0 * t), 0.55);\n float front = mix(-extent - 1.15 * BEAD - SHADOW - SHADOW_SOFT, extent + HOLDER + SHADOW + SHADOW_SOFT, e);\n \n float u = front - m;\n float v = dir * p.y - tilt * p.x;\n float cover = smoothstep(-AA, AA, u);\n\n float a = 2.4 * i + 0.7;\n vec2 offset = misregistration * (1.0 - settle) * vec2(cos(a), sin(a)) * (0.6 + 0.4 * mod(i * 3.0, 4.0) / 3.0);\n vec4 s = getToColor(spMirror(uv + offset / aspect));\n float amount = separation(s.rgb, i);\n float streak = spNoise(vec2(v * 90.0, m * 2.0 + i * 13.0));\n streak = smoothstep(0.3, 0.9, streak);\n float speck = step(spHash(floor(p * 260.0) + i * 17.3), 0.07 * rough);\n amount *= 1.0 - rough * (0.3 * streak + speck);\n float ga = radians(i < 0.5 ? 0.0 : (i < 1.5 ? 75.0 : (i < 2.5 ? 15.0 : 45.0)));\n vec2 g = mat2(cos(ga), sin(ga), -sin(ga), cos(ga)) * p * cells;\n \n \n vec2 cell = 2.0 * PI * fract(g);\n float spot = 0.5 - 0.25 * (cos(cell.x) + cos(cell.y));\n float d = 1.0 - 2.0 * amount;\n float level = 0.5 - 0.5 * sign(d) * pow(abs(d), 1.5);\n float w = 0.16;\n float dotted = smoothstep(-w, w, level * (1.0 + 2.0 * w) - w - spot);\n float c = mix(dotted, amount, settle) * mix(s.a, 1.0, settle);\n vec3 ink = 1.0 - c * (1.0 - inkFilter(i));\n float wet = (1.0 - smoothstep(0.75, 1.0, t)) * exp(-max(u, 0.0) / 0.1) * cover * c;\n ink *= 1.0 - 0.12 * wet;\n vec3 printed = (n == 0 ? vec3(1.0) : col) * ink + 0.06 * wet * streak;\n col = mix(col, printed, cover);\n if (n == 0) alpha = mix(from.a, to.a, cover);\n\n if (t > 0.0 && t < 1.0) {\n float us = u + dir * SHADOW;\n shade *= 1.0 - 0.35 * smoothstep(-BEAD - SHADOW_SOFT, -BEAD + SHADOW_SOFT, us)\n * (1.0 - smoothstep(HOLDER - SHADOW_SOFT, HOLDER + SHADOW_SOFT, us));\n float bead = BEAD * (0.55 + 0.6 * spNoise(vec2(v * 7.0, i * 5.0)));\n float bx = clamp((u + 0.5 * bead) / (0.5 * bead), -1.0, 1.0);\n float bz = sqrt(1.0 - bx * bx);\n float beadMask = smoothstep(-bead - AA, -bead + AA, u) * (1.0 - smoothstep(-AA, AA, u));\n vec3 bc = inkColor(i) * (0.45 + 0.55 * bz) * (0.92 + 0.16 * spNoise(vec2(v * 30.0, u * 120.0)));\n bc += 0.35 * pow(smoothstep(0.75, 1.0, bz), 3.0) * (0.6 + 0.4 * spNoise(vec2(v * 40.0, i)));\n float rubber = smoothstep(-AA, AA, u) * (1.0 - smoothstep(RUBBER - AA, RUBBER + AA, u));\n float holder = smoothstep(RUBBER - AA, RUBBER + AA, u) * (1.0 - smoothstep(HOLDER - AA, HOLDER + AA, u));\n float hx = clamp((u - RUBBER) / (HOLDER - RUBBER) * 2.0 - 1.0, -1.0, 1.0);\n vec3 metal = vec3(0.62, 0.64, 0.67) * (0.55 + 0.45 * sqrt(1.0 - hx * hx));\n metal += 0.3 * (1.0 - smoothstep(0.0, 0.15, abs(hx + 0.35 * dir)));\n metal *= 1.0 - 0.5 * smoothstep(0.8, 1.0, abs(hx));\n vec3 rc = vec3(0.1, 0.11, 0.12) + 0.12 * (1.0 - smoothstep(0.0, 0.004, abs(u - 0.0025)));\n \n tool = vec4(beadMask * bc + rubber * rc + holder * metal, beadMask + rubber + holder);\n }\n }\n col = col * shade * (1.0 - tool.a) + tool.rgb;\n return vec4(col, 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","SequinStroke":"// SequinStroke — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SequinStroke.glsl\n// Author: gre\n// License: MIT\n// Description: The picture becomes a field of overlapping reversible sequins; an unseen hand strokes across it in three sweeps from top to bottom, and the sequins under its round tip turn over in the direction of the stroke with a glint, showing the incoming picture on their backs, while those just outside each sweep lift and fall 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 rows; \n\nuniform float sparkle; \n\nconst float PI = 3.14159265;\nconst float PASSES = 3.0;\nconst float FLIP = 0.16;\nconst float PITCH = 1.25;\nconst float R = 0.75;\nconst vec3 L = vec3(-0.4504, 0.6006, 0.6606);\nconst vec3 HALF = vec3(-0.2472, 0.3295, 0.9112);\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 ease(float t) {\n t = clamp(t, 0.0, 1.0);\n return t * t * (3.0 - 2.0 * t);\n}\n\nfloat laneDist(vec2 c, float k) {\n return abs(c.y - 1.0 + (k + 0.5) / PASSES - 0.03 * sin(6.0 * c.x + 2.0 * k)) * PASSES;\n}\n\nfloat turnAt(vec2 c, float jitter) {\n float own = 0.0, best = 1e3;\n for (int i = 0; i < 3; i++) {\n float m = laneDist(c, float(i));\n if (m < best) { best = m; own = float(i); }\n }\n float a = 0.0;\n for (int i = 0; i < 3; i++) {\n float k = float(i);\n float d = mod(k, 2.0) < 0.5 ? 1.0 : -1.0;\n float along = d > 0.0 ? c.x / ratio : 1.0 - c.x / ratio;\n float m = laneDist(c, k);\n \n float t = 0.06 + ((k + along) / PASSES + 0.05 * m * m) * 0.62 + jitter;\n float f = (progress - t) / FLIP;\n if (k == own) a += d * PI * ease(f);\n else a += d * 0.8 * clamp(1.0 - 2.5 * (m - 0.5), 0.0, 1.0) * sin(PI * clamp(f * 0.8, 0.0, 1.0));\n }\n return a;\n}\n\nvec2 centerOf(vec2 id) {\n return vec2((id.x + 0.5 + 0.5 * mod(id.y, 2.0)) * PITCH, id.y + 0.5);\n}\n\nfloat angleOf(vec2 id) {\n return turnAt(centerOf(id) / rows, 0.02 * hash12(id));\n}\n\nvec2 poseOf(vec2 p, vec2 id, float a) {\n float sa = sin(a);\n vec2 s = p - centerOf(id) - vec2(0.25 * sa, 0.0);\n return vec2(s.x / max(abs(cos(a)), 0.02), s.y) / (1.0 + 0.25 * abs(sa));\n}\n\nfloat depthOf(vec2 id, float a) {\n \n return 2.0 * abs(sin(a)) + 0.01 * id.y;\n}\n\nvec4 shadeSequin(vec2 uv, vec2 p, vec2 id, float a, float e) {\n vec2 q = poseOf(p, id, a);\n float ca = cos(a), sa = sin(a);\n bool back = ca < 0.0;\n vec2 src = uv + e * (q - (p - centerOf(id))) / rows / vec2(ratio, 1.0);\n src = 1.0 - abs(1.0 - abs(src));\n vec4 col = back ? getToColor(src) : getFromColor(src);\n float face = back ? -1.0 : 1.0;\n vec3 nrm = normalize(vec3(face * sa + 0.45 * q.x, 0.45 * q.y, abs(ca)));\n float dif = 0.85 + 0.3 * dot(nrm, L) - 0.25 * smoothstep(0.75, 1.0, length(q) / R);\n float spec = pow(max(dot(nrm, HALF), 0.0), 40.0) + 0.6 * pow(abs(sa), 6.0);\n vec3 c = col.rgb * mix(1.0, dif, e) + sparkle * e * spec * vec3(1.0, 0.96, 0.88) * 0.7;\n return vec4(c, col.a);\n}\n\nvec4 transition(vec2 uv) {\n float e = ease(progress / 0.08) * ease((1.0 - progress) / 0.08);\n vec2 p = uv * vec2(ratio, 1.0) * rows;\n float aaw = rows / 260.0;\n float j0 = floor(p.y);\n\n float z1 = -1e3, z2 = -1e3, a1 = 0.0, a2 = 0.0, ang1 = 0.0, ang2 = 0.0;\n vec2 id1 = vec2(0.0), id2 = vec2(0.0);\n float near = 1e3, aHome = 0.0;\n for (int dj = -1; dj <= 1; dj++) {\n float j = j0 + float(dj);\n float i0 = floor(p.x / PITCH - 0.5 * mod(j, 2.0));\n for (int di = -1; di <= 1; di++) {\n vec2 id = vec2(i0 + float(di), j);\n float a = angleOf(id);\n float dc = length(p - centerOf(id));\n if (dc < near) { near = dc; aHome = a; }\n vec2 q = poseOf(p, id, a);\n float r = length(q);\n float squash = mix(1.0, max(abs(cos(a)), 0.02), q.x * q.x / max(r * r, 1e-6));\n float cov = clamp((R - r) * (1.0 + 0.25 * abs(sin(a))) * squash / aaw + 0.5, 0.0, 1.0);\n if (cov <= 0.0) continue;\n float z = depthOf(id, a);\n if (z > z1) {\n z2 = z1; a2 = a1; id2 = id1; ang2 = ang1;\n z1 = z; a1 = cov; id1 = id; ang1 = a;\n } else if (z > z2) {\n z2 = z; a2 = cov; id2 = id; ang2 = a;\n }\n }\n }\n\n \n float sh1 = 0.0, sh2 = 0.0;\n for (int dj = -1; dj <= 1; dj++) {\n float j = j0 + float(dj);\n float i0 = floor(p.x / PITCH - 0.5 * mod(j, 2.0));\n for (int di = -1; di <= 1; di++) {\n vec2 id = vec2(i0 + float(di), j);\n float a = angleOf(id);\n float z = depthOf(id, a);\n for (int l = 0; l < 2; l++) {\n float zl = l == 0 ? z1 : z2;\n float gap = z - zl;\n if (zl < -1e2 || gap <= 1e-4) continue;\n vec2 q = poseOf(p - vec2(0.08, -0.1) * (1.0 + 2.5 * gap), id, a);\n float s = 1.0 - smoothstep(R - 0.1, R + 0.12 + 0.1 * gap, length(q));\n if (l == 0) sh1 = max(sh1, s); else sh2 = max(sh2, s);\n }\n }\n }\n\n vec4 under = abs(aHome) > 0.5 * PI ? getToColor(uv) : getFromColor(uv);\n under.rgb *= 1.0 - 0.45 * e;\n vec4 c = under;\n if (a2 > 0.0) {\n vec4 c2 = shadeSequin(uv, p, id2, ang2, e);\n c2.rgb *= 1.0 - 0.4 * e * sh2;\n c = mix(c, c2, a2);\n }\n if (a1 > 0.0) {\n vec4 c1 = shadeSequin(uv, p, id1, ang1, e);\n c1.rgb *= 1.0 - 0.4 * e * sh1;\n c = mix(c, c1, a1);\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","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 cracks like a pane of glass from an impact point, then its shards break loose from the impact outward, tumbling in 3D and falling away with gravity to reveal the incoming image behind\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 shards; \n\nuniform float gravity; \n\nuniform float seed; \n\nconst float EYE = 2.5;\n\nconst float JITTER = 0.32;\n\nconst float EDGE = 0.0012;\nconst float CRACK_WIDTH = 0.0025;\nconst float BEVEL = 0.006;\n\nvec3 hash32(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yxz + 33.33);\n return fract((p3.xxy + p3.yzz) * p3.zyx);\n}\n\nfloat cellSize() {\n return 1.0 / clamp(shards, 3.0, 8.0);\n}\n\nvec2 seedOffset() {\n return vec2(37.0, 17.0) * floor(seed);\n}\n\nvec2 corner(vec2 p) {\n return (p + JITTER * (2.0 * hash32(p + seedOffset()).xy - 1.0)) * cellSize();\n}\n\nfloat side(vec2 q, vec2 a, vec2 b) {\n vec2 d = b - a;\n return (d.x * (q.y - a.y) - d.y * (q.x - a.x)) / length(d);\n}\n\nbool diagonalUp(vec2 c) {\n return hash32(c + seedOffset() + 0.5).z > 0.5;\n}\n\nfloat triangleDist(vec2 q, vec2 p0, vec2 p1, vec2 p2) {\n return min(min(side(q, p0, p1), side(q, p1, p2)), side(q, p2, p0));\n}\n\nvec4 locate(vec2 q) {\n vec2 c = floor(q / cellSize());\n \n vec2 a, b, cc, d;\n for (int i = 0; i < 2; i++) {\n a = corner(c);\n b = corner(c + vec2(1.0, 0.0));\n cc = corner(c + 1.0);\n d = corner(c + vec2(0.0, 1.0));\n c.x += side(q, d, a) < 0.0 ? -1.0 : (side(q, b, cc) < 0.0 ? 1.0 : 0.0);\n a = corner(c);\n b = corner(c + vec2(1.0, 0.0));\n cc = corner(c + 1.0);\n d = corner(c + vec2(0.0, 1.0));\n c.y += side(q, a, b) < 0.0 ? -1.0 : (side(q, cc, d) < 0.0 ? 1.0 : 0.0);\n }\n a = corner(c);\n b = corner(c + vec2(1.0, 0.0));\n cc = corner(c + 1.0);\n d = corner(c + vec2(0.0, 1.0));\n bool up = diagonalUp(c);\n float d0 = up ? triangleDist(q, a, b, cc) : triangleDist(q, a, b, d);\n float d1 = up ? triangleDist(q, a, cc, d) : triangleDist(q, b, cc, d);\n return vec4(c, d1 > d0 ? 1.0 : 0.0, abs(max(d0, d1)));\n}\n\nvec3 rotate(vec3 v, vec3 k, float angle) {\n float c = cos(angle), s = sin(angle);\n return v * c + cross(k, v) * s + k * dot(k, v) * (1.0 - c);\n}\n\nvec2 impact() {\n return clamp(center, 0.0, 1.0) * vec2(ratio, 1.0);\n}\n\nfloat reach() {\n vec2 c = impact();\n return length(max(c, vec2(ratio, 1.0) - c));\n}\n\nfloat fallMargin() {\n return 0.1 + 1.5 * cellSize();\n}\n\nfloat releaseTime(vec2 mid, float dn, float h, float g, float margin) {\n float latest = max(0.98 - sqrt(2.0 * (mid.y + margin) / g), 0.04);\n return 0.04 + (latest - 0.04) * (0.8 * pow(dn, 0.8) + 0.2 * h);\n}\n\nfloat flash(vec2 q) {\n float f = sin(3.141592653589793 * clamp(progress / 0.12, 0.0, 1.0));\n vec2 d = q - impact();\n return 0.6 * f * exp(-dot(d, d) / (0.004 + 0.02 * progress));\n}\n\nvec4 transition(vec2 uv) {\n float s = cellSize();\n vec2 a = vec2(uv.x * ratio, uv.y);\n vec3 eye = vec3(0.5 * ratio, 0.5, -EYE);\n vec3 ray = vec3(a, 0.0) - eye;\n vec3 light = normalize(vec3(-0.35, 0.55, -1.0));\n vec3 halfway = normalize(light - normalize(ray));\n float g = 12.0 * clamp(gravity, 0.5, 3.0);\n vec2 imp = impact();\n float rch = reach();\n float margin = fallMargin();\n \n float crackTime = clamp(0.6 * (0.94 - sqrt(2.0 * (1.0 + margin) / g)), 0.05, 0.22);\n\n vec4 pane = vec4(0.0);\n float paneDepth = 1e9;\n vec4 here = locate(a);\n vec2 hc = here.xy;\n vec2 ha = corner(hc), hb = corner(hc + vec2(1.0, 0.0)), hcc = corner(hc + 1.0), hd = corner(hc + vec2(0.0, 1.0));\n bool hup = diagonalUp(hc);\n vec2 hcenter = here.z < 0.5 ? (hup ? ha + hb + hcc : ha + hb + hd) : (hup ? ha + hcc + hd : hb + hcc + hd);\n vec3 hh = hash32(hc + vec2(0.31, 0.57) * (here.z + 1.0) + seedOffset());\n hcenter /= 3.0;\n if (progress < releaseTime(hcenter, clamp(length(hcenter - imp) / rch, 0.0, 1.0), hh.x, g, margin)) {\n vec4 col = getFromColor(uv);\n float crack = clamp((progress - crackTime * length(a - imp) / rch) / 0.03, 0.0, 1.0);\n \n vec3 n = rotate(vec3(0.0, 0.0, -1.0), normalize(vec3(hh.yz - 0.5, 0.0) + 1e-4), 0.06 * crack * (hh.x - 0.5));\n col.rgb *= 1.0 + 1.2 * (dot(n, light) + light.z);\n col.rgb += crack * 0.35 * pow(max(dot(n, halfway), 0.0), 400.0) * col.a;\n float line = crack * (1.0 - smoothstep(0.0, CRACK_WIDTH, here.w));\n col.rgb = mix(col.rgb, vec3(0.95, 0.98, 1.0) * col.a, 0.85 * line);\n pane = col;\n paneDepth = 1.0;\n }\n\n \n float t1 = 1e9, t2 = 1e9;\n vec4 c1 = vec4(0.0), c2 = vec4(0.0);\n float a1 = 0.0, a2 = 0.0;\n float shadow = 0.0;\n\n \n \n vec2 look = a - 0.06 * progress * (a - imp) / rch - (a - eye.xy) * 0.06 * progress;\n vec2 g0 = floor(look / s) - 1.0;\n float rows = ceil(1.0 / s);\n for (int ri = 0; ri < 11; ri++) {\n float j = g0.y + float(ri);\n if (j > rows) break;\n if (j < -1.0) continue;\n for (int ci = 0; ci < 3; ci++) {\n vec2 c = vec2(g0.x + float(ci), j);\n vec2 ca = corner(c), cb = corner(c + vec2(1.0, 0.0)), ccc = corner(c + 1.0), cd = corner(c + vec2(0.0, 1.0));\n bool up = diagonalUp(c);\n for (int k = 0; k < 2; k++) {\n vec2 p0 = (k == 1 && !up) ? cb : ca;\n vec2 p1 = k == 0 ? cb : ccc;\n vec2 p2 = (k == 0 && up) ? ccc : cd;\n vec2 mid = (p0 + p1 + p2) / 3.0;\n vec3 h1 = hash32(c + vec2(0.31, 0.57) * float(k + 1) + seedOffset());\n vec2 away = mid - imp;\n float dist = length(away);\n float dn = clamp(dist / rch, 0.0, 1.0);\n float e = progress - releaseTime(mid, dn, h1.x, g, margin);\n if (e <= 0.0) continue;\n vec3 h2 = hash32(c + vec2(0.73, 0.19) * float(k + 1) + seedOffset());\n float near = 1.0 - dn;\n vec3 vel = vec3(away / max(dist, 1e-3) * (0.03 + 0.08 * h1.y) * (0.4 + near), -(0.05 + 0.2 * near * h1.z));\n vec3 pos = vec3(mid, 0.0) + vel * e - vec3(0.0, 0.5 * g * e * e, 0.0);\n if (pos.y + 1.5 * s < -0.05) continue;\n vec3 axis = normalize(vec3(h2.x - 0.5, h2.y - 0.5, 0.3 * (h2.z - 0.5)) + 1e-4);\n float angle = (3.0 + 5.0 * h2.z) * (h2.x < 0.5 ? -1.0 : 1.0) * e;\n vec3 n = rotate(vec3(0.0, 0.0, -1.0), axis, angle);\n float rel = smoothstep(0.0, 0.04, e);\n\n float den = dot(ray, n);\n float t = dot(pos - eye, n) / (abs(den) > 1e-4 ? den : 1e-4);\n vec2 q = mid + rotate(eye + t * ray - pos, axis, -angle).xy;\n float border = min(min(q.x, ratio - q.x), min(q.y, 1.0 - q.y));\n float inside = triangleDist(q, p0, p1, p2);\n float ed = min(inside, border);\n if (t > 0.0 && t < t2 && t < paneDepth && ed > 0.0) {\n vec3 nf = den > 0.0 ? -n : n;\n vec4 col = getFromColor(vec2(q.x / ratio, q.y));\n col.rgb *= mix(1.0, clamp(dot(nf, light) / -light.z, 0.45, 1.1), rel);\n float glint = max(dot(nf, halfway), 0.0);\n col.rgb += rel * 0.3 * pow(glint, 60.0) * col.a;\n float line = 0.85 * (1.0 - smoothstep(0.0, CRACK_WIDTH, inside)) * (1.0 - rel);\n float bevel = 0.8 * rel * (1.0 - smoothstep(0.0, BEVEL, ed)) * (0.3 + 0.7 * pow(glint, 6.0));\n col.rgb = mix(col.rgb, vec3(0.92, 0.97, 0.97) * col.a, max(line, bevel));\n float cover = mix(1.0, smoothstep(0.0, 2.0 * EDGE, ed), rel);\n if (t < t1) {\n t2 = t1; c2 = c1; a2 = a1;\n t1 = t; c1 = col; a1 = cover;\n } else {\n t2 = t; c2 = col; a2 = cover;\n }\n }\n\n float lden = dot(light, n);\n float ts = dot(pos - vec3(a, 0.0), n) / (abs(lden) > 1e-4 ? lden : 1e-4);\n vec2 qs = mid + rotate(vec3(a, 0.0) + ts * light - pos, axis, -angle).xy;\n float eds = min(triangleDist(qs, p0, p1, p2), min(min(qs.x, ratio - qs.x), min(qs.y, 1.0 - qs.y)));\n if (ts > 0.0 && eds > 0.0) {\n shadow = max(shadow, rel * smoothstep(0.0, 0.004 + 0.08 * ts, eds) * 0.45 * (1.0 - smoothstep(0.1, 0.9, ts)));\n }\n }\n }\n }\n\n \n vec4 back = getToColor(uv);\n back.rgb *= 1.0 - shadow;\n pane.rgb *= 1.0 - shadow;\n if (paneDepth == 1.0) back = pane;\n vec4 color = c1 * a1 + c2 * min(a2, 1.0 - a1) + back * max(1.0 - a1 - a2, 0.0);\n color.rgb += flash(a) * color.a;\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","Shockwave":"// Shockwave — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Shockwave.glsl\n// Author: Gilad Levi, github @Giladx\n// License: MIT\n// Description: A diagonal shockwave breaks the outgoing image into tiny falling glass tiles. Each tile slips away with a brief chromatic split and neon edge glow, revealing the incoming image beneath 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 tileSize; \n \n uniform float scatter; \n \n uniform float diagonal; \n \n uniform float prism; \n \n uniform float glow; \n\n float toseeHash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n }\n\n vec4 transition(vec2 uv) {\n float size = max(tileSize, 0.008);\n vec2 grid = max(vec2(1.0), floor(vec2(ratio, 1.0) / size));\n vec2 cell = floor(uv * grid);\n vec2 cellUV = fract(uv * grid);\n vec2 centerUV = (cell + 0.5) / grid;\n\n float sweep = mix(\n centerUV.x,\n 0.64 * centerUV.x + 0.36 * (1.0 - centerUV.y),\n clamp(diagonal, 0.0, 1.0)\n );\n\n float noise = toseeHash(cell);\n float start = 0.62 * sweep + 0.07 * noise;\n float t = clamp((progress - start) / 0.29, 0.0, 1.0);\n float movement = t * clamp(scatter, 0.0, 1.5);\n\n float wobble = toseeHash(cell + vec2(19.3, 7.7)) * 2.0 - 1.0;\n vec2 drift = vec2(0.65 * wobble, -0.95) * movement;\n vec2 movingCellUV = cellUV - drift;\n\n float inside =\n step(0.012, movingCellUV.x) *\n step(movingCellUV.x, 0.988) *\n step(0.012, movingCellUV.y) *\n step(movingCellUV.y, 0.988);\n\n float tileShape = mix(1.0, inside, smoothstep(0.0, 0.13, t));\n float oldVisibility = 1.0 - smoothstep(0.48, 0.87, t);\n float oldMask = tileShape * oldVisibility;\n\n vec2 oldUV = clamp(uv - drift / grid, 0.0, 1.0);\n vec4 oldColor = getFromColor(oldUV);\n\n float flare = sin(3.14159265 * t);\n vec2 shift = vec2(0.006, -0.002) * prism * flare;\n vec4 offsetColor = getFromColor(\n clamp(oldUV + shift, 0.0, 1.0)\n );\n oldColor.r = offsetColor.r;\n\n vec4 result = mix(getToColor(uv), oldColor, oldMask);\n\n float edgeDistance = min(\n min(movingCellUV.x, 1.0 - movingCellUV.x),\n min(movingCellUV.y, 1.0 - movingCellUV.y)\n );\n\n float edge =\n (1.0 - smoothstep(0.0, 0.10, edgeDistance)) * inside;\n\n vec3 cyan = vec3(0.12, 0.95, 1.0);\n vec3 pink = vec3(1.0, 0.20, 0.65);\n\n vec3 rimColor = mix(\n cyan,\n pink,\n toseeHash(cell + vec2(5.4, 28.6))\n );\n\n result.rgb = clamp(\n result.rgb + rimColor * edge * flare * glow * oldMask * 0.60,\n 0.0,\n 1.0\n );\n\n return result;\n }\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","ShoreWash":"// ShoreWash — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ShoreWash.glsl\n// Author: gre\n// License: MIT\n// Description: A thin sheet of water runs up over the outgoing image like the last of a wave on a beach, its lobed front edged with bubbly foam; it slows, stops just past the far edge and drains back, leaving the incoming image wet and glossy as it dries\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 foam; \n\nuniform float refraction; \n\nuniform vec4 water; \n\nconst float AA = 0.002;\n\nconst float LOBE = 0.06;\nconst float LACE = 0.3;\nconst float CELL = 0.045;\n\nconst float RUNUP = 0.4;\nconst float FOAMW = 0.1;\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\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\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(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 bubbles(vec2 p, float density) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n float d1 = 8.0;\n float d2 = 8.0;\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 o = vec2(float(x), float(y));\n vec2 c = o + 0.15 + 0.7 * hash22(i + o) - f;\n float d = dot(c, c);\n if (d < d1) {\n d2 = d1;\n d1 = d;\n } else if (d < d2) {\n d2 = d;\n }\n }\n }\n float e = sqrt(d2) - sqrt(d1);\n float w = 0.12 + 0.6 * density;\n return (1.0 - smoothstep(w - 0.12, w + 0.12, e)) * smoothstep(0.0, 0.35, density);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(0.0, 1.0);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n \n float a = dot(q, dir);\n float b = dot(q, vec2(-dir.y, dir.x));\n float extent = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n float start = -extent - LOBE - 0.1;\n float stop = extent + LOBE + 0.01;\n\n float up = clamp(progress / RUNUP, 0.0, 1.0);\n float back = clamp((progress - RUNUP) / (1.0 - RUNUP), 0.0, 1.0);\n float front = mix(start, stop, 1.0 - pow(1.0 - up, 1.6)) - (stop - start) * pow(back, 1.5);\n\n float lobes = vnoise(vec2(b * 7.0 + 3.1, progress * 2.0)) * 0.7 + vnoise(vec2(b * 17.0, 5.0 + progress * 3.0)) * 0.3;\n float behind = front + LOBE * (lobes - 0.5) * 2.0 - a; \n float sheet = smoothstep(-AA, AA, behind);\n\n \n \n float swapped = max(smoothstep(0.01, 0.8 * FOAMW, behind), (progress < RUNUP ? sheet : 1.0) * smoothstep(RUNUP - 0.08, RUNUP, progress));\n\n vec2 rp = vec2(a * 20.0, b * 5.0 + 3.0 * vnoise(q * 4.0)) - vec2(7.0 * min(progress, RUNUP) - 5.0 * back, 0.0);\n float n0 = vnoise(rp);\n vec2 g = (vnoise(rp + vec2(0.15, 0.0)) - n0) / 0.15 * dir + (vnoise(rp + vec2(0.0, 0.15)) - n0) / 0.15 * vec2(-dir.y, dir.x);\n float thick = sheet * smoothstep(0.0, 0.12, behind);\n vec2 off = g * refraction * thick * vec2(1.0 / ratio, 1.0);\n\n vec4 c = mix(getFromColor(mirror(uv + off)), getToColor(mirror(uv + off)), swapped);\n c.rgb = mix(c.rgb, water.rgb, water.a * sheet * (0.3 + 0.7 * smoothstep(0.0, 0.35, behind)));\n float glint = pow(max(dot(normalize(vec3(-g, 3.0)), normalize(vec3(-0.3, 0.6, 1.0))), 0.0), 14.0);\n c.rgb += glint * 0.4 * thick;\n\n float wet = (1.0 - sheet) * exp(min(behind, 0.0) * 2.5) * smoothstep(RUNUP, RUNUP + 0.05, progress) * (1.0 - smoothstep(0.7, 1.0, progress));\n c.rgb *= mix(vec3(1.0), c.rgb, 0.55 * wet);\n c.rgb += 0.1 * wet * smoothstep(0.4, 0.9, vnoise(vec2(a * 30.0, b * 6.0)));\n\n vec2 lp = vec2(a - 0.4 * (progress < RUNUP ? front : stop), b) / CELL;\n float patches = smoothstep(0.45, 0.8, 0.6 * vnoise(lp * vec2(0.4, 0.1) + 4.0) + 0.4 * vnoise(lp * 0.3 + 9.0));\n float bandW = FOAMW * (0.5 + vnoise(vec2(b * 25.0, 2.0)));\n float density = (1.0 - smoothstep(0.0, bandW, behind)) * (1.0 - smoothstep(RUNUP - 0.05, RUNUP + 0.12, progress));\n density = max(density, 0.55 * patches * (1.0 - smoothstep(0.0, LACE, behind)) * (1.0 - 0.5 * back));\n density = max(density, 0.9 * (1.0 - smoothstep(0.0, 0.012 + 0.02 * vnoise(vec2(b * 40.0, 1.0)), behind)));\n density *= sheet;\n float f = 0.0;\n if (density > 0.0) {\n f = max(bubbles(lp, density), 0.85 * bubbles(lp * 1.7 + 7.0, density * 0.9));\n f = max(f, 0.45 * smoothstep(0.15, 0.7, density)) * foam;\n }\n c.rgb *= 1.0 - 0.25 * sheet * foam * (1.0 - f) * smoothstep(0.0, 0.6, density);\n c.rgb = mix(c.rgb, vec3(0.97, 0.98, 0.97), clamp(f, 0.0, 1.0));\n float sh = smoothstep(-0.03, 0.0, behind);\n c.rgb *= 1.0 - 0.35 * (1.0 - sheet) * sh * sh * (1.0 - smoothstep(RUNUP - 0.05, RUNUP, progress));\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","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 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 float lift = min(1.0, 8.0 * t);\n float gap = 0.06 * w * lift;\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 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 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","ShutterWipe":"// ShutterWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ShutterWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A camera's focal-plane shutter fires across the frame, seen through the camera's gate: thin metal blades fan down from a tight stack above it until they overlap over the whole frame, then keep running down and stack below it, uncovering the incoming image from the 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\nuniform int blades; \n\nuniform float tilt; \n\nuniform float gate; \n\nuniform vec4 color; \n\nconst float STACK = 0.016;\nconst float REST = 0.05;\n\nvec4 transition(vec2 uv) {\n float n = clamp(float(blades), 3.0, 10.0);\n \n float h = 1.7 / n + 0.02;\n float pile = (n - 1.0) * STACK;\n \n \n float travel = 1.0 + 2.0 * REST + h + pile;\n vec2 t = clamp((progress - vec2(0.0, 0.3)) / 0.7, 0.0, 1.0);\n vec2 pos = 1.0 + REST + vec2(0.0, pile) - travel * t * t * (3.0 - 2.0 * t);\n vec2 vel = travel * 6.0 * t * (1.0 - t) / 0.7;\n\n float x = (uv.x - 0.5) * ratio;\n vec4 col = progress < 0.5 ? getFromColor(uv) : getToColor(uv);\n \n for (int i = 0; i < 10; i++) {\n float k = float(i) / (n - 1.0);\n if (k < 1.0001) {\n float v = mix(vel.x, vel.y, k);\n float d = uv.y - mix(pos.x, pos.y, k) + tilt * 0.1 * v * x;\n float aa = 0.002 + 0.005 * v;\n float sh = (1.0 - smoothstep(0.0, 0.03 + 0.012 * v, -d)) * (1.0 - smoothstep(-aa, aa, d));\n col.rgb *= 1.0 - 0.65 * color.a * sh * sh;\n float l = clamp(d / h, 0.0, 1.0);\n float lip = smoothstep(0.003, 0.007, d) * (1.0 - smoothstep(0.007, 0.014, d));\n float s = (uv.y - d - 0.55 + 0.3 * x) * 2.5;\n float sheen = 0.3 * exp(-s * s) * (1.0 - l) * (1.0 - l);\n vec3 metal = color.rgb * (1.3 - 0.75 * l) + (0.25 * lip + sheen) * (0.6 + 0.4 * color.rgb) * color.a;\n metal *= 0.4 + 0.6 * smoothstep(0.0, 0.005, d);\n float cover = smoothstep(-aa, aa, d) * (1.0 - smoothstep(h - aa, h + aa, d));\n col = mix(col, vec4(clamp(metal, 0.0, 1.0), color.a), cover);\n }\n }\n float g = gate * smoothstep(0.0, 0.12, progress) * (1.0 - smoothstep(0.88, 1.0, progress));\n vec2 c = abs(uv - 0.5) * vec2(ratio, 1.0) - vec2(0.5 * ratio, 0.5) + 1.5 * g;\n float e = length(max(c, 0.0)) + min(max(c.x, c.y), 0.0) - 0.5 * g;\n float on = smoothstep(0.0, 0.002, gate) * smoothstep(0.0, 0.04, progress) * (1.0 - smoothstep(0.96, 1.0, progress));\n col.rgb *= 1.0 - 0.5 * color.a * on * smoothstep(-0.4 * g - 0.001, 0.0, e);\n vec3 housing = min(color.rgb * (1.5 - smoothstep(0.0, 0.2 * g + 0.001, e)), 1.0);\n return mix(col, vec4(housing, color.a), on * smoothstep(-0.002, 0.002, e));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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","SketchDissolve":"// SketchDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SketchDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image fades back to blank paper while the incoming one is drawn on it in pencil, outlines first and then hatching in the shadows, before its shading and colors fill in until the picture is complete\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 lineWidth; \n\nuniform float edges; \n\nuniform float hatching; \n\nuniform vec4 paper; \n\nuniform vec4 ink; \n\nfloat sdHash (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 sdNoise (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(sdHash(i), sdHash(i + vec2(1.0, 0.0)), f.x),\n mix(sdHash(i + vec2(0.0, 1.0)), sdHash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nvec2 sdTone (vec2 uv) {\n vec4 c = getToColor(uv);\n return vec2(dot(c.rgb, vec3(0.299, 0.587, 0.114)), c.a);\n}\n\nfloat sdHatch (vec2 q, vec2 d, float dark) {\n float s = dot(q, d) * 60.0 + 0.5 * sdNoise(q * 9.0 + d * 13.0);\n float row = floor(s);\n float along = dot(q, vec2(-d.y, d.x)) * 8.0 + sdHash(vec2(row, d.y * 7.0)) * 5.0;\n float cell = floor(along);\n float k = sdHash(vec2(row, cell) + d * 31.0);\n float gap = smoothstep(0.0, 0.12, fract(along)) * (1.0 - smoothstep(0.75 - 0.2 * k, 1.0, fract(along)));\n float w = 0.5 * clamp(dark, 0.0, 1.0) * (0.7 + 0.3 * k);\n return (1.0 - smoothstep(w - 0.24, w, abs(fract(s) - 0.5))) * gap * (0.6 + 0.4 * k);\n}\n\nvec4 transition (vec2 uv) {\n vec2 q = vec2(uv.x * ratio, uv.y);\n vec2 wob = (vec2(sdNoise(q * 6.0), sdNoise(q * 6.0 + 17.0)) - 0.5) * 0.004;\n vec2 su = uv + wob * (1.0 - progress);\n vec2 dx = vec2(0.001 * lineWidth / ratio, 0.0);\n vec2 dy = vec2(0.0, 0.001 * lineWidth);\n vec2 tl = sdTone(su - dx + dy), tm = sdTone(su + dy), tr = sdTone(su + dx + dy);\n vec2 ml = sdTone(su - dx), mr = sdTone(su + dx);\n vec2 bl = sdTone(su - dx - dy), bm = sdTone(su - dy), br = sdTone(su + dx - dy);\n vec2 gx = (tr + 2.0 * mr + br) - (tl + 2.0 * ml + bl);\n vec2 gy = (tl + 2.0 * tm + tr) - (bl + 2.0 * bm + br);\n float g = max(length(vec2(gx.x, gy.x)), length(vec2(gx.y, gy.y))) * max(edges, 0.0);\n float outline = smoothstep(0.12, 0.5, g);\n vec4 toC = getToColor(uv);\n float l = clamp((tm.x + bm.x + ml.x + mr.x) * 0.25, 0.0, 1.0);\n\n float grain = 0.65 + 0.35 * sdNoise(q * vec2(180.0, 60.0));\n float order = sdNoise(q * 3.0 + 4.0);\n float fine = sdNoise(q * 24.0);\n float drawOutline = smoothstep(0.0, 0.1, progress - (0.22 * order + 0.05 * fine));\n float drawHatch = smoothstep(0.0, 0.12, progress - (0.2 + 0.2 * order + 0.05 * fine));\n\n float fill = smoothstep(0.0, 0.22, progress - (0.4 + 0.25 * l + 0.1 * order));\n\n float dark = 1.0 - l;\n float h1 = sdHatch(q, vec2(0.7071, 0.7071), smoothstep(0.35, 0.9, dark));\n float h2 = sdHatch(q, vec2(0.7071, -0.7071), smoothstep(0.65, 1.0, dark));\n float hatch = hatching * 0.8 * max(h1, 0.8 * h2) * toC.a;\n\n hatch *= drawHatch * (1.0 - 0.6 * fill);\n float pencil = max(outline * drawOutline, hatch) * grain;\n pencil *= 1.0 - smoothstep(0.7, 1.0, progress);\n\n vec4 base = mix(getFromColor(uv), paper, smoothstep(0.02, 0.38, progress));\n float sat = smoothstep(0.55, 1.0, progress);\n vec4 tone = vec4(paper.rgb * mix(0.3, 1.0, l), paper.a * toC.a);\n vec4 col = mix(tone, toC, sat);\n base = mix(base, col, fill);\n return mix(base, ink, pencil);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SkyLanterns":"// SkyLanterns — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SkyLanterns.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture rounds into a paper lantern lit warmly from inside and drifts off into the dusk over the incoming picture, while little lanterns made of the same picture rise on both sides; as the last ones float away, day breaks on the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 dusk; \n\nuniform float glow; \n\nuniform vec3 flame; \n\nconst int COUNT = 18;\n\nfloat hash(float p) {\n p = fract(p * 0.1031);\n p *= p + 33.33;\n p *= p + p;\n return fract(p);\n}\n\nfloat profile(float y, float lip) {\n float v = clamp(y, -1.0, 1.0);\n float t = max(v, 0.0);\n float b = max(-v, 0.0);\n float w = 0.72 * sqrt(max(1.0 - t * t * t * t, 0.0)) * (1.0 - 0.3 * b * b);\n float m = max(lip - 1.0 - v, 0.0) / lip;\n return w * sqrt(max(1.0 - m * m, 0.0));\n}\n\nfloat steep(float y, float lip) {\n float g = (profile(y + 0.01, lip) - profile(y - 0.01, lip)) * 50.0;\n return sqrt(1.0 + g * g);\n}\n\nvec4 paper(vec2 l, float w, float k, float lip, float flick) {\n float mouth = mix(ratio, profile(lip - 1.0, lip), k);\n \n float x = clamp(l.x / max(l.y < lip - 1.0 ? mouth : w, 1e-4), -1.0, 1.0);\n float turn = asin(x * 0.999);\n float bx = mix(x, turn * 0.6366, k);\n vec2 crop = mix(vec2(1.0), min(vec2(0.8 / ratio, ratio / 0.8), 1.0), k);\n vec4 c = getFromColor(clamp(0.5 + 0.5 * vec2(bx, l.y) * crop, 0.0, 1.0));\n vec2 f = (l + vec2(0.0, 0.7)) * vec2(1.25, 0.72);\n float core = exp(-dot(f, f)) * flick;\n vec3 lit = (c.rgb * 0.75 + 0.2 * flame) * mix(vec3(0.7, 0.58, 0.56), 0.55 + 1.3 * flame, core);\n lit += flame * 0.3 * core * core;\n lit *= 1.0 - 0.45 * x * x * x * x;\n lit *= 1.0 - 0.13 * smoothstep(0.88, 1.0, cos(l.y * 20.0));\n lit *= 1.0 - 0.07 * smoothstep(0.92, 1.0, cos(turn * 9.0));\n vec2 e = vec2(l.x / mouth, (l.y + 1.0 - lip) / lip);\n float r = length(e);\n float inside = 1.0 - smoothstep(0.82, 0.92, r);\n vec3 hole = flame * (0.45 + 0.95 * exp(-dot(e, e) * 2.5)) * flick;\n lit = mix(lit, flame * vec3(0.45, 0.36, 0.3), 1.0 - smoothstep(0.98, 1.06, r));\n lit = mix(lit, hole, inside);\n return vec4(mix(c.rgb, lit, k) * 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 float side = min(ratio, 1.0);\n\n float night = smoothstep(0.0, 0.25, p) * (1.0 - smoothstep(0.66, 1.0, p));\n vec4 c = getToColor(uv);\n float lum = dot(c.rgb, vec3(0.299, 0.587, 0.114));\n vec3 moon = mix(vec3(lum), c.rgb, 0.6) * vec3(0.32, 0.42, 0.78) + vec3(0.02, 0.03, 0.08);\n c.rgb = mix(c.rgb, moon, dusk * night) * c.a;\n\n vec3 halo = vec3(0.0);\n \n for (int i = 0; i < COUNT; i++) {\n float f = float(i);\n float z = 0.2 + 0.8 * f / float(COUNT - 1);\n float sz = mix(0.028, 0.115, z * z) * mix(side, 1.0, 0.15);\n float t = p - 0.17 - 0.2 * hash(f + 3.0);\n if (t <= 0.0) continue;\n \n float v = fract(f * 0.618034 + 0.2) * 2.0 - 1.0;\n float x = 0.5 * (ratio + 0.06) * sign(v) * mix(abs(v), 0.5 + 0.5 * abs(v), smoothstep(0.25, 0.5, z));\n x += 0.025 * side * sin(p * 8.0 + f * 2.1);\n float y = -0.5 - 1.3 * sz + t * (1.5 + 1.4 * z) + 0.7 * t * t;\n vec2 d = q - vec2(x, y);\n float sw = 0.1 * sin(p * 9.0 + f * 1.7);\n d = vec2(d.x + sw * d.y, d.y - sw * d.x) / sz;\n float on = smoothstep(0.0, 0.06, t);\n float flick = 0.92 + 0.08 * sin(p * 60.0 + f * 4.0);\n halo += on * flame * (0.3 * exp(-dot(d, d) * 0.55) + 0.06 * exp(-length(d) * 0.7)) * flick;\n if (abs(d.x) < 0.8 && abs(d.y) < 1.0) {\n float w = profile(d.y, 0.09);\n float m = smoothstep(0.0, 0.003 / sz * steep(d.y, 0.09), w - abs(d.x));\n vec4 s = paper(d, w, 1.0, 0.09, flick);\n s.rgb = mix(s.rgb, (0.75 * s.rgb * vec3(0.8, 0.85, 1.0) + vec3(0.03, 0.03, 0.06) * s.a), 1.0 - z);\n c = s * m + c * (1.0 - s.a * m);\n }\n }\n\n float k = smoothstep(0.01, 0.3, p);\n float up = smoothstep(0.2, 0.92, p);\n float S = mix(0.5, 0.15 * side, smoothstep(0.0, 0.6, p));\n float lip = max(0.09 * k, 1e-3);\n vec2 pos = vec2(0.26 * ratio * smoothstep(0.08, 0.55, p) + 0.03 * side * sin(p * 8.0) * k, 1.0 * up * up + 0.1 * up - 0.03 * k * (1.0 - up));\n vec2 d = q - pos;\n float sw = 0.08 * sin(p * 9.0) * k;\n d = vec2(d.x + sw * d.y, d.y - sw * d.x) / S;\n float flick = 0.94 + 0.06 * sin(p * 50.0);\n float w = mix(ratio, profile(d.y, lip), k);\n \n float slack = 0.004 / S * (1.0 - k) + 0.03 * (1.0 - smoothstep(0.0, 0.05, p));\n float m = smoothstep(0.0, 0.004 / S * mix(1.0, steep(d.y, lip), k), w + slack - abs(d.x)) * smoothstep(0.0, 0.004 / S, 1.0 + slack - abs(d.y));\n halo += k * flame * (0.5 * exp(-dot(d, d) * 0.5) + 0.12 * exp(-length(d) * 0.6)) * flick;\n c.rgb += glow * night * 0.55 * halo * (0.35 * c.a + c.rgb);\n vec4 s = paper(d, w, k, lip, flick);\n \n c = s * m + c * (1.0 - m * mix(1.0, s.a, k));\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","SlashSplit":"// SlashSplit — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SlashSplit.glsl\n// Author: gre\n// License: MIT\n// Description: A bright blade stroke slashes diagonally across the outgoing image with a flash, then the two cut halves slip along the cut in opposite directions and fly off the frame, casting soft shadows on the incoming image beneath\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 separation; \n\nuniform vec4 flash; \n\nuniform vec4 shadow; \n\nconst float CUT = 0.18;\nconst float EDGE = 0.0015;\nconst vec2 SHADOW_OFFSET = vec2(0.015, -0.022);\nconst float SHADOW_BLUR = 0.035;\n\nfloat boxDistance (vec2 q) {\n vec2 d = abs(q) - 0.5 * vec2(ratio, 1.0);\n return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);\n}\n\nvec3 piece (vec2 q, vec2 v, vec2 n, float s) {\n vec2 y = q - v;\n return vec3(y, max(boxDistance(y), -s * dot(y, n)) - 0.5 * EDGE);\n}\n\nvec4 transition (vec2 uv) {\n float p = progress;\n float a = radians(angle);\n vec2 T = vec2(cos(a), sin(a));\n vec2 N = vec2(-T.y, T.x);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float d = dot(q, N);\n float along = dot(q, T);\n\n float t = clamp((p - 0.8 * CUT) / (1.0 - 0.8 * CUT), 0.0, 1.0);\n float open = separation * (1.0 - pow(1.0 - t, 3.0));\n float margin = length(SHADOW_OFFSET) + SHADOW_BLUR + 2.0 * EDGE;\n float exitX = (ratio + separation + margin) / max(abs(T.x), 1e-3);\n float exitY = (1.0 + separation + margin) / max(abs(T.y), 1e-3);\n float slide = min(exitX, exitY) * t * t * (1.5 - 0.5 * t);\n vec2 vUp = T * slide + N * open;\n\n vec4 to = getToColor(uv);\n vec2 sq = q - SHADOW_OFFSET;\n float sdUp = piece(sq, vUp, N, 1.0).z;\n float sdDown = piece(sq, -vUp, N, -1.0).z;\n float sh = shadow.a * smoothstep(0.0, 0.1, t) * (1.0 - smoothstep(-0.5 * SHADOW_BLUR, SHADOW_BLUR, min(sdUp, sdDown)));\n vec4 c = vec4(mix(to.rgb, shadow.rgb, sh), to.a);\n\n float reach = 0.5 * length(vec2(ratio, 1.0)) + 0.1;\n float k = clamp(p / CUT, 0.0, 1.0);\n float head = mix(-reach, reach, 1.0 - (1.0 - k) * (1.0 - k));\n float behind = head - along;\n float drawn = clamp(0.5 + behind / EDGE, 0.0, 1.0);\n\n float rim = flash.a * smoothstep(0.0, CUT, p) * (1.0 - 0.6 * t) * drawn;\n for (int i = 0; i < 2; i++) {\n float s = i == 0 ? 1.0 : -1.0;\n vec3 h = piece(q, s * vUp, N, s);\n float cover = clamp(0.5 - h.z / EDGE, 0.0, 1.0);\n vec4 col = getFromColor(clamp(h.xy / vec2(ratio, 1.0) + 0.5, 0.0, 1.0));\n float e = max(s * dot(h.xy, N), 0.0);\n col.rgb = mix(col.rgb, flash.rgb, rim * exp(-e / 0.004) * col.a);\n c = mix(c, col, cover);\n }\n\n float tail = drawn * (0.35 + 0.65 * exp(-max(behind, 0.0) * 4.0));\n float env = smoothstep(0.0, 0.03, p) * (1.0 - smoothstep(CUT, CUT + 0.12, p));\n float core = exp(-abs(d) / 0.0025) + 0.35 * exp(-abs(d) / 0.02);\n float spark = exp(-length(vec2(behind, d)) / 0.03) * (1.0 - k);\n float glow = flash.a * env * (core * tail + spark);\n float burst = flash.a * 0.25 * smoothstep(0.6 * CUT, CUT, p) * (1.0 - smoothstep(CUT, CUT + 0.15, p));\n c.rgb = mix(c.rgb, flash.rgb, burst * c.a);\n c.rgb += flash.rgb * glow * c.a;\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","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","SlideProjector":"// SlideProjector — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SlideProjector.glsl\n// Author: gre\n// License: MIT\n// Description: A slide projector changes slides: the outgoing picture is jerked up out of the frame, blurring as it leaves the focal plane, the bare lamp flickers on the screen for an instant, then the incoming picture drops in from the top, bounces and hunts for focus before 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 bounce; \n\nuniform float defocus; \n\nuniform float flicker; \n\nuniform vec4 lampColor; \n\nconst float PI = 3.14159265;\nconst float MOUNT = 0.07;\nconst float CLEAR = 1.0 + MOUNT;\nconst int TAPS = 16;\n\nfloat hash(float n) {\n vec3 p3 = fract(vec3(n) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat liftOut(float p) {\n float u = clamp((p - 0.05) / 0.3, 0.0, 1.0);\n float d = clamp(p / 0.12, 0.0, 1.0);\n float s = sin(PI * d);\n return CLEAR * u * u * (0.6 + 0.4 * u) - (0.004 + 0.012 * bounce) * s * s;\n}\n\nfloat dropIn(float p) {\n float v = clamp((p - 0.37) / 0.19, 0.0, 1.0);\n float y = CLEAR * (1.0 - v * v);\n float w = clamp((p - 0.56) / 0.22, 0.0, 1.0);\n float h = 0.06 * bounce;\n \n float s1 = clamp(w / 0.72, 0.0, 1.0);\n float s2 = clamp((w - 0.72) / 0.28, 0.0, 1.0);\n return y + h * 4.0 * s1 * (1.0 - s1) + h * 0.15 * 4.0 * s2 * (1.0 - s2);\n}\n\nfloat blurAmount(float p) {\n float s = clamp((p - 0.56) / 0.4, 0.0, 1.0);\n float k = 1.0 - s;\n float hunt = abs(cos(s * PI * 1.5)) * k;\n return smoothstep(0.04, 0.3, p) * (p < 0.56 ? 1.0 : hunt);\n}\n\nfloat band(float y, float a, float b, float aa) {\n return clamp((min(y - a, b - y)) / aa + 0.5, 0.0, 1.0);\n}\n\nvec4 gate(vec2 q, float yf, float yt, float light, float shade) {\n \n float af = 0.0015 * min(abs(yf) * 400.0, 1.0) + 1e-6;\n float at = 0.0015 * min(abs(yt) * 400.0, 1.0) + 1e-6;\n vec4 c = vec4(lampColor.rgb * lampColor.a * light, lampColor.a);\n float mf = band(q.y, yf - MOUNT, yf + 1.0 + MOUNT, af);\n float mt = band(q.y, yt - MOUNT, yt + 1.0 + MOUNT, at);\n c.rgb *= 1.0 - 0.96 * max(mf, mt);\n float pf = band(q.y, yf, yf + 1.0, af);\n if (pf > 0.0) {\n vec4 t = getFromColor(vec2(q.x, q.y - yf));\n c = mix(c, vec4(t.rgb * t.a * shade, t.a), pf);\n }\n float pt = band(q.y, yt, yt + 1.0, at);\n if (pt > 0.0) {\n vec4 t = getToColor(vec2(q.x, q.y - yt));\n c = mix(c, vec4(t.rgb * t.a * shade, t.a), pt);\n }\n return c;\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n\n float yf = liftOut(p);\n float yt = dropIn(p);\n \n float dp = 0.004;\n float vf = (liftOut(p + dp) - liftOut(p - dp)) / (2.0 * dp);\n float vt = (dropIn(p + dp) - dropIn(p - dp)) / (2.0 * dp);\n float smear = min(max(abs(vf), abs(vt)) * 0.012, 0.07);\n\n float b = blurAmount(p);\n float radius = defocus * 0.02 * b;\n float zoom = 1.0 + 0.025 * defocus * b;\n vec2 c0 = (uv - 0.5) / zoom + 0.5;\n\n float env = smoothstep(0.0, 0.12, p) * (1.0 - smoothstep(0.72, 1.0, p));\n float fc = p * 30.0;\n float fl = mix(hash(floor(fc)), hash(floor(fc) + 1.0), smoothstep(0.3, 0.7, fract(fc)));\n vec2 d = (uv - 0.5) * vec2(ratio, 1.0) / (0.5 * sqrt(ratio * ratio + 1.0));\n float light = (1.0 - 0.3 * dot(d, d)) * (1.0 - 0.3 * flicker * fl * env);\n float shade = mix(1.0, 0.92 * light, env);\n\n vec4 c;\n if (radius + smear < 1e-4) {\n c = gate(c0, yf, yt, light, shade);\n return c.a > 0.0 ? vec4(c.rgb / c.a, c.a) : vec4(0.0);\n }\n c = vec4(0.0);\n for (int i = 0; i < TAPS; i++) {\n float fi = float(i);\n float a = fi * 2.39996;\n vec2 o = sqrt((fi + 0.5) / float(TAPS)) * vec2(cos(a) / ratio, sin(a)) * radius;\n o.y += ((fi + 0.5) / float(TAPS) - 0.5) * smear;\n \n vec2 q = 1.0 - abs(1.0 - abs(c0 + o));\n c += gate(q, yf, yt, light, shade);\n }\n c /= float(TAPS);\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","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","SlitStretch":"// SlitStretch — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SlitStretch.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a sheet cut with rows of staggered slits that is pulled from both ends: it lengthens, the slits open into diamonds and the strands between them twist and thin out like expanded metal until only the incoming image is left behind\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 float stretch; \n\nuniform float shading; \n\nuniform float neck; \n\nuniform int horizontal; \n\nvec4 transition(vec2 uv) {\n float t = progress;\n float q = t * t * (3.0 - 2.0 * t);\n if (q <= 0.0) return getFromColor(uv);\n vec2 asp = vec2(ratio, 1.0);\n \n vec2 p = (uv - 0.5) * asp;\n if ((horizontal != 0)) p = p.yx;\n float Sy = 1.0 + stretch * q;\n \n float ys = clamp(p.y / (Sy * ((horizontal != 0) ? ratio : 1.0)), -0.5, 0.5);\n float hw = 0.5 * ((horizontal != 0) ? 1.0 : ratio);\n float wf = 1.0 - 0.7 * neck * q * (1.0 - 4.0 * ys * ys);\n \n float side = (hw * wf - abs(p.x)) / (0.003 * min(1.0, 200.0 * q) + 1e-7);\n p.x /= wf;\n float a = 0.5 * size;\n float b = 0.22 * size * Sy;\n float j = floor(p.y / b + 0.5);\n float xo = mod(j, 2.0) * a;\n float i = floor((p.x - xo) / (2.0 * a) + 0.5);\n vec2 c = vec2(i * 2.0 * a + xo, j * b);\n vec2 d = p - c;\n \n vec2 d2 = p - vec2(c.x + (p.x > c.x ? a : -a), c.y + (p.y > c.y ? b : -b));\n if (abs(d2.x) / a + abs(d2.y) / b < abs(d.x) / a + abs(d.y) / b) d = d2;\n\n \n \n float grow = 1.0 + 0.12 * q;\n float A = max(a * mix(0.72, 1.0, q) * grow, 1e-4);\n float H = max(b * sqrt(q) * grow, 1e-5);\n float f = abs(d.x) / A + abs(d.y) / H - 1.0;\n float dist = f / sqrt(1.0 / (A * A) + 1.0 / (H * H));\n float e = 0.004;\n \n float hole = max(smoothstep(0.0, e, e * q * q * q * q - dist), clamp(0.5 - side, 0.0, 1.0));\n\n vec4 img = vec4(0.0);\n if (hole < 1.0) {\n vec2 sp = vec2(p.x, p.y / Sy);\n if ((horizontal != 0)) sp = sp.yx;\n img = getFromColor(clamp(sp / asp + 0.5, 0.0, 1.0));\n float facet = clamp(d.x * d.y / (0.25 * a * b + 1e-6), -1.0, 1.0);\n float rim = clamp(1.0 - dist / (0.25 * b + 1e-5), 0.0, 1.0);\n img.rgb *= 1.0 + shading * q * (0.35 * facet - 0.25 * rim);\n if (hole <= 0.0) return img;\n }\n vec4 bg = getToColor(uv);\n \n float sh = (1.0 - smoothstep(0.0, 0.25 * b + e, -dist)) * clamp(0.5 + side, 0.0, 1.0);\n bg.rgb *= 1.0 - 0.45 * shading * sh * (1.0 - q);\n return mix(img, bg, hole);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SlitThread":"// SlitThread — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SlitThread.glsl\n// Author: gre\n// License: MIT\n// Description: A slit is cut across the middle of the outgoing image and the incoming image is pulled down through it from behind, bulging the old picture above the slit, then swings back up in front of it to 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 sheet; \n\nuniform float depth; \n\nconst vec2 LIGHT = vec2(-0.6, 0.8);\n\nvec2 rectE(vec2 q, vec2 lo, vec2 hi, vec2 box) {\n return max(lo - q, q - hi) * box;\n}\n\nfloat rectD(vec2 q, vec2 lo, vec2 hi, vec2 box) {\n vec2 e = rectE(q, lo, hi, box);\n return max(e.x, e.y);\n}\n\nfloat bump(vec2 q, vec2 lo, vec2 hi, vec2 box, float y0) {\n vec2 e = rectE(q, lo, hi, box) + 0.1;\n float d = length(max(e, 0.0)) + min(max(e.x, e.y), 0.0) - 0.1;\n return (1.0 - smoothstep(-0.12, 0.05, d)) * smoothstep(y0, y0 + 0.1, q.y);\n}\n\nvec4 transition(vec2 uv) {\n vec2 box = vec2(ratio, 1.0);\n float px = 1.0 / 200.0;\n float t = progress;\n float k = clamp(depth, 0.0, 1.0);\n float s0 = clamp(sheet, 0.5, 0.95);\n float y0 = 0.5;\n\n \n float yStart = y0 + 0.012;\n \n float yTurn = y0 - 0.004 - 1.5 * px - s0;\n float t0 = 0.06;\n float tTurn = t0 + (1.0 - t0) / (1.0 + sqrt(max(-yTurn, 0.0) / (yStart - yTurn)));\n float down = smoothstep(t0, tTurn, t);\n float rise = smoothstep(tTurn, 1.0, t);\n float s = mix(s0, 1.0, rise);\n float yb = mix(mix(yStart, yTurn, down), 0.0, rise);\n vec2 lo = vec2(0.5 - 0.5 * s, yb), hi = vec2(0.5 + 0.5 * s, yb + s);\n float through = step(tTurn, t);\n float threading = smoothstep(t0, t0 + 0.12, t) * (1.0 - smoothstep(tTurn - 0.1, tTurn, t));\n float enter = smoothstep(t0, t0 + 0.15, t);\n float hidden = (1.0 - through) * enter;\n\n float cut = smoothstep(0.0, 0.12, t);\n float halfL = (0.5 * s0 + 0.035) * cut;\n float along = clamp(abs(uv.x - 0.5) / max(halfL, 1e-4), 0.0, 1.0);\n float onSlit = (1.0 - smoothstep(halfL - px, halfL, abs(uv.x - 0.5))) * cut;\n float gap = (0.004 + 0.007 * threading * (1.0 - along * along)) * cut;\n float dy = uv.y - y0;\n\n vec2 grad = vec2(0.0);\n if (hidden * k > 0.0) {\n vec2 e = vec2(0.01, 0.0);\n float bx = bump(uv + e.xy, lo, hi, box, y0) - bump(uv - e.xy, lo, hi, box, y0);\n float by = bump(uv + e.yx, lo, hi, box, y0) - bump(uv - e.yx, lo, hi, box, y0);\n grad = vec2(bx, by) * hidden * k;\n }\n vec4 c = getFromColor(uv - 0.01 * grad);\n c.rgb *= 1.0 - 1.2 * dot(grad, LIGHT);\n\n c.rgb *= 1.0 - onSlit * 0.85 * (1.0 - smoothstep(gap - 0.5 * px, gap + 0.5 * px, abs(dy)));\n float lipLit = onSlit * smoothstep(gap - 0.5 * px, gap + 0.5 * px, -dy) * (1.0 - smoothstep(gap, gap + 0.012, -dy));\n c.rgb += 0.12 * lipLit;\n\n float below = 1.0 - smoothstep(-0.5 * px, 0.5 * px, uv.y - (y0 - gap));\n float front = mix(below, 1.0, through);\n float lift = mix(1.0, 0.6, rise);\n float sh = rectD(uv - vec2(0.008, -0.014) * lift, lo, hi, box);\n float shadowFront = mix(below, 1.0, smoothstep(tTurn, tTurn + 0.08, t));\n c.rgb *= 1.0 - 0.45 * k * shadowFront * (1.0 - smoothstep(-0.02, 0.025, sh)) * (1.0 - rise * rise) * enter;\n\n float d = rectD(uv, lo, hi, box);\n \n float aa = px * (1.0 - rise) + 1e-4;\n float cov = (1.0 - smoothstep(-aa, aa, d - 0.004 * rise)) * front;\n vec4 to = getToColor(clamp((uv - lo) / s, 0.0, 1.0));\n float lip = (y0 - gap - uv.y) / px;\n float lipShade = threading * step(0.0, lip);\n to.rgb *= 1.0 - 0.5 * k * lipShade * exp(-lip / 5.0);\n to.rgb *= 1.0 - 0.12 * k * smoothstep(-0.01, 0.0, d) * (1.0 - rise);\n return mix(c, to, cov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SlotReels":"// SlotReels — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SlotReels.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is cut into vertical reels that spin downward like drums, motion-blurred with speed, carrying the outgoing image then the incoming one, and stop one after another from left to right with a small mechanical bounce\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 reels; \n\nuniform float blur; \n\nuniform float stagger; \n\nuniform float bounce; \n\nuniform vec4 separator; \n\nconst float PI = 3.141592653589793;\n\nconst float ARC = 1.15;\nconst float SETTLE = 0.1;\nconst float LINE = 0.006;\nconst float EDGE = 0.0015;\n\nfloat stopTime(float i, float n) {\n float order = n > 1.0 ? i / (n - 1.0) : 1.0;\n return (1.0 - SETTLE) * (1.0 - clamp(stagger, 0.0, 0.9) * (1.0 - order));\n}\n\nfloat reelOffset(float t, float stopT, float turns) {\n float amp = 0.07 * bounce;\n \n float v1 = amp * PI * stopT / (turns * SETTLE);\n float u = clamp(t / stopT, 0.0, 1.0);\n float g = u * u * (3.0 - 2.0 * u) + v1 * (u * u * u - u * u);\n float b = clamp((t - stopT) / SETTLE, 0.0, 1.0);\n return turns * g + amp * sin(PI * b) * (1.0 - b) * (1.0 - b);\n}\n\nfloat reelSpeed(float t, float stopT, float turns) {\n float amp = 0.07 * bounce;\n float v1 = amp * PI * stopT / (turns * SETTLE);\n if (t < stopT) {\n float u = max(t / stopT, 0.0);\n return turns * (6.0 * u * (1.0 - u) + v1 * u * (3.0 * u - 2.0)) / stopT;\n }\n float b = min((t - stopT) / SETTLE, 1.0);\n return amp * (1.0 - b) * (PI * cos(PI * b) * (1.0 - b) - 2.0 * sin(PI * b)) / SETTLE;\n}\n\nvec4 transition (vec2 uv) {\n float n = max(float(reels), 1.0);\n float i = min(floor(uv.x * n), n - 1.0);\n float lx = uv.x * n - i;\n float stopT = stopTime(i, n);\n \n float turns = 2.0 * floor(stopT * 4.0) + 1.0;\n\n float drum = smoothstep(0.0, 0.12, progress) * (1.0 - smoothstep(stopT, stopT + SETTLE, progress));\n float y = 2.0 * uv.y - 1.0;\n \n float theta = asin(clamp(y * sin(ARC), -1.0, 1.0));\n float v = mix(uv.y, 0.5 + theta / (2.0 * ARC), drum);\n float depth = (1.0 - cos(theta)) * drum;\n float px = 0.5 + (lx - 0.5) * (1.0 + 0.2 * depth);\n\n \n float off = reelOffset(progress, stopT, turns) - turns;\n float speed = abs(reelSpeed(progress, stopT, turns));\n float spread = blur * min(speed * 0.02, 0.22) * drum;\n\n vec4 c = vec4(0.0);\n float wsum = 0.0;\n for (int k = 0; k < 8; k++) {\n float f = float(k) / 7.0 - 0.5;\n float w = 1.0 - abs(f);\n float vv = v + off + spread * f;\n float seg = floor(vv);\n vec2 q = vec2((i + clamp(px, 0.0, 1.0)) / n, vv - seg);\n vec4 s = mod(seg, 2.0) < 0.5 ? getToColor(q) : getFromColor(q);\n \n s.rgb *= 1.0 - 0.6 * drum * (1.0 - y * y) * (1.0 - smoothstep(0.0, 0.02, min(q.y, 1.0 - q.y)));\n c += w * s;\n wsum += w;\n if (spread < 1e-4) break;\n }\n c /= wsum;\n\n float facing = cos(theta);\n c.rgb *= mix(1.0, 0.25 + 0.75 * facing * facing, drum);\n c.rgb += drum * 0.07 * c.a * exp(-12.0 * (y - 0.3) * (y - 0.3));\n\n float env = smoothstep(0.0, 0.1, progress) * (1.0 - smoothstep(0.9, 1.0, progress));\n float reelW = ratio / n;\n float persp = reelW / (1.0 + 0.2 * depth);\n float dSide = min(px, 1.0 - px) * persp;\n float dInner = min(i > 0.5 ? px : 2.0, i < n - 1.5 ? 1.0 - px : 2.0) * persp;\n float line = 1.0 - smoothstep(0.5 * LINE - EDGE, 0.5 * LINE + EDGE, dInner);\n float outside = 1.0 - smoothstep(-EDGE, 0.0, dSide);\n c.rgb *= 1.0 - 0.35 * env * (1.0 - smoothstep(0.0, 0.03 * reelW + LINE, dInner));\n return mix(c, separator, max(line * env, outside));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 if (body <= 0.0) return m < 0.5 ? getFromColor(uv) : getToColor(uv);\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 float wisp = vnoise(w * 3.3 - 2.0 * churn) - 0.5;\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 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 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\n vec2 g = max(vec2(grid), 1.0);\n vec2 cell = min(floor(vec2(uv.x, 1.0 - uv.y) * g), g - 1.0);\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 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","Snap":"// Snap — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Snap.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image spans the frame like a plank held at its sides: it sags in the middle under its own weight, a jagged crack runs up from the bottom, and the two halves snap apart, swing down around their outer top corners and drop out of the frame, revealing the incoming image under their 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 float sag; \n\nuniform float jaggedness; \n\nuniform vec4 shadow; \n\nconst float PI = 3.141592653589793;\nconst float BREAK = 0.34;\nconst float AA = 0.002;\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 jag(float y, float freq, float seed) {\n float k = y * freq;\n return mix(hash(floor(k) + seed), hash(floor(k) + seed + 1.0), fract(k)) - 0.5;\n}\n\nfloat crackX(float y) {\n return 0.5 * ratio + jaggedness * (jag(y, 7.0, 3.0) + 0.4 * jag(y, 23.0, 41.0));\n}\n\nvec2 toPiece(vec2 p, mat2 rot, float fall, float bend) {\n vec2 q = rot * (p + vec2(0.0, fall - 1.0)) + vec2(0.0, 1.0);\n q.y += bend * sin(PI * clamp(q.x / ratio, 0.0, 1.0));\n return q;\n}\n\nfloat toCrack(vec2 q, float side) {\n float c = crackX(q.y);\n return (side > 0.0 ? ratio - c : c) - q.x;\n}\n\nfloat cover(vec2 q, float e, float w) {\n vec2 d = min(q, vec2(ratio, 1.0) - q);\n return clamp(min(min(d.x, d.y), e) / w + 1.0, 0.0, 1.0);\n}\n\nvec4 shade(vec2 q, float e, float side, float sa, float front, float t) {\n vec4 col = getFromColor(vec2(side > 0.0 ? 1.0 - q.x / ratio : q.x / ratio, q.y));\n float crack = (1.0 - smoothstep(0.0, 0.005, e)) * (1.0 - smoothstep(front - 0.05, front, q.y));\n col.rgb *= (1.0 - 0.75 * crack * (1.0 - smoothstep(0.0, 0.08, t))) * (1.0 - 0.3 * sa * smoothstep(0.0, 0.5 * ratio, q.x));\n return col;\n}\n\nvec4 transition(vec2 uv) {\n vec2 p = vec2(uv.x * ratio, uv.y);\n vec2 m = vec2(ratio - p.x, p.y);\n float load = smoothstep(0.0, BREAK, progress);\n float t = clamp((progress - BREAK) / (1.0 - BREAK), 0.0, 1.0);\n float bend = sag * load * (1.0 - smoothstep(0.0, 0.3, t));\n float front = 1.12 * smoothstep(0.12, BREAK, progress) - 0.06;\n float a = 1.1 * t * (0.6 + 0.4 * t);\n float d = max(t - 0.25, 0.0) / 0.75;\n float fall = 1.1 * d * d;\n float ca = cos(a), sa = sin(a);\n mat2 rot = mat2(ca, sa, -sa, ca);\n\n vec2 ql = toPiece(p, rot, fall, bend);\n vec2 qr = toPiece(m, rot, fall, bend);\n float el = toCrack(ql, -1.0);\n float er = toCrack(qr, 1.0);\n float cl = cover(ql, el, AA);\n float cr = cover(qr, er, AA);\n\n float lift = 0.3 * load + 0.7 * smoothstep(0.0, 0.4, t);\n vec2 o = vec2(0.015, -0.03) * lift;\n float soft = 0.004 + 0.05 * lift;\n vec2 sl = toPiece(p - o, rot, fall, bend);\n vec2 sr = toPiece(m - vec2(-o.x, o.y), rot, fall, bend);\n float sh = shadow.a * lift * max(cover(sl, toCrack(sl, -1.0), soft), cover(sr, toCrack(sr, 1.0), soft));\n\n vec4 to = getToColor(uv);\n float alpha = sh + to.a * (1.0 - sh);\n to = vec4((shadow.rgb * sh + to.rgb * to.a * (1.0 - sh)) / max(alpha, 1e-5), alpha);\n vec4 col = mix(to, shade(ql, el, -1.0, sa, front, t), cl);\n return mix(col, shade(qr, er, 1.0, sa, front, t), cr);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 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 float bound = (abs(sin(tilt)) * halfCard.x + abs(cos(tilt)) * halfCard.y) * (1.0 - SHRINK);\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 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 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","Snowflake":"// Snowflake — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Snowflake.glsl\n// Author: gre\n// License: MIT\n// Description: A six-armed paper snowflake is cut out of the outgoing picture: the rest of the sheet drops away around it, its punched holes fall out, and the snowflake, still made of the picture, hangs by a thin tab from the top edge, swings and turns, then tears loose and falls, revealing the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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\nconst float PI = 3.141592653589793;\nconst vec2 SHADOW = vec2(0.016, -0.028);\nconst vec3 PAPER = vec3(0.94, 0.93, 0.9);\n\nfloat aa(float d) { return clamp(d * 400.0 + 1.0, 0.0, 1.0); }\nfloat frameDist(vec2 S) { vec2 d = min(S, vec2(ratio, 1.0) - S); return min(d.x, d.y); }\nfloat drop(float t) { t = clamp(t, 0.0, 1.0); return t * t; }\nmat2 rot(float a) { float c = cos(a), s = sin(a); return mat2(c, -s, s, c); }\n\nfloat segment(vec2 p, vec2 a, vec2 b) {\n vec2 pa = p - a, ba = b - a;\n return length(pa - ba * clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0));\n}\n\nfloat armAngle(vec2 v) { return mod(atan(v.x, v.y + 1e-6) + PI / 6.0, PI / 3.0) - PI / 6.0; }\n\nvec2 fold6(vec2 v) {\n float a = abs(armAngle(v));\n return length(v) * vec2(cos(a), sin(a));\n}\n\nfloat flakeShape(vec2 v) {\n vec2 q = fold6(v);\n float d = length(q) - 0.38;\n d = min(d, max(abs(q.y) - 0.12 + 0.05 * q.x, q.x - 0.9));\n d = min(d, segment(q, vec2(0.46, 0.0), vec2(0.61, 0.25)) - 0.072);\n d = min(d, segment(q, vec2(0.7, 0.0), vec2(0.79, 0.15)) - 0.058);\n d = min(d, length(q - vec2(0.9, 0.0)) - 0.095);\n return d;\n}\n\nfloat holes(vec2 v) {\n vec2 q = fold6(v);\n float h = min(length(q - vec2(0.24, 0.0)) - 0.05, length(q - vec2(0.24, 0.14)) - 0.035);\n return min(h, length(q) - 0.07);\n}\n\nfloat flake(vec2 S, vec2 c, float sc) {\n float tab = max(abs(S.x - c.x) - 0.02 * sc, max(c.y + 0.9 * sc - S.y, S.y - 1.0));\n return min(flakeShape((S - c) / sc) * sc, tab);\n}\n\nvec2 hang(vec2 Q, vec2 tab, float ang, float squeeze) {\n vec2 d = rot(ang) * (Q - tab);\n return tab + vec2(d.x / squeeze, d.y);\n}\n\nvec2 sheet(vec2 Q, float t) {\n return rot(0.15 * t) * (Q + vec2(0.0, 2.6 * t - 1.0)) + vec2(0.0, 1.0);\n}\n\nfloat cutSweep(vec2 v, float t) { return step(fract(atan(v.x, v.y + 1e-6) * 0.5 / PI + 1.0), t); }\n\nvec4 transition(vec2 uv) {\n float p = progress, R = ratio;\n vec2 Q = vec2(uv.x * R, uv.y);\n float sc = size * min(1.0, R * 1.1);\n vec2 c = vec2(0.5 * R, 0.97 - 0.9 * sc);\n vec2 tab = vec2(c.x, 1.0);\n\n float cutT = 1.2 * smoothstep(0.0, 0.13, p) - 0.1;\n float cutA = smoothstep(0.0, 0.05, p) * (1.0 - smoothstep(0.75, 0.95, p));\n float wasteT = drop((p - 0.13) / 0.34);\n float holeT = drop((p - 0.26) / 0.3);\n float s = clamp((p - 0.36) / 0.64, 0.0, 1.0);\n float fall = drop((p - 0.7) / 0.3);\n float ang = 0.3 * sin(s * 10.0) * exp(-3.5 * s) * smoothstep(0.0, 0.12, s) + 0.6 * fall;\n float turn = 0.5 * sin(s * 7.0 + 0.6) * exp(-2.5 * s) * smoothstep(0.0, 0.15, s) + 1.1 * fall;\n float squeeze = cos(turn);\n float lift = smoothstep(0.08, 0.3, p);\n vec2 drop2 = vec2(0.0, 2.2 * fall);\n\n vec4 col = getToColor(uv);\n vec2 Ssh = hang(Q - SHADOW + drop2, tab, ang, squeeze);\n float fsh = max(flake(Ssh, c, sc), -holes((Ssh - c) / sc) * sc);\n col.rgb *= 1.0 - 0.4 * lift * smoothstep(0.02, -0.02, fsh);\n\n vec2 W = sheet(Q, wasteT);\n vec2 Wsh = sheet(Q - SHADOW, wasteT);\n col.rgb *= 1.0 - 0.35 * smoothstep(0.0, 0.1, wasteT) * smoothstep(-0.03, 0.03, min(frameDist(Wsh), flake(Wsh, c, sc)));\n float f = flake(W, c, sc);\n vec4 a = getFromColor(clamp(vec2(W.x / R, W.y), 0.0, 1.0));\n a.rgb *= 1.0 - 0.45 * cutA * smoothstep(0.004, 0.0, f) * cutSweep(W - c, cutT);\n col = mix(col, a, aa(f) * aa(frameDist(W)));\n\n vec2 H = Q + vec2(0.0, 2.6 * holeT);\n float h = holes((H - c) / sc) * sc;\n a = getFromColor(clamp(vec2(H.x / R, H.y), 0.0, 1.0));\n a.rgb *= 1.0 - 0.45 * cutA * smoothstep(0.004, 0.0, -h);\n col = mix(col, a, aa(-h));\n\n vec2 S = hang(Q + drop2, tab, ang, squeeze);\n vec2 v = (S - c) / sc;\n f = flake(S, c, sc);\n h = holes(v) * sc;\n float edge = min(-f, h);\n a = getFromColor(clamp(vec2(S.x / R, S.y), 0.0, 1.0));\n \n float aA = armAngle(v);\n float crease = sign(aA) * smoothstep(0.0, 0.02, abs(aA) * length(v)) * smoothstep(0.0, 0.02, (PI / 6.0 - abs(aA)) * length(v));\n a.rgb *= 1.0 + lift * (0.04 * crease - 0.12 * abs(sin(turn)));\n a.rgb = mix(a.rgb, PAPER, 0.65 * lift * (1.0 - smoothstep(0.0, 0.0035, edge)));\n a.rgb *= 1.0 - 0.45 * cutA * (1.0 - lift) * smoothstep(0.004, 0.0, edge) * max(cutSweep(v, cutT), step(h, 0.01));\n col = mix(col, a, aa(-f) * aa(h) * aa(frameDist(S)));\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","Soak":"// Soak — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Soak.glsl\n// Author: gre\n// License: MIT\n// Description: A drop of water lands on the outgoing image as if it were a sheet of paper: a wet stain with a dark tide line spreads from it, the soaked paper turns see-through and cockles, sags into a bowl under its weight, then tears out in the middle and drops away, and the ragged hole follows the stain out to the edges onto 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 seeThrough; \n\nuniform float sag; \n\nconst float TEAR = 0.3;\nconst float F = 1.6;\n\nfloat hash(vec2 p) {\n vec3 q = fract(p.xyx * 0.1031);\n q += dot(q, q.yzx + 33.33);\n return fract((q.x + q.y) * q.z);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p), f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x), mix(hash(i + vec2(0.0, 1.0)), hash(i + 1.0), f.x), f.y);\n}\n\nfloat ease(float x) {\n x = clamp(x, 0.0, 1.0);\n return x * x * (3.0 - 2.0 * x);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat bowl(float r, float rr) {\n float s = min(r / rr, 1.0);\n return (1.0 - s * s) * (1.0 - s * s);\n}\n\nvec4 transition(vec2 uv) {\n vec2 R = vec2(ratio, 1.0);\n vec2 c = center * R;\n vec2 P = uv * R;\n float far = length(max(c, R - c));\n float p = progress;\n\n vec2 d = P - c;\n float r = length(d);\n vec2 dir = r > 1e-5 ? d / r : vec2(1.0, 0.0);\n \n float ragW = 1.0 + 0.35 * (noise(dir * 2.2 + 3.1) - 0.5) + 0.12 * (noise(dir * 7.0 + 9.0) - 0.5);\n float ragH = 1.0 + 0.3 * (noise(dir * 2.6 + 5.7) - 0.5) + 0.12 * (noise(dir * 6.0 + 1.3) - 0.5);\n\n float stain = 1.35 * far * ease(p / 0.7);\n float rw = stain * ragW;\n float th = clamp((p - TEAR) / (1.0 - TEAR), 0.0, 1.0);\n float rh = 1.3 * far * pow(th, 1.3) * ragH;\n\n float rr = max(0.8 * stain, 1e-3);\n \n float depth = sag * 0.6 * min(rr, 0.5) * ease(p / TEAR) * (1.0 - ease(th / 0.15));\n float droop = sag * 0.3 * ease(th / 0.06) * (1.0 - ease(th / 0.9)) * exp(-max(r - rh, 0.0) / 0.06);\n vec2 S = P;\n for (int i = 0; i < 3; i++) {\n S = c + d * (F + depth * bowl(length(S - c), rr) + droop) / F;\n }\n \n float outside = clamp((r - rh) * 300.0 + 1.0, 0.0, 1.0);\n float s = min(r / rr, 1.0);\n float z = depth * (1.0 - s * s) * (1.0 - s * s) + droop;\n float slope = 4.0 * depth * s * (1.0 - s * s) / rr + droop / 0.06 * outside;\n\n vec4 from = getFromColor(mirror(S / R));\n vec4 to = getToColor(uv);\n float wetEdge = rw - length(S - c);\n float wet = clamp(wetEdge * 300.0, 0.0, 1.0);\n float soak = smoothstep(0.0, 0.2, wetEdge);\n vec2 n = S * 14.0;\n float n0 = noise(n);\n float cockle = ((noise(n - vec2(0.3, 0.0)) - n0) - (noise(n - vec2(0.0, 0.3)) - n0)) * 0.7 * soak;\n vec3 paper = from.rgb * (1.0 - 0.18 * wet - 0.1 * soak + cockle);\n paper = mix(paper, to.rgb * 0.85, seeThrough * soak);\n float tide = wetEdge / 0.012;\n paper *= 1.0 - 0.3 * exp(-tide * tide) * wet;\n paper *= clamp(1.0 - 0.8 * z + 0.35 * slope * dot(dir, vec2(-0.6, 0.8)), 0.3, 1.15);\n float rim = (1.0 - smoothstep(0.0, 0.012, r - rh)) * outside * ease(th / 0.02);\n paper = mix(paper, vec3(0.93, 0.91, 0.86), 0.75 * rim);\n vec4 sheet = vec4(paper, mix(from.a, to.a, seeThrough * soak));\n\n float fall = clamp((p - TEAR) / 0.35, 0.0, 1.0);\n float zp = depth + 6.0 * fall * fall;\n vec2 Sp = c + d * (F + zp) / F;\n float inPlug = clamp((0.16 * ragH * (1.0 - 0.1 * fall) - length(Sp - c)) * 300.0, 0.0, 1.0) * (1.0 - fall);\n vec4 plug = getFromColor(mirror(Sp / R));\n plug = mix(vec4(plug.rgb * 0.72, plug.a), vec4(to.rgb * 0.85, to.a), seeThrough);\n plug.rgb *= (1.0 - 0.8 * depth) * (1.0 - 0.6 * fall);\n vec4 below = mix(to, plug, inPlug * ease(th / 0.02));\n below.rgb *= 1.0 - 0.35 * exp(-max(rh - r, 0.0) / 0.05) * (1.0 - th);\n\n float hole = clamp((rh - r) * 300.0, 0.0, 1.0);\n return mix(sheet, below, hole);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","SoapDrop":"// SoapDrop — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SoapDrop.glsl\n// Author: gre\n// License: MIT\n// Description: A drop of soap touches the outgoing image, which floats on water like a skin: the skin rushes away from the drop and piles up into a glossy, wrinkled rim that is shoved out of the frame, leaving the incoming image under clear, rippling water\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 crumple; \n\nconst float TAU = 6.2831853;\nconst float AA = 0.002;\nconst vec3 LIGHT = vec3(-0.45, 0.55, 0.7);\nconst vec2 LIGHT_XY = vec2(-0.633, 0.774);\nconst vec3 HALFWAY = vec3(-0.244, 0.299, 0.923);\n\nfloat sdHash(float p) {\n p = fract(p * 0.1031);\n p *= p + 33.33;\n p *= p + p;\n return fract(p);\n}\n\nfloat sdNoise(float x, float n) {\n float i = floor(x);\n float f = fract(x);\n f = f * f * (3.0 - 2.0 * f);\n return mix(sdHash(mod(i, n)), sdHash(mod(i + 1.0, n)), f);\n}\n\nvec2 sdMirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat sdAngle(vec2 q) {\n return atan(q.y, q.x + 1e-9) / TAU + 0.5;\n}\n\nfloat sdFront(float th, float R) {\n return R * (1.0 + 0.08 * crumple * (sdNoise(th * 7.0, 7.0) + 0.5 * sdNoise(th * 19.0, 19.0) - 0.75));\n}\n\nfloat sdHeight(vec2 q, float R0, float L) {\n float r = length(q);\n float th = sdAngle(q);\n float R = sdFront(th, R0);\n float d = max(r - R, 0.0);\n float comp = R / L * exp(-d / L);\n float T = comp / (1.0 + comp);\n float wob = 9.0 * sdNoise(th * 13.0, 13.0) + 7.0 * sdNoise(th * 37.0, 37.0);\n \n float folds = sin(d * 110.0 + wob) * sdNoise(th * 53.0 + d * 40.0, 53.0) * smoothstep(0.05, 0.3, R);\n float lip = 1.0 - exp(-d / 0.004);\n return 0.008 * T * lip * (1.0 + 1.4 * crumple * T * folds);\n}\n\nvec4 transition(vec2 uv) {\n vec2 a = vec2(ratio, 1.0);\n vec2 q = (uv - center) * a;\n float r = length(q);\n vec2 dir = q / max(r, 1e-5);\n float th = sdAngle(q);\n float rmax = length(max(center, 1.0 - center) * a);\n\n float t = progress;\n float e = t * (1.4 - 0.4 * t);\n float L = 0.02 + 0.05 * e;\n \n float R0 = e * (rmax + 0.02) / (1.0 - 0.06 * crumple);\n float R = sdFront(th, R0);\n\n float d = max(r - R, 0.0);\n float fall = exp(-d / L);\n float s = max(r - R * fall, 0.0);\n float comp = R / L * fall;\n float T = comp / (1.0 + comp);\n\n const vec2 EPS = vec2(0.0015, 0.0);\n vec2 grad = vec2(\n sdHeight(q + EPS, R0, L) - sdHeight(q - EPS, R0, L),\n sdHeight(q + EPS.yx, R0, L) - sdHeight(q - EPS.yx, R0, L)\n ) / (2.0 * EPS.x);\n vec3 n = normalize(vec3(-grad, 1.0));\n float diffuse = max(1.0 + 0.9 * (dot(n, LIGHT) - LIGHT.z), 0.0);\n \n float spec = max(pow(max(dot(n, HALFWAY), 0.0), 50.0) - pow(HALFWAY.z, 50.0), 0.0);\n\n vec2 suv = center + (dir * s - grad * 0.004) / a;\n vec4 skin = getFromColor(sdMirror(suv));\n skin.rgb *= diffuse * (1.0 - 0.18 * T);\n skin.rgb += 0.6 * spec * T * skin.a;\n\n float behind = max(R - r, 0.0);\n float calm = 1.0 - t;\n float k = behind * 70.0 - t * 38.0;\n float env = calm * calm * exp(-behind * 3.0);\n float wave = 0.009 * sin(k) + 0.005 * sin(k * 0.43 + 1.7);\n vec4 water = getToColor(sdMirror(uv - dir * env * wave / a));\n water.rgb *= 1.0 + 0.25 * env * cos(k) * dot(dir, LIGHT_XY);\n float shadow = T * exp(-behind / 0.03) * (0.5 + 0.5 * dot(dir, LIGHT_XY));\n water.rgb *= 1.0 - 0.45 * calm * shadow;\n\n float m = mix(1.0, smoothstep(-AA, AA, r - R), smoothstep(0.0, 4.0 * AA, R));\n return mix(water, skin, 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","SoapFilm":"// SoapFilm — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SoapFilm.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture becomes a reflection on a soap film stretched across the frame: rainbow interference bands swirl over it in slow eddies that carry the reflection round with them, and as the film drains thin from the top it turns clear in patches, revealing the incoming picture 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 swirl; \n\nuniform float iridescence; \n\nfloat hash(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yxz + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\nfloat noise(vec2 p) {\n vec2 i = floor(p), f = fract(p);\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x), mix(hash(i + vec2(0.0, 1.0)), hash(i + 1.0), f.x), f.y);\n}\n\nvec2 flow(vec2 q) {\n mat2 r = mat2(0.88, 0.48, -0.48, 0.88);\n vec2 a = (r * q) * vec2(5.0, 4.2) + vec2(0.0, 0.7);\n vec2 v = vec2(0.84 * sin(a.x) * cos(a.y), -cos(a.x) * sin(a.y)) * r;\n vec2 b = q * vec2(2.3, 2.9) + 1.7;\n return v + vec2(-0.6 * sin(b.x) * cos(b.y), 0.476 * cos(b.x) * sin(b.y));\n}\n\nvec2 advect(vec2 q, float t) {\n vec2 o = q;\n for (int i = 0; i < 5; i++) o -= flow(o) * (t / 5.0);\n return o - q;\n}\n\nvec2 toUv(vec2 uv, vec2 o) {\n return 1.0 - abs(1.0 - mod(uv + o / vec2(ratio, 1.0), 2.0));\n}\n\nvec4 transition(vec2 uv) {\n vec2 q = vec2(uv.x * ratio, uv.y);\n float p = progress;\n vec2 oa = advect(q, swirl * p * p * 1.6);\n vec2 ob = advect(q, -swirl * (1.0 - p) * (1.0 - p) * 1.6);\n vec2 qt = q + advect(q, 0.3 + (0.3 + swirl) * 1.6 * p);\n\n float nn = 0.6 * noise(qt * 3.0) + 0.3 * noise(qt * 6.5 + 3.1) + 0.1 * noise(qt * 13.0 - 5.7);\n \n float h = clamp(1.1 - 1.9 * p + 0.8 * (nn - 0.5) - 0.3 * (uv.y - 0.5), 0.0, 1.0);\n \n float d = 0.85 * h;\n vec3 refl = sin(8.357 * d / vec3(0.62, 0.53, 0.45));\n refl *= refl;\n \n refl = mix(refl, vec3(dot(refl, vec3(0.3333))), 0.65 * smoothstep(0.35, 0.85, d));\n\n float clear = 1.0 - smoothstep(0.0, 0.3, h);\n float film = iridescence * smoothstep(0.0, 0.35, p) * (1.0 - clear);\n vec4 a = getFromColor(toUv(uv, oa));\n vec4 b = getToColor(toUv(uv, ob));\n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), clear);\n c.rgb = c.a > 0.0 ? c.rgb / c.a : vec3(0.0);\n \n vec3 tint = c.rgb * mix(vec3(1.0), 0.6 + 0.75 * refl, smoothstep(0.08, 0.3, d)) + 0.14 * refl;\n c.rgb = mix(c.rgb, tint, film);\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","SourceSink":"// SourceSink — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SourceSink.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image wells up from one point as a round bubble while the outgoing one streams away along curved field lines and drains into a second point, both pictures flowing like a field between two charges\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 source; \n\nuniform vec2 sink; \n\nuniform float flow; \n\nuniform float swirl; \n\nuniform float shading; \n\nvec2 cmul(vec2 a, vec2 b) { return vec2(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x); }\nvec2 cdiv(vec2 a, vec2 b) { return vec2(a.x * b.x + a.y * b.y, a.y * b.x - a.x * b.y) / max(dot(b, b), 1e-12); }\n\nvec2 mirrorUv(vec2 uv) { return 1.0 - abs(1.0 - mod(uv, 2.0)); }\n\nvec2 unflow(vec2 w, vec2 A, vec2 B, vec2 asp, float s, float a) {\n vec2 v = cmul(w, exp(s) * vec2(cos(a), sin(a)));\n return mirrorUv(cdiv(A - cmul(B, v), vec2(1.0, 0.0) - v) / asp + 0.5);\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n vec2 asp = vec2(ratio, 1.0);\n vec2 A = (source - 0.5) * asp, B = (sink - 0.5) * asp;\n if (length(B - A) < 0.01) B = A + vec2(0.01, 0.0);\n float ab = length(B - A);\n vec2 z = (uv - 0.5) * asp;\n vec2 w = cdiv(z - A, z - B);\n\n float e = t * t * (3.0 - 2.0 * t);\n \n \n float h = 0.5 - 0.5 * w.x * inversesqrt(max(dot(w, w), 1e-12));\n float a = clamp(swirl, -2.5, 2.5) * h;\n vec4 from = getFromColor(unflow(w, A, B, asp, -flow * h * e, -a * e));\n vec4 to = getToColor(unflow(w, A, B, asp, flow * h * (1.0 - e), a * (1.0 - e)));\n\n \n float p0 = pow(t, 3.6), p1 = pow(1.0 - t, 3.6);\n float q = p0 / (p0 + p1);\n vec2 za = z - A, zb = z - B;\n float d = ((1.0 - q) * dot(za, za) - q * dot(zb, zb))\n / (length((1.0 - 2.0 * q) * z - (1.0 - q) * A + q * B) + sqrt(q * (1.0 - q)) * ab);\n float radius = sqrt(q * (1.0 - q)) * ab / max(abs(1.0 - 2.0 * q), 1e-4);\n float rim = clamp(0.3 * radius, 1e-4, 0.07);\n\n \n float m = smoothstep(-0.003, 0.003, d + 0.003 * (1.0 - 2.0 * t));\n float env = shading * 4.0 * t * (1.0 - t);\n from.rgb *= 1.0 - 0.55 * env * exp(-max(d, 0.0) / rim);\n to.rgb += 0.3 * env * exp(-d * d / (0.08 * rim * rim)) * (1.0 - m);\n return mix(to, from, 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","SpeedLines":"// SpeedLines — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SpeedLines.glsl\n// Author: gre\n// License: MIT\n// Description: Comic-style speed lines shoot in from the edges of the frame toward a focus point as the outgoing image punches in; at the peak it cuts to the incoming image, which settles back as the lines retract to the 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\nuniform vec2 center; \n\nuniform vec4 lineColor; \n\nuniform float density; \n\nuniform float focus; \n\nuniform float zoom; \n\nconst float PI = 3.141592653589793;\nconst float AA = 0.0012;\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 reachOf(float h) {\n float d = 0.05 * h;\n float a = 1.0 - clamp((progress - d) / 0.4, 0.0, 1.0);\n float b = clamp((progress - 0.5 - d) / 0.4, 0.0, 1.0);\n return (1.0 - a * a * a) * (1.0 - b * b * b);\n}\n\nfloat layer(float a, float e, float r, float n, float seed, float E) {\n \n float cell = mod(floor(a * n), n);\n float h1 = hash12(vec2(cell, seed));\n float h2 = hash12(vec2(cell, seed + 7.0));\n float h3 = hash12(vec2(cell, seed + 13.0));\n float on = step(0.22, h1);\n float h4 = hash12(vec2(cell, seed + 50.0 + floor(progress * 12.0)));\n \n \n float len = 1.0 - 0.85 * h2 * h2 - 0.15 * h4;\n float tipPeak = E * (1.0 - (1.0 - focus) * (0.55 + 0.45 * len));\n float tip = mix(E + 0.05, tipPeak, reachOf(h3));\n float t = clamp((e - tip) / max(E * (0.2 + 0.5 * h2), 1e-4), 0.0, 1.0);\n float cellWidth = 2.0 * PI * r / n;\n \n float offset = 0.3 + 0.4 * h3;\n float width = min(cellWidth * (0.06 + 0.22 * h1) * sqrt(t), (0.5 - abs(offset - 0.5)) * cellWidth - AA);\n float across = abs(fract(a * n) - offset) * cellWidth;\n return on * (1.0 - smoothstep(width - AA, width + AA, across)) * step(tip, e);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 asp = vec2(ratio, 1.0);\n vec2 d = (uv - center) * asp;\n float r = length(d);\n \n float a = atan(d.y, d.x + 1e-6) / (2.0 * PI) + 0.5;\n \n \n float e = length((uv - center) * 2.0);\n \n \n vec2 w = uv - center;\n vec2 room = vec2(w.x > 0.0 ? 1.0 - center.x : center.x, w.y > 0.0 ? 1.0 - center.y : center.y);\n vec2 exits = room / max(abs(w), vec2(1e-6));\n float E = e * min(exits.x, exits.y);\n\n float k = p < 0.5 ? smoothstep(0.0, 0.5, p) : 1.0 - smoothstep(0.5, 1.0, p);\n float s = 1.0 - zoom * k * k;\n \n vec2 q = center + (uv - center) * s;\n vec4 c = p < 0.5 ? getFromColor(q) : getToColor(q);\n\n \n float n = max(floor(density), 2.0);\n float l = layer(a, e, r, n, 1.0, E);\n l = max(l, layer(fract(a + 0.5 / n), e, r, n, 31.0, E));\n l *= lineColor.a;\n\n vec4 pc = vec4(c.rgb * c.a, c.a);\n pc = pc * (1.0 - l) + vec4(lineColor.rgb, 1.0) * l;\n return pc.a > 0.0 ? vec4(pc.rgb / pc.a, pc.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","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;\nconst float AA = 0.0015;\nconst vec3 LIGHT = vec3(-0.5, 0.6, 1.0) / 1.2689;\n\nvec4 transition(vec2 uv) {\n vec4 b = getToColor(uv);\n\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n vec2 side = vec2(-dir.y, dir.x);\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 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 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 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 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","SpinningTop":"// SpinningTop — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SpinningTop.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image curls round into a spinning top standing on its point, which whirls faster and faster with its picture streaking round it, wobbles, then skitters off out of the frame, uncovering 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 float wobble; \n\nuniform float turns; \n\nconst float PI = 3.14159265;\nconst float CAM = 3.0;\nconst float GROUND = 0.07;\n\nfloat a1, c1, rMax, hSheet, spin, tilt, prec, wRow;\nvec3 shift;\n\nfloat profile(float v) {\n v = clamp(v, 0.0, 1.0);\n float s = min(v / 0.6, 1.0);\n return max(mix(1.0 - pow(1.0 - s, 1.6), 0.08, smoothstep(0.58, 0.85, v)), 0.02);\n}\n\nfloat widthAt(float v) {\n float e = clamp(abs(v - 0.6) / 0.6, 0.0, 1.0);\n return mix(1.0, 2.0 * PI * rMax * profile(v) / ratio, 1.0 - pow(1.0 - a1, 1.0 + 3.0 * e));\n}\n\nfloat angleOf(vec2 q) {\n vec2 a = abs(q);\n float b;\n if (a.x < 0.25 * a.y) {\n float w = a.x / a.y;\n float w2 = w * w;\n b = w * (1.0 - w2 * (1.0 / 3.0 - w2 * (0.2 - w2 / 7.0)));\n } else if (a.x < a.y) {\n b = atan(a.x / a.y);\n } else {\n b = 0.5 * PI - atan(a.y / max(a.x, 1e-9));\n }\n if (q.y < 0.0) b = PI - b;\n return q.x < 0.0 ? -b : b;\n}\n\nvec3 rotY(vec3 p, float a) {\n float c = cos(a), s = sin(a);\n return vec3(c * p.x + s * p.z, p.y, -s * p.x + c * p.z);\n}\n\nvec3 unbend(vec3 p) {\n float base = -0.5 + GROUND * a1;\n vec3 apex = vec3(0.0, base, -rMax * a1);\n vec3 q = rotY(p - shift - apex, -prec);\n float c = cos(tilt), s = sin(tilt);\n q.xy = mat2(c, -s, s, c) * q.xy;\n q = rotY(q, prec + spin) + apex;\n float v = (q.y - base) / hSheet;\n wRow = widthAt(v);\n float k = c1 * 2.0 * PI / (ratio * wRow);\n float zf = -a1 * rMax * (1.0 - profile(v));\n \n float sl = a1 * rMax * 5.2 / hSheet;\n float lip = inversesqrt(1.0 + sl * sl);\n if (k < 1e-3) return vec3(q.x, v, (q.z - zf) * lip);\n float R = 1.0 / k;\n vec2 d = vec2(q.x, q.z - zf + R);\n return vec3(angleOf(d) * R, v, (length(d) - R) * lip);\n}\n\nfloat sdf(vec3 p) {\n vec3 u = unbend(p);\n vec2 o = max(abs(u.xy - vec2(0.0, 0.5)) - vec2(0.5 * ratio * wRow, 0.5), 0.0) * vec2(1.0, hSheet);\n return length(vec3(o, u.z));\n}\n\nvec4 sheet(float s, float v) {\n float o = s < 0.5 ? s + 1.0 : s - 1.0;\n float m = 0.5 * (1.0 - smoothstep(0.0, 0.05, min(s, 1.0 - s))) * smoothstep(0.9, 1.0, c1);\n vec2 inset = vec2(0.004 * m, 0.0);\n return mix(\n getFromColor(clamp(vec2(s, v), inset, 1.0 - inset)),\n getFromColor(clamp(vec2(o, v), inset, 1.0 - inset)), m);\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n a1 = smoothstep(0.0, 0.3, t);\n c1 = min(1.0, 1.06 * a1);\n float a2 = smoothstep(0.2, 0.75, t);\n float a3 = smoothstep(0.6, 1.0, t);\n \n rMax = 0.27 * min(1.0, 1.4 * ratio);\n hSheet = mix(1.0, 2.6 * rMax, a1);\n spin = turns * 2.0 * PI * a2 * a2 + 8.0 * a3;\n float x2 = clamp((t - 0.2) / 0.55, 0.0, 1.0);\n float x3 = clamp((t - 0.6) / 0.4, 0.0, 1.0);\n float da2 = 6.0 * x2 * (1.0 - x2) / 0.55;\n float da3 = 6.0 * x3 * (1.0 - x3) / 0.4;\n float omega = turns * 4.0 * PI * a2 * da2 + 8.0 * da3;\n prec = 9.0 * a2 * a2 + 3.0 * a3;\n tilt = wobble * 0.3 * a2 * a2 * (1.0 - a3) + 0.45 * a3 * a3;\n float hop = 0.05 * abs(sin(a3 * 3.0 * PI)) * (1.0 - a3);\n shift = vec3(a3 * a3 * (0.5 * ratio + 2.5 * rMax + 0.5), hop, 0.0);\n\n \n vec3 ro = vec3(0.0, 1.1, CAM);\n vec3 rd = normalize(vec3((uv - 0.5) * vec2(ratio, 1.0), 0.0) - ro);\n float hd = (CAM - 0.6) / -rd.z;\n float hEnd = (CAM + 1.2) / -rd.z;\n float minD = 1e3;\n bool hit = false;\n for (int i = 0; i < 100; i++) {\n float d = sdf(ro + rd * hd);\n minD = min(minD, d);\n if (d < 4e-4) { hit = true; break; }\n hd += d * 0.9;\n if (hd > hEnd) break;\n }\n\n vec4 bg = getToColor(uv);\n float shadowAmt = a1 * (1.0 - a3);\n vec3 foot = vec3(shift.x, -0.5 + GROUND * a1, -rMax);\n vec2 fs = (ro + (foot - ro) * (CAM / (CAM - foot.z))).xy;\n vec2 fd = ((uv - 0.5) * vec2(ratio, 1.0) - fs - vec2(0.5 * rMax, 0.0)) / vec2(rMax * 1.4, 0.04);\n float contact = exp(-dot(fd, fd)) / (1.0 + 20.0 * shift.y);\n bg.rgb *= 1.0 - (0.25 * (1.0 - smoothstep(0.0, 0.08, minD)) + 0.5 * contact) * shadowAmt;\n if (!hit) return bg;\n \n for (int j = 0; j < 3; j++) hd += sdf(ro + rd * hd);\n\n vec3 p = ro + rd * hd;\n vec3 u = unbend(p);\n float w = wRow;\n vec2 e = vec2(1e-3, 0.0);\n vec3 n = normalize(vec3(\n unbend(p + e.xyy).z - unbend(p - e.xyy).z,\n unbend(p + e.yxy).z - unbend(p - e.yxy).z,\n unbend(p + e.yyx).z - unbend(p - e.yyx).z));\n bool front = dot(n, rd) < 0.0;\n if (!front) n = -n;\n float s0 = u.x / (ratio * w) + 0.5;\n \n float blur = min(omega / (2.0 * PI) * 0.012, 0.4) * smoothstep(0.9, 1.0, c1);\n vec4 c = vec4(0.0);\n float tw = 0.0;\n for (int j = 0; j < 12; j++) {\n float f = float(j) / 11.0;\n float wt = 1.0 - 0.8 * f;\n float s = s0 - blur * f;\n s = s < 0.0 ? s + 1.0 : s;\n c += sheet(s, u.y) * wt;\n tw += wt;\n if (blur == 0.0) break;\n }\n c /= tw;\n vec3 L = normalize(vec3(-0.5, 0.7, 1.0));\n float diff = max(dot(n, L), 0.0);\n float spec = pow(max(dot(reflect(-L, n), -rd), 0.0), 24.0);\n float shade = mix(1.0, 0.45 + 0.7 * diff, a1);\n if (front) c.rgb = c.rgb * shade + 0.35 * spec * a1 * c.a;\n else c.rgb *= 0.35 * shade;\n float aa = 1.5 / 200.0;\n float ex = mix(1.0, smoothstep(0.0, aa, 0.5 * ratio * w - abs(u.x)), c1 * (1.0 - c1) * 4.0);\n float ey = mix(1.0, smoothstep(0.0, aa / hSheet, 0.5 - abs(u.y - 0.5)), min(a1 * 4.0, 1.0));\n return mix(bg, c, min(ex, ey));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 vec2 s = n - 2.0 * k;\n vec2 l = c - k;\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 vec2 n = max(vec2(grid), vec2(1.0));\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","SpiralLines":"// SpiralLines — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SpiralLines.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture is redrawn as one continuous spiral line winding inward on paper, thick in its darks and thin in its lights; the line thins to a hairline spiral from the center out, swells again into the shapes of the incoming picture and spreads back into the full photo\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 winding; \n\nuniform vec4 ink; \n\nuniform vec4 paper; \n\nconst float TAU = 6.283185307;\n\nvec4 weighted(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nfloat shade(vec4 c) {\n return clamp(1.1 * (1.0 - dot(c.rgb, vec3(0.299, 0.587, 0.114))) - 0.04, 0.0, 1.0) * c.a;\n}\n\nfloat strokeWidth(vec2 dir, float rc, float n, float style, float aa) {\n vec2 asp = vec2(ratio, 1.0);\n float t = progress - 0.1 * (rc / (0.5 * length(asp)) - 0.5);\n float dark = 0.0;\n for (int i = 0; i < 5; i++) {\n float a = float(i) - 2.0;\n \n vec2 o = abs(a) > 1.5 ? dir * a * 0.1 : vec2(-dir.y, dir.x) * a * 0.3;\n vec2 cuv = clamp((dir * max(rc, 0.0) + o / n) / asp + 0.5, 0.0, 1.0);\n dark += 0.2 * (t < 0.5 ? shade(getFromColor(cuv)) : shade(getToColor(cuv)));\n }\n \n float k = smoothstep(0.02, 0.21, abs(t - 0.5));\n \n return mix(1.0 + aa, mix(0.13, 0.1 + 0.8 * dark, k), style);\n}\n\nvec4 transition(vec2 uv) {\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float n = max(strokes, 1.0);\n float r = max(length(q), 1e-4);\n \n float th = abs(q.x) + abs(q.y) < 1e-5 ? 0.0 : atan(q.y, q.x);\n float f = fract(r * n - th / TAU + winding * smoothstep(0.0, 1.0, progress)) - 0.5;\n float d = 2.0 * abs(f);\n\n float style = min(1.0, min(progress, 1.0 - progress) / 0.24);\n style *= 2.0 - style;\n float aa = n / 420.0;\n float rc = r - f / n;\n float w = strokeWidth(q / r, rc, n, style, aa);\n \n float w2 = strokeWidth(q / r, rc + (f < 0.0 ? -1.0 : 1.0) / n, n, style, aa);\n float line = 1.0 - min(smoothstep(w - aa, w + aa, d), smoothstep(w2 - aa, w2 + aa, 2.0 - d));\n\n vec4 photo = weighted(progress < 0.5 ? getFromColor(uv) : getToColor(uv));\n vec4 stroke = mix(photo, weighted(ink), smoothstep(0.1, 0.9, style));\n vec4 o = mix(weighted(paper), stroke, line);\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","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;\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 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 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 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 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 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","SplitFlap":"// SplitFlap — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SplitFlap.glsl\n// Author: gre\n// License: MIT\n// Description: The frame becomes a split-flap board: in each cell the top half of the outgoing image flips down on a hinge across the middle, cell after cell, its back bringing the bottom half of 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; \n\nuniform float stagger; \n\nuniform float randomness; \n\nuniform int flaps; \n\nuniform float gap; \n\nuniform float perspective; \n\nuniform float shading; \n\nuniform vec4 background; \n\nconst float PI = 3.141592653589793;\nconst float EDGE = 0.001;\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 cellTime(vec2 cell, vec2 grid) {\n float wave = (cell.x + 0.5 * (grid.y - 1.0 - cell.y)) / max(grid.x - 1.0 + 0.5 * (grid.y - 1.0), 1.0);\n float order = mix(wave, hash12(cell + 17.0), randomness);\n float delay = clamp(stagger, 0.0, 0.99);\n return clamp((progress - order * delay) / (1.0 - delay), 0.0, 1.0);\n}\n\nfloat flapIndex(float t, float n) {\n return min(floor(t * n), n - 1.0);\n}\n\nfloat flapAngle(float t, float n) {\n float u = t * n - flapIndex(t, n);\n return PI * u * (0.3 + 0.7 * u);\n}\n\nvec4 card(float i, float n, vec2 cell, vec2 grid, vec2 lc) {\n if (i < 0.5) return getFromColor((cell + lc) / grid);\n vec2 src = cell;\n if (i < n - 0.5) src = floor(vec2(hash12(cell * 3.7 + i * 11.3), hash12(cell * 5.3 + i * 7.9 + 1.7)) * grid);\n return getToColor((src + lc) / grid);\n}\n\nfloat cardMask(float x, float f, vec2 cellSize, float g) {\n if (g <= 0.0) return 1.0;\n float e = EDGE * min(1.0, g / max(gap, 1e-4));\n \n float d = min(min(x, 1.0 - x) * cellSize.x, min(2.0 * f, 0.5 - f) * cellSize.y);\n return smoothstep(0.5 * g - e, 0.5 * g + e, d);\n}\n\nvec4 transition (vec2 uv) {\n vec2 grid = max(vec2(size), 1.0);\n float n = max(float(flaps), 1.0);\n vec2 cellSize = vec2(ratio, 1.0) / grid / min(ratio, 1.0);\n vec2 cell = floor(uv * grid);\n vec2 l = uv * grid - cell;\n float g = gap * smoothstep(0.0, 0.12, progress) * (1.0 - smoothstep(0.88, 1.0, progress));\n \n float w = l.y - 0.5;\n bool upper = w >= 0.0;\n\n \n \n float t = cellTime(cell, grid);\n float k = flapIndex(t, n);\n float a = flapAngle(t, n);\n bool started = t * n > k;\n bool landed = t >= 1.0;\n vec4 color = card(k + (upper ? (started ? 1.0 : 0.0) : (landed ? 1.0 : 0.0)), n, cell, grid, l);\n if (started && !landed) color.rgb *= 1.0 - 0.45 * shading * max(upper ? cos(a) : -cos(a), 0.0);\n color = mix(background, color, cardMask(l.x, abs(w), cellSize, g));\n\n \n float nearest = -1.0;\n for (int d = -1; d <= 1; d++) {\n vec2 nc = cell + vec2(float(d), 0.0);\n if (nc.x < 0.0 || nc.x > grid.x - 1.0) continue;\n float nt = d == 0 ? t : cellTime(nc, grid);\n float na = d == 0 ? a : flapAngle(nt, n);\n float fc = cos(na);\n float fs = sin(na);\n \n if (abs(fc) < 1e-5 || (w >= 0.0) != (fc > 0.0)) continue;\n float f = w / fc;\n if (f > 0.5) continue;\n float z = f * fs;\n if (z <= nearest) continue;\n float lx = 0.5 + (l.x - float(d) - 0.5) * (1.0 - perspective * z);\n if (lx < 0.0 || lx > 1.0) continue;\n bool front = fc > 0.0;\n vec2 lc = vec2(lx, front ? 0.5 + f : 0.5 - f);\n float m = cardMask(lx, f, cellSize, g);\n if (m <= 0.0) continue;\n vec4 img = card(flapIndex(nt, n) + (front ? 0.0 : 1.0), n, nc, grid, lc);\n float lambert = (front ? 0.92 * fc - 0.4 * fs : 0.4 * fs - 0.92 * fc) / 0.92;\n img.rgb *= mix(1.0 - shading, 1.0, clamp(lambert, 0.0, 1.0));\n color = mix(color, img, m);\n nearest = z;\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","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","SpotlightWipe":"// SpotlightWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/SpotlightWipe.glsl\n// Author: gre\n// License: MIT\n// Description: The stage lights go down on the outgoing image and a soft oval spotlight searches across it along a curved path, comes to rest and lights the incoming image inside it, then widens until the stage lights come back up 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 vec2 center; \n\nuniform float size; \n\nuniform float darkness; \n\nuniform vec3 warmth; \n\nconst float FLAT = 0.72;\n\nconst float LIT = 0.74;\n\nvec2 path(float t, vec2 c) {\n vec2 a = vec2(0.08, 0.3);\n vec2 b = vec2(0.35, 1.15);\n vec2 d = vec2(1.05, 0.95);\n float s = 1.0 - t;\n return s * s * s * a + 3.0 * s * s * t * b + 3.0 * s * t * t * d + t * t * t * c;\n}\n\nvec4 transition(vec2 uv) {\n vec2 asp = vec2(ratio, 1.0);\n float p = progress;\n\n \n \n float t = clamp(p / 0.5, 0.0, 1.0);\n t = t * t * (3.0 - 2.0 * t);\n vec2 c = path(t, center);\n\n vec2 far = max(center, 1.0 - center) * asp;\n float full = length(vec2(far.x, far.y / FLAT)) / LIT;\n float g = smoothstep(0.44, 1.0, p);\n float radius = mix(0.5 * size, full, g * (0.3 + 0.7 * g));\n\n \n vec2 q = (uv - c) * asp;\n float r = length(vec2(q.x, q.y / FLAT)) / radius;\n\n float core = 1.0 - smoothstep(0.72, 1.08, r);\n float ring = (r - 0.9) / 0.09;\n float spot = max(core * (1.0 - 0.1 * r * r), 0.12 * (1.0 - smoothstep(0.9, 2.4, r))) + 0.16 * exp(-ring * ring);\n\n float s = darkness * smoothstep(0.0, 0.18, p) * (1.0 - smoothstep(0.72, 1.0, p));\n vec3 light = 1.0 - s + s * spot * warmth;\n\n float lit = smoothstep(0.42, 0.58, p) * (1.0 - smoothstep(LIT, 1.0, r));\n vec4 col = mix(getFromColor(uv), getToColor(uv), lit);\n return vec4(col.rgb * light, 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","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","Steamroll":"// Steamroll — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Steamroll.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming picture arrives wound on a heavy roller that rolls across the outgoing one from left to right, pressing it down and bunching it up in its shadow just ahead of its contact line, and lays the incoming picture down flat behind it as it unrolls\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 float press; \n\nconst float PI = 3.141592653589793;\n\nvec2 mirrored(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nvec4 transition(vec2 uv) {\n float t = progress * progress * (3.0 - 2.0 * progress);\n float r = radius * min(ratio, 1.0);\n float X = uv.x * ratio;\n float xc = mix(-r - 0.02, ratio + r + 0.02, t);\n float A = press * smoothstep(0.0, r, xc + r) * (1.0 - smoothstep(0.94, 1.0, progress));\n float L = 0.7 * r;\n float u = max(X - xc - r, 0.0) / L;\n\n \n vec4 a = getFromColor(mirrored(vec2(uv.x - 1.6 * L * A * exp(-u) / ratio, uv.y)));\n a.rgb *= 1.0 - A * (0.45 * exp(-u / 0.35) + 0.35 * exp(-u / 1.2));\n\n vec4 b = getToColor(uv);\n b.rgb *= 1.0 - 0.4 * A * (1.0 - smoothstep(0.0, 0.4 * r, xc - r - X));\n vec4 col = X < xc ? b : a;\n\n float ph = asin(clamp((X - xc) / r, -1.0, 1.0));\n \n float row = xc + r * (PI - ph);\n float zoom = 1.0 + 0.3 * r * (1.0 + cos(ph));\n vec4 c = getToColor(mirrored(vec2(row / ratio, 0.5 + (uv.y - 0.5) / zoom)));\n c.rgb = c.rgb * (0.4 + 0.65 * max(cos(ph + 0.5), 0.0)) + 0.3 * c.a * pow(max(cos(ph + 0.6), 0.0), 40.0);\n return mix(col, c, smoothstep(0.0, 0.004, r - abs(X - xc)));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 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.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 {\n \n a = (1.0 - progress) / 0.1;\n return simple_sample_with_corners_to(p, corner_size * a, 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","StickySplit":"// StickySplit — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StickySplit.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is pulled apart down the middle like melted cheese: the halves part slowly while the picture between them stretches into a gooey web, which opens into glossy strings that thin out, sag and snap one by one, until the halves slide off and leave 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 strings; \n\nuniform float sag; \n\nuniform float gloss; \n\nuniform float seed; \n\nconst float AA = 0.002;\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 mirror(float v) {\n return 1.0 - abs(1.0 - abs(v));\n}\n\nvec4 transition(vec2 uv) {\n vec2 q = vec2(uv.x * ratio, uv.y);\n float x0 = 0.5 * ratio + 0.012 * sin(q.y * 7.0 + 1.0) + 0.006 * sin(q.y * 19.0 + 2.0);\n \n float D = 0.5 * ratio + 0.06;\n float p = progress;\n float d = D * p * (0.45 + 0.55 * p * p);\n float G = d / D;\n float H = min(q.x - x0 + d, x0 + d - q.x);\n float on = smoothstep(0.0, 0.03, G);\n if (H < 0.0) {\n vec2 h = q.x < x0 ? q + vec2(d, 0.0) : q - vec2(d, 0.0);\n vec4 c = getFromColor(vec2(h.x / ratio, h.y));\n c.rgb *= 1.0 - 0.2 * gloss * on * (1.0 - smoothstep(0.0, 0.015, -H));\n return c;\n }\n float s = clamp((q.x - x0) / max(d, 1e-5), -1.0, 1.0);\n float n = max(strings, 1.0);\n float fade = 1.0 - smoothstep(0.85, 0.98, p);\n float best = -1.0;\n float bestN = 0.0;\n float bestW = 1.0;\n float bestOff = 0.0;\n float cov = 0.0;\n float shade = 0.0;\n for (int i = 0; i < 32; i++) {\n float fi = float(i);\n if (fi >= n) break;\n vec2 o = vec2(fi, 7.3 * seed);\n float h1 = hash(o + 1.7);\n float h2 = hash(o + 2.9);\n float h3 = hash(o + 4.1);\n float h4 = hash(o + 5.3);\n float h5 = hash(o + 6.7);\n float h6 = hash(o + 8.3);\n float yL = (fi + 0.5 + 0.9 * (h1 - 0.5)) / n;\n float st = smoothstep(0.12 + 0.1 * h3, 0.4 + 0.12 * h5, p);\n float yR = yL + (h2 - 0.5) * 3.5 / n * st;\n float hang = sag * (0.1 + 0.9 * h3 * h3) * 0.45 * G;\n \n float ts = 0.45 + 0.2 * h4 + 0.2 * h6;\n float k = smoothstep(ts, ts + 0.05, p);\n float sb = 0.7 * (h5 - 0.5);\n float side = s < sb ? -1.0 : 1.0;\n float a = (1.0 - side * s) * d;\n float aTip = mix((1.0 - side * sb) * d, 0.035 + 0.03 * h1, k);\n float lineY = mix(yL, yR, 0.5 * s + 0.5);\n float yc = lineY - hang * (1.0 - s * s) * (1.0 - k) - k * sag * 1.5 * a * a;\n float slope = (0.5 * (yR - yL) + 2.0 * hang * s * (1.0 - k)) / max(d, 1e-4) + 3.0 * k * sag * a * side;\n float dist = abs(q.y - yc) / sqrt(1.0 + slope * slope);\n float hw = mix(0.9 / n, mix(0.008, 0.03, h6 * h6) * 0.35 / (0.35 + d), st);\n hw *= mix(1.0, 0.6 + 0.4 * s * s, st) * (0.8 + 0.4 * sin(s * (4.0 + 5.0 * h2) + 6.28 * h4));\n hw *= 1.0 - 0.7 * smoothstep(ts - 0.08, ts, p) * exp(-(s - sb) * (s - sb) * 30.0);\n hw += 0.6 / n * exp(-(1.0 - abs(s)) * d / 0.025);\n hw *= fade * mix(1.0, smoothstep(0.0, 0.025, aTip - a), k);\n float m = hw - dist;\n if (m > best) {\n best = m;\n bestN = q.y - yc;\n bestW = hw;\n bestOff = yc - lineY;\n }\n float fat = clamp(hw / AA, 0.0, 1.0);\n cov = max(cov, smoothstep(-AA, AA, m) * fat);\n shade = max(shade, smoothstep(-0.008, 0.004, hw - abs(q.y + 0.01 - yc)) * fat);\n }\n vec4 c = getFromColor(vec2(x0 / ratio, mirror(q.y - bestOff)));\n \n float body = clamp(best / max(min(bestW, 0.01), 1e-5), 0.0, 1.0);\n float nn = sign(bestN) * (1.0 - body);\n float g = gloss * on;\n c.rgb *= 1.0 - g * 0.35 * (1.0 - sqrt(1.0 - nn * nn));\n c.rgb += g * 0.45 * exp(-(nn - 0.5) * (nn - 0.5) * 40.0) * c.a;\n vec4 inc = getToColor(uv);\n inc.rgb *= 1.0 - 0.4 * g * shade - 0.25 * g * fade * exp(-H / 0.012);\n float w = mix(1.0, cov, smoothstep(0.0, 2.0 * AA, 2.0 * d));\n return mix(inc, c, 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","StopMotion":"// StopMotion — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StopMotion.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a paper cutout that jerks off the frame in choppy stop-motion steps, with a tiny new tilt and offset each step and a drop shadow, while the incoming cutout jerks in the same way and lands\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 jitter; \n\nuniform float shadow; \n\nuniform vec4 backColor; \n\nuniform vec4 rimColor; \n\nconst float SHRINK = 0.2; \nconst float RIM = 0.012;\nconst float RADIUS = 0.006;\nconst float AA = 0.0015;\n\nfloat hash11(float p) {\n p = fract(p * 0.1031);\n p *= p + 33.33;\n p *= p + p;\n return fract(p);\n}\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\nfloat offFrame(vec2 h, float a) {\n return 0.5 * ratio + abs(cos(a)) * h.x + abs(sin(a)) * h.y + 0.08;\n}\n\nvec2 cutoutSize(float s, float l) {\n return (0.5 * vec2(ratio, 1.0) + RIM * l) * s;\n}\n\nvec4 drawCutout(vec4 col, vec2 q, vec2 c, float a, float s, float l, bool incoming) {\n vec2 asp = vec2(ratio, 1.0);\n vec2 halfImage = 0.5 * asp;\n vec2 halfCut = halfImage + RIM * l;\n float rad = RADIUS * l;\n float ca = cos(a), sa = sin(a);\n mat2 unrotate = mat2(ca, -sa, sa, ca);\n\n \n vec2 rs = unrotate * (q - c - vec2(0.018, -0.026) * l) / s;\n vec2 ss = clamp(rs / asp + 0.5, 0.0, 1.0);\n float sAlpha = max(incoming ? getToColor(ss).a : getFromColor(ss).a, rimColor.a);\n float ds = roundedBox(rs, halfCut, rad) * s;\n float blur = 0.004 + 0.016 * l;\n col.rgb *= 1.0 - clamp(shadow, 0.0, 1.0) * 0.75 * l * sAlpha * (1.0 - smoothstep(-blur, blur, ds));\n\n vec2 r = unrotate * (q - c) / s;\n float dCut = roundedBox(r, halfCut, rad) * s;\n float dImage = roundedBox(r, halfImage, 0.0) * s;\n float cutCover = clamp(0.5 - dCut / AA, 0.0, 1.0);\n float imageCover = clamp(0.5 - dImage / AA, 0.0, 1.0);\n vec2 st = clamp(r / asp + 0.5, 0.0, 1.0);\n vec4 img = premultiply(incoming ? getToColor(st) : getFromColor(st));\n vec4 cut = mix(premultiply(rimColor), img, imageCover) * cutCover;\n return cut + col * (1.0 - cut.a);\n}\n\nvec4 transition(vec2 uv) {\n float n = float(steps < 2 ? 2 : steps);\n \n float k = floor(progress * n + 0.5);\n if (k <= 0.0) return getFromColor(uv);\n if (k >= n) return getToColor(uv);\n\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float j = clamp(jitter, 0.0, 1.0);\n\n float l0 = min(k / 2.0, 1.0);\n float m0 = clamp((k - 1.0) / (0.45 * n), 0.0, 1.0);\n m0 = m0 * m0 * (0.4 + 0.6 * m0);\n float s0 = 1.0 - SHRINK * l0;\n float a0 = 0.22 * m0 + l0 * j * 0.2 * (hash11(k) - 0.5);\n vec2 c0 = vec2(-offFrame(cutoutSize(s0, l0), a0) * m0, 0.05 * m0 * m0)\n + l0 * j * vec2(0.07 * (hash11(k + 100.0) - 0.5), 0.05 * (hash11(k + 200.0) - 0.5));\n\n float l1 = min((n - k) / 2.0, 1.0);\n float m1 = clamp((n - 2.0 - k) / (0.45 * n), 0.0, 1.0);\n m1 = m1 * m1 * (0.4 + 0.6 * m1);\n float s1 = 1.0 - SHRINK * l1;\n float a1 = -0.25 * m1 + l1 * j * 0.2 * (hash11(k + 300.0) - 0.5);\n vec2 c1 = vec2(offFrame(cutoutSize(s1, l1), a1) * m1, -0.06 * m1 * m1)\n + l1 * j * vec2(0.07 * (hash11(k + 400.0) - 0.5), 0.05 * (hash11(k + 500.0) - 0.5));\n\n \n vec4 col = premultiply(backColor);\n if (m0 < 1.0) col = drawCutout(col, q, c0, a0, s0, l0, false);\n if (m1 < 1.0) col = drawCutout(col, q, c1, a1, s1, l1, true);\n if (col.a <= 0.0) return vec4(0.0);\n col.rgb /= col.a;\n col.rgb *= 1.0 - 0.04 * j * hash11(k + 600.0);\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","Stratify":"// Stratify — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Stratify.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image separates by its own brightness like oil and water: its light shapes float up out of the frame as one cut-out layer while its dark shapes sink down as another, both keeping their outlines and casting soft shadows, revealing the incoming image 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 shadow; \n\nuniform float softness; \n\nconst vec3 W = vec3(0.299, 0.587, 0.114);\n\nfloat luma(vec2 p) {\n return dot(getFromColor(p).rgb, W);\n}\n\nvec2 unit(float r) {\n return vec2(r / max(ratio, 1.0), r * min(ratio, 1.0));\n}\n\nfloat around(vec2 p) {\n vec2 d = unit(0.05);\n float sum = 0.0;\n for (int i = 0; i < 5; i++) {\n float a = 1.2566 * float(i) + 0.3;\n vec2 q = p + d * vec2(cos(a), sin(a));\n sum += luma(1.0 - abs(1.0 - mod(q, 2.0)));\n }\n return 0.2 * sum;\n}\n\nfloat lightness(vec2 p, vec4 c, float th, float soft) {\n return smoothstep(th - soft, th + soft + 1e-4, dot(c.rgb, W)) * smoothstep(th, th + 0.08, around(p));\n}\n\nfloat inside(float y, float aa) {\n return clamp(min(y, 1.0 - y) / aa + 0.5, 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float th = 0.25 * (luma(vec2(0.25)) + luma(vec2(0.75)) + luma(vec2(0.25, 0.75)) + luma(vec2(0.75, 0.25)));\n th = clamp(th, 0.1, 0.9);\n\n float t = progress;\n float rise = 1.08 * t * t * (1.6 - 0.6 * t);\n float sink = 1.08 * t * t * t * (2.0 - t);\n float lift = sin(3.14159 * t);\n float aa = 0.0015 * smoothstep(0.0, 0.1, t) + 1e-6;\n\n vec2 pL = uv - vec2(0.0, rise);\n vec2 pD = uv + vec2(0.0, sink);\n vec4 light = getFromColor(pL);\n vec4 dark = getFromColor(pD);\n float mL = inside(pL.y, aa) * lightness(pL, light, th, softness);\n float mD = inside(pD.y, aa) * (1.0 - lightness(pD, dark, th, softness));\n float wD = min(mD, 1.0 - mL);\n\n vec2 so = unit(1.0) * vec2(-0.012, 0.02) * lift;\n vec2 sL = pL + so;\n vec2 sD = pD + so;\n float shL = inside(sL.y, aa) * lightness(sL, getFromColor(sL), th, 0.1);\n float shD = inside(sD.y, aa) * (1.0 - lightness(sD, getFromColor(sD), th, 0.1));\n\n vec4 to = getToColor(uv);\n to.rgb *= 1.0 - shadow * lift * max(shL, shD);\n \n dark.rgb *= 1.0 - shadow * lift * shL;\n return to * (1.0 - mL - wD) + dark * wD + light * mL;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 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 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 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 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 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 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 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","StrobeToss":"// StrobeToss — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/StrobeToss.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is tossed in as a small card that flies along an arc over the outgoing image and lands full frame, lit by a strobe: every flash freezes a crisp copy of the card where it was, so a trail of pictures records its flight\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 flashes; \n\nuniform float pop; \n\nuniform float dim; \n\nuniform vec4 border; \n\nconst int MAX_FLASHES = 10;\nconst float PI = 3.14159265;\n\nfloat growth(float t) {\n return smoothstep(0.5, 1.0, t);\n}\n\nvec4 pose(float t, vec2 box) {\n float u = 1.0 - pow(1.0 - clamp(t / 0.8, 0.0, 1.0), 1.6);\n float g = growth(t);\n float a = PI + 0.35 - (PI + 0.2) * u;\n \n vec2 r = vec2(mix((0.5 * box.x + 0.15 * length(box) + 0.07) / 0.93, 0.31 * max(box.x, 1.0), sqrt(u)), 0.3);\n vec2 c = r * vec2(cos(a), sin(a)) + vec2(0.0, 0.04);\n return vec4(c * (1.0 - g), mix(0.3, 1.0, g * g), 0.9 * (u - 0.5) * (1.0 - g) * (1.0 - g) - 0.6 * (1.0 - u));\n}\n\nfloat edgeDist(vec2 l, vec4 P, vec2 box) {\n vec2 e = abs(l) - 0.5 * box * P.z;\n return max(e.x, e.y);\n}\n\nvec4 card(vec4 acc, vec2 q, vec2 box, float t, float age, float shadow, float flash, float px) {\n vec4 P = pose(t, box);\n float k = 1.0 - growth(t);\n float c = cos(P.w), s = sin(P.w);\n mat2 rot = mat2(c, -s, s, c);\n vec2 l = rot * (q - P.xy);\n float ds = edgeDist(l - rot * vec2(0.018, -0.026) * k, P, box);\n acc.rgb *= 1.0 - 0.5 * shadow * sqrt(k) * (1.0 - smoothstep(-0.02, 0.03, ds));\n float d = edgeDist(l, P, box);\n \n float aa = px * clamp(k * 12.0, 1e-4, 1.0);\n float cov = clamp(0.5 - d / aa, 0.0, 1.0);\n vec4 col = getToColor(clamp(l / (box * P.z) + 0.5, 0.0, 1.0));\n col = mix(col, border, clamp(0.5 + (d + 0.016 * sqrt(k)) / aa, 0.0, 1.0));\n col.rgb *= 1.0 - 0.3 * clamp(age, 0.0, 1.0) * k;\n col.rgb = mix(col.rgb, vec3(1.0), flash * k);\n return mix(acc, col, cov);\n}\n\nvec4 transition(vec2 uv) {\n vec2 box = vec2(ratio, 1.0);\n vec2 q = (uv - 0.5) * box;\n float px = 0.002;\n float p = progress;\n vec4 acc = getFromColor(uv);\n acc.rgb *= 1.0 - clamp(dim, 0.0, 1.0) * smoothstep(0.0, 0.5, p);\n float n = clamp(float(flashes), 2.0, float(MAX_FLASHES));\n for (int i = 1; i <= MAX_FLASHES; i++) {\n float t = float(i) / (n + 1.0);\n if (float(i) > n || t > p) break;\n float age = (p - t) * (n + 1.0);\n acc = card(acc, q, box, t, age, smoothstep(0.0, 0.6, age), 0.0, px);\n }\n float last = min(floor(p * (n + 1.0)), n);\n float flash = clamp(pop, 0.0, 1.0) * step(1.0, last) * exp(-(p * (n + 1.0) - last) * 9.0);\n acc = card(acc, q, box, p, -1.0, 1.0, 0.6 * flash, px);\n acc.rgb += 0.15 * flash * (1.0 - growth(p));\n return acc;\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Subdivide":"// Subdivide — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Subdivide.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is cut in quick beats like a sheet under a guillotine, each piece cut again across its longer side at its own uneven point and pushed apart into floating cards, then the cards flip over one by one to the incoming image and the cuts close back in reverse order\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 gap; \n\nuniform float shadow; \n\nuniform vec4 background; \n\nconst int LEVELS = 5;\nconst float CUT = 0.08;\nconst float FLIP = 0.12;\nconst float CLOSE = 0.06;\nconst float PERSPECTIVE = 0.6;\n\nfloat hash(float n) {\n vec3 p = fract(vec3(n) * vec3(0.1031, 0.1030, 0.0973));\n p += dot(p, p.yzx + 33.33);\n return fract((p.x + p.y) * p.z);\n}\n\nfloat opening(float t, float l) {\n float u = clamp((t - 0.03 - l * 0.07) / CUT, 0.0, 1.0) - 1.0;\n float c = clamp((t - 0.77 - (float(LEVELS - 1) - l) * 0.04) / CLOSE, 0.0, 1.0);\n return (1.0 + 2.4 * u * u * u + 1.4 * u * u) * (1.0 - c * c);\n}\n\nmat3 descend(vec2 p, float t, float aa) {\n vec2 lo = vec2(0.0), hi = vec2(ratio, 1.0), off = vec2(0.0);\n float node = 1.0, cov = 1.0, edge = 1.0, g = gap;\n for (int l = 0; l < LEVELS; l++) {\n vec2 size = hi - lo;\n vec2 ax = size.x > size.y ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n float cut = dot(lo + (0.32 + 0.36 * hash(node)) * size, ax);\n float s = g * opening(t, float(l));\n float d = dot(p - off, ax) - cut;\n float side = step(0.0, d);\n float dg = abs(d) - 0.5 * s;\n float fade = clamp(s / aa, 0.0, 1.0);\n cov = min(cov, mix(1.0, clamp(0.5 + dg / aa, 0.0, 1.0), fade));\n edge = min(edge, dg + 1.0 - fade);\n off += ax * (side - 0.5) * s;\n lo = mix(lo, lo * (1.0 - ax) + cut * ax, side);\n hi = mix(hi * (1.0 - ax) + cut * ax, hi, side);\n node = 2.0 * node + side;\n g *= 0.8;\n }\n return mat3(lo, hi.x, hi.y, off, cov, edge, node);\n}\n\nfloat turn(float node, float t) {\n float n = exp2(float(LEVELS));\n float u = clamp((t - 0.4 - 0.26 * (2.0 * n - 1.0 - node) / (n - 1.0)) / FLIP, 0.0, 1.0);\n return u * u * (3.0 - 2.0 * u);\n}\n\nvec4 cardPoint(vec2 p, mat3 m, float t, float aa) {\n vec2 lo = m[0].xy, hi = vec2(m[0].z, m[1].x);\n vec2 hs = 0.5 * (hi - lo);\n vec2 q = p - 0.5 * (lo + hi) - m[1].yz;\n bool alongX = hs.x > hs.y;\n vec2 lq = alongX ? q : q.yx;\n vec2 lh = alongX ? hs : hs.yx;\n float a = 3.14159265 * turn(m[2].z, t);\n float c = cos(a), s = sin(a);\n \n float k = PERSPECTIVE * s;\n float m0 = 1.0 - lh.x * k;\n float den = c * m0 - lq.x * k;\n float x = lq.x / (abs(den) < 1e-6 ? 1e-6 : den);\n float w = (1.0 + x * k) / m0;\n vec2 l = vec2(x, lq.y * w) / lh;\n vec2 e = (1.0 - abs(l)) * lh * vec2(abs(c), 1.0) / w;\n \n float vis = mix(1.0, clamp(0.5 + min(e.x, e.y) / aa, 0.0, 1.0), min(20.0 * s, 1.0));\n return vec4(alongX ? l : l.yx, c, vis);\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n vec2 p = uv * vec2(ratio, 1.0);\n float aa = 1.0 / 300.0;\n mat3 m = descend(p, t, aa);\n vec4 cp = cardPoint(p, m, t, aa);\n float cov = m[2].x * cp.w;\n vec2 lo = m[0].xy, hi = vec2(m[0].z, m[1].x);\n vec2 c = 0.5 * (lo + hi), h = 0.5 * (hi - lo);\n bool back = cp.z < 0.0;\n vec2 lp = back ? (h.x > h.y ? vec2(-cp.x, cp.y) : vec2(cp.x, -cp.y)) : cp.xy;\n vec2 src = clamp((c + clamp(lp, -1.0, 1.0) * h) / vec2(ratio, 1.0), 0.0, 1.0);\n vec4 card = back ? getToColor(src) : getFromColor(src);\n\n float lift = smoothstep(0.02, 0.18, t) * (1.0 - smoothstep(0.72, 0.99, t));\n float bevel = lift * (1.0 - smoothstep(0.0, 0.005, m[2].y));\n card.rgb = mix(card.rgb, card.rgb * 0.7 + 0.3, 0.5 * bevel);\n card.rgb *= 0.55 + 0.45 * abs(cp.z);\n\n vec2 sp = p + vec2(-0.012, 0.018) * lift;\n mat3 ms = descend(sp, t, 0.03);\n float sh = ms[2].x * cardPoint(sp, ms, t, 0.03).w;\n vec4 bg = background;\n bg.rgb *= 1.0 - shadow * sh * lift;\n return mix(bg, card, cov);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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","Swim":"// Swim — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Swim.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image turns into a fish and swims out of the frame head first: its body narrows into a forked tail, a bending wave runs from its head to its tail and swings wider beat by beat, lighting and shading its flanks as it bends and driving it faster until it is gone, revealing the incoming image under its soft 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 float swing; \n\nuniform float beats; \n\nuniform float taper; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\nconst float AA = 0.003;\nconst float HEAD = 0.38;\nconst float PEDUNCLE = 0.8;\nconst float FORK = 0.17;\nconst float K = 2.0 * PI * 0.8;\n\nfloat wave(float u, float amp, float ph) {\n return amp * (0.1 + 0.9 * u * u) * sin(K * u - ph);\n}\n\nfloat dwave(float u, float amp, float ph) {\n return amp * (1.8 * u * sin(K * u - ph) + (0.1 + 0.9 * u * u) * K * cos(K * u - ph));\n}\n\nfloat ddwave(float u, float amp, float ph) {\n float a = K * u - ph;\n return amp * (1.8 * sin(a) + 3.6 * u * K * cos(a) - (0.1 + 0.9 * u * u) * K * K * sin(a));\n}\n\nfloat centerline(float u, float amp, float ph) {\n return wave(clamp(u, -0.1, PEDUNCLE), amp, ph) + dwave(PEDUNCLE, amp, ph) * max(u - PEDUNCLE, 0.0);\n}\n\nfloat slope(float u, float amp, float ph) {\n return u < -0.1 ? 0.0 : dwave(min(u, PEDUNCLE), amp, ph);\n}\n\nfloat trunk(float u) {\n return 1.0 - taper * smoothstep(0.3, PEDUNCLE, u);\n}\n\nfloat profile(float u, float m) {\n float h = pow(sin(0.5 * PI * clamp(u / HEAD, 0.0, 1.0)), 0.6);\n float body = trunk(u);\n float fin = mix(1.0 - taper, 0.95, smoothstep(PEDUNCLE, 0.97, u));\n float w = u < PEDUNCLE ? h * body : max(body, fin);\n return mix(1.0, w, m);\n}\n\nvec2 bodyCoords(vec2 P, float head, float len, float amp, float ph) {\n float u = (P.x - head) / len;\n for (int i = 0; i < 4; i++) {\n vec2 T = normalize(vec2(len, slope(u, amp, ph)));\n u += dot(P - vec2(head + u * len, 0.5 + centerline(u, amp, ph)), T) / len;\n }\n vec2 T = normalize(vec2(len, slope(u, amp, ph)));\n return vec2(u, dot(P - vec2(head + u * len, 0.5 + centerline(u, amp, ph)), vec2(-T.y, T.x)));\n}\n\nfloat fish(vec2 b, float len, float hh, float m) {\n float e = 0.002;\n float hw = hh * profile(b.x, m);\n float dw = clamp(hh * (profile(b.x + e, m) - profile(b.x - e, m)) / (2.0 * e * len), -4.0, 4.0);\n float side = (abs(b.y) - hw) / sqrt(1.0 + dw * dw);\n float tail = len * (1.0 - m * FORK * (1.0 - min(abs(b.y) / max(hw, 1e-3), 1.0)));\n float s = b.x * len;\n return max(max(side, -s), s - tail) - 2.0 * AA * (1.0 - m);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n bool tall = ratio < 1.0;\n float L = tall ? 1.0 / ratio : ratio;\n vec2 P = tall ? vec2((1.0 - uv.y) * L, uv.x) : vec2(uv.x * L, uv.y);\n\n float m = smoothstep(0.0, 0.35, t);\n float len = L * mix(1.0, 0.6, m);\n float hh = 0.5 * mix(1.0, 0.6, m);\n \n float amp = swing * min(1.0, L / 1.6) * smoothstep(0.0, 0.6, t);\n float g = t * (0.5 + 0.5 * t);\n float ph = 2.0 * PI * beats * g;\n float travel = 0.6 * L + 0.3 + swing;\n \n float head = 0.12 * L * m * (1.0 - t) - travel * (pow(t, 2.4) + 0.012 * sin(4.0 * PI * beats * g) * t * (1.0 - t));\n\n vec2 b = bodyCoords(P, head, len, amp, ph);\n float inBody = 1.0 - smoothstep(-AA, AA, fish(b, len, hh, m));\n\n float u = b.x;\n float hw = hh * profile(u, m);\n float body = hh * mix(1.0, trunk(u), m);\n vec2 src = mirror(vec2(u, 0.5 + 0.5 * b.y / max(hw, 0.6 * body)));\n vec4 c = getFromColor(tall ? vec2(src.y, 1.0 - src.x) : src);\n\n vec2 T = normalize(vec2(len, slope(u, amp, ph)));\n vec2 lat = tall ? vec2(T.x, T.y) : vec2(-T.y, T.x);\n float vn = clamp(b.y / max(body, 1e-3), -1.0, 1.0);\n float fin = smoothstep(PEDUNCLE - 0.05, PEDUNCLE + 0.05, u);\n vec3 N = normalize(vec3(lat * vn * (1.0 - fin), mix(sqrt(1.0 - vn * vn), 1.0, fin)));\n vec3 Ld = normalize(vec3(-0.35, 0.55, 0.75));\n float diff = max(dot(N, Ld), 0.0) / Ld.z;\n float spec = pow(max(dot(reflect(-Ld, N), vec3(0.0, 0.0, 1.0)), 0.0), 16.0);\n float k = shading * m;\n float curv = ddwave(clamp(u, 0.0, PEDUNCLE), amp, ph) / (len * len);\n \n float crease = clamp(0.25 * curv * vn, -1.0, 1.0) * (1.0 - fin);\n c.rgb = c.rgb * mix(1.0, min(diff, 1.1) * (1.0 - 0.3 * crease), 0.7 * k) + 0.08 * k * spec * c.a;\n\n vec2 off = 0.06 * m * (tall ? vec2(1.0, 1.0) : vec2(1.0, -1.0));\n \n float sd = fish(b - vec2(dot(off, T) / len, dot(off, vec2(-T.y, T.x))), len, hh, m);\n vec4 bg = getToColor(uv);\n bg.rgb *= 1.0 - 0.5 * k * (1.0 - smoothstep(-0.04, 0.08, sd));\n\n return mix(bg, c, inBody * (1.0 - 0.15 * m * fin));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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: The image twists into a round swirl around the center that peaks mid-way, where the outgoing image dissolves into the incoming one, then untwists\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 radius; \n\nuniform vec2 center; \n\nconst float PI = 3.141592653589793;\nconst float TAU = 6.283185307179586;\nconst float ZOOM = 0.12;\n\nconst float BLUR = 0.05;\nconst int TAPS = 12;\n\nvec2 mirrored(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nvec4 transition(vec2 uv) {\n \n float s = sin(PI * progress);\n float amount = s * s;\n \n float speed = PI * sin(TAU * progress);\n float reveal = smoothstep(0.3, 0.7, progress);\n\n vec2 aspect = vec2(ratio, 1.0);\n vec2 d = (uv - center) * aspect;\n float x = clamp(length(d) / max(radius, 1e-3), 0.0, 1.0);\n float falloff = (1.0 - x) * (1.0 - x);\n float twist = strength * TAU * falloff;\n float angle = twist * amount;\n \n float spread = clamp(twist * speed * BLUR, -1.2, 1.2);\n d *= 1.0 - ZOOM * amount * falloff;\n\n vec4 col = vec4(0.0);\n float total = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float k = float(i) / float(TAPS - 1) - 0.5;\n float w = 1.0 - abs(k);\n float a = angle + spread * k;\n float c = cos(a);\n float sn = sin(a);\n vec2 q = mirrored(center + vec2(c * d.x - sn * d.y, sn * d.x + c * d.y) / aspect);\n col += mix(getFromColor(q), getToColor(q), reveal) * w;\n total += w;\n }\n return col / 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","Tableau":"// Tableau — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Tableau.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image parts like a theater tableau curtain: each half is drawn up and out toward its top corner, opening a high rounded arch while the fabric gathers into pleats fanning toward the corners, then the two swags fly up out of 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 folds; \n\nuniform float shading; \n\nuniform float hitch; \n\nconst float PI = 3.141592653589793;\n\nfloat edgeX(float y, vec2 c, float k, float q) {\n if (y >= c.y) {\n float t = clamp((1.0 - y) / max(1.0 - c.y, 1e-4), 0.0, 1.0);\n return 0.5 - (0.5 - c.x) * pow(max(1.0 - pow(1.0 - t, q), 0.0), 1.0 / q);\n }\n \n float r = (y / max(c.y, 1e-4) - k) / (1.0 - k);\n return c.x * (r >= 0.0 ? sqrt(r) : -sqrt(-r));\n}\n\nfloat edgeY(float x, vec2 c, float k, float q) {\n if (x >= c.x) {\n float b = clamp((0.5 - x) / max(0.5 - c.x, 1e-4), 0.0, 1.0);\n return 1.0 - (1.0 - c.y) * (1.0 - pow(max(1.0 - pow(b, q), 0.0), 1.0 / q));\n }\n float r = x / c.x;\n return c.y * (k + (1.0 - k) * r * r);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n float G = smoothstep(0.0, 0.62, p);\n float f = clamp((p - 0.42) / 0.58, 0.0, 1.0);\n float fly = f * f * (3.0 - 2.0 * f);\n \n float k = 0.7 * fly;\n float lift = (1.08 - k * hitch) * f * f;\n float bunch = clamp(0.2 / ratio, 0.1, 0.18);\n vec2 c = vec2(0.5 - (0.5 - bunch) * G, hitch * smoothstep(0.0, 0.8, G));\n \n float q = mix(0.6, 2.0, smoothstep(0.0, 0.7, G));\n float right = step(0.5, uv.x);\n float x = mix(uv.x, 1.0 - uv.x, right);\n float y = uv.y - lift;\n\n float e = edgeX(y, c, k, q);\n float dx = (e - x) * ratio;\n float dy = y - edgeY(x, c, k, q);\n float d = dx * abs(dy) / max(length(vec2(dx, dy)), 1e-6);\n float w = 0.002 * G + 1e-4;\n float inside = clamp(1.0 + d / w, 0.0, 1.0);\n\n float span = mix(c.x, e, step(c.y, y));\n float u = clamp(x / max(span, 1e-4), 0.0, 1.0);\n float hem = c.y * mix(u * u, 1.0, k);\n float v = clamp((1.0 - y) / max(1.0 - hem, 1e-4), 0.0, 1.0);\n\n float n = max(2.0, floor(folds * min(ratio, 1.0) + 0.5));\n \n float a = 2.0 * PI * n * u + 0.7 * sin(PI * n * u * 0.73 + 1.3);\n float squeeze = 1.0 - 2.0 * span;\n float amp = G * mix(0.3, 0.95, squeeze) * (0.8 + 0.2 * sin(PI * n * u * 0.41 + 0.4));\n float su = clamp(u + amp * sin(a) / (2.0 * PI * n), 0.0, 1.0);\n vec4 from = getFromColor(vec2(mix(0.5 * su, 1.0 - 0.5 * su, right), 1.0 - v));\n\n float slope = 2.2 * amp * cos(a);\n float tilt = 1.1 * G * v * v * (0.3 + 0.7 * u);\n vec3 nrm = normalize(vec3(-slope, -tilt, 1.0));\n \n vec3 L = normalize(vec3(-0.35, 0.6, 1.0));\n float diffuse = max(dot(nrm, L), 0.0) / L.z;\n float sheen = pow(max(dot(nrm, normalize(L + vec3(0.0, 0.0, 1.0))), 0.0), 10.0);\n float crease = 0.5 + 0.5 * sin(a);\n float edge = exp(-max(d, 0.0) * 70.0);\n float light = diffuse * (1.0 - 0.5 * crease * crease * amp) * (1.0 - 0.3 * squeeze * v * G) * (1.0 - 0.3 * edge)\n + 0.22 * sheen * amp;\n from.rgb *= mix(1.0, light, shading * smoothstep(0.0, 0.25, G));\n\n vec4 to = getToColor(uv);\n float shadow = 0.5 * shading * exp(max(-d, 0.0) * -30.0) * G * (1.0 - fly);\n to.rgb *= 1.0 - shadow;\n return mix(to, from, 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","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 \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 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 vec2 myst = uv;\n float animationTime = progress;\n float easingTime = KeySpline(animationTime, .68,.01,.17,.98);\n float blur = max(normpdf(easingTime) - exp(-5.0), 0.0) / (1.0 - exp(-5.0));\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 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 vec2 mystNext = myst;\n mystNext.y *= 1./ratio;\n mystNext = rotateUv(mystNext, r, vec2(1., 0.), -1.);\n mystNext.y *= ratio;\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","TileBlast":"// TileBlast — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TileBlast.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image breaks into square tiles that blast toward the viewer from a point, the nearest ones first, each one tumbling and growing in perspective as it flies out past the frame, uncovering the incoming image behind 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 int rows; \n\nuniform vec2 center; \n\nuniform float spin; \n\nuniform float shading; \n\nconst float EYE = 2.0;\nconst float ZEND = 1.6;\n\nconst float DRIFT = 0.3;\n\nconst float WAVE = 0.75;\nconst float JITTER = 0.06;\nconst float FLIGHT = 0.45;\nconst float FINAL = 0.75;\nconst float EDGE = 0.0015;\n\nconst vec3 L = vec3(-0.32, 0.4, 0.86);\nconst vec3 HV = vec3(-0.1659, 0.2073, 0.9641);\n\nvec4 hash4(vec2 p) {\n vec4 q = fract(vec4(p.xyxy) * vec4(0.1031, 0.1030, 0.0973, 0.1099));\n q += dot(q, q.wzxy + 33.33);\n return fract((q.xxyz + q.yzzw) * q.zywx);\n}\n\nfloat flight(vec2 g, vec2 size, vec2 c, float dmax) {\n float d = clamp((length((g + 0.5) * size - c) - 0.7 * size.y) / dmax, 0.0, 1.0);\n float t = (progress - WAVE * d - JITTER * hash4(g).x) / FLIGHT;\n t = clamp(max(t, (progress - FINAL) / (1.0 - FINAL)), 0.0, 1.0);\n return t * (0.55 + 0.45 * t);\n}\n\nvec2 flyDir(vec2 g, vec2 size, vec2 c) {\n vec2 v = (g + 0.5) * size - c;\n float l = length(v);\n \n vec2 a = 6.2831853 * hash4(g + 7.0).xy;\n return l > 0.02 * size.y ? v / l : vec2(cos(a.x), sin(a.x));\n}\n\nvec3 turn(vec3 v, vec3 k, float cb, float sb) {\n return v * cb + cross(k, v) * sb + k * dot(k, v) * (1.0 - cb);\n}\n\nvec4 transition(vec2 uv) {\n vec2 aspect = vec2(ratio, 1.0);\n vec2 P = uv * aspect;\n vec2 c = clamp(center, 0.0, 1.0) * aspect;\n float n = clamp(float(rows), 1.0, 12.0);\n vec2 grid = vec2(max(1.0, floor(ratio * n + 0.5)), n);\n vec2 size = aspect / grid;\n \n float dmax = max(length(max(c, aspect - c) - 0.5 * size) - 0.7 * size.y, 1e-3);\n float spinAmt = clamp(spin, 0.0, 1.0);\n float shadeAmt = clamp(shading, 0.0, 1.0);\n vec3 eye = vec3(c, EYE);\n vec3 ray = vec3(P - c, -EYE);\n\n \n float z1 = 1e9, z2 = 1e9;\n vec2 g1 = vec2(-1e4), g2 = vec2(-1e4);\n vec2 q1 = P, q2 = P;\n float m1 = 0.0, m2 = 0.0, s1 = 1.0, s2 = 1.0;\n float lift1 = 0.0, lift2 = 0.0;\n\n \n \n \n \n float dw = max(0.4 * size.y / (length(P - c) * ZEND / EYE + DRIFT), 1.0 / 31.0);\n vec2 lastCell = vec2(-1e4), lastSide = vec2(0.0);\n for (int k = 0; k < 32; k++) {\n float wk = float(k) * dw;\n if (wk > 1.0 + dw) break;\n wk = min(wk, 1.0);\n vec2 back = c + (P - c) * (EYE - ZEND * wk) / EYE;\n vec2 home = back - DRIFT * wk * flyDir(floor(back / size), size, c);\n home = back - DRIFT * wk * flyDir(floor(home / size), size, c);\n vec2 f = home / size;\n vec2 cell = floor(f);\n vec2 side = step(0.5, fract(f)) * 2.0 - 1.0;\n \n if (cell == lastCell && side == lastSide) continue;\n lastCell = cell;\n lastSide = side;\n for (int j = 0; j < 4; j++) {\n vec2 g = cell + vec2(j == 1 || j == 3 ? side.x : 0.0, j >= 2 ? side.y : 0.0);\n if (g.x < 0.0 || g.y < 0.0 || g.x >= grid.x || g.y >= grid.y) continue;\n if (g == g1 || g == g2) continue;\n float u = flight(g, size, c, dmax);\n if (u >= 1.0) continue;\n vec4 h = hash4(g + 31.0);\n vec2 dir = flyDir(g, size, c);\n vec2 h0 = (g + 0.5) * size;\n vec3 tc = vec3(h0 + dir * DRIFT * u, ZEND * u);\n float a = spinAmt * 2.4 * (h.x - 0.5) * u;\n float b = spinAmt * (0.5 + 0.7 * h.y) * (h.z < 0.5 ? -1.0 : 1.0) * 1.8 * u;\n vec3 ax = normalize(vec3(-dir.y + 0.4 * (h.w - 0.5), dir.x, 0.0));\n float ca = cos(a), sa = sin(a), cb = cos(b), sb = sin(b);\n vec3 a1 = turn(vec3(ca, sa, 0.0), ax, cb, sb);\n vec3 a2 = turn(vec3(-sa, ca, 0.0), ax, cb, sb);\n vec3 nrm = turn(vec3(0.0, 0.0, 1.0), ax, cb, sb);\n float den = dot(ray, nrm);\n if (abs(den) < 1e-5) continue;\n float lam = dot(tc - eye, nrm) / den;\n if (lam <= 0.0 || lam >= z2) continue;\n vec3 hit = eye + lam * ray - tc;\n vec2 l = vec2(dot(hit, a1), dot(hit, a2));\n \n vec2 box = 0.5 * size - abs(l);\n float e = min(box.x, box.y) * EYE / (EYE - tc.z) * max(abs(nrm.z), 0.15);\n float m = clamp(e / (2.0 * EDGE) + 0.5 + 0.5 * (1.0 - smoothstep(0.0, 0.06, u)), 0.0, 1.0);\n if (m <= 0.0) continue;\n vec3 nf = den < 0.0 ? nrm : -nrm;\n float lit = 1.0 - 0.6 * shadeAmt * (1.0 - clamp(dot(nf, L) / L.z, 0.0, 1.0));\n float lift = smoothstep(0.0, 0.15, u);\n lit += shadeAmt * lift * (0.2 * pow(max(dot(nf, HV), 0.0), 60.0) + 0.3 * (1.0 - smoothstep(0.0, 0.003, e)));\n if (den >= 0.0) lit *= 0.55;\n if (lam < z1) {\n z2 = z1; g2 = g1; q2 = q1; m2 = m1; s2 = s1; lift2 = lift1;\n z1 = lam; g1 = g; q1 = h0 + l; m1 = m; s1 = lit; lift1 = lift;\n } else {\n z2 = lam; g2 = g; q2 = h0 + l; m2 = m; s2 = lit; lift2 = lift;\n }\n }\n }\n\n float shTo = 0.0, sh1 = 0.0, sh2 = 0.0;\n if (shadeAmt > 0.0) {\n vec2 base = floor(P / size);\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 g = base + vec2(float(x), float(y));\n if (g.x < 0.0 || g.y < 0.0 || g.x >= grid.x || g.y >= grid.y) continue;\n float u = flight(g, size, c, dmax);\n float z = ZEND * u;\n \n float w = smoothstep(0.0, 0.03, u) * (1.0 - smoothstep(0.1 * size.y, 0.7 * size.y, z));\n if (w <= 0.0) continue;\n vec2 o = P + L.xy / L.z * z - ((g + 0.5) * size + flyDir(g, size, c) * DRIFT * u);\n float blur = 0.004 + 0.25 * z;\n vec2 sb = 0.5 * size - abs(o) + 0.5 * blur;\n float sh = smoothstep(0.0, blur, sb.x) * smoothstep(0.0, blur, sb.y) * w;\n \n shTo = max(shTo, sh);\n if (g != g1) sh1 = max(sh1, sh);\n if (g != g2) sh2 = max(sh2, sh);\n }\n }\n }\n float dark = 0.5 * shadeAmt;\n\n float settle = 1.0 - progress;\n vec2 tq = c + (P - c) / (1.0 + 0.06 * settle * settle);\n vec4 col = getToColor(tq / aspect);\n col.rgb *= (1.0 - dark * shTo) * (1.0 - 0.25 * shadeAmt * (1.0 - smoothstep(0.2, 0.9, progress)));\n if (m2 > 0.0) {\n vec4 img = getFromColor(clamp(q2 / aspect, 0.0, 1.0));\n img.rgb *= s2 * mix(1.0 - dark * sh2, 1.0, lift2);\n col = mix(col, img, m2);\n }\n if (m1 > 0.0) {\n vec4 img = getFromColor(clamp(q1 / aspect, 0.0, 1.0));\n img.rgb *= s1 * mix(1.0 - dark * sh1, 1.0, lift1);\n col = mix(col, img, m1);\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","TileConveyor":"// TileConveyor — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TileConveyor.glsl\n// Author: gre\n// License: MIT\n// Description: Gaps open between the tiles of the outgoing image over a track that winds through every tile; the tiles glide along it like a train, the outgoing ones leaving at the bottom right while the incoming ones enter at the bottom left and wind through the frame until they settle 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 order; \n\nuniform float gap; \n\nuniform float shading; \n\nuniform vec4 tray; \n\nuniform vec4 track; \n\nconst float EDGE = 0.0016;\n\nvec2 cellAt(float d, float n) {\n if (d < 0.0) return vec2(-1.0, 0.0);\n if (d > n * n - 0.5) return vec2(n, 0.0);\n vec2 p = vec2(0.0);\n float t = d;\n float s = 1.0;\n for (int i = 0; i < 3; i++) {\n if (s < n) {\n float rx = mod(floor(t / 2.0), 2.0);\n float ry = abs(mod(t, 2.0) - rx);\n if (ry < 0.5) {\n if (rx > 0.5) p = s - 1.0 - p;\n p = p.yx;\n }\n p += s * vec2(rx, ry);\n t = floor(t / 4.0);\n s *= 2.0;\n }\n }\n return p;\n}\n\nfloat indexAt(vec2 c, float n) {\n float d = 0.0;\n vec2 p = c;\n float s = n / 2.0;\n for (int i = 0; i < 3; i++) {\n if (s >= 1.0) {\n float rx = mod(floor(p.x / s), 2.0);\n float ry = mod(floor(p.y / s), 2.0);\n d += s * s * (rx > 0.5 ? 3.0 - ry : ry);\n if (ry < 0.5) {\n if (rx > 0.5) p = n - 1.0 - p;\n p = p.yx;\n }\n s /= 2.0;\n }\n }\n return d;\n}\n\nfloat turns(vec2 a, vec2 c, vec2 b) {\n a -= c;\n b -= c;\n return abs(a.x * b.y - a.y * b.x);\n}\n\nfloat sdBox(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\nfloat sdSegment(vec2 p, vec2 a, vec2 b) {\n vec2 pa = p - a, ba = b - a;\n return length(pa - ba * clamp(dot(pa, ba) / dot(ba, ba), 0.0, 1.0));\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - abs(v));\n}\n\nvec4 transition(vec2 uv) {\n float n = floor(exp2(clamp(float(order), 1.0, 3.0)) + 0.5);\n float N = n * n;\n vec2 asp = vec2(ratio, 1.0);\n float open = smoothstep(0.0, 0.12, progress) * (1.0 - smoothstep(0.88, 1.0, progress));\n float q = clamp((progress - 0.07) / 0.86, 0.0, 1.0);\n float D = N * mix(q, q * q * (3.0 - 2.0 * q), 0.7);\n float K = floor(D);\n float f = D - K;\n \n f -= 0.5 * sin(6.2831853 * f) / 6.2831853;\n\n vec2 g = uv * n;\n vec2 cell = clamp(floor(g), 0.0, n - 1.0);\n float dc = indexAt(cell, n);\n float px = EDGE * n;\n float hs = 0.5 - 0.5 * clamp(gap, 0.05, 0.4) * open;\n float radius = 0.1 * open;\n\n vec2 gs = g * asp;\n float tw = 0.1 * min(ratio, 1.0);\n vec2 cc = (cell + 0.5) * asp;\n float dl = min(sdSegment(gs, cc, (cellAt(dc - 1.0, n) + 0.5) * asp),\n sdSegment(gs, cc, (cellAt(dc + 1.0, n) + 0.5) * asp));\n vec4 col = mix(tray, track, (1.0 - smoothstep(tw - px, tw + px, dl)) * (0.65 + 0.35 * smoothstep(0.0, 0.35 * tw, dl)));\n\n float shadow = 0.0;\n vec4 acc = vec4(0.0);\n float alpha = 0.0;\n for (int i = 0; i < 9; i++) {\n vec2 nc = cell + vec2(mod(float(i), 3.0), floor(float(i) / 3.0)) - 1.0;\n bool entry = nc.x == -1.0 && nc.y == 0.0;\n if (!entry && (min(nc.x, nc.y) < 0.0 || max(nc.x, nc.y) > n - 1.0)) continue;\n \n float k = entry ? -1.0 : indexAt(nc, n);\n float j = k - K;\n if (j < -N) continue;\n vec2 c1 = cellAt(k + 1.0, n);\n vec2 lc = g - 0.5 - mix(nc, c1, f);\n vec2 lp = lc * asp;\n \n float lim = mix(0.5, 0.25 + 0.5 * (sqrt((f - 0.5) * (f - 0.5) + 0.0025) - 0.05), open);\n float h = max(turns(cellAt(k - 1.0, n), nc, c1), turns(nc, c1, cellAt(k + 2.0, n))) > 0.5 ? min(hs, lim) : hs;\n \n vec2 hb = h * asp + 3.0 * px * (1.0 - open) * (k >= 0.0 && k < N ? 1.0 : -1.0);\n float sd = sdBox(lp, hb, radius * h);\n \n float fade = 1.0 - smoothstep(0.4, 0.5, max(abs(lc.x), abs(lc.y)));\n shadow = max(shadow, open * fade * (1.0 - smoothstep(-0.04, 0.12, sdBox(lp - vec2(0.04, -0.06), hb, radius * h))));\n float cover = 1.0 - smoothstep(-px, px, sd);\n if (cover <= 0.0) continue;\n vec2 src = cellAt(j >= 0.0 ? j : j + N, n);\n vec2 suv = mirror((src + 0.5 + 0.5 * lp / (h * asp)) / n);\n vec4 c = j >= 0.0 ? getFromColor(suv) : getToColor(suv);\n float rim = 1.0 - smoothstep(0.0, 0.05, -sd);\n float lit = dot(normalize(lp / hb + 1e-5), vec2(-0.7071, 0.7071));\n c.rgb *= 1.0 + shading * open * (rim * 0.35 * lit - 0.08 * (1.0 - rim));\n acc = mix(acc, c, cover);\n alpha = mix(alpha, 1.0, cover);\n }\n col.rgb *= 1.0 - 0.6 * shading * shadow;\n return mix(col, acc / max(alpha, 1e-4), 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","TileRings":"// TileRings — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TileRings.glsl\n// Author: gre\n// License: MIT\n// Description: The image is cut into tiles that ride concentric rectangular rings like the dials of a combination lock: the rings turn a quarter of the way round in alternating directions, the tiles turning the corners like links of a chain, then the tiles flip over to the incoming image in a ripple running round each ring, and the rings turn back until every tile clicks home\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 rings; \n\nuniform float stagger; \n\nuniform float shadow; \n\nuniform vec4 backColor; \n\nconst float PI = 3.141592653589793;\nconst float GAP = 0.035;\nconst float EYE = 3.0;\nconst vec2 LIGHT = vec2(0.12, -0.16);\n\nfloat ringOf(vec2 c, vec2 dims) {\n return min(min(c.x, c.y), min(dims.x - 1.0 - c.x, dims.y - 1.0 - c.y));\n}\n\nfloat indexOf(vec2 c, float r, vec2 wh) {\n vec2 q = c - r;\n if (q.y < 0.5) return q.x;\n if (q.x > wh.x - 0.5) return wh.x + q.y;\n if (q.y > wh.y - 0.5) return 2.0 * wh.x + wh.y - q.x;\n return 2.0 * (wh.x + wh.y) - q.y;\n}\n\nvec2 cellAt(float k, float r, vec2 wh) {\n float L = 2.0 * (wh.x + wh.y);\n k = mod(k, L);\n vec2 q = k < wh.x ? vec2(k, 0.0)\n : k < wh.x + wh.y ? vec2(wh.x, k - wh.x)\n : k < 2.0 * wh.x + wh.y ? vec2(2.0 * wh.x + wh.y - k, wh.y)\n : vec2(0.0, L - k);\n return q + r;\n}\n\nfloat smooth3(float u) {\n return u * u * (3.0 - 2.0 * u);\n}\n\nfloat ease(float u) {\n float s = sin(PI * u);\n return smooth3(u) + 0.6 * u * u * u * s * s;\n}\n\nfloat edge(float d, float px) {\n return clamp(0.5 - d / px, 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float R = clamp(float(rings), 2.0, 4.0);\n float sh = 2.0 * R;\n float lg = max(sh, floor(sh * max(ratio, 1.0 / ratio) + 0.5));\n vec2 dims = ratio >= 1.0 ? vec2(lg, sh) : vec2(sh, lg);\n vec2 P = uv * dims;\n vec2 here = clamp(floor(P), vec2(0.0), dims - 1.0);\n float px = sh / 600.0;\n float open = sin(PI * progress);\n \n float hs = 0.5 - GAP * open + 2.0 * px * (1.0 - smoothstep(0.0, 0.1, open));\n float st = clamp(stagger, 0.0, 0.4);\n\n float z1 = -9.0, z2 = -9.0, cov1 = 0.0, cov2 = 0.0, a1 = 0.0, a2 = 0.0;\n vec2 s1 = P, s2 = P;\n float shade = 0.0;\n for (int pass = 0; pass < 2; pass++) {\n for (int j = 0; j < 9; j++) {\n vec2 c = here + vec2(mod(float(j), 3.0), floor(float(j) / 3.0)) - 1.0;\n if (c.x >= 0.0 && c.y >= 0.0 && c.x < dims.x && c.y < dims.y) {\n float r = ringOf(c, dims);\n vec2 wh = dims - 1.0 - 2.0 * r;\n float L = 2.0 * (wh.x + wh.y);\n float t = clamp((progress - st * (R - 1.0 - r) / (R - 1.0)) / (1.0 - st), 0.0, 1.0);\n float u1 = clamp(t / 0.34, 0.0, 1.0), u2 = clamp((t - 0.66) / 0.34, 0.0, 1.0);\n float s = floor(0.25 * L + 0.5) * (mod(r, 2.0) < 0.5 ? 1.0 : -1.0) * (ease(u1) - ease(u2));\n float k = indexOf(c, r, wh);\n float fs = s - floor(s);\n float h = mod(k - floor(s), L);\n vec2 home = cellAt(h, r, wh) + 0.5;\n vec2 ctr = mix(c, cellAt(k + 1.0, r, wh), fs) + 0.5;\n float a = PI * smooth3(smooth3(clamp((t - 0.34 - 0.2 * h / L) / 0.12, 0.0, 1.0)));\n float sa = max(sin(a), 0.0), ca = cos(a);\n float ride = 0.5 * (sin(PI * u1) + sin(PI * u2));\n float lift = 0.5 * ride + sa;\n float sc = 1.0 + 0.04 * ride + 0.15 * sa;\n if (pass == 0) {\n \n vec2 d = (P - ctr) / sc;\n float den = EYE * ca + d.x * sa;\n den = abs(den) < 1e-5 ? 1e-5 : den;\n float x = d.x * EYE / den;\n vec2 lp = vec2(x, d.y * (EYE - x * sa) / EYE);\n vec2 ink = sc * vec2(max(abs(ca), 0.05), 1.0);\n vec2 e = (abs(lp) - hs) * ink;\n float cv = den * ca > 0.0 || abs(ca) < 0.05 ? edge(e.x, px) * edge(e.y, px) : 0.0;\n float z = lift + 0.001 * cv;\n vec2 src = home + vec2(ca < 0.0 ? -lp.x : lp.x, lp.y);\n \n vec2 f = abs(P - ctr) - hs;\n float under = sa > 0.0 ? edge(f.x, px) * edge(f.y, px) : 0.0;\n for (int m = 0; m < 2; m++) {\n float cm = m == 0 ? cv : under;\n float zm = m == 0 ? z : -1.0;\n float am = m == 0 ? a : PI;\n vec2 sm = m == 0 ? src : home + P - ctr;\n if (cm > 0.0 && zm > z1) {\n z2 = z1; cov2 = cov1; a2 = a1; s2 = s1;\n z1 = zm; cov1 = cm; a1 = am; s1 = sm;\n } else if (cm > 0.0 && zm > z2) {\n z2 = zm; cov2 = cm; a2 = am; s2 = sm;\n }\n }\n } else if (lift > z1 + 0.01) {\n vec2 d = (P - ctr - LIGHT * lift) / sc;\n vec2 b = abs(d * vec2(1.0 / max(abs(ca), 0.05), 1.0)) - hs;\n float w = length(max(b, 0.0)) + min(max(b.x, b.y), 0.0);\n float blur = 0.04 + 0.12 * lift;\n shade = max(shade, min(lift - max(z1, 0.0), 1.0) * (1.0 - smoothstep(-blur, blur, w)));\n }\n }\n }\n }\n\n vec4 col = backColor;\n if (cov2 > 0.0) {\n vec2 q = clamp(s2 / dims, 0.0, 1.0);\n vec4 c2 = cos(a2) < 0.0 ? getToColor(q) : getFromColor(q);\n float sa = sin(a2);\n c2.rgb *= 1.0 - 0.45 * sa * sa + 0.2 * sa * abs(cos(a2));\n col = mix(col, c2, cov2);\n }\n vec2 q = clamp(s1 / dims, 0.0, 1.0);\n vec4 c1 = cos(a1) < 0.0 ? getToColor(q) : getFromColor(q);\n float sa = sin(a1);\n c1.rgb *= 1.0 - 0.45 * sa * sa + 0.2 * sa * abs(cos(a1));\n col = mix(col, c1, cov1);\n col.rgb *= 1.0 - 0.6 * shadow * shade;\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","TileShuffle":"// TileShuffle — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TileShuffle.glsl\n// Author: gre\n// License: MIT\n// Description: The frame is cut into tiles that swap places in pairs, round after round along the rows then along the columns, one tile of each pair lifting to swing over the other with a soft shadow; each tile turns to the incoming image during one of its swaps, so the incoming picture arrives scrambled and the last rounds sort it out\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 tiles; \n\nuniform float gap; \n\nuniform float shadow; \n\nuniform vec4 tray; \n\nconst float MAX_TILES = 8.0;\n\nconst int ROUNDS = 4;\n\nconst float OPEN = 0.15;\n\nconst float START = 0.07;\n\nconst float WAVE = 0.4;\nconst float JITTER = 0.15;\n\nconst float GROW = 0.08;\nconst float SINK = 0.03;\n\nconst float SWING = 0.2;\nconst float EDGE = 0.0015;\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 boxDist(vec2 p, vec2 b, float r) {\n vec2 d = abs(p) - b + r;\n return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0) - r;\n}\n\nvec2 partner(vec2 c, float k, vec2 n) {\n bool rows = mod(k, 2.0) < 0.5;\n float a = rows ? c.x : c.y;\n float len = rows ? n.x : n.y;\n float line = rows ? c.y : c.x;\n float par = len < 2.5 ? mod(line + floor(0.5 * k), 2.0) : step(0.5, hash12(vec2(line, 7.0 * k + 1.0)));\n float b = mod(a - par, 2.0) < 0.5 ? a + 1.0 : a - 1.0;\n if (a < par || b >= len) b = a;\n return rows ? vec2(b, c.y) : vec2(c.x, b);\n}\n\nbool differ(vec2 a, vec2 b) {\n return abs(a.x - b.x) + abs(a.y - b.y) > 0.5;\n}\n\nfloat swapTime(vec2 c, vec2 b, float k, vec2 n, vec2 sw) {\n vec2 m = 0.5 * (c + b);\n float t0 = START + k * sw.y + sw.x * (WAVE * (m.x + n.y - 1.0 - m.y) + JITTER * hash12(min(c, b) + 13.0 * k));\n return (progress - t0) / sw.x;\n}\n\nvec4 currentSwap(vec2 c, vec2 n, vec2 sw) {\n vec4 cur = vec4(float(ROUNDS), 0.0, c);\n bool found = false;\n for (int i = 0; i < ROUNDS; i++) {\n float k = float(i);\n if (!found) {\n vec2 b = partner(c, k, n);\n if (differ(b, c)) {\n float u = swapTime(c, b, k, n, sw);\n if (u < 1.0) {\n cur = vec4(k, max(u, 0.0), b);\n found = true;\n }\n }\n }\n }\n return cur;\n}\n\nfloat swapLift(vec2 c, vec4 cur) {\n if (cur.x >= float(ROUNDS)) return 0.0;\n float u = cur.y;\n float bell = 16.0 * u * u * (1.0 - u) * (1.0 - u);\n bool over = (hash12(min(c, cur.zw) + 13.0 * cur.x + 3.7) < 0.5) == (c.x + c.y < cur.z + cur.w);\n return over ? bell : -bell;\n}\n\nvec2 swapPos(vec2 c, vec4 cur, float lift) {\n float u = cur.y;\n float e = u * u * u * (u * (6.0 * u - 15.0) + 10.0);\n vec2 side = (cur.zw - c).yx * (hash12(cur.zw + c + 1.9 * cur.x) < 0.5 ? 1.0 : -1.0);\n return mix(c, cur.zw, e) + 0.5 + SWING * max(lift, 0.0) * side;\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - abs(v));\n}\n\nvec4 tileColor(vec4 src, float w, float lift, float e, float sh) {\n vec4 c = w <= 0.0 ? getFromColor(mirror(src.xy)) : w >= 1.0 ? getToColor(mirror(src.zw))\n : mix(getFromColor(mirror(src.xy)), getToColor(mirror(src.zw)), w);\n float up = max(lift, 0.0);\n float rim = 0.2 * up * (1.0 - smoothstep(0.0, 0.006, e));\n c.rgb = mix(clamp(c.rgb * (1.0 + 0.06 * up + 0.1 * min(lift, 0.0)) * (1.0 - sh), 0.0, 1.0), vec3(1.0), rim);\n return c;\n}\n\nvec4 transition(vec2 uv) {\n \n float nl = clamp(float(tiles), 2.0, MAX_TILES);\n vec2 n = ratio >= 1.0\n ? vec2(nl, clamp(floor(nl / ratio + 0.5), 2.0, MAX_TILES))\n : vec2(clamp(floor(nl * ratio + 0.5), 2.0, MAX_TILES), nl);\n vec2 cell = vec2(ratio, 1.0) / n;\n vec2 x = uv * vec2(ratio, 1.0);\n vec2 here = clamp(floor(uv * n), vec2(0.0), n - 1.0);\n float open = smoothstep(0.0, OPEN, progress) * (1.0 - smoothstep(1.0 - OPEN, 1.0, progress));\n float g = clamp(gap, 0.0, 0.15) * open * min(cell.x, cell.y);\n \n vec2 hb = vec2(0.5 * cell - 0.5 * g + EDGE * max(1.0 - 0.5 * g / EDGE, 0.0));\n float rad = 0.6 * g;\n \n float gapK = 1.0 + WAVE + JITTER;\n float sd = (1.0 - 2.0 * START) / (float(ROUNDS - 1) * gapK + 1.0 + WAVE * (n.x + n.y - 2.0) + JITTER);\n vec2 sw = vec2(sd, sd * gapK);\n\n \n float z1 = -9.0, z2 = -9.0, m1 = 0.0, m2 = 0.0, l1 = 0.0, l2 = 0.0, w1 = 0.0, w2 = 0.0, e1 = 0.0, e2 = 0.0;\n vec4 s1 = vec4(0.0), s2 = vec4(0.0);\n for (int j = 0; j < 5; j++) {\n for (int i = 0; i < 5; i++) {\n vec2 o = vec2(float(i) - 2.0, float(j) - 2.0);\n vec2 c = here + o;\n if (abs(o.x) + abs(o.y) > 3.5 || c.x < 0.0 || c.y < 0.0 || c.x >= n.x || c.y >= n.y) continue;\n vec4 cur = currentSwap(c, n, sw);\n float lift = swapLift(c, cur);\n float sc = 1.0 + GROW * max(lift, 0.0) - SINK * max(-lift, 0.0);\n vec2 q = (x - swapPos(c, cur, lift) * cell) / sc;\n float e = -boxDist(q, hb, rad) * sc;\n float cov = clamp(e / EDGE + 0.5, 0.0, 1.0);\n \n float z = lift + 0.001 * cov;\n if (cov <= 0.0 || z <= z2) continue;\n \n vec2 s = c, h = c;\n float before = 0.0, after = 0.0;\n for (int k = ROUNDS - 1; k >= 0; k--) {\n if (float(k) < cur.x) {\n vec2 b = partner(s, float(k), n);\n if (differ(b, s)) before += 1.0;\n s = b;\n }\n }\n for (int k = 0; k < ROUNDS; k++) {\n if (float(k) >= cur.x) {\n vec2 b = partner(h, float(k), n);\n if (differ(b, h)) after += 1.0;\n h = b;\n }\n }\n \n \n float turn = floor(hash12(h + 21.3) * (before + after));\n float w = before + after < 0.5 ? smoothstep(1.0 - 2.0 * OPEN, 1.0 - START, progress)\n : before > turn ? 1.0 : before == turn ? smoothstep(0.35, 0.65, cur.y) : 0.0;\n vec2 l = q / cell + 0.5;\n vec4 src = vec4((s + l) / n, (h + l) / n);\n if (z > z1) {\n z2 = z1; m2 = m1; l2 = l1; w2 = w1; e2 = e1; s2 = s1;\n z1 = z; m1 = cov; l1 = lift; w1 = w; e1 = e; s1 = src;\n } else {\n z2 = z; m2 = cov; l2 = lift; w2 = w; e2 = e; s2 = src;\n }\n }\n }\n\n float sh0 = 0.0, sh1 = 0.0, sh2 = 0.0;\n vec2 light = vec2(0.45, -0.75) * min(cell.x, cell.y);\n for (int j = 0; j < 5; j++) {\n for (int i = 0; i < 5; i++) {\n vec2 o = vec2(float(i) - 2.0, float(j) - 2.0);\n vec2 c = here + o;\n if (abs(o.x) + abs(o.y) > 3.5 || c.x < 0.0 || c.y < 0.0 || c.x >= n.x || c.y >= n.y) continue;\n vec4 cur = currentSwap(c, n, sw);\n float lift = swapLift(c, cur);\n float up = max(lift, 0.0);\n vec2 d = x - swapPos(c, cur, lift) * cell - light * (0.15 * g / min(cell.x, cell.y) + 0.06 * up);\n float blur = 0.003 + 0.25 * g + 0.04 * up * min(cell.x, cell.y);\n float sdist = boxDist(d, hb * (1.0 + GROW * up - SINK * max(-lift, 0.0)), rad);\n float a = (1.0 - smoothstep(-blur, blur, sdist)) * (0.75 - 0.25 * up);\n sh0 = max(sh0, a);\n if (lift > z2 + 0.01) sh2 = max(sh2, a);\n if (lift > z1 + 0.01) sh1 = max(sh1, a);\n }\n }\n\n float k = clamp(shadow, 0.0, 1.0);\n vec4 col = vec4(tray.rgb * (1.0 - k * sh0), tray.a);\n \n if (m2 > 0.0 && m1 < 1.0) col = mix(col, tileColor(s2, w2, l2, e2, k * sh2), m2);\n if (m1 > 0.0) col = mix(col, tileColor(s1, w1, l1, e1, k * sh1), m1);\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","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","TriangleFlip":"// TriangleFlip — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TriangleFlip.glsl\n// Author: gre\n// License: MIT\n// Description: The image is cut into a mosaic of triangles that turn over in perspective in a wave spreading from a point, each one rolling away from it about one of its three axes, catching a glint of light and casting a soft shadow, and showing its part of the incoming image on its 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 int rows; \n\nuniform vec2 center; \n\nuniform float stagger; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\nconst float SQRT3 = 1.7320508075688772;\nconst float EDGE = 0.0012;\n\nconst float EYE = 3.0;\n\nconst float LIFT = 0.3;\nconst vec3 LIGHT = vec3(-0.4, 0.45, 0.8);\n\nfloat easeInOut(float t) {\n return mix(t, t * t * (3.0 - 2.0 * t), 0.75);\n}\n\nfloat triDistSqueezed(vec2 p, float r, float o, vec2 a, vec2 b, float k) {\n vec2 n0 = vec2(0.0, -o);\n vec2 n1 = vec2(0.5 * SQRT3, 0.5) * o;\n vec2 n2 = vec2(-0.5 * SQRT3, 0.5) * o;\n float d0 = (r - dot(p, n0)) * k / length(vec2(dot(n0, a) * k, dot(n0, b)));\n float d1 = (r - dot(p, n1)) * k / length(vec2(dot(n1, a) * k, dot(n1, b)));\n float d2 = (r - dot(p, n2)) * k / length(vec2(dot(n2, a) * k, dot(n2, b)));\n return min(d0, min(d1, d2));\n}\n\nfloat triDist(vec2 p, float r, float o) {\n return triDistSqueezed(p, r, o, vec2(1.0, 0.0), vec2(0.0, 1.0), 1.0);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat aa(float d, float e) {\n return clamp(d / max(2.0 * e, 1e-6) + 0.5, 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n vec2 frame = vec2(ratio, 1.0);\n vec2 pos = uv * frame;\n float h = 1.0 / max(float(rows), 1.0);\n float side = 2.0 * h / SQRT3;\n float inradius = side / (2.0 * SQRT3);\n vec2 e1 = vec2(side, 0.0);\n vec2 e2 = vec2(0.5 * side, h);\n \n float lv = pos.y / h;\n vec2 cell = floor(vec2(pos.x / side - 0.5 * lv, lv));\n float eye = EYE * side;\n\n vec2 origin = center * frame;\n vec2 farthest = max(origin, frame - origin);\n float reach = max(length(farthest), 1e-4);\n float st = clamp(stagger, 0.0, 0.9);\n float sh = clamp(shading, 0.0, 1.0);\n vec3 l = normalize(LIGHT);\n vec3 hv = normalize(l + vec3(0.0, 0.0, 1.0));\n vec2 a0 = vec2(0.0, 1.0);\n vec2 a1 = vec2(0.5 * SQRT3, 0.5);\n vec2 a2 = vec2(-0.5 * SQRT3, 0.5);\n\n float wFrom = 0.0;\n float wTo = 0.0;\n float hole = 0.0;\n float shadow = 0.0;\n vec4 c1 = vec4(0.0);\n vec4 c2 = vec4(0.0);\n float m1 = 0.0;\n float m2 = 0.0;\n float z1 = -1e9;\n float z2 = -1e9;\n vec4 col;\n\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n for (int k = 0; k < 2; k++) {\n vec2 nc = cell + vec2(float(i), float(j));\n float o = k == 0 ? 1.0 : -1.0;\n vec2 base = nc.x * e1 + nc.y * e2;\n vec2 ctr = base + (k == 0 ? 1.0 : 2.0) * (e1 + e2) / 3.0;\n vec2 q = pos - ctr;\n\n vec2 toward = ctr - origin;\n float dist = length(toward);\n vec2 dir = dist > 1e-5 ? toward / dist : vec2(1.0, 0.0);\n float delay = clamp(dist / reach, 0.0, 1.0);\n float t = clamp((progress - delay * st) / (1.0 - st), 0.0, 1.0);\n\n if (t <= 0.0 || t >= 1.0) {\n float m = aa(triDist(q, inradius, o), EDGE);\n if (t <= 0.0) wFrom += m;\n else wTo += m;\n continue;\n }\n\n \n \n vec2 a = a0;\n if (abs(dot(a1, dir)) < abs(dot(a, dir))) a = a1;\n if (abs(dot(a2, dir)) < abs(dot(a, dir))) a = a2;\n vec2 b = vec2(-a.y, a.x);\n if (dot(b, dir) > 0.0) b = -b;\n\n float ang = PI * easeInOut(t);\n float ca = cos(ang);\n float sa = sin(ang);\n float lift = LIFT * side * sa;\n\n \n \n float mh = aa(triDist(q, inradius, o), EDGE);\n float k2 = smoothstep(0.0, 0.2, t);\n wFrom += mh * (1.0 - k2);\n wTo += mh * k2;\n hole = max(hole, mh * sa);\n vec2 sq = q + LIGHT.xy / LIGHT.z * lift;\n float sk = 0.3 + 0.7 * abs(ca);\n vec2 sp = dot(sq, a) * a + dot(sq, b) / sk * b;\n float sd = triDistSqueezed(sp, inradius, o, a, b, sk);\n float blur = 0.004 + 0.3 * lift;\n shadow = max(shadow, 0.5 * sa * (1.0 - smoothstep(-blur, blur, -sd)));\n\n \n \n float qb = dot(q, b);\n float den = eye * ca + sa * qb;\n if (abs(den) < 1e-6) continue;\n float s = (eye - lift) * ca / den;\n if (s <= 0.0) continue;\n float hz = eye * (1.0 - s);\n float alpha = s * dot(q, a);\n float beta = s * qb * ca + (hz - lift) * sa;\n vec2 lp = alpha * a + beta * b;\n float d = triDistSqueezed(lp, inradius, o, a, b, max(abs(ca), 1e-3)) / s;\n float m = aa(d, EDGE);\n if (m <= 0.0) continue;\n\n bool front = ca > 0.0;\n if (front) {\n col = getFromColor(mirror((ctr + lp) / frame));\n } else {\n col = getToColor(mirror((ctr + alpha * a - beta * b) / frame));\n }\n vec3 n = vec3(-sa * b, ca) * (front ? 1.0 : -1.0);\n float lit = dot(n, l) / l.z;\n col.rgb *= 1.0 - sh * (1.0 - clamp(lit, 0.0, 1.0)) * 0.65 + sh * 0.15 * max(lit - 1.0, 0.0);\n float spec = pow(max(dot(n, hv), 0.0), 60.0);\n col.rgb += sh * sa * (0.45 * spec + 0.15 * (1.0 - smoothstep(0.0, 3.0 * EDGE, d))) * col.a;\n\n if (hz > z1) {\n c2 = c1; m2 = m1; z2 = z1;\n c1 = col; m1 = m; z1 = hz;\n } else if (hz > z2) {\n c2 = col; m2 = m; z2 = hz;\n }\n }\n }\n }\n\n vec4 color = mix(getFromColor(uv), getToColor(uv), wTo / max(wFrom + wTo, 1e-6));\n color.rgb *= 1.0 - sh * clamp(max(shadow, 0.8 * hole), 0.0, 1.0);\n color = mix(color, c2, m2);\n color = mix(color, c1, m1);\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","TruchetWipe":"// TruchetWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TruchetWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A grid of square tiles, each holding two quarter-circle arcs, links into long winding paths; starting from the middle and spreading outward, the paths are drawn as thin lines of the incoming image, then thicken into bands with a dark outline and a soft shadow until they merge over 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 cells; \n\nuniform float outline; \n\nuniform float spread; \n\nconst float AA = 0.0012;\nconst float LINE = 0.003;\nconst float SHADOW = 0.025;\n\nconst float STROKE = 0.08;\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\nvec4 transition(vec2 uv) {\n float n = max(floor(cells + 0.5), 1.0);\n vec2 p = (uv - 0.5) * vec2(ratio, 1.0);\n vec2 g = p * n + 0.5;\n vec2 cell = floor(g);\n vec2 q = fract(g);\n \n if (hash12(cell + 17.0) > 0.5) q.x = 1.0 - q.x;\n \n float d = min(abs(length(q) - 0.5), abs(length(q - 1.0) - 0.5));\n\n float T = clamp(length(p) / (0.5 * length(vec2(ratio, 1.0))) + 0.4 * (vnoise(p * 3.0 + 4.0) - 0.5), 0.0, 1.0);\n float lag = 0.8 * clamp(spread, 0.0, 1.0);\n \n float s = clamp((progress - lag * T) / (0.95 - lag), 0.0, 1.0);\n \n float aa = AA * n;\n float k = clamp((s - 0.25) / 0.75, 0.0, 1.0);\n float w = STROKE * smoothstep(0.0, 0.3, s) + (0.5 + LINE * n + 3.0 * aa - STROKE) * k * k;\n \n float e = d - w;\n\n float band = 1.0 - smoothstep(-2.0 * aa, 0.0, e);\n float gap = max(e + aa, 0.0);\n float fall = 1.0 - smoothstep(0.0, SHADOW * n, gap);\n float edge = max(0.8 * (1.0 - smoothstep(LINE * n, LINE * n + 2.0 * aa, gap)), 0.4 * fall * fall);\n float shade = clamp(outline, 0.0, 1.0) * smoothstep(0.0, STROKE, w) * edge;\n\n vec4 a = getFromColor(uv);\n a.rgb *= 1.0 - shade;\n vec4 b = getToColor(uv);\n \n vec4 o = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), band);\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","Tumble":"// Tumble — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Tumble.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is thrown away like a rigid card, tumbling end over end with a slight spin as it flies off into the distance in perspective, its darker back showing on every flip and its soft shadow shrinking on 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 flips; \n\nuniform float spin; \n\nuniform vec2 direction; \n\nuniform float perspective; \n\nuniform float shading; \n\nconst float PI = 3.141592653589793;\nconst float EDGE = 0.0015;\n\nconst vec3 LIGHT = vec3(0.348, 0.696, -0.628);\n\nvec3 roll(vec3 v, float c, float s) {\n return vec3(c * v.x - s * v.y, s * v.x + c * v.y, v.z);\n}\n\nfloat cardDistance(vec2 q) {\n vec2 e = abs(q) - vec2(0.5 * ratio, 0.5);\n return max(e.x, e.y);\n}\n\nvec3 castOnCard(vec3 d, vec3 rel, vec3 U, vec3 V, vec3 N) {\n float dn = dot(d, N);\n if (abs(dn) < 1e-6) return vec3(0.0, 0.0, -1.0);\n float k = dot(rel, N) / dn;\n vec3 h = k * d - rel;\n return vec3(dot(h, U), dot(h, V), k);\n}\n\nvec2 cardUv(vec2 q) {\n return clamp(vec2(q.x / ratio, q.y) + 0.5, 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n float t = clamp(progress / 0.95, 0.0, 1.0);\n float size = exp(-2.8 * t * t * (0.4 + 0.6 * t));\n float away = 1.0 - size;\n float turn = t * t * (3.0 - 2.0 * t);\n float a = 2.0 * PI * flips * turn;\n float r = 2.0 * PI * spin * turn;\n float cr = cos(r), sr = sin(r);\n \n vec3 U = roll(vec3(1.0, 0.0, 0.0), cr, sr);\n vec3 V = roll(vec3(0.0, cos(a), sin(a)), cr, sr);\n vec3 N = roll(vec3(0.0, -sin(a), cos(a)), cr, sr);\n\n \n float dist = 1.0 / clamp(perspective, 0.1, 1.0);\n vec2 seen = direction * away + vec2(0.0, 0.12 * t * (1.0 - t));\n vec3 rel = vec3(seen / size, dist / size);\n float fade = 1.0 - smoothstep(0.8, 1.0, t);\n float shadowAmount = 0.6 * shading * sqrt(size) * fade;\n\n vec2 p = vec2((uv.x - 0.5) * ratio, uv.y - 0.5);\n vec4 color = getToColor(uv);\n\n if (shadowAmount > 0.0) {\n vec3 ds = vec3(p - vec2(-0.05, -0.08) * min(4.0 * t, 1.0) * size, dist);\n vec3 hs = castOnCard(ds, rel, U, V, N);\n if (hs.z > 0.0) {\n float blur = 0.005 + 0.06 * min(3.0 * t, 1.0) * size;\n float sd = cardDistance(hs.xy) * max(abs(dot(ds, N)) / length(ds), 0.05) / hs.z;\n float sh = (1.0 - smoothstep(-blur, blur, sd)) * getFromColor(cardUv(hs.xy)).a;\n color.rgb *= 1.0 - shadowAmount * sh;\n }\n }\n\n vec3 d = vec3(p, dist);\n vec3 hit = castOnCard(d, rel, U, V, N);\n if (hit.z <= 0.0) return color;\n float dn = dot(d, N);\n \n float grazing = max(abs(dn) / length(d), 0.05);\n float e = EDGE * min(20.0 * t, 1.0) * hit.z / grazing;\n float m = clamp(0.5 - cardDistance(hit.xy) / max(e, 1e-6), 0.0, 1.0) * fade;\n if (m <= 0.0) return color;\n\n vec4 card = getFromColor(cardUv(hit.xy));\n \n bool front = dn > 0.0;\n vec3 facing = front ? -N : N;\n float lit = min((0.35 + 0.65 * max(dot(facing, LIGHT), 0.0)) / (0.35 + 0.65 * -LIGHT.z), 1.0);\n float shade = mix(1.0, lit * (front ? 1.0 : 0.55), shading);\n if (!front) card.rgb = mix(card.rgb, vec3(dot(card.rgb, vec3(0.299, 0.587, 0.114))), 0.4 * shading);\n float glint = pow(max(dot(facing, normalize(LIGHT - normalize(d))), 0.0), 60.0);\n card.rgb = card.rgb * shade + 0.35 * shading * glint * smoothstep(0.0, 0.2, t);\n if (m >= 1.0) return card;\n \n vec4 mixed = mix(vec4(color.rgb * color.a, color.a), vec4(card.rgb * card.a, card.a), m);\n return mixed.a > 0.0 ? vec4(mixed.rgb / mixed.a, mixed.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","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 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 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 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 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 color = mix(color, lineColor, line * strength);\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 vec2 p = uv + vec2(0.004 * speed * sin(uv.y * 9.0 + progress * 30.0), 0.0);\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 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 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 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","Umbrella":"// Umbrella — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Umbrella.glsl\n// Author: gre\n// License: MIT\n// Description: Seen from above, an umbrella made of the incoming picture pops open over the outgoing one: a furled star of pleats spins as its ribs spread and stretch the fabric into taut shaded panels with a scalloped hem and a soft shadow, then the canopy rises toward the camera and flattens out 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 int ribs; \n\nuniform float shading; \n\nuniform float spin; \n\nuniform vec4 metal; \n\nconst float PI = 3.141592653589793;\n\nvec2 rot(vec2 v, float a) {\n float c = cos(a), s = sin(a);\n return vec2(c * v.x - s * v.y, s * v.x + c * v.y);\n}\n\nvec3 panelAt(vec2 q, float n) {\n float th = abs(q.x) + abs(q.y) < 1e-5 ? 0.0 : atan(q.y, q.x);\n float a = floor(th * n / (2.0 * PI) + 0.5) * 2.0 * PI / n;\n return vec3(rot(q, -a), a);\n}\n\nfloat across(vec2 l, float n) {\n return clamp(l.y / (max(l.x, 1e-4) * tan(PI / n)), -1.0, 1.0);\n}\n\nfloat hemGap(vec2 l, float u, float R, float sag, float n) {\n float chord = R * cos(PI / n);\n float tilt = 2.0 * chord * sag * u / max(l.x * tan(PI / n), 0.3 * chord * tan(PI / n) + 1e-4);\n return (chord * (1.0 - sag * (1.0 - u * u)) - l.x) / sqrt(1.0 + tilt * tilt);\n}\n\nvec4 transition(vec2 uv) {\n vec2 asp = vec2(ratio, 1.0);\n vec2 q = (uv - 0.5) * asp;\n float n = max(float(ribs), 5.0);\n\n float o = clamp(progress / 0.46, 0.0, 1.0);\n o *= sqrt(o);\n \n float pop = 1.0 + (o - 1.0) * (o - 1.0) * (2.4 * (o - 1.0) + 1.4);\n float v = clamp((progress - 0.34) / 0.66, 0.0, 1.0);\n float rise = v * v * (3.0 - 2.0 * v);\n float g = smoothstep(0.3, 1.0, v);\n float dome = 1.0 - g;\n float size = min(ratio, 1.0);\n float k = 0.42 * size;\n float rEnd = 0.54 * length(asp) / cos(PI / n);\n float R = mix(k * pop, rEnd, rise * rise);\n float sag = mix(mix(0.75, 0.09, smoothstep(0.15, 0.9, pop)), 0.0, g);\n float turn = spin * ((1.0 - o) * (1.0 - o) - 0.12 * v * sin(2.0 * PI * v) * dome);\n\n vec2 qc = rot(q, turn);\n vec3 panel = panelAt(qc, n);\n vec2 l = panel.xy;\n float u = across(l, n);\n float X = R * cos(PI / n) * (1.0 - sag * (1.0 - u * u));\n float e = hemGap(l, u, R, sag, n);\n \n float cov = smoothstep(-0.002, 0.002, e) * smoothstep(0.0, 0.01, R);\n\n float height = (0.4 + rise) * dome;\n vec3 sp = panelAt(rot(q - vec2(0.04, -0.06) * height * size, turn), n);\n float se = hemGap(sp.xy, across(sp.xy, n), R, sag, n);\n float soft = (0.015 + 0.05 * height) * size;\n float shadow = 0.55 * shading * dome * smoothstep(0.0, 0.15 * size, R) * smoothstep(-soft, soft, se);\n\n float rho = clamp(l.x / max(X, 1e-3), 0.0, 1.0);\n float bulge = 1.0 - 0.16 * (1.0 - rho * rho);\n \n float over = 1.1 * k / max(R, 1e-3) - 1.0;\n over = 0.5 * (over + sqrt(over * over + 0.01));\n vec2 tuv = 0.5 + qc * mix((1.0 + over) * bulge, 1.0, g) / asp;\n tuv = 1.0 - abs(1.0 - mod(tuv, 2.0));\n vec4 fabric = getToColor(tuv);\n\n float w = smoothstep(0.0, 0.05 * size, R) * dome;\n float crease = cos(17.0 * u) * (1.0 - rho) * (1.0 - rho) * 0.3 + cos(9.0 * u) * rho * rho * 0.06;\n vec2 grad = w * vec2(-0.15 - 0.75 * rho * rho, (0.35 + 1.6 * sag) * u * (0.3 + 0.7 * rho) + crease);\n vec3 nrm = normalize(vec3(-rot(grad, panel.z - turn), 1.0));\n vec3 L = normalize(vec3(-0.45, 0.6, 0.75));\n float lit = mix(1.0, max(dot(nrm, L), 0.0) / L.z, 0.8 * shading);\n vec3 H = normalize(L + vec3(0.0, 0.0, 1.0));\n float sheen = pow(max(dot(nrm, H), 0.0), 40.0) - pow(H.z, 40.0);\n float px = l.x * sin(PI / n);\n float rib = (1.0 - abs(u)) * px;\n float seam = (1.0 - smoothstep(0.001, 0.004, rib)) * smoothstep(0.0, 0.03, px);\n float ridge = (1.0 - smoothstep(0.004, 0.02, rib)) * smoothstep(0.002, 0.006, rib) * smoothstep(0.0, 0.06, px);\n float stitch = 1.0 - smoothstep(0.001, 0.0025, abs(e - 0.012));\n vec3 col = fabric.rgb * lit * (1.0 - shading * w * (0.45 * seam + 0.18 * stitch));\n \n col += shading * w * (0.18 * max(sheen, 0.0) + 0.07 * ridge + 0.07 * (1.0 - smoothstep(0.0, 0.012, e)));\n\n vec4 from = getFromColor(uv);\n vec4 c = vec4(from.rgb * from.a * (1.0 - shadow), from.a);\n\n vec2 tip = l - R * vec2(cos(PI / n), (l.y < 0.0 ? -1.0 : 1.0) * sin(PI / n));\n float tipR = 0.009 * size * w;\n float ball = (1.0 - smoothstep(tipR - 0.002, tipR, length(tip))) * smoothstep(0.2, 0.6, w);\n float shine = 0.7 + 0.5 * max(dot(rot(tip, panel.z - turn) / max(tipR, 1e-3), L.xy), 0.0);\n c = mix(c, vec4(metal.rgb * shine, 1.0), ball * metal.a);\n\n c = mix(c, vec4(col * fabric.a, fabric.a), cov);\n\n float r = length(q) / (0.022 * size * w + 1e-4);\n float cone = 0.75 + 0.45 * dot(q / max(length(q), 1e-4), L.xy) * min(r, 1.0) + 0.35 * (1.0 - smoothstep(0.25, 0.4, r));\n float cap = (1.0 - smoothstep(0.88, 1.0, r)) * smoothstep(0.0, 0.2, w);\n c = mix(c, vec4(metal.rgb * cone, 1.0), cap * metal.a * cov);\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","Unbox":"// Unbox — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Unbox.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is tossed in folded up as an open card box, its middle the floor and its borders the walls, lands with a small bounce after its shadow, then its walls fall open flat one pair after the other, each with a bounce, until the unfolded sheet covers 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 depth; \n\nuniform float perspective; \n\nuniform float shading; \n\nuniform vec4 paper; \n\nconst float PI = 3.141592653589793;\nconst float EDGE = 0.0016;\nconst float YAW0 = 0.45;\nconst vec3 LIGHT = vec3(-0.35045, 0.45058, 0.82107);\n\nfloat wallAngle(float u) {\n float k = u / 0.72;\n return u < 0.72 ? 0.5 * PI * (1.0 - k * k) : 0.12 * sin(PI * (u - 0.72) / 0.28);\n}\n\nvec2 sideSign(int i) {\n if (i == 0) return vec2(-1.0);\n if (i == 1) return vec2(0.0, -1.0);\n if (i == 2) return vec2(0.0, 1.0);\n if (i == 3) return vec2(-1.0, 0.0);\n if (i == 4) return vec2(1.0, 0.0);\n return vec2(i == 5 || i == 7 ? -1.0 : 1.0, i < 7 ? -1.0 : 1.0);\n}\n\nvec2 quadOrigin(int i, float W, float c) {\n vec2 sg = sideSign(i);\n return vec2(sg.x > 0.0 ? W - c : c, sg.y > 0.0 ? 1.0 - c : c);\n}\n\nvec4 quadAxes(int i) {\n vec2 sg = sideSign(i);\n if (i == 0 || i == 1 || i == 2) return vec4(1.0, 0.0, 0.0, i == 0 ? 1.0 : sg.y);\n if (i == 3 || i == 4) return vec4(0.0, 1.0, sg.x, 0.0);\n return vec4(sg.x, 0.0, 0.0, sg.y);\n}\n\nvec2 quadSize(int i, float W, float c) {\n if (i == 0) return vec2(W - 2.0 * c, 1.0 - 2.0 * c);\n if (i == 1 || i == 2) return vec2(W - 2.0 * c, c);\n if (i == 3 || i == 4) return vec2(1.0 - 2.0 * c, c);\n return vec2(c);\n}\n\nvec4 quadCut(int i) {\n if (i == 0) return vec4(0.0);\n if (i == 1 || i == 2) return vec4(0.0, 0.0, 0.0, 1.0);\n if (i == 3 || i == 4) return vec4(1.0, 1.0, 0.0, 1.0);\n return vec4(0.0, 1.0, 1.0, 1.0);\n}\n\nmat3 quadFrame(int i, float W, float c, vec4 wt, vec2 tt) {\n vec2 sg = sideSign(i);\n vec3 O = vec3(quadOrigin(i, W, c), 0.0);\n vec3 U = vec3(1.0, 0.0, 0.0), V = vec3(0.0, 1.0, 0.0);\n if (i == 1 || i == 2) {\n V = vec3(0.0, sg.y * wt.x, wt.y);\n } else if (i == 3 || i == 4) {\n U = vec3(0.0, 1.0, 0.0);\n V = vec3(sg.x * wt.z, 0.0, wt.w);\n } else if (i >= 5) {\n \n V = vec3(0.0, sg.y * wt.x, wt.y);\n U = vec3(sg.x * tt.x, 0.0, 0.0) + tt.y * vec3(0.0, -sg.y * wt.y, wt.x);\n }\n return mat3(U, V, O);\n}\n\nvec3 rotate(vec3 v, vec2 rot) {\n return vec3(v.x * rot.x - v.y * rot.y, v.x * rot.y + v.y * rot.x, v.z);\n}\n\nvec4 shadeFace(int i, vec4 hit, float W, float c, vec4 wt, vec2 tt, vec2 rot, float amount) {\n if (i < 0) return vec4(0.0);\n mat3 F = quadFrame(i, W, c, wt, tt);\n vec4 ax = quadAxes(i);\n vec2 len = quadSize(i, W, c);\n vec2 st = hit.xy;\n bool front = hit.w * (ax.x * ax.w - ax.y * ax.z) < 0.0;\n vec3 n = rotate(cross(F[0], F[1]), rot) * (front ? 1.0 : -1.0) * (ax.x * ax.w - ax.y * ax.z);\n vec4 col = getToColor(clamp((quadOrigin(i, W, c) + st.x * ax.xy + st.y * ax.zw) / vec2(W, 1.0), 0.0, 1.0));\n float lit = min((0.45 + 0.55 * max(dot(n, LIGHT), 0.0)) / (0.45 + 0.55 * LIGHT.z), 1.0);\n float up = i == 0 ? 0.0 : clamp(F[1].z, 0.0, 1.0);\n if (front) {\n \n lit *= 1.0 - up * (0.35 + 0.4 * (1.0 - st.y / len.y));\n if (i == 0) {\n vec4 ao = exp(-vec4(st.x, len.x - st.x, st.y, len.y - st.y) / (0.25 * c)) * wt.wwyy;\n lit *= 1.0 - 0.45 * max(max(ao.x, ao.y), max(ao.z, ao.w));\n }\n col.rgb = mix(col.rgb, paper.rgb * 0.8, 0.25 * up);\n } else {\n col = vec4(paper.rgb, paper.a * col.a);\n }\n \n float rim = up * quadCut(i).w * (1.0 - smoothstep(0.006, 0.014, len.y - st.y));\n col.rgb = mix(col.rgb * mix(1.0, lit, shading * amount), paper.rgb * 1.05, rim * amount);\n return col;\n}\n\nvec4 transition(vec2 uv) {\n float W = ratio;\n float c = clamp(depth, 0.1, 0.35) * min(W, 1.0);\n float D = 1.0 / (0.25 + 0.75 * clamp(perspective, 0.0, 1.0));\n float f = clamp(progress / 0.36, 0.0, 1.0);\n float fe = 1.0 - (1.0 - f) * (1.0 - f);\n float h = 0.22 * (1.0 - f * f) + 0.03 * sin(PI * clamp((progress - 0.36) / 0.09, 0.0, 1.0));\n \n float y0 = 0.52 + 0.5 * W * sin(YAW0) + 0.5 * cos(YAW0);\n vec3 off = vec3(0.0, y0 * (1.0 - fe), h);\n float yaw = YAW0 * (1.0 - fe) * (1.0 - fe);\n vec2 rot = vec2(cos(yaw), sin(yaw));\n float tb = wallAngle(clamp((progress - 0.42) / 0.34, 0.0, 1.0));\n float ts = wallAngle(clamp((progress - 0.6) / 0.4, 0.0, 1.0));\n vec4 wt = vec4(cos(tb), sin(tb), cos(ts), sin(ts));\n vec2 tt = vec2(cos(0.97 * tb), sin(0.97 * tb));\n float amount = clamp(10.0 * (tb + ts + h), 0.0, 1.0);\n float aa = EDGE * amount + 1e-4;\n vec3 C = vec3(0.5 * W, 0.5, 0.0);\n vec3 E = vec3(0.5 * W, 0.5, D);\n vec3 dir = vec3(uv.x * W, uv.y, 0.0) - E;\n\n \n float t1 = 1e4, t2 = 1e4;\n vec4 h1 = vec4(0.0), h2 = vec4(0.0);\n int i1 = -1, i2 = -1;\n for (int i = 0; i < 9; i++) {\n mat3 F = quadFrame(i, W, c, wt, tt);\n vec3 U = rotate(F[0], rot), V = rotate(F[1], rot);\n vec3 n = cross(U, V);\n float den = dot(dir, n);\n if (abs(den) < 1e-6) continue;\n vec3 O = C + rotate(F[2] - C, rot) + off;\n float t = dot(O - E, n) / den;\n if (t <= 0.0 || t >= t2) continue;\n vec3 q = E + t * dir - O;\n vec2 st = vec2(dot(q, U), dot(q, V));\n vec2 len = quadSize(i, W, c);\n vec4 d = vec4(st.x, len.x - st.x, st.y, len.y - st.y);\n vec4 fr = quadCut(i);\n \n d = mix(d + 1e-4, d, fr);\n if (min(min(d.x, d.y), min(d.z, d.w)) <= -aa) continue;\n vec4 e = mix(vec4(1.0), clamp(d / aa + 1.0, 0.0, 1.0), fr);\n vec4 hit = vec4(st, e.x * e.y * e.z * e.w, den);\n if (t < t1) { t2 = t1; h2 = h1; i2 = i1; t1 = t; h1 = hit; i1 = i; }\n else { t2 = t; h2 = hit; i2 = i; }\n }\n\n vec4 c1 = shadeFace(i1, h1, W, c, wt, tt, rot, amount);\n vec4 c2 = shadeFace(i2, h2, W, c, wt, tt, rot, amount);\n vec3 P1 = E + t1 * dir, P2 = E + t2 * dir;\n\n vec4 ground = getFromColor(uv);\n vec3 G = E + dir;\n float shG = 0.0, sh1 = 0.0, sh2 = 0.0;\n for (int i = 0; i < 9; i++) {\n mat3 F = quadFrame(i, W, c, wt, tt);\n vec3 U = rotate(F[0], rot), V = rotate(F[1], rot);\n vec3 O = C + rotate(F[2] - C, rot) + off;\n vec2 len = quadSize(i, W, c);\n vec3 n = cross(U, V);\n float den = dot(LIGHT, n);\n if (abs(den) < 1e-6) continue;\n for (int k = 0; k < 3; k++) {\n if ((k == 1 && i1 < 0) || (k == 2 && i2 < 0)) continue;\n vec3 P = k == 0 ? G : (k == 1 ? P1 : P2);\n float s = dot(O - P, n) / den;\n if (s < 2e-3) continue;\n vec3 q = P + s * LIGHT - O;\n vec2 st = vec2(dot(q, U), dot(q, V));\n float soft = 0.004 + 0.12 * s;\n float inside = min(min(st.x, len.x - st.x), min(st.y, len.y - st.y));\n float a = smoothstep(-soft, soft, inside) / (1.0 + 1.5 * s);\n if (k == 0) shG = max(shG, a); else if (k == 1) sh1 = max(sh1, a); else sh2 = max(sh2, a);\n }\n }\n float sk = 0.9 * shading * amount * min(8.0 * progress, 1.0);\n ground.rgb *= 1.0 - sk * shG;\n c1.rgb *= 1.0 - sk * sh1;\n c2.rgb *= 1.0 - sk * sh2;\n return mix(mix(ground, c2, h2.z), c1, h1.z);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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","Unstack":"// Unstack — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Unstack.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is a stack of horizontal bands with the incoming image stacked on top of it, out of frame: bands are yanked out sideways one at a time in a shuffled order, and each time everything above drops into the gap with a small bounce, so the incoming image comes down into the frame in beats\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 bounce; \n\nuniform vec4 slot; \n\nconst float PULL = 0.11;\nconst float FALL = 0.1;\n\nconst float LAG = 0.85;\nconst float IMPACT = 0.62;\n\nconst float REACH = 1.3;\nconst float EDGE = 0.0015;\nconst int TAPS = 16;\n\nfloat hash(float n) {\n vec2 p = fract(vec2(n) * 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 count() {\n return clamp(float(bands), 2.0, 12.0);\n}\n\nfloat rank(float i, float n) {\n float r = 0.0, hi = hash(i + 7.0);\n for (int j = 0; j < 12; j++) {\n if (float(j) >= n) break;\n float h = hash(float(j) + 7.0);\n if (h < hi || (h == hi && float(j) < i)) r += 1.0;\n }\n return r;\n}\n\nfloat startTime(float r, float n) {\n return 0.02 + r * (0.96 - LAG * PULL - FALL) / (n - 1.0);\n}\n\nfloat pullPhase(float t0) {\n return clamp((progress - t0) / PULL, 0.0, 1.0);\n}\n\nfloat pullOffset(float u, float r) {\n return (mod(r, 2.0) < 0.5 ? 1.0 : -1.0) * REACH * u * u;\n}\n\nfloat hump(float s) {\n return 4.0 * s * (1.0 - s);\n}\n\nfloat dropOf(float t0) {\n float t = clamp((progress - t0 - LAG * PULL) / FALL, 0.0, 1.0);\n if (t < IMPACT) return (t / IMPACT) * (t / IMPACT);\n \n float s = (t - IMPACT) / (1.0 - IMPACT);\n float h = s < 0.6 ? hump(s / 0.6) : 0.3 * hump((s - 0.6) / 0.4);\n return 1.0 - 0.2 * clamp(bounce, 0.0, 1.0) * h;\n}\n\nfloat box(float v, float a, float b, float soft) {\n return smoothstep(a - soft, a + soft, v) * (1.0 - smoothstep(b - soft, b + soft, v));\n}\n\nvec4 transition(vec2 uv) {\n float n = count(), H = 1.0 / n;\n vec4 c = vec4(0.0);\n float covered = 0.0;\n float above = 1.0, below = 1.0;\n vec4 front = vec4(0.0);\n float frontA = 0.0, shadow = 1.0;\n float D = 0.0, floorY = 0.0;\n for (int k = 0; k < 24; k++) {\n float j = float(k);\n if (j >= 2.0 * n) break;\n float b = (j - D) * H;\n float y = uv.y - b;\n float u = 0.0, r = 0.0, t0 = 0.0;\n if (j < n) {\n r = rank(j, n);\n t0 = startTime(r, n);\n u = pullPhase(t0);\n }\n if (u > 0.0) {\n float x = pullOffset(u, r);\n float lift = smoothstep(0.0, 0.35, u);\n float off = 0.22 * H * lift;\n float grow = 1.0 + 0.08 * lift;\n shadow *= 1.0 - 0.55 * lift * box(uv.x - x - sign(x) * off * 0.4, 0.0, 1.0, off)\n * box(uv.y + off - b - 0.5 * H, -0.5 * H * grow, 0.5 * H * grow, off);\n \n float ly = (y - 0.5 * H) / grow + 0.5 * H;\n float ya = clamp(min(ly, H - ly) / (EDGE * lift + 1e-5) + 0.5, 0.0, 1.0);\n \n float v = sign(x) * max(min(0.012 * 2.0 * REACH * u / PULL, 0.1), EDGE);\n float s0 = uv.x - x;\n float lo = min(s0, s0 + v), hi = max(s0, s0 + v);\n float a = ya * max(min(hi, 1.0) - max(lo, 0.0), 0.0) / abs(v);\n if (a > 0.0) {\n ly = clamp(ly, 0.0, H);\n vec4 sum = vec4(0.0);\n for (int m = 0; m < TAPS; m++) {\n vec4 t = getFromColor(vec2(mix(max(lo, 0.0), min(hi, 1.0), (float(m) + 0.5) / float(TAPS)), j * H + ly));\n sum += vec4(t.rgb * t.a, t.a);\n }\n vec4 band = vec4(sum.rgb / max(sum.a, 1e-6), sum.a / float(TAPS));\n band.rgb *= 1.0 - 0.3 * lift * (1.0 - smoothstep(0.0, 0.2 * H, min(ly, H - ly)));\n front = mix(front, band, frontA > 0.0 ? a : 1.0);\n frontA = a + frontA * (1.0 - a);\n }\n } else {\n \n float e = max(min(EDGE, 0.5 * (b - floorY)), 0.0) + 1e-6;\n float m = clamp(y / e + 1.0, 0.0, 1.0) * step(y, H);\n if (m > 0.0) {\n vec4 img = j < n\n ? getFromColor(vec2(uv.x, j * H + max(y, 0.0)))\n : getToColor(vec2(uv.x, (j - n) * H + max(y, 0.0)));\n c = mix(c, img, covered > 0.0 ? m : 1.0);\n covered = max(covered, m);\n }\n if (y < 0.0) above = min(above, -y);\n if (y > H) below = min(below, y - H);\n floorY = b + H;\n }\n if (j < n) D += dropOf(t0);\n }\n vec4 gap = slot;\n gap.rgb *= (1.0 - 0.65 * exp(-above / (0.2 * H))) * (1.0 - 0.35 * exp(-below / (0.1 * H)));\n c = mix(gap, c, covered);\n c.rgb *= shadow;\n return mix(c, front, frontA);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","Unstir":"// Unstir — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Unstir.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture is a liquid that whirls stir one after another, stretching it into curls, ribbons and fine marbled filaments; the filaments take the colors of the incoming picture and the stirring undoes itself, curl by curl, until the incoming picture is whole\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 stir; \n\nuniform float size; \n\nconst int TAPS = 12;\nconst int WHIRLS = 6;\n\nvec2 mirrorUv(vec2 u) {\n return 1.0 - abs(1.0 - mod(u, 2.0));\n}\n\nvec4 pm(vec4 c) {\n return vec4(c.rgb * c.a, c.a);\n}\n\nfloat dye(vec2 x) {\n return 0.5 + 0.25 * sin(9.0 * x.x + 2.0 * sin(5.0 * x.y)) + 0.25 * sin(8.0 * x.y - 2.0 * sin(6.0 * x.x));\n}\n\nvec4 transition(vec2 uv) {\n vec2 s = vec2(ratio, 1.0) / min(ratio, 1.0);\n float r2 = size * size * max(s.x, s.y);\n float th = 1.12 - 1.24 * smoothstep(0.32, 0.68, progress);\n float env = smoothstep(0.0, 0.2, progress) * (1.0 - smoothstep(0.85, 1.0, progress));\n vec2 pos[TAPS];\n for (int i = 0; i < TAPS; i++) {\n float fi = float(i);\n pos[i] = (uv - 0.5) * s + vec2(fract(fi * 0.618 + 0.3) - 0.5, (fi + 0.5) / float(TAPS) - 0.5) * 0.0035 * env;\n }\n\n \n for (int j = 0; j < WHIRLS; j++) {\n float k = float(WHIRLS - 1 - j);\n \n float peak = 0.37 + 0.05 * k;\n float t = smoothstep(0.02 * k, peak, progress) * (1.0 - smoothstep(peak, 0.9 + 0.02 * k, progress));\n float g0 = stir * t * (mod(k, 2.0) * 2.0 - 1.0);\n float a = 2.4 * k + 0.6;\n vec2 c = 0.34 * s * vec2(cos(a), sin(a));\n for (int i = 0; i < TAPS; i++) {\n vec2 d = pos[i] - c;\n float g = g0 * exp(-dot(d, d) / r2);\n float cg = cos(g) - 1.0, sg = sin(g);\n pos[i] += vec2(cg * d.x - sg * d.y, sg * d.x + cg * d.y);\n }\n }\n\n vec4 sum = vec4(0.0);\n for (int i = 0; i < TAPS; i++) {\n vec2 u = mirrorUv(pos[i] / s + 0.5);\n sum += mix(pm(getFromColor(u)), pm(getToColor(u)), smoothstep(-0.1, 0.1, dye(pos[i]) - th));\n }\n return sum.a > 0.0 ? vec4(sum.rgb / sum.a, sum.a / float(TAPS)) : 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","Vaporize":"// Vaporize — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Vaporize.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image goes up in smoke: from one side, the picture itself turns to vapour that rises over what is still intact, curls into wisps and pales as it thins 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 vec2 direction; \n\nuniform float rise; \n\nuniform float swirl; \n\nuniform vec4 color; \n\nconst float RAGGED = 0.09;\nconst float BAND = 0.12;\nconst float LIFE = 0.16;\nconst int TAPS = 6;\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 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(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 p) {\n return 0.55 * vnoise(p) + 0.3 * vnoise(p * 2.03 + 5.1) + 0.15 * vnoise(p * 4.1 + 9.7);\n}\n\nvec2 curl(vec2 p) {\n float e = 0.1;\n float n = vnoise(p);\n float nx = vnoise(p + vec2(e, 0.0));\n float ny = vnoise(p + vec2(0.0, e));\n return vec2(ny - n, n - nx) / e;\n}\n\nfloat sweep(float t) {\n return t + 0.6 * t * (1.0 - t) * (1.0 - 2.0 * t);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nvec4 transition(vec2 uv) {\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(0.0, 1.0);\n vec2 side = vec2(-dir.y, dir.x);\n vec2 q = (uv - 0.5) * vec2(ratio, 1.0);\n float along = dot(q, dir);\n float across = dot(q, side);\n float ext = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n\n float ragged = RAGGED * (2.0 * fbm(q * 2.5 + 1.3) - 1.0);\n float start = -ext - RAGGED;\n float travel = 2.0 * ext + 2.0 * RAGGED + BAND;\n float front = start + travel * sweep(progress) + ragged;\n\n float gone = smoothstep(0.0, BAND, front - along);\n vec4 base = mix(getFromColor(uv), getToColor(uv), gone);\n\n \n float height = max(rise, 0.05) * (0.7 + 0.6 * vnoise(vec2(across * 3.0 + 2.7, 0.5)));\n float age = (along - front) / height;\n float released = progress - age * LIFE;\n if (age <= 0.0 || age >= 1.0 || released <= 0.0) return base;\n\n \n float origin = start + travel * sweep(released) + ragged;\n vec2 org = q - dir * (along - origin);\n\n vec2 sw = curl(org * 3.0 + dir * progress * 1.5) * (swirl * 0.08 * sqrt(age));\n vec2 src = org - sw;\n\n vec2 spreadOut = (side * 0.07 + dir * 0.02) * sqrt(age);\n vec4 c = vec4(0.0);\n for (int i = 0; i < TAPS; i++) {\n float t = float(i) / float(TAPS - 1) - 0.5;\n vec4 img = getFromColor(mirror((src + spreadOut * t) / vec2(ratio, 1.0) + 0.5));\n c += vec4(img.rgb * img.a, img.a);\n }\n c = c.a > 0.0 ? vec4(c.rgb / c.a, c.a / float(TAPS)) : vec4(0.0);\n\n vec2 wq = (q - 0.6 * sw - dir * (progress * 2.5)) * 4.0;\n float w = fbm(vec2(dot(wq, side), dot(wq, dir) * 0.6) + 2.0);\n float density = smoothstep(1.2 * age - 0.2, 1.2 * age + 0.1, w);\n density *= 1.0 - smoothstep(0.3, 1.0, age);\n \n density *= smoothstep(-ext, -ext + 0.05, origin);\n\n float pale = smoothstep(0.0, 0.5, age);\n float l = dot(c.rgb, vec3(0.299, 0.587, 0.114));\n c = mix(c, vec4(mix(vec3(l), color.rgb, 0.7), c.a * color.a), pale * 0.85);\n c.rgb = min(c.rgb + 0.12 * pale * density * (1.0 - density), vec3(1.0));\n float a = density * c.a;\n float outA = a + base.a * (1.0 - a);\n if (outA <= 0.0) return vec4(0.0);\n return vec4((c.rgb * a + base.rgb * base.a * (1.0 - a)) / outA, outA);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = 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 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 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 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 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 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 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 rgb = mix(rgb, vec3(luma(rgb)), 0.6 * dens);\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 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 float dark = g < 0.1 * amount ? min(10.0 * amount, 1.0) : 0.0;\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 snow *= min(10.0 * amount, 1.0);\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","ViscousFingers":"// ViscousFingers — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/ViscousFingers.glsl\n// Author: gre\n// License: MIT\n// Description: The incoming image is pushed into the outgoing one like air into oil squeezed between two glass plates: a bubble grows into a few rounded fingers that keep splitting in two at their tips, shoving the old picture aside into thin glossy threads, until the fingers swell and close the last gaps\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 int fingers; \n\nconst float TAU = 6.2831853;\nconst float AA = 0.0025;\nconst float R0 = 0.07;\nconst vec3 LIGHT = vec3(-0.4511, 0.5514, 0.7018);\nconst vec3 HALFWAY = vec3(-0.2445, 0.2989, 0.9224);\n\nfloat vfHash(float p) {\n p = fract(p * 0.1031);\n p *= p + 33.33;\n p *= p + p;\n return fract(p);\n}\n\nfloat vfCap(float r, float lim, float w) {\n float x = clamp((lim - r) / max(w, 1e-4), 0.0, 1.0);\n return sqrt(x * (2.0 - x));\n}\n\nvec2 vfMirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat vfSplit(float c, float l, float s) {\n return R0 * s * (0.8 + 0.4 * vfHash(c + 97.0 * l + 11.7));\n}\n\nfloat vfFinger(float l, float n, float c, float a, float r, float n0, float Rt, float fill) {\n float g = 1.0;\n float ck = c;\n float lk = l;\n \n for (int k = 0; k < 5; k++) {\n if (lk < 0.0) break;\n g = min(g, 0.68 + 0.32 * vfHash(ck + 97.0 * lk + 3.1));\n ck = floor(ck * 0.5);\n lk -= 1.0;\n }\n float split = vfSplit(c, l, 2.0 * n / n0);\n float rs = l < 0.5 ? 0.0 : vfSplit(floor(c * 0.5), l - 1.0, n / n0) * (1.0 - 0.3 * TAU * 2.0 / n);\n float cell = TAU * r / n;\n \n float fork = l < 0.5 ? 1.0 : smoothstep(rs, rs + 0.6 * (split - rs), r);\n float ac = (mod(c, 2.0) < 0.5 ? 0.5 : -0.5) * (1.0 - fork);\n float tip = Rt * mix(g, 1.0, fill);\n float w = mix(mix(0.2, 0.3, smoothstep(0.0, 0.3, tip - r)), 0.56, fill) * (2.0 - fork) * cell + 3.0 * AA * fill;\n float end = l < 3.5 ? min(tip, split + w) : tip;\n return max(abs(a - ac) * cell - w * vfCap(r, end, w), max(r - end, rs - r));\n}\n\nfloat vfField(vec2 q, float Rt, float fill) {\n float r = length(q);\n float th = atan(q.y, dot(q, q) > 0.0 ? q.x : 1.0) / TAU + 0.5;\n th += (0.012 * sin(r * 11.0 + TAU * th * 3.0) + 0.007 * sin(r * 23.0 - TAU * th * 7.0)) / (0.3 + r);\n\n float n0 = float(fingers);\n float dist = r - min(Rt, R0);\n float n = n0;\n for (int l = 0; l < 5; l++) {\n float fl = float(l);\n float x = th * n;\n float c = floor(x);\n float a = x - c - 0.5;\n float side = a < 0.0 ? -1.0 : 1.0;\n \n dist = min(dist, vfFinger(fl, n, mod(c, n), a, r, n0, Rt, fill));\n dist = min(dist, vfFinger(fl, n, mod(c + side, n), a - side, r, n0, Rt, fill));\n n *= 2.0;\n }\n return dist;\n}\n\nvec4 transition(vec2 uv) {\n vec2 asp = vec2(ratio, 1.0);\n vec2 q = (uv - center) * asp;\n vec2 dir = q / max(length(q), 1e-4);\n float rmax = length(max(center, 1.0 - center) * asp);\n\n float t = progress;\n float Rt = t * (rmax + 0.1) / 0.55;\n float fill = clamp((t - 0.45) / 0.55, 0.0, 1.0);\n float grow = smoothstep(0.0, 0.08, Rt) * (1.0 - fill * fill);\n\n const vec2 EPS = vec2(0.002, 0.0);\n float d = vfField(q, Rt, fill);\n vec2 grad = vec2(vfField(q + EPS, Rt, fill) - d, vfField(q + EPS.yx, Rt, fill) - d) / EPS.x;\n vec2 gdir = grad / max(length(grad), 1e-4);\n\n float slope = 0.4 * exp(-max(d, 0.0) / 0.01) * grow;\n vec3 nrm = normalize(vec3(-slope * gdir, 1.0));\n float diffuse = max(1.0 + 0.9 * (dot(nrm, LIGHT) - LIGHT.z), 0.0);\n float spec = max(pow(max(dot(nrm, HALFWAY), 0.0), 40.0) - pow(HALFWAY.z, 40.0), 0.0);\n\n \n vec2 suv = uv - dir * 0.03 * exp(-max(d, 0.0) / 0.05) * grow / asp;\n vec4 oil = getFromColor(vfMirror(suv));\n oil.rgb = oil.rgb * diffuse + 0.4 * spec * oil.a;\n\n vec4 air = getToColor(uv);\n air.rgb *= 1.0 - 0.35 * grow * exp(min(d, 0.0) / 0.006);\n\n return mix(air, oil, smoothstep(-2.0 * AA, 0.0, 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","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;\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 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 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 float reach = 0.7 * maxR;\n\n vec2 n0 = floor(p / h);\n \n float k = smoothstep(0.0, 0.05, flight(groupOf(n0, h, c, maxR)));\n vec4 col = k <= 0.0 ? premultiplied(getFromColor(uv)) : k >= 1.0 ? premultiplied(getToColor(uv)) : mix(premultiplied(getFromColor(uv)), premultiplied(getToColor(uv)), k);\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 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 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","WarpSpeed":"// WarpSpeed — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WarpSpeed.glsl\n// Author: gre\n// License: MIT\n// Description: The camera jumps to light speed: star streaks shoot out from the center and stretch longer and longer while the outgoing image is pulled into a radial smear, then after a flash the incoming image emerges from the center as the streaks shrink 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 vec2 center; \n\nuniform float streaks; \n\nuniform vec4 streakColor; \n\nuniform float strength; \n\nuniform float flash; \n\nconst float PI = 3.141592653589793;\nconst int TAPS = 12;\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 stars(float a, float r, float n, float layer, float travel, float speed, float reach) {\n float cell = floor(a * n);\n float h1 = hash(vec2(cell, layer));\n float h2 = hash(vec2(cell, layer + 17.0));\n float h3 = hash(vec2(cell, layer + 31.0));\n float life = fract(h1 + travel * (0.6 + 0.8 * h2));\n float head = reach * (0.05 + 1.05 * pow(life, 1.4));\n float tail = head * (1.0 - min(0.9, speed * (0.15 + 0.5 * h3)));\n float along = clamp((r - tail) / max(head - tail, 1e-4), 0.0, 1.0);\n float inside = step(tail, r) * (1.0 - smoothstep(head - 0.006, head, r));\n float profile = inside * along * along;\n \n \n float f = fract(a * n);\n float cellWidth = 2.0 * PI * r / n;\n float offset = 0.3 + 0.4 * h3;\n float across = (f - offset) * cellWidth;\n float width = min(0.0014 + 0.002 * r / reach, 0.15 * cellWidth);\n float x = across * across / (width * width);\n float line = (exp(-x) + 0.25 * exp(-x / 9.0)) * smoothstep(0.0, 0.2, min(f, 1.0 - f));\n float fade = smoothstep(0.0, 0.2, life) * (1.0 - smoothstep(0.9, 1.0, life));\n return profile * line * fade * (0.4 + 0.6 * h2) * step(0.25, hash(vec2(cell, layer + 43.0)));\n}\n\nvec4 smear(vec2 uv, float k, float b, float jitter, bool incoming) {\n if (b <= 0.0 && k >= 1.0) {\n vec4 c = incoming ? getToColor(uv) : getFromColor(uv);\n return vec4(c.rgb * c.a, c.a);\n }\n vec4 sum = vec4(0.0);\n for (int i = 0; i < TAPS; i++) {\n float s = k * (1.0 - b * (float(i) + jitter) / float(TAPS));\n vec2 q = center + (uv - center) * s;\n vec4 c = incoming ? getToColor(q) : getFromColor(q);\n sum += vec4(c.rgb * c.a, c.a);\n }\n return sum / float(TAPS);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n vec2 aspect = vec2(ratio, 1.0);\n vec2 d = (uv - center) * aspect;\n float r = length(d);\n \n float a = atan(d.y, d.x + 1e-6) / (2.0 * PI) + 0.5;\n vec2 far = max(center, 1.0 - center) * aspect;\n float reach = length(far);\n\n float speed = sin(PI * p);\n speed *= speed;\n float travel = 3.0 * (p - sin(2.0 * PI * p) / (2.0 * PI));\n float jitter = hash(floor(uv * aspect * 997.0));\n\n float goOut = smoothstep(0.0, 0.55, p);\n float goIn = 1.0 - smoothstep(0.45, 1.0, p);\n float soft = 0.35 * reach;\n float edge = mix(-soft, reach + soft, smoothstep(0.42, 0.78, p));\n float m = 1.0 - smoothstep(edge - soft, edge, r);\n vec4 before = vec4(0.0);\n vec4 after = vec4(0.0);\n if (m < 1.0) before = smear(uv, 1.0 - 0.3 * strength * goOut * goOut, 0.6 * strength * goOut, jitter, false);\n if (m > 0.0) after = smear(uv, 1.0 - 0.3 * strength * goIn * goIn, 0.6 * strength * goIn, jitter, true);\n vec4 c = mix(before, after, m);\n float dark = p < 0.5 ? speed : speed * speed * speed;\n c.rgb *= 1.0 - 0.65 * (0.5 + 0.5 * strength) * dark;\n\n float n = max(floor(streaks), 1.0);\n float len = speed * (0.5 + 1.5 * strength);\n float s = stars(a, r, n, 1.0, travel, len, reach);\n s += stars(fract(a + 0.37), r, max(floor(n * 0.71), 1.0), 2.0, travel * 1.3, len, reach);\n float core = r / (0.35 * reach);\n float peak = (p - 0.5) * 9.0;\n float glow = flash * exp(-peak * peak) * speed * (0.35 + 0.9 * exp(-core * core));\n vec3 light = streakColor.rgb * streakColor.a * (2.2 * s * speed + glow);\n \n return c.a > 0.0 ? vec4(clamp(c.rgb / c.a + light, 0.0, 1.0), 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","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: A drop falls into the image like into still water: round ripples spread out from where it hits, bending the image with glints on their slopes, the incoming image shows up inside the leading ripple, and the water calms down\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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\nuniform vec2 center; \n\nuniform float refraction; \n\nuniform float highlight; \n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat wave(float s, float k, float lambda, float t) {\n float env = smoothstep(-0.3 * lambda, 0.6 * lambda, s) * exp(-s / (3.5 * lambda));\n \n return env * sin(k * s + speed * t);\n}\n\nvec4 transition(vec2 uv) {\n float k = 2.0 * max(amplitude, 1.0);\n float lambda = 6.2831853 / k;\n \n vec2 q = (uv - center) * vec2(ratio, 1.0);\n float r = length(q);\n vec2 dir = r > 0.0 ? q / r : vec2(0.0);\n vec2 far = max(center, 1.0 - center) * vec2(ratio, 1.0);\n float R = length(far);\n\n float edge = 0.35 * lambda;\n float soft = 0.1 * lambda;\n \n \n float t = progress;\n float e = mix(t, 1.0 - (1.0 - t) * (1.0 - t), 0.4);\n float front = mix(-0.3 * lambda, R + edge + soft + 0.01, e);\n float s = front - r;\n\n float calm = 1.0 - smoothstep(0.55, 1.0, t);\n calm *= calm;\n \n \n float d = 0.02 * lambda;\n float r0 = max(r - d, 0.0);\n float slope = calm * (wave(front - r - d, k, lambda, t) - wave(front - r0, k, lambda, t)) / ((r + d - r0) * k);\n vec2 offset = dir * slope * refraction / vec2(ratio, 1.0);\n\n vec4 ca = getFromColor(mirror(uv - offset));\n vec4 cb = getToColor(mirror(uv - offset));\n float m = smoothstep(edge - soft, edge + soft, s);\n \n vec4 c = mix(vec4(ca.rgb * ca.a, ca.a), vec4(cb.rgb * cb.a, cb.a), m);\n\n float h = calm * wave(s, k, lambda, t);\n float lit = -dot(dir, normalize(vec2(-0.6, 0.8))) * slope;\n float glint = highlight * (0.2 * h + 0.6 * smoothstep(0.2, 0.9, lit) - 0.3 * smoothstep(0.2, 0.9, -lit));\n c.rgb = clamp(c.rgb + glint * c.a, 0.0, c.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","WatercolorDissolve":"// WatercolorDissolve — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WatercolorDissolve.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing image is washed off into wet paper, then the incoming one is painted in watercolor: pale washes spread first, blooming where the paint is still wet and drying with darker edges and grainy pigment, then deeper glazes go on, darkest tones first, until the picture is complete\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 edges; \n\nuniform float blooms; \n\nuniform float granulation; \n\nuniform vec4 paper; \n\nfloat wcHash(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n \n p3 = fract(p3 + dot(p3, p3.yzx + 33.33));\n return fract((p3.x + p3.y) * p3.z * 37.0);\n}\n\nfloat wcNoise(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(wcHash(i), wcHash(i + vec2(1.0, 0.0)), f.x),\n mix(wcHash(i + vec2(0.0, 1.0)), wcHash(i + vec2(1.0, 1.0)), f.x),\n f.y\n );\n}\n\nfloat wcFbm(vec2 p) {\n float v = 0.0;\n float a = 0.5;\n for (int i = 0; i < 4; i++) {\n v += a * wcNoise(p);\n p = mat2(1.6, 1.2, -1.2, 1.6) * p + 5.7;\n a *= 0.5;\n }\n float z = (v / 0.9375 - 0.5) / 0.11;\n return 0.5 + 0.5 * z / sqrt(1.0 + z * z);\n}\n\nvec2 wcFold(vec2 p) {\n return 1.0 - abs(1.0 - mod(p, 2.0));\n}\n\nfloat wcFront(float start, float dur, float margin) {\n float s = clamp((progress - start) / dur, 0.0, 1.0);\n s = mix(s, s * s * (3.0 - 2.0 * s), 0.5);\n return s * (1.0 + 2.0 * margin) - margin;\n}\n\nfloat wcRim(float d, float w) {\n float r = 1.0 - smoothstep(0.0, w, d);\n return smoothstep(-0.006, 0.004, d) * r * r;\n}\n\nfloat wcLuma(vec3 c) {\n return dot(c, vec3(0.299, 0.587, 0.114));\n}\n\nvec4 transition(vec2 uv) {\n \n if (progress >= 0.98) return getToColor(uv);\n vec2 q = vec2(uv.x * ratio, uv.y);\n vec2 px = vec2(1.0 / ratio, 1.0);\n vec4 from = getFromColor(uv);\n\n \n vec2 gq = mat2(0.8, 0.6, -0.6, 0.8) * q;\n float grain = 0.55 * wcNoise(gq * 120.0) + 0.45 * wcNoise(gq * 50.0 + 3.1);\n float tooth = 0.03 * (grain - 0.5);\n vec2 w = vec2(wcNoise(q * 2.5 + 1.3), wcNoise(q * 2.5 + 8.1)) - 0.5;\n\n vec4 run = vec4(from.rgb * from.a, from.a);\n for (int i = 0; i < 4; i++) {\n float a = float(i) * 1.570796 + 0.8;\n vec4 f = getFromColor(wcFold(uv + 0.007 * vec2(cos(a), sin(a)) * px));\n run += vec4(f.rgb * f.a, f.a);\n }\n vec3 fromRun = run.a > 0.0 ? run.rgb / run.a : from.rgb;\n float d0 = wcFront(0.0, 0.4, 0.1) - wcFbm(q * 2.8 + 0.9 * w + 11.0);\n float lift = smoothstep(-0.03, 0.06, d0);\n vec3 stain = mix(paper.rgb, paper.rgb * fromRun, 0.12);\n vec3 c = mix(from.rgb, mix(fromRun, stain, smoothstep(0.0, 0.1, d0)), lift);\n c *= 1.0 - 0.18 * wcRim(d0, 0.05) * (1.0 - wcLuma(fromRun)) * lift;\n c *= (1.0 - 0.06 * lift * (1.0 - smoothstep(0.05, 0.4, d0)) * (1.0 - smoothstep(0.35, 0.6, progress))) * (1.0 - 0.05 * (grain - 0.5) * lift);\n float alpha = mix(from.a, paper.a, lift);\n \n if (progress <= 0.07) return vec4(c, alpha);\n\n \n \n \n vec2 hand = uv + 0.012 * w * px;\n vec4 broad = vec4(0.0);\n vec4 fine = vec4(0.0);\n for (int i = 0; i < 8; i++) {\n float a = float(i) * 0.785398 + 0.3;\n vec4 b = getToColor(wcFold(hand + 0.035 * vec2(cos(a), sin(a)) * px));\n vec4 f = getToColor(wcFold(hand + 0.012 * vec2(-sin(a), cos(a)) * px));\n broad += vec4(b.rgb * b.a, b.a);\n fine += vec4(f.rgb * f.a, f.a);\n }\n vec3 broadC = broad.rgb / max(broad.a, 1e-3);\n vec3 fineC = fine.rgb / max(fine.a, 1e-3);\n broad.a /= 8.0;\n fine.a /= 8.0;\n float pool = wcNoise(q * 4.0 + w * 2.0 + 31.0);\n\n float d1 = wcFront(0.07, 0.43, 0.12) - wcFbm(q * 3.0 + 1.2 * w + 2.0);\n float cov1 = smoothstep(-0.05, 0.03, d1) * lift;\n float k1 = 0.55 * broad.a;\n vec3 g1 = mix(vec3(1.0), broadC, (0.4 + 0.3 * pool) * broad.a);\n vec2 bq = q / 0.3;\n vec2 bc = floor(bq);\n float frill = 0.5 * wcNoise(q * 14.0) + 0.3 * wcNoise(q * 33.0 + 4.0) + 0.2 * wcNoise(q * 80.0 + 9.0);\n float inBloom = 0.0;\n float bloomRim = 0.0;\n for (int j = -1; j <= 1; j++) {\n for (int i = -1; i <= 1; i++) {\n vec2 cell = bc + vec2(float(i), float(j));\n if (wcHash(cell + vec2(17.0, 53.0)) < blooms) {\n vec2 ctr = cell + 0.3 + 0.4 * vec2(wcHash(cell + vec2(3.0, 71.0)), wcHash(cell + vec2(89.0, 9.0)));\n float g = clamp((d1 - 0.08 - 0.2 * wcHash(cell + vec2(5.0, 37.0))) / 0.3, 0.0, 1.0);\n g = 1.0 - (1.0 - g) * (1.0 - g) * (1.0 - g);\n \n float r = g * (0.18 + 0.14 * wcHash(cell + vec2(61.0, 7.0))) * (0.45 + 1.1 * frill);\n float d = r - length(bq - ctr);\n float inside = smoothstep(-0.015, 0.015, d);\n inBloom = max(inBloom, inside * smoothstep(0.0, 0.25, r));\n bloomRim = max(bloomRim, inside * (1.0 - smoothstep(0.0, 0.05, d)) * smoothstep(0.0, 0.1, r));\n }\n }\n }\n g1 = mix(g1, mix(vec3(1.0), g1, 0.55), inBloom);\n g1 *= mix(vec3(1.0), g1 * g1 * 0.9, bloomRim);\n g1 *= mix(vec3(1.0), g1, edges * 0.8 * wcRim(d1, 0.06));\n\n float t2 = clamp(mix(wcFbm(q * 3.2 - 1.0 * w + 7.0), mix(1.0, wcLuma(fineC), fine.a), 0.55) + tooth, 0.0, 1.0);\n float d2 = wcFront(0.25, 0.42, 0.1) - t2;\n float cov2 = smoothstep(-0.006, 0.004, d2) * cov1;\n vec3 g2 = clamp(mix(vec3(1.0), fineC, (0.75 + 0.2 * (1.0 - pool)) * fine.a) / mix(vec3(1.0), broadC, 0.55 * broad.a), 0.0, 1.0);\n g2 *= mix(vec3(1.0), g2 * g2 * 0.92, edges * wcRim(d2, 0.07));\n\n vec3 wash = mix(vec3(1.0), g1, cov1) * mix(vec3(1.0), g2, cov2);\n float settle = clamp((grain - 0.5) * 2.0 + 0.5 * (wcNoise(q * 18.0 + 9.0) - 0.5), -0.4, 1.0);\n wash = min(wash * (1.0 - granulation * 0.45 * settle * (1.0 - wcLuma(wash))), 1.0);\n \n float a1 = alpha + (1.0 - alpha) * clamp(cov1 * k1 + cov2 * 0.35 * fine.a, 0.0, 1.0);\n c = mix(c * wash, wash, (a1 - alpha) / max(a1, 1e-3));\n alpha = a1;\n\n vec4 to = getToColor(uv);\n float t3 = clamp(mix(wcFbm(q * 3.6 + 0.8 * w + 19.0), mix(1.0, wcLuma(fineC), fine.a), 0.45) + tooth, 0.0, 1.0);\n float d3 = wcFront(0.45, 0.53, 0.1) - t3;\n float cov3 = smoothstep(-0.006, 0.004, d3);\n vec3 last = to.rgb * mix(vec3(1.0), to.rgb * 0.9, edges * 0.7 * wcRim(d3, 0.05));\n return vec4(mix(c, last, cov3), mix(alpha, to.a, cov3));\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","WaterfallWipe":"// WaterfallWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WaterfallWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Blocks of the incoming image pour down from above the frame column after column, like a waterfall: in each column they fall one behind the other, land with a small bounce and stack up from the bottom, casting soft shadows on the outgoing image until the stack 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 int columns; \n\nuniform float stagger; \n\nuniform float bounce; \n\nuniform float shadow; \n\nuniform int reverse; \n\nconst int MAX_ROWS = 48;\n\nconst float SPACING = 1.15;\n\nconst float SETTLE = 0.15;\n\nconst float THROW = 0.25;\nconst float GROW = 0.06;\nconst float EDGE = 0.0015;\n\nfloat boxDist(vec2 p, vec2 b) {\n vec2 d = abs(p) - b;\n return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);\n}\n\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - abs(v));\n}\n\nvec4 transition(vec2 uv) {\n float nc = clamp(float(columns), 1.0, 40.0);\n float nr = clamp(floor(nc / ratio + 0.5), 1.0, float(MAX_ROWS));\n vec2 cell = vec2(ratio / nc, 1.0 / nr);\n vec2 x = uv * vec2(ratio, 1.0);\n float here = clamp(floor(uv.x * nc), 0.0, nc - 1.0);\n\n \n float top = 1.0 + 0.5 * GROW * cell.y + 2.0 * EDGE;\n \n \n \n \n float st = nc > 1.0 ? clamp(stagger, 0.0, 0.8) : 0.0;\n float w = THROW;\n float e = 0.2 * clamp(bounce, 0.0, 1.0);\n float hTop = sqrt(w * w + top - (nr - 1.0) * cell.y);\n float dn = SPACING * (sqrt(w * w + cell.y) - w);\n float u = (1.0 - st) / (dn * (nr - 1.0) + hTop - w + 2.0 * e * hTop + SETTLE);\n float d = dn * u;\n float k = clamp(shadow, 0.0, 1.0);\n\n \n float z1 = -1.0, z2 = -1.0, m1 = 0.0, m2 = 0.0, a1 = 0.0, a2 = 0.0, shade = 0.0;\n vec2 s1 = vec2(0.0), s2 = vec2(0.0);\n vec2 light = vec2(0.35, -0.5) * min(cell.x, cell.y);\n for (int i = 0; i < 3; i++) {\n float c = here + float(i) - 1.0;\n if (c < 0.0 || c >= nc) continue;\n float order = (reverse != 0) ? nc - 1.0 - c : c;\n float t0 = nc > 1.0 ? st * order / (nc - 1.0) : 0.0;\n \n float floorY = 0.0;\n for (int j = 0; j < MAX_ROWS; j++) {\n float r = float(j);\n if (r >= nr) break;\n float slot = r * cell.y;\n float s = progress - t0 - r * d;\n \n if (s <= 0.0) break;\n float rh = sqrt(w * w + top - slot);\n float land = u * (rh - w);\n float y = top;\n float air = 1.0;\n if (s > land) {\n \n float b = s - land;\n y = slot + max(0.0, b * (2.0 * e * rh - b / u) / u);\n air = 1.0 - smoothstep(0.0, (2.0 * e * rh + SETTLE) * u, b);\n } else {\n y = top - s * (2.0 * w + s / u) / u;\n }\n y = max(y, floorY);\n floorY = y + cell.y;\n float z, cov, a;\n vec2 src;\n if (air <= 0.0 && y - slot < 0.02 * cell.y) {\n \n if (c != here || x.y < slot || x.y >= slot + cell.y || z2 >= 0.0) continue;\n z = 0.0; cov = 1.0; a = 0.0; src = uv;\n } else {\n float inFrame = clamp((1.0 - y) / cell.y, 0.0, 1.0);\n vec2 center = vec2((c + 0.5) * cell.x, y + 0.5 * cell.y);\n float sc = 1.0 + GROW * air;\n vec2 q = (x - center) / sc;\n float blur = 0.002 + 0.3 * air * cell.y;\n float sd = boxDist(x - center - light * air, 0.5 * cell * sc);\n shade = max(shade, (1.0 - smoothstep(-blur, blur, sd)) * air * inFrame);\n float dist = boxDist(q, 0.5 * cell) * sc;\n \n float aa = EDGE * min(8.0 * air, 1.0);\n cov = aa > 0.0 ? clamp(0.5 - dist / aa, 0.0, 1.0) : step(dist, 0.0);\n z = air + 0.001 * r;\n if (cov <= 0.0 || z <= z2) continue;\n src = (vec2(c, r) * cell + q + 0.5 * cell) / vec2(ratio, 1.0);\n vec2 lq = q / (0.5 * cell);\n float bev = 1.0 - smoothstep(0.0, 0.12, -dist / min(cell.x, cell.y));\n a = air * bev * 0.5 * (lq.y - lq.x);\n }\n if (z > z1) {\n z2 = z1; m2 = m1; a2 = a1; s2 = s1;\n z1 = z; m1 = cov; a1 = a; s1 = src;\n } else {\n z2 = z; m2 = cov; a2 = a; s2 = src;\n }\n }\n }\n\n \n vec4 col = getFromColor(uv);\n col.rgb *= 1.0 - 0.6 * k * shade;\n if (m2 > 0.0 && m1 < 1.0) {\n vec4 b = getToColor(mirror(s2));\n b.rgb = clamp(b.rgb * (1.0 + 0.6 * k * a2) * (1.0 - 0.6 * k * shade * step(z2, 0.0)), 0.0, 1.0);\n col = mix(col, b, m2);\n }\n if (m1 > 0.0) {\n vec4 b = getToColor(mirror(s1));\n b.rgb = clamp(b.rgb * (1.0 + 0.6 * k * a1) * (1.0 - 0.6 * k * shade * step(z1, 0.0)), 0.0, 1.0);\n col = mix(col, b, m1);\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","WaveWipe":"// WaveWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/WaveWipe.glsl\n// Author: gre\n// License: MIT\n// Description: A breaking wave crashes across the frame, its lip curling over in front of its face and throwing foam and spray ahead, its shadow darkening the outgoing image; the incoming image is left behind it, tinted and bent by the water, clearing as the wave passes\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 curl; \n\nuniform float foam; \n\nuniform float refraction; \n\nuniform vec4 water; \n\nuniform vec4 foamColor; \n\nconst float PI = 3.141592653589793;\n\nconst float AA = 0.002;\n\nconst float TRAIL = 0.35;\n\nconst float BAND = 0.4;\n\nconst float REACH = 0.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 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\nvec2 mirror(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat droplets(vec2 q, float cell, float density, float seed) {\n vec2 g = q / cell;\n vec2 id = floor(g);\n if (hash12(id + seed) >= density) return 0.0;\n float r = 0.1 + 0.2 * hash12(id + seed + 4.7);\n vec2 c = id + 0.5 + (0.45 - r) * (vec2(hash12(id + seed + 1.3), hash12(id + seed + 8.1)) * 2.0 - 1.0);\n float px = AA / cell;\n return 1.0 - smoothstep(r - px, r + px, length(g - c));\n}\n\nvec4 transition(vec2 uv) {\n float t = progress;\n\n vec2 dir = length(direction) > 0.0 ? normalize(direction) : vec2(1.0, 0.0);\n \n vec2 up = vec2(-dir.y, dir.x);\n if (up.y < 0.0 || (up.y == 0.0 && up.x > 0.0)) up = -up;\n float e = 0.5 * (abs(dir.x) * ratio + abs(dir.y));\n float w = 0.5 * (abs(up.x) * ratio + abs(up.y));\n \n vec2 p = (uv - 0.5) * vec2(ratio, 1.0) / (2.0 * w);\n vec2 q = vec2(dot(p, dir), dot(p, up) + 0.5);\n float E = e / (2.0 * w);\n\n float R = max(curl, 0.01);\n \n float Rb = 0.5 * R;\n float tipAngle = PI * (0.08 - 0.5 * smoothstep(0.0, 0.85, t));\n \n float travel = mix(t, t * t * (3.0 - 2.0 * t), 0.25);\n vec2 C = vec2(mix(-E - R - REACH, E + Rb + TRAIL + BAND, travel), 1.02 - R);\n\n vec2 d = q - C;\n \n if (d.x == 0.0) d.x = 1e-6;\n float r = length(d);\n float ang = atan(d.y, d.x);\n \n float k = clamp((ang - tipAngle) / (PI - tipAngle), 0.0, 1.0);\n float rIn = R - (R - Rb) * (1.0 - (1.0 - k) * (1.0 - k));\n bool curled = ang >= tipAngle;\n \n float s = 1.0 - clamp(q.y / C.y, 0.0, 1.0);\n float face = C.x - Rb - TRAIL * s * s;\n float behind = face - q.x; \n\n float wet;\n if (curled) {\n wet = smoothstep(-AA, AA, r - rIn) * (ang > 0.5 * PI ? 1.0 : 1.0 - smoothstep(-AA, AA, r - R));\n } else {\n wet = smoothstep(-AA, AA, behind);\n }\n float lip = curled ? 1.0 - smoothstep(0.5 * PI - 0.3, 0.5 * PI + 0.5, ang) : 0.0;\n\n float n = vnoise(q * vec2(14.0, 10.0) + vec2(-9.0 * t, 3.0 * t));\n\n vec4 a = getFromColor(uv);\n float gap = max(min(r - R, -behind), 0.0);\n float shade = 0.55 * exp(-gap / 0.1) * (1.0 - smoothstep(0.0, REACH, gap)) * smoothstep(0.0, 0.6, q.y) * (1.0 - smoothstep(C.y + 0.2 * R, C.y + 1.1 * R, q.y));\n shade += 0.25 * (1.0 - smoothstep(0.0, R, r));\n a.rgb *= 1.0 - shade;\n float fwd = max(r - R, 0.0);\n float zone = smoothstep(tipAngle - 0.4, tipAngle + 0.2, ang) * (1.0 - smoothstep(0.0, REACH, fwd)) * step(0.0, r - R);\n vec2 sq = (d - t * vec2(0.5, -0.25)) * vec2(0.55, 1.0);\n float thin = exp(-fwd / 0.12);\n float spray = droplets(sq, 0.02, foam * thin, 1.0) + 0.6 * droplets(sq * 1.6 + 3.1, 0.02, foam * thin, 7.0);\n float mist = foam * n * n * exp(-fwd / 0.06) * (1.0 - smoothstep(0.0, REACH, fwd)) * smoothstep(-AA, AA, r - R) * smoothstep(tipAngle, tipAngle + 0.3, ang);\n a.rgb = mix(a.rgb, foamColor.rgb, foamColor.a * clamp(spray * zone + mist, 0.0, 1.0));\n\n float band = max(1.0 - smoothstep(0.05, BAND, behind), lip);\n float bend = refraction * band * band;\n vec2 off = bend * (dir * sin(17.0 * q.y + 2.0 * sin(9.0 * q.x) - 6.0 * t) + up * cos(13.0 * q.x - 5.0 * t));\n vec4 b = getToColor(mirror(uv + off * 2.0 * w / vec2(ratio, 1.0)));\n float luma = dot(b.rgb, vec3(0.299, 0.587, 0.114));\n vec3 tinted = water.rgb * (0.4 + 0.9 * luma) * (1.0 + 0.6 * q.y);\n tinted += 0.18 * lip * (1.0 - k) * vec3(0.5, 1.0, 0.9);\n tinted *= 1.0 - 0.35 * lip * (1.0 - smoothstep(0.0, 0.06, r - rIn));\n tinted += 0.35 * (curled ? k * (1.0 - smoothstep(0.0, 0.015, r - rIn)) : 1.0 - smoothstep(0.0, 0.015, behind)) * vec3(0.7, 0.95, 1.0);\n b.rgb = mix(b.rgb, tinted, water.a * band);\n\n float crest = curled ? (1.0 - smoothstep(0.01, 0.02 + 0.12 * n, abs(R - r))) * smoothstep(tipAngle, tipAngle + 0.4, ang) * (1.0 - smoothstep(0.5 * PI + 0.2, 0.5 * PI + 0.8, ang)) : 0.0;\n float churn = (1.0 - smoothstep(0.0, 0.15 + 0.1 * n, q.y)) * (1.0 - smoothstep(0.0, 0.3, abs(behind))) * smoothstep(0.3, 0.7, n);\n b.rgb = mix(b.rgb, foamColor.rgb, foamColor.a * clamp(foam * 1.5 * (crest + churn), 0.0, 1.0));\n\n \n vec4 c = mix(vec4(a.rgb * a.a, a.a), vec4(b.rgb * b.a, b.a), wet);\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","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 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 float spread = 3.141592653589793 * progress;\n \n vec2 hand = vec2(max(sin(spread), 0.0), 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 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 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 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 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","Whirlwind":"// Whirlwind — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Whirlwind.glsl\n// Author: gre\n// License: MIT\n// Description: A whirlwind crosses the frame from left to right: it winds the outgoing image into a spiral around its eye and draws it inward as it passes, and leaves the incoming image in its wake, which unwinds and straightens out 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 turns; \n\nuniform float size; \n\nconst float PI = 3.141592653589793;\nconst int TAPS = 16;\n\nconst float LEAN = 0.35;\n\nconst float PX = 0.004;\n\nvec2 mirrored(vec2 v) {\n vec2 m = mod(v, 2.0);\n return mix(m, 2.0 - m, step(1.0, m));\n}\n\nvec4 transition(vec2 uv) {\n float t = progress, R = ratio;\n vec2 Q = vec2(uv.x * R, uv.y);\n float S = size * min(R, 1.0);\n \n float reach = 0.5 * LEAN + 0.01;\n \n float x = t + 0.3 * sin(2.0 * PI * t) / (2.0 * PI);\n vec2 c = vec2(mix(-reach, R + reach, x), 0.5 + 0.08 * sin(t * 6.0));\n \n float ramp = min(2.0 * S, 0.7 * R);\n float g = smoothstep(0.0, ramp, c.x) * smoothstep(0.0, ramp, R - c.x);\n vec2 d = Q - c;\n float s2 = S * S;\n float k = s2 / (dot(d, d) + s2);\n float k3 = k * k * k;\n float kp = k3 * g;\n float A = 2.0 * PI * turns;\n float th = A * kp;\n float inflow = 1.0 + 0.5 * kp;\n \n float spread = min(0.15 * th * k + PX * 6.0 * A * g * length(d) * k3 * k / s2, 1.0);\n vec4 col = vec4(0.0);\n float wsum = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float u = float(i) / float(TAPS - 1) - 0.5;\n float a = th + spread * u;\n float w = 1.0 - abs(u);\n float ca = cos(a), sa = sin(a);\n vec2 s = c + mat2(ca, -sa, sa, ca) * d * inflow;\n float f = s.x - c.x + LEAN * (s.y - 0.5);\n vec2 su = mirrored(vec2(s.x / R, s.y));\n vec4 v = mix(getToColor(su), getFromColor(su), smoothstep(-0.004, 0.004, f));\n \n col += w * vec4(v.rgb * v.a, v.a);\n wsum += w;\n }\n col /= wsum;\n return vec4(col.rgb / max(col.a, 1e-5) * (1.0 - 0.3 * kp * k), 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","Whittle":"// Whittle — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Whittle.glsl\n// Author: gre\n// License: MIT\n// Description: Straight cuts are scored across the outgoing image one after another, and each time the piece beyond the cut lifts and slides away along it, whittling the image down to a small polygon that slides off last and uncovers 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 cuts; \n\nuniform vec4 score; \n\nuniform vec4 shadow; \n\nconst float AA = 0.0018;\nconst float SCORE_TIME = 0.075;\nconst float LIFT = 0.025;\nconst float GAP = 0.012;\nconst vec2 SHADOW_OFFSET = vec2(0.014, -0.022);\nconst float SHADOW_BLUR = 0.03;\n\nvec2 normalOf(float k) {\n float a = k * 2.39996 + 0.7;\n return vec2(cos(a), sin(a));\n}\n\nfloat offsetOf(float k, float n, float r) {\n return 0.42 * r * (0.35 + 0.65 * (1.0 - k / n)) * (0.8 + 0.2 * fract(k * 0.618));\n}\n\nfloat boxDistance(vec2 q) {\n vec2 d = abs(q) - 0.5 * vec2(ratio, 1.0);\n return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);\n}\n\nfloat pieceDistance(vec2 q, int k, int nc, float n, float r) {\n float sd = boxDistance(q);\n for (int m = 0; m < 6; m++) {\n if (m >= k) break;\n float fm = float(m);\n sd = max(sd, dot(q, normalOf(fm)) - offsetOf(fm, n, r));\n }\n if (k < nc) sd = max(sd, offsetOf(float(k), n, r) - dot(q, normalOf(float(k))));\n return sd;\n}\n\nvec2 slideDir(float k, vec2 nk) {\n return vec2(-nk.y, nk.x) * (mod(k, 2.0) < 0.5 ? 1.0 : -1.0);\n}\n\nfloat startOf(float k, float n) {\n return 0.08 + k * 0.92 / (n + 2.2);\n}\n\nfloat slideOf(float k, float n) {\n return clamp((progress - startOf(k, n)) * (n + 2.2) / (0.92 * 2.2), 0.0, 1.0);\n}\n\nvec4 transition(vec2 uv) {\n vec2 P = (uv - 0.5) * vec2(ratio, 1.0);\n int nc = int(clamp(float(cuts), 2.0, 6.0));\n float n = float(nc);\n float r = min(ratio, 1.0) + 0.25 * abs(ratio - 1.0);\n \n float travel = length(vec2(ratio, 1.0)) + 0.1;\n\n vec4 c = getToColor(uv);\n for (int k = 6; k >= 0; k--) {\n if (k > nc) continue;\n float fk = float(k);\n bool last = k == nc;\n vec2 nk = normalOf(last ? fk - 1.0 : fk);\n vec2 dk = slideDir(fk, nk);\n float g = slideOf(fk, n);\n if (g >= 1.0) continue;\n float lift = smoothstep(0.0, 0.35, g);\n vec2 shift = dk * travel * g * g * g + (last ? vec2(0.0) : nk * GAP * lift);\n float scale = 1.0 + LIFT * lift * (1.0 - g);\n vec2 Q = (P - shift) / scale;\n vec2 S = (P - shift - SHADOW_OFFSET * lift) / scale;\n if (lift > 0.0) {\n float blur = SHADOW_BLUR * (0.3 + lift);\n float sh = lift * (1.0 - smoothstep(-blur, blur, pieceDistance(S, k, nc, n, r)));\n c.rgb = mix(c.rgb, shadow.rgb, shadow.a * sh);\n }\n\n \n float cover = clamp(0.5 - (pieceDistance(Q, k, nc, n, r) - AA) / AA, 0.0, 1.0);\n if (cover <= 0.0) continue;\n vec4 col = getFromColor(clamp(Q / vec2(ratio, 1.0) + 0.5, 0.0, 1.0));\n for (int m = 0; m < 6; m++) {\n if (m > k || m >= nc) break;\n float fm = float(m);\n vec2 nm = normalOf(fm);\n vec2 dm = slideDir(fm, nm);\n float run = clamp((progress - startOf(fm, n) + SCORE_TIME) / SCORE_TIME, 0.0, 1.0);\n float head = mix(-1.0, 1.0, run) * (0.5 * dot(abs(dm), vec2(ratio, 1.0)) + 0.02);\n float behind = head - dot(Q, dm);\n float drawn = clamp(0.5 + behind / AA, 0.0, 1.0) * (1.0 - smoothstep(0.0, 0.25, slideOf(fm, n)));\n float e = abs(dot(Q, nm) - offsetOf(fm, n, r));\n float line = exp(-e / 0.0016) + 0.3 * exp(-e / 0.008);\n float tip = exp(-length(vec2(behind, e)) / 0.012) * min(run * 20.0, 1.0) * (1.0 - run);\n col.rgb = mix(col.rgb, score.rgb, clamp(score.a * drawn * (line * (0.6 + 0.4 * exp(-max(behind, 0.0) * 3.0)) + tip), 0.0, 1.0));\n }\n c = mix(c, col, cover);\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","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","Wormhole":"// Wormhole — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Wormhole.glsl\n// Author: gre\n// License: MIT\n// Description: A small glass-like sphere opens in the outgoing picture and bends the scene around it, with the incoming world visible inside; the camera falls through its mouth and comes out into the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 swirl; \n\nuniform float ring; \n\nconst float PI = 3.14159265;\nconst int STEPS = 16;\n\nvec2 mirrored(vec2 v) {\n return 1.0 - abs(1.0 - mod(v, 2.0));\n}\n\nfloat skyRadius(float th) {\n float k = 1.2 * max(th - 1.4, 0.0);\n return th < 1.4 ? tan(0.5 * th) : tan(0.7) + 0.7 * k / (1.0 + k);\n}\n\nvec4 trace(float rs, vec2 dir, float A, float field) {\n vec2 asp = vec2(ratio, 1.0);\n float b = max(sin(A), 0.0);\n float l0 = cos(A);\n float al = 2.0 * atan(rs / (2.0 * field));\n float L = sin(al);\n float m2 = (L - b) * (L + b);\n bool through = m2 < 0.0;\n \n bool crit = l0 < 0.0 && abs(m2) < 0.3 * b * b;\n float x0 = 0.0, x1 = 1.0;\n if (!crit) {\n if (through) {\n x0 = -0.5 * PI;\n x1 = atan(l0, sqrt(-m2));\n } else {\n float psi = asin(clamp(sqrt(m2) / max(abs(l0), 1e-4), 0.0, 1.0));\n x0 = l0 > 0.0 ? psi : 0.0;\n x1 = l0 > 0.0 ? PI : psi;\n }\n }\n \n float w = (x1 - x0) / float(STEPS);\n float phi = 0.0;\n for (int i = 0; i < STEPS; i++) {\n float x = x0 + (float(i) + 0.5) * w;\n float s = sin(x);\n float h = 1.0 - x;\n float l = x - l0 * h;\n phi += crit\n ? L / sqrt(max((l * l + b * b * h * h) * (l * l - m2 * h * h), 1e-9))\n : L / sqrt(max(through ? b * b - L * L * s * s : m2 + b * b * s * s, 0.02 * b * b + 1e-9));\n }\n phi *= w;\n bool other = through || l0 < 0.0;\n float th = other ? phi : PI - phi;\n float bend = th - al;\n float a = swirl * 2.0 * bend / (1.0 + abs(bend));\n vec2 e = mat2(cos(a), sin(a), -sin(a), cos(a)) * dir;\n \n vec2 q = e * sign(th) * skyRadius(abs(th)) * 2.0 * field;\n if (other) {\n \n vec2 k = 1.8 / asp * (1.0 - smoothstep(0.7, 2.7, A));\n q /= sqrt(1.0 + q * q * k * k);\n }\n vec2 st = mirrored(0.5 + q / asp);\n vec4 c = other ? getToColor(st) : getFromColor(st);\n\n float off = (L - b) / (0.03 + 0.1 * b);\n float edge = smoothstep(0.0, 0.12, b) * smoothstep(0.0, 0.3, l0);\n c.rgb *= 1.0 - 0.35 * edge * exp(-abs(off) * 0.6) * (through ? 1.0 : 0.6);\n c.rgb = min(c.rgb + ring * edge * (0.25 + 0.75 * c.rgb) * exp(-off * off * 5.0), 1.0);\n return vec4(c.rgb * c.a, c.a);\n}\n\nvec4 transition(vec2 uv) {\n float p = progress;\n \n float A = PI * p * p * (2.0 - p);\n vec2 asp = vec2(ratio, 1.0);\n float field = 0.3 * length(asp);\n vec2 d = (uv - 0.5) * asp;\n \n float rs = max(length(d), 1e-4);\n vec2 dir = length(d) > 1e-5 ? normalize(d) : vec2(1.0, 0.0);\n \n float rim = 2.0 * field * tan(0.5 * min(A, 1.6));\n float dr = 0.0014 * exp(-abs(rs - rim) / (0.02 + 0.06 * rim)) * smoothstep(0.0, 0.15, A) * (1.0 - smoothstep(1.4, 1.6, A));\n vec4 c = trace(rs, dir, A, field);\n if (dr > 1e-4) {\n c += trace(max(abs(rs - dr), 1e-4), rs < dr ? -dir : dir, A, field) + trace(rs + dr, dir, A, field);\n c /= 3.0;\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","Wrench":"// Wrench — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Wrench.glsl\n// Author: gre\n// License: MIT\n// Description: The outgoing picture is a tray of stuck tiles that is wrenched: its two ends twist against each other in 3D while cracks run out along the joints, it snaps back flat, and the loosened tiles tip out one after another and fall out of the frame, uncovering the incoming picture\n\nuniform shader _from;\nuniform shader _to;\nuniform float2 _resolution;\nuniform float progress;\nuniform float ratio;\n\nvec4 getFromColor(vec2 uv) { return vec4(unpremul(_from.eval(vec2(uv.x, 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 rows; \n\nuniform float twist; \n\nuniform float shading; \n\nconst float PI = 3.14159265;\nconst float EYE = 1.8;\nconst float TWIST_END = 0.48;\nconst float POP_SPREAD = 0.24;\nconst float FLIGHT = 0.28;\nconst float THICK = 0.03;\nconst float EDGE = 0.0015;\nconst vec3 L = vec3(-0.3, 0.45, 0.84);\n\nvec4 hash4(vec2 p) {\n vec4 q = fract(vec4(p.xyxy) * vec4(0.1031, 0.1030, 0.0973, 0.1099));\n q += dot(q, q.wzxy + 33.33);\n return fract((q.xxyz + q.yzzw) * q.zywx);\n}\n\nfloat wrench(float s) {\n if (s < 0.75) return smoothstep(0.0, 0.75, s);\n float r = (s - 0.75) / 0.25;\n return (1.0 - r) * (1.0 - r) * cos(2.5 * PI * r);\n}\n\nfloat arrival(vec2 f, vec2 seg, vec2 grid, vec2 size) {\n vec2 o = clamp(floor(0.5 * grid + 0.5), vec2(1.0), max(grid - 1.0, vec2(1.0)));\n vec2 far = max(o, grid - o) * size;\n float d = dot(abs(f - o), size) / (far.x + far.y);\n return 0.75 * d + 0.25 * hash4(seg + 41.0).x;\n}\n\nfloat popU(vec2 g, vec2 grid, vec2 size) {\n float order = clamp((0.55 * hash4(g).x + 0.45 * arrival(g + 0.5, vec2(-7.0), grid, size) - 0.2) / 0.62, 0.0, 1.0);\n return clamp((progress - TWIST_END - POP_SPREAD * order) / FLIGHT, 0.0, 1.0);\n}\n\nfloat lambert(vec3 n, float shade) {\n return 1.0 + shade * 0.8 * (max(dot(n, L), 0.0) / L.z - 1.0);\n}\n\nvec4 face(vec3 o, vec3 d, vec3 c, vec3 ex, vec3 ey, vec2 h, vec2 grow) {\n vec3 n = cross(ex, ey);\n float dn = dot(n, d);\n if (abs(dn) < 1e-5) return vec4(0.0);\n float t = dot(n, c - o) / dn;\n vec3 x = o + t * d - c;\n vec2 l = vec2(dot(x, ex), dot(x, ey));\n float e = EDGE * max(t, 0.1) / max(abs(dn) / length(d), 0.25);\n vec2 m = h + 0.5 * e * abs(grow) - abs(l - 0.5 * e * grow);\n return vec4(clamp(min(m.x, m.y) / e + 0.5, 0.0, 1.0) * step(0.1, t), t, l);\n}\n\nvec2 crackAt(float fa, float fb, float n, float other, vec2 grid, vec2 size, float sz, float cp, float widen, float lipSide) {\n float j = floor(fa + 0.5);\n if (j < 1.0 || j > n - 1.0) return vec2(0.0);\n vec2 f = other > 0.0 ? vec2(fb, j) : vec2(j, fb);\n vec2 seg = other > 0.0 ? vec2(floor(fb), j + 20.0) : vec2(j, floor(fb));\n float open = clamp((cp - arrival(f, seg, grid, size)) / 0.1, 0.0, 1.0);\n float w = (0.004 + 0.006 * widen) * open;\n float sd = (fa - j) * sz;\n float e = 0.0012;\n float k = clamp((0.5 * w - abs(sd)) / e + 0.5, 0.0, 1.0) * clamp(w / e, 0.0, 1.0);\n float lip = clamp(1.0 - abs(sd * lipSide - 0.5 * w - 0.002) / 0.002, 0.0, 1.0) * open;\n return vec2(k, lip);\n}\n\nvec4 transition(vec2 uv) {\n vec2 aspect = vec2(ratio, 1.0);\n vec2 P = (uv - 0.5) * aspect;\n float n = clamp(float(rows), 1.0, 8.0);\n vec2 grid = vec2(max(1.0, floor(ratio * n + 0.5)), n);\n vec2 size = aspect / grid;\n float shade = clamp(shading, 0.0, 1.0);\n float s = clamp(progress / TWIST_END, 0.0, 1.0);\n float amp = 1.25 * clamp(twist, 0.0, 1.0) * wrench(s);\n float k2 = 2.0 * amp / ratio;\n\n \n vec2 q = P;\n float c = 1.0, sn = 0.0;\n for (int k = 0; k < 10; k++) {\n float th = amp * clamp(2.0 * q.x / ratio, -1.0, 1.0);\n c = cos(th);\n sn = sin(th);\n q.y = P.y * EYE / (c * EYE + P.y * sn);\n q.x = P.x * (EYE - q.y * sn) / EYE;\n }\n\n vec4 col = getToColor(uv);\n col.rgb *= 1.0 - 0.45 * shade * (1.0 - smoothstep(0.5, 1.0, progress));\n\n vec2 f = (q + 0.5 * aspect) / size;\n vec2 cell = floor(f);\n \n float soft = 1.0 - min(20.0 * amp, 1.0);\n float inX = clamp((0.5 * ratio - abs(q.x)) / EDGE + soft, 0.0, 1.0);\n\n \n float Y = q.y > 0.0 ? 0.5 : -0.5;\n float den = P.y * c - EYE * sn;\n float dd = abs(den) > 1e-5 ? (EYE * Y * c - P.y * (EYE - Y * sn)) / den : -1.0;\n float band = inX * clamp(dd / EDGE + 0.5, 0.0, 1.0) * clamp((THICK - dd) / EDGE + 0.5, 0.0, 1.0) * step(0.5, abs(q.y)) * step(abs(q.y), 0.6);\n if (band > 0.0) {\n vec4 e = getFromColor(vec2(q.x / ratio + 0.5, Y > 0.0 ? 0.995 : 0.005));\n e.rgb *= lambert(vec3(0.0, Y * 2.0 * c, Y * 2.0 * sn), shade) * (1.0 - 0.25 * shade);\n col = mix(col, e, band);\n }\n\n float inside = inX * clamp((0.5 - abs(q.y)) / EDGE + soft, 0.0, 1.0);\n float pu = popU(cell, grid, size);\n float cp = (s - 0.1) / 0.62;\n float widen = smoothstep(0.75, 0.85, s);\n vec2 cv = crackAt(f.x, f.y, grid.x, 0.0, grid, size, size.x, cp, widen, 1.0);\n vec2 ch = crackAt(f.y, f.x, grid.y, 1.0, grid, size, size.y, cp, widen, -1.0);\n float crack = max(cv.x, ch.x);\n if (inside > 0.0 && pu <= 0.0) {\n float lip = max(cv.y, ch.y) * (1.0 - crack);\n \n vec2 cc = (cell + 0.5) * size - 0.5 * aspect;\n float loose = clamp((cp - arrival(cell + 0.5, vec2(-3.0), grid, size)) / 0.3, 0.0, 1.0);\n float thc = amp * clamp(2.0 * cc.x / ratio, -1.0, 1.0);\n vec3 nSmooth = normalize(vec3(-q.y * k2, -sn, c));\n vec3 nFlat = vec3(0.0, -sin(thc), cos(thc));\n float lit = lambert(normalize(mix(nSmooth, nFlat, loose)), shade);\n \n vec2 slip = (hash4(cell + 5.0).xy - 0.5) * 0.012 * loose * wrench(s);\n vec4 tile = getFromColor((q - slip) / aspect + 0.5);\n tile.rgb = tile.rgb * lit * (1.0 - 0.8 * crack) + 0.3 * lip * tile.a;\n col = mix(col, tile, inside);\n } else if (pu > 0.0) {\n \n vec2 fl = fract(f) * size;\n float ao = 0.0;\n if (popU(cell + vec2(-1.0, 0.0), grid, size) <= 0.0 && cell.x > 0.0) ao = max(ao, 1.0 - fl.x / 0.03);\n if (popU(cell + vec2(1.0, 0.0), grid, size) <= 0.0 && cell.x < grid.x - 1.0) ao = max(ao, 1.0 - (size.x - fl.x) / 0.03);\n if (popU(cell + vec2(0.0, -1.0), grid, size) <= 0.0 && cell.y > 0.0) ao = max(ao, 1.0 - fl.y / 0.03);\n if (popU(cell + vec2(0.0, 1.0), grid, size) <= 0.0 && cell.y < grid.y - 1.0) ao = max(ao, 1.0 - (size.y - fl.y) / 0.03);\n col.rgb *= (1.0 - 0.5 * shade * clamp(ao, 0.0, 1.0)) * (1.0 - 0.8 * crack * (1.0 - smoothstep(0.0, 0.25, pu)));\n }\n\n \n vec3 eye = vec3(0.0, 0.0, EYE);\n vec3 dir = vec3(P, -EYE);\n float shadow = 0.0;\n float bestT = 1e5, nextT = 1e5;\n float topM = 0.0, nextM = 0.0;\n vec2 topUv = vec2(0.5), nextUv = vec2(0.5);\n float topLit = 1.0, nextLit = 1.0;\n \n float pcx = floor((P.x / 1.1 + 0.5 * ratio) / size.x);\n vec3 hs = vec3(0.5 * size, 0.5 * THICK);\n for (int j = 0; j < 8; j++) {\n if (float(j) >= grid.y) break;\n for (int i = -3; i <= 3; i++) {\n vec2 g = vec2(pcx + float(i), float(j));\n if (g.x < 0.0 || g.x >= grid.x) continue;\n float u = popU(g, grid, size);\n if (u <= 0.0 || u >= 1.0) continue;\n vec4 h = hash4(g + 17.0);\n vec2 c0 = (g + 0.5) * size - 0.5 * aspect;\n float fall = max(u - 0.2, 0.0);\n float a = (0.9 + 0.3 * h.y) * u * (1.6 - 0.6 * u);\n float r = (h.z - 0.5) * 0.6 * fall;\n float ca = cos(a), sa = sin(a), cr = cos(r), sr = sin(r);\n vec3 ex = vec3(cr, sr, 0.0);\n vec3 ey = vec3(-sr * ca, cr * ca, sa);\n vec3 ez = vec3(sr * sa, -cr * sa, ca);\n vec3 pivot = vec3(c0.x + (h.w - 0.5) * 0.2 * fall, c0.y - hs.y - (c0.y - hs.y + 0.55 + 0.9 * size.y) * fall * fall / 0.64, 0.07 * smoothstep(0.0, 0.12, u) + 0.25 * fall);\n \n vec2 lo = 0.005 * step(0.5, g);\n vec2 hi = 0.005 * step(g, grid - 1.5);\n vec2 hf = hs.xy - 0.5 * (lo + hi);\n vec2 off = 0.5 * (lo - hi);\n vec3 ctr = pivot + ey * hs.y - ez * hs.z + ex * off.x + ey * off.y;\n vec3 toEye = eye - ctr;\n float sy = dot(ey, toEye) > 0.0 ? 1.0 : -1.0;\n float sx = dot(ex, toEye) > 0.0 ? 1.0 : -1.0;\n float sz = dot(ez, toEye) > 0.0 ? 1.0 : -1.0;\n\n vec4 F = face(eye, dir, ctr + ez * (sz * hs.z), ex, ey, hf, vec2(sx, sy));\n vec4 Sy = face(eye, dir, ctr + ey * (sy * hf.y), ex, ez, vec2(hf.x, hs.z), vec2(sx, sz));\n vec4 Sx = face(eye, dir, ctr + ex * (sx * hf.x), ey, ez, vec2(hf.y, hs.z), vec2(sy, sz));\n float m = max(F.x, max(Sy.x, Sx.x));\n\n vec2 ax = ex.xy - L.xy / L.z * ex.z;\n vec2 ay = ey.xy - L.xy / L.z * ey.z;\n vec2 sd = P - (ctr.xy - L.xy / L.z * ctr.z);\n float det = ax.x * ay.y - ax.y * ay.x;\n \n float edgeOn = smoothstep(0.02, 0.15, abs(det));\n det = abs(det) < 0.05 ? (det < 0.0 ? -0.05 : 0.05) : det;\n vec2 sl = vec2(sd.x * ay.y - sd.y * ay.x, ax.x * sd.y - ax.y * sd.x) / det;\n float blur = 0.004 + 0.12 * ctr.z;\n vec2 sb = hs.xy - abs(sl);\n shadow = max(shadow, smoothstep(-blur, blur, min(sb.x, sb.y)) * (1.0 - u) * smoothstep(0.0, 0.05, u) * edgeOn / (1.0 + 2.0 * ctr.z));\n\n if (m <= 0.0) continue;\n float t = 1e5;\n vec2 st = vec2(0.0);\n float lit = 1.0;\n if (F.x > 0.0) {\n t = F.y;\n st = c0 + off + F.zw;\n \n lit = lambert(ez * sz, shade) * (sz > 0.0 ? 1.0 : 0.6);\n }\n if (Sy.x > 0.0 && Sy.y < t - 1e-4 && F.x < 0.99) {\n t = Sy.y;\n st = c0 + off + vec2(Sy.z, sy * (hf.y - 0.002));\n lit = lambert(ey * sy, shade) * (1.0 - 0.2 * shade);\n }\n if (Sx.x > 0.0 && Sx.y < t - 1e-4 && F.x < 0.99) {\n t = Sx.y;\n st = c0 + off + vec2(sx * (hf.x - 0.002), Sx.z);\n lit = lambert(ex * sx, shade) * (1.0 - 0.2 * shade);\n }\n if (t < bestT) {\n nextT = bestT;\n nextM = topM;\n nextUv = topUv;\n nextLit = topLit;\n bestT = t;\n topM = m;\n topUv = st / aspect + 0.5;\n topLit = lit;\n } else if (t < nextT) {\n nextT = t;\n nextM = m;\n nextUv = st / aspect + 0.5;\n nextLit = lit;\n }\n }\n }\n col.rgb *= 1.0 - 0.6 * shade * shadow;\n vec4 behind = getFromColor(clamp(nextUv, 0.0, 1.0));\n behind.rgb *= nextLit;\n vec4 top = getFromColor(clamp(topUv, 0.0, 1.0));\n top.rgb *= topLit;\n return mix(mix(col, behind, nextM), top, topM);\n}\n\nhalf4 main(float2 _coord) {\n vec2 _uv = _coord / _resolution;\n vec4 _c = clamp(transition(vec2(_uv.x, 1.0 - _uv.y)), 0.0, 1.0);\n return half4(_c.rgb * _c.a, _c.a);\n}\n","XorWipe":"// XorWipe — generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/XorWipe.glsl\n// Author: gre\n// License: MIT\n// Description: Discs grow one after another from five points across the frame and every disc edge flips what it passes over, so crescents and lenses of the two images alternate until the last disc sweeps the frame onto 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 rim; \n\nconst float SHARP = 300.0;\n\nfloat ease(float x) { x = clamp(x, 0.0, 1.0); return x * x * (3.0 - 2.0 * x); }\n\nvec2 seed(int i) {\n return i == 0 ? vec2(0.3, 0.38) : i == 1 ? vec2(0.74, 0.62) : i == 2 ? vec2(0.52, 0.18) : i == 3 ? vec2(0.18, 0.8) : vec2(0.86, 0.22);\n}\n\nvec4 transition(vec2 uv) {\n vec2 a = vec2(ratio, 1.0);\n vec2 P = uv * a;\n float par = 1.0, shade = 0.0, line = 0.0;\n \n for (int i = 0; i < 5; i++) {\n vec2 S = seed(i) * a;\n \n float r = (length(max(S, a - S)) + 0.01 + rim) * ease((progress - float(i) * 0.12) / 0.52);\n float d = r - length(P - S);\n \n float born = min(r * SHARP, 1.0);\n float c = clamp(d * SHARP + 0.5, 0.0, 1.0) * born;\n par *= 1.0 - 2.0 * c;\n float k = 1.0 - smoothstep(0.0, min(rim, 0.5 * r) + 1e-4, d);\n shade += c * k * k;\n line += max(1.0 - abs(d) * SHARP * 0.5, 0.0) * born;\n }\n vec4 col = mix(getFromColor(uv), getToColor(uv), 0.5 - 0.5 * par);\n float env = 4.0 * progress * (1.0 - progress);\n col.rgb *= 1.0 - 0.35 * min(shade, 1.0) * env;\n col.rgb = mix(col.rgb, vec3(1.0), 0.35 * min(line, 1.0) * env);\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","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 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 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"};