gl-transitions 1.74.0 → 1.76.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.
- package/README.md +78 -0
- package/compatibility.json +2070 -0
- package/glsl3/AdvancedMosaic.glsl +21 -0
- package/glsl3/BlockDissolve.glsl +16 -0
- package/glsl3/BookFlip.glsl +37 -0
- package/glsl3/Bounce.glsl +35 -0
- package/glsl3/BowTieHorizontal.glsl +123 -0
- package/glsl3/BowTieVertical.glsl +117 -0
- package/glsl3/BowTieWithParameter.glsl +74 -0
- package/glsl3/Box.glsl +33 -0
- package/glsl3/ButterflyWaveScrawler.glsl +33 -0
- package/glsl3/CircleCrop.glsl +20 -0
- package/glsl3/ColourDistance.glsl +19 -0
- package/glsl3/CrazyParametricFun.glsl +20 -0
- package/glsl3/CrossZoom.glsl +68 -0
- package/glsl3/DefocusBlur.glsl +47 -0
- package/glsl3/Directional.glsl +18 -0
- package/glsl3/DirectionalScaled.glsl +35 -0
- package/glsl3/DoomScreenTransition.glsl +62 -0
- package/glsl3/Dreamy.glsl +14 -0
- package/glsl3/DreamyZoom.glsl +43 -0
- package/glsl3/Drop_Zone_Flicker.glsl +159 -0
- package/glsl3/EdgeTransition.glsl +50 -0
- package/glsl3/FilmBurn.glsl +63 -0
- package/glsl3/Fold.glsl +12 -0
- package/glsl3/GlitchDisplace.glsl +78 -0
- package/glsl3/GlitchMemories.glsl +17 -0
- package/glsl3/GridFlip.glsl +77 -0
- package/glsl3/HSVfade.glsl +29 -0
- package/glsl3/HorizontalClose.glsl +16 -0
- package/glsl3/HorizontalOpen.glsl +18 -0
- package/glsl3/InvertedPageCurl.glsl +228 -0
- package/glsl3/LeftRight.glsl +28 -0
- package/glsl3/LinearBlur.glsl +30 -0
- package/glsl3/Mosaic.glsl +45 -0
- package/glsl3/Overexposure.glsl +25 -0
- package/glsl3/PolkaDotsCurtain.glsl +14 -0
- package/glsl3/PuzzleRight.glsl +57 -0
- package/glsl3/Radial.glsl +19 -0
- package/glsl3/Rectangle.glsl +29 -0
- package/glsl3/RectangleCrop.glsl +30 -0
- package/glsl3/Revolve_Left.glsl +98 -0
- package/glsl3/Rolls.glsl +42 -0
- package/glsl3/RotateScaleVanish.glsl +42 -0
- package/glsl3/SimpleFlip.glsl +14 -0
- package/glsl3/SimpleZoom.glsl +20 -0
- package/glsl3/SimpleZoomOut.glsl +23 -0
- package/glsl3/Slides.glsl +41 -0
- package/glsl3/StarWipe.glsl +51 -0
- package/glsl3/StaticFade.glsl +47 -0
- package/glsl3/StereoViewer.glsl +214 -0
- package/glsl3/StripDatamoshGlitch.glsl +187 -0
- package/glsl3/Swirl.glsl +34 -0
- package/glsl3/TVStatic.glsl +29 -0
- package/glsl3/TilesWave.glsl +63 -0
- package/glsl3/TopBottom.glsl +27 -0
- package/glsl3/VerticalClose.glsl +16 -0
- package/glsl3/VerticalOpen.glsl +17 -0
- package/glsl3/WaterDrop.glsl +21 -0
- package/glsl3/ZoomInCircles.glsl +40 -0
- package/glsl3/ZoomLeftWipe.glsl +36 -0
- package/glsl3/ZoomRigthWipe.glsl +36 -0
- package/glsl3/angular.glsl +25 -0
- package/glsl3/burn.glsl +14 -0
- package/glsl3/burn0.glsl +55 -0
- package/glsl3/cannabisleaf.glsl +18 -0
- package/glsl3/chessboard.glsl +28 -0
- package/glsl3/circle.glsl +24 -0
- package/glsl3/circleopen.glsl +18 -0
- package/glsl3/colorphase.glsl +19 -0
- package/glsl3/coord-from-in.glsl +18 -0
- package/glsl3/crosshatch.glsl +20 -0
- package/glsl3/crosswarp.glsl +10 -0
- package/glsl3/cube.glsl +71 -0
- package/glsl3/directional-easing.glsl +19 -0
- package/glsl3/directionalwarp.glsl +20 -0
- package/glsl3/directionalwipe.glsl +22 -0
- package/glsl3/displacement.glsl +26 -0
- package/glsl3/dissolve.glsl +54 -0
- package/glsl3/doorway.glsl +55 -0
- package/glsl3/fade.glsl +13 -0
- package/glsl3/fadecolor.glsl +15 -0
- package/glsl3/fadegrayscale.glsl +21 -0
- package/glsl3/flyeye.glsl +20 -0
- package/glsl3/fragment.glsl +54 -0
- package/glsl3/heart.glsl +19 -0
- package/glsl3/hexagonalize.glsl +78 -0
- package/glsl3/kaleidoscope.glsl +25 -0
- package/glsl3/luma.glsl +15 -0
- package/glsl3/luminance_melt.glsl +131 -0
- package/glsl3/morph.glsl +20 -0
- package/glsl3/mosaic_transition.glsl +20 -0
- package/glsl3/multiply_blend.glsl +19 -0
- package/glsl3/old_tv_lost_signal.glsl +51 -0
- package/glsl3/parametric_glitch.glsl +29 -0
- package/glsl3/perlin.glsl +66 -0
- package/glsl3/pinwheel.glsl +20 -0
- package/glsl3/pixelize.glsl +21 -0
- package/glsl3/polar_function.glsl +24 -0
- package/glsl3/powerKaleido.glsl +57 -0
- package/glsl3/randomNoisex.glsl +15 -0
- package/glsl3/randomsquares.glsl +20 -0
- package/glsl3/ripple.glsl +20 -0
- package/glsl3/rotateTransition.glsl +22 -0
- package/glsl3/rotate_scale_fade.glsl +39 -0
- package/glsl3/scale-in.glsl +18 -0
- package/glsl3/splitSlideInHorizontal.glsl +26 -0
- package/glsl3/splitSlideInOutHorizontal.glsl +23 -0
- package/glsl3/splitSlideInOutVertical.glsl +23 -0
- package/glsl3/splitSlideInVertical.glsl +24 -0
- package/glsl3/splitSlideOutHorizontal.glsl +22 -0
- package/glsl3/splitSlideOutVertical.glsl +22 -0
- package/glsl3/squareswire.glsl +26 -0
- package/glsl3/squeeze.glsl +23 -0
- package/glsl3/static_wipe.glsl +39 -0
- package/glsl3/swap.glsl +64 -0
- package/glsl3/tangentMotionBlur.glsl +139 -0
- package/glsl3/undulatingBurnOut.glsl +56 -0
- package/glsl3/wind.glsl +25 -0
- package/glsl3/windowblinds.glsl +18 -0
- package/glsl3/windowslice.glsl +16 -0
- package/glsl3/wipeDown.glsl +12 -0
- package/glsl3/wipeLeft.glsl +12 -0
- package/glsl3/wipeRight.glsl +12 -0
- package/glsl3/wipeUp.glsl +12 -0
- package/glsl3/x_axis_translation.glsl +21 -0
- package/glsl3/zoomInOut.glsl +20 -0
- package/index.d.ts +61 -0
- package/layouts.json +2956 -0
- package/llms-full.txt +1707 -0
- package/llms.txt +153 -0
- package/msl/AdvancedMosaic.metal +136 -0
- package/msl/BlockDissolve.metal +108 -0
- package/msl/BookFlip.metal +191 -0
- package/msl/Bounce.metal +128 -0
- package/msl/BowTieHorizontal.metal +375 -0
- package/msl/BowTieVertical.metal +375 -0
- package/msl/BowTieWithParameter.metal +361 -0
- package/msl/Box.metal +204 -0
- package/msl/ButterflyWaveScrawler.metal +190 -0
- package/msl/CircleCrop.metal +117 -0
- package/msl/ColourDistance.metal +110 -0
- package/msl/CrazyParametricFun.metal +139 -0
- package/msl/CrossZoom.metal +274 -0
- package/msl/DefocusBlur.metal +297 -0
- package/msl/Directional.metal +107 -0
- package/msl/DirectionalScaled.metal +147 -0
- package/msl/DoomScreenTransition.metal +212 -0
- package/msl/Dreamy.metal +133 -0
- package/msl/DreamyZoom.metal +182 -0
- package/msl/Drop_Zone_Flicker.metal +561 -0
- package/msl/EdgeTransition.metal +277 -0
- package/msl/FilmBurn.metal +425 -0
- package/msl/Fold.metal +110 -0
- package/msl/GlitchDisplace.metal +374 -0
- package/msl/GlitchMemories.metal +146 -0
- package/msl/GridFlip.metal +285 -0
- package/msl/HSVfade.metal +161 -0
- package/msl/HorizontalClose.metal +100 -0
- package/msl/HorizontalOpen.metal +103 -0
- package/msl/InvertedPageCurl.metal +762 -0
- package/msl/LeftRight.metal +138 -0
- package/msl/LinearBlur.metal +169 -0
- package/msl/Mosaic.metal +212 -0
- package/msl/Overexposure.metal +130 -0
- package/msl/PolkaDotsCurtain.metal +112 -0
- package/msl/PuzzleRight.metal +262 -0
- package/msl/Radial.metal +102 -0
- package/msl/Rectangle.metal +129 -0
- package/msl/RectangleCrop.metal +127 -0
- package/msl/Revolve_Left.metal +363 -0
- package/msl/Rolls.metal +209 -0
- package/msl/RotateScaleVanish.metal +227 -0
- package/msl/SimpleFlip.metal +110 -0
- package/msl/SimpleZoom.metal +116 -0
- package/msl/SimpleZoomOut.metal +127 -0
- package/msl/Slides.metal +244 -0
- package/msl/StarWipe.metal +204 -0
- package/msl/StaticFade.metal +193 -0
- package/msl/StereoViewer.metal +707 -0
- package/msl/StripDatamoshGlitch.metal +828 -0
- package/msl/Swirl.metal +152 -0
- package/msl/TVStatic.metal +136 -0
- package/msl/TilesWave.metal +290 -0
- package/msl/TopBottom.metal +138 -0
- package/msl/VerticalClose.metal +100 -0
- package/msl/VerticalOpen.metal +103 -0
- package/msl/WaterDrop.metal +126 -0
- package/msl/ZoomInCircles.metal +169 -0
- package/msl/ZoomLeftWipe.metal +152 -0
- package/msl/ZoomRigthWipe.metal +152 -0
- package/msl/angular.metal +111 -0
- package/msl/burn.metal +103 -0
- package/msl/burn0.metal +236 -0
- package/msl/cannabisleaf.metal +120 -0
- package/msl/chessboard.metal +144 -0
- package/msl/circle.metal +115 -0
- package/msl/circleopen.metal +124 -0
- package/msl/colorphase.metal +106 -0
- package/msl/coord-from-in.metal +111 -0
- package/msl/crosshatch.metal +126 -0
- package/msl/crosswarp.metal +103 -0
- package/msl/cube.metal +259 -0
- package/msl/directional-easing.metal +111 -0
- package/msl/directionalwarp.metal +121 -0
- package/msl/directionalwipe.metal +120 -0
- package/msl/displacement.metal +129 -0
- package/msl/dissolve.metal +146 -0
- package/msl/doorway.metal +210 -0
- package/msl/fade.metal +95 -0
- package/msl/fadecolor.metal +104 -0
- package/msl/fadegrayscale.metal +123 -0
- package/msl/flyeye.metal +133 -0
- package/msl/fragment.metal +276 -0
- package/msl/heart.metal +134 -0
- package/msl/hexagonalize.metal +274 -0
- package/msl/kaleidoscope.metal +157 -0
- package/msl/luma.metal +113 -0
- package/msl/luminance_melt.metal +337 -0
- package/msl/morph.metal +131 -0
- package/msl/mosaic_transition.metal +137 -0
- package/msl/multiply_blend.metal +127 -0
- package/msl/old_tv_lost_signal.metal +172 -0
- package/msl/parametric_glitch.metal +152 -0
- package/msl/perlin.metal +206 -0
- package/msl/pinwheel.metal +112 -0
- package/msl/pixelize.metal +134 -0
- package/msl/polar_function.metal +116 -0
- package/msl/powerKaleido.metal +304 -0
- package/msl/randomNoisex.metal +115 -0
- package/msl/randomsquares.metal +118 -0
- package/msl/ripple.metal +113 -0
- package/msl/rotateTransition.metal +116 -0
- package/msl/rotate_scale_fade.metal +167 -0
- package/msl/scale-in.metal +111 -0
- package/msl/splitSlideInHorizontal.metal +147 -0
- package/msl/splitSlideInOutHorizontal.metal +138 -0
- package/msl/splitSlideInOutVertical.metal +138 -0
- package/msl/splitSlideInVertical.metal +144 -0
- package/msl/splitSlideOutHorizontal.metal +131 -0
- package/msl/splitSlideOutVertical.metal +131 -0
- package/msl/squareswire.metal +144 -0
- package/msl/squeeze.metal +133 -0
- package/msl/static_wipe.metal +147 -0
- package/msl/swap.metal +256 -0
- package/msl/tangentMotionBlur.metal +583 -0
- package/msl/undulatingBurnOut.metal +217 -0
- package/msl/wind.metal +131 -0
- package/msl/windowblinds.metal +107 -0
- package/msl/windowslice.metal +108 -0
- package/msl/wipeDown.metal +105 -0
- package/msl/wipeLeft.metal +105 -0
- package/msl/wipeRight.metal +105 -0
- package/msl/wipeUp.metal +105 -0
- package/msl/x_axis_translation.metal +110 -0
- package/msl/zoomInOut.metal +125 -0
- package/package.json +1 -1
- package/skills/gl-transitions/SKILL.md +46 -0
- package/skills/gl-transitions/references/catalog.md +224 -0
- package/skills/gl-transitions/references/skia.md +118 -0
- package/skills/gl-transitions/references/video.md +71 -0
- package/skills/gl-transitions/references/webgl.md +122 -0
- package/sksl/index.d.ts +4 -0
- package/sksl/index.js +1 -0
- package/wgsl/AdvancedMosaic.wgsl +108 -0
- package/wgsl/BlockDissolve.wgsl +78 -0
- package/wgsl/BookFlip.wgsl +157 -0
- package/wgsl/Bounce.wgsl +98 -0
- package/wgsl/BowTieHorizontal.wgsl +331 -0
- package/wgsl/BowTieVertical.wgsl +331 -0
- package/wgsl/BowTieWithParameter.wgsl +313 -0
- package/wgsl/Box.wgsl +176 -0
- package/wgsl/ButterflyWaveScrawler.wgsl +158 -0
- package/wgsl/CircleCrop.wgsl +88 -0
- package/wgsl/ColourDistance.wgsl +82 -0
- package/wgsl/CrazyParametricFun.wgsl +111 -0
- package/wgsl/CrossZoom.wgsl +219 -0
- package/wgsl/DefocusBlur.wgsl +269 -0
- package/wgsl/Directional.wgsl +79 -0
- package/wgsl/DirectionalScaled.wgsl +117 -0
- package/wgsl/DoomScreenTransition.wgsl +171 -0
- package/wgsl/Dreamy.wgsl +102 -0
- package/wgsl/DreamyZoom.wgsl +154 -0
- package/wgsl/Drop_Zone_Flicker.wgsl +513 -0
- package/wgsl/EdgeTransition.wgsl +216 -0
- package/wgsl/FilmBurn.wgsl +361 -0
- package/wgsl/Fold.wgsl +82 -0
- package/wgsl/GlitchDisplace.wgsl +327 -0
- package/wgsl/GlitchMemories.wgsl +118 -0
- package/wgsl/GridFlip.wgsl +250 -0
- package/wgsl/HSVfade.wgsl +131 -0
- package/wgsl/HorizontalClose.wgsl +72 -0
- package/wgsl/HorizontalOpen.wgsl +75 -0
- package/wgsl/InvertedPageCurl.wgsl +690 -0
- package/wgsl/LeftRight.wgsl +109 -0
- package/wgsl/LinearBlur.wgsl +131 -0
- package/wgsl/Mosaic.wgsl +174 -0
- package/wgsl/Overexposure.wgsl +102 -0
- package/wgsl/PolkaDotsCurtain.wgsl +83 -0
- package/wgsl/PuzzleRight.wgsl +230 -0
- package/wgsl/Radial.wgsl +74 -0
- package/wgsl/Rectangle.wgsl +100 -0
- package/wgsl/RectangleCrop.wgsl +98 -0
- package/wgsl/Revolve_Left.wgsl +314 -0
- package/wgsl/Rolls.wgsl +181 -0
- package/wgsl/RotateScaleVanish.wgsl +199 -0
- package/wgsl/SimpleFlip.wgsl +82 -0
- package/wgsl/SimpleZoom.wgsl +85 -0
- package/wgsl/SimpleZoomOut.wgsl +96 -0
- package/wgsl/Slides.wgsl +216 -0
- package/wgsl/StarWipe.wgsl +169 -0
- package/wgsl/StaticFade.wgsl +159 -0
- package/wgsl/StereoViewer.wgsl +625 -0
- package/wgsl/StripDatamoshGlitch.wgsl +755 -0
- package/wgsl/Swirl.wgsl +124 -0
- package/wgsl/TVStatic.wgsl +106 -0
- package/wgsl/TilesWave.wgsl +262 -0
- package/wgsl/TopBottom.wgsl +109 -0
- package/wgsl/VerticalClose.wgsl +72 -0
- package/wgsl/VerticalOpen.wgsl +75 -0
- package/wgsl/WaterDrop.wgsl +98 -0
- package/wgsl/ZoomInCircles.wgsl +138 -0
- package/wgsl/ZoomLeftWipe.wgsl +121 -0
- package/wgsl/ZoomRigthWipe.wgsl +121 -0
- package/wgsl/angular.wgsl +83 -0
- package/wgsl/burn.wgsl +74 -0
- package/wgsl/burn0.wgsl +198 -0
- package/wgsl/cannabisleaf.wgsl +92 -0
- package/wgsl/chessboard.wgsl +116 -0
- package/wgsl/circle.wgsl +87 -0
- package/wgsl/circleopen.wgsl +96 -0
- package/wgsl/colorphase.wgsl +77 -0
- package/wgsl/coord-from-in.wgsl +83 -0
- package/wgsl/crosshatch.wgsl +96 -0
- package/wgsl/crosswarp.wgsl +75 -0
- package/wgsl/cube.wgsl +217 -0
- package/wgsl/directional-easing.wgsl +83 -0
- package/wgsl/directionalwarp.wgsl +92 -0
- package/wgsl/directionalwipe.wgsl +91 -0
- package/wgsl/displacement.wgsl +96 -0
- package/wgsl/dissolve.wgsl +116 -0
- package/wgsl/doorway.wgsl +174 -0
- package/wgsl/fade.wgsl +67 -0
- package/wgsl/fadecolor.wgsl +75 -0
- package/wgsl/fadegrayscale.wgsl +93 -0
- package/wgsl/flyeye.wgsl +105 -0
- package/wgsl/fragment.wgsl +227 -0
- package/wgsl/heart.wgsl +103 -0
- package/wgsl/hexagonalize.wgsl +238 -0
- package/wgsl/kaleidoscope.wgsl +124 -0
- package/wgsl/luma.wgsl +80 -0
- package/wgsl/luminance_melt.wgsl +299 -0
- package/wgsl/morph.wgsl +103 -0
- package/wgsl/mosaic_transition.wgsl +107 -0
- package/wgsl/multiply_blend.wgsl +96 -0
- package/wgsl/old_tv_lost_signal.wgsl +142 -0
- package/wgsl/parametric_glitch.wgsl +124 -0
- package/wgsl/perlin.wgsl +174 -0
- package/wgsl/pinwheel.wgsl +84 -0
- package/wgsl/pixelize.wgsl +105 -0
- package/wgsl/polar_function.wgsl +88 -0
- package/wgsl/powerKaleido.wgsl +254 -0
- package/wgsl/randomNoisex.wgsl +85 -0
- package/wgsl/randomsquares.wgsl +87 -0
- package/wgsl/ripple.wgsl +85 -0
- package/wgsl/rotateTransition.wgsl +85 -0
- package/wgsl/rotate_scale_fade.wgsl +138 -0
- package/wgsl/scale-in.wgsl +79 -0
- package/wgsl/splitSlideInHorizontal.wgsl +118 -0
- package/wgsl/splitSlideInOutHorizontal.wgsl +109 -0
- package/wgsl/splitSlideInOutVertical.wgsl +109 -0
- package/wgsl/splitSlideInVertical.wgsl +115 -0
- package/wgsl/splitSlideOutHorizontal.wgsl +102 -0
- package/wgsl/splitSlideOutVertical.wgsl +102 -0
- package/wgsl/squareswire.wgsl +115 -0
- package/wgsl/squeeze.wgsl +105 -0
- package/wgsl/static_wipe.wgsl +117 -0
- package/wgsl/swap.wgsl +218 -0
- package/wgsl/tangentMotionBlur.wgsl +503 -0
- package/wgsl/undulatingBurnOut.wgsl +181 -0
- package/wgsl/wind.wgsl +101 -0
- package/wgsl/windowblinds.wgsl +79 -0
- package/wgsl/windowslice.wgsl +80 -0
- package/wgsl/wipeDown.wgsl +77 -0
- package/wgsl/wipeLeft.wgsl +77 -0
- package/wgsl/wipeRight.wgsl +77 -0
- package/wgsl/wipeUp.wgsl +77 -0
- package/wgsl/x_axis_translation.wgsl +82 -0
- package/wgsl/zoomInOut.wgsl +94 -0
package/msl/Swirl.metal
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// Swirl — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Swirl.glsl
|
|
2
|
+
// Author: Sergey Kosarevsky
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: Both images swirl around the center while crossfading
|
|
5
|
+
// Bindings and uniform layout: see the gl-transitions package README
|
|
6
|
+
|
|
7
|
+
// language: metal1.0
|
|
8
|
+
#include <metal_stdlib>
|
|
9
|
+
#include <simd/simd.h>
|
|
10
|
+
|
|
11
|
+
using metal::uint;
|
|
12
|
+
|
|
13
|
+
struct Uniforms {
|
|
14
|
+
float progress;
|
|
15
|
+
float ratio;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
metal::float4 getToColor(
|
|
19
|
+
thread metal::float2& uv,
|
|
20
|
+
metal::sampler _sampler,
|
|
21
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
22
|
+
) {
|
|
23
|
+
float _e17 = uv[0u];
|
|
24
|
+
float _e19 = uv[1u];
|
|
25
|
+
metal::float4 _e22 = _to.sample(_sampler, metal::float2(_e17, 1.0 - _e19), metal::level(0.0));
|
|
26
|
+
return _e22;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
metal::float4 getFromColor(
|
|
30
|
+
thread metal::float2& uv_1,
|
|
31
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
32
|
+
metal::sampler _sampler
|
|
33
|
+
) {
|
|
34
|
+
float _e17 = uv_1[0u];
|
|
35
|
+
float _e19 = uv_1[1u];
|
|
36
|
+
metal::float4 _e22 = _from.sample(_sampler, metal::float2(_e17, 1.0 - _e19), metal::level(0.0));
|
|
37
|
+
return _e22;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
metal::float4 transition(
|
|
41
|
+
thread metal::float2& UV,
|
|
42
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
43
|
+
metal::sampler _sampler,
|
|
44
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
45
|
+
constant Uniforms& uniforms
|
|
46
|
+
) {
|
|
47
|
+
float Radius = {};
|
|
48
|
+
float T = {};
|
|
49
|
+
float Dist = {};
|
|
50
|
+
float Percent = {};
|
|
51
|
+
float A = {};
|
|
52
|
+
float local = {};
|
|
53
|
+
float Theta = {};
|
|
54
|
+
float S = {};
|
|
55
|
+
float C = {};
|
|
56
|
+
metal::float4 C0_ = {};
|
|
57
|
+
metal::float2 param = {};
|
|
58
|
+
metal::float4 C1_ = {};
|
|
59
|
+
metal::float2 param_1 = {};
|
|
60
|
+
Radius = 1.0;
|
|
61
|
+
float _e30 = uniforms.progress;
|
|
62
|
+
T = _e30;
|
|
63
|
+
metal::float2 _e31 = UV;
|
|
64
|
+
UV = _e31 - metal::float2(0.5, 0.5);
|
|
65
|
+
metal::float2 _e33 = UV;
|
|
66
|
+
Dist = metal::length(_e33);
|
|
67
|
+
float _e35 = Dist;
|
|
68
|
+
float _e36 = Radius;
|
|
69
|
+
if (_e35 < _e36) {
|
|
70
|
+
float _e38 = Radius;
|
|
71
|
+
float _e39 = Dist;
|
|
72
|
+
float _e41 = Radius;
|
|
73
|
+
Percent = (_e38 - _e39) / _e41;
|
|
74
|
+
float _e43 = T;
|
|
75
|
+
if (_e43 <= 0.5) {
|
|
76
|
+
float _e45 = T;
|
|
77
|
+
local = metal::mix(0.0, 1.0, _e45 / 0.5);
|
|
78
|
+
} else {
|
|
79
|
+
float _e48 = T;
|
|
80
|
+
local = metal::mix(1.0, 0.0, (_e48 - 0.5) / 0.5);
|
|
81
|
+
}
|
|
82
|
+
float _e52 = local;
|
|
83
|
+
A = _e52;
|
|
84
|
+
float _e53 = Percent;
|
|
85
|
+
float _e54 = Percent;
|
|
86
|
+
float _e56 = A;
|
|
87
|
+
Theta = (((_e53 * _e54) * _e56) * 8.0) * 3.14159;
|
|
88
|
+
float _e60 = Theta;
|
|
89
|
+
S = metal::sin(_e60);
|
|
90
|
+
float _e62 = Theta;
|
|
91
|
+
C = metal::cos(_e62);
|
|
92
|
+
metal::float2 _e64 = UV;
|
|
93
|
+
float _e65 = C;
|
|
94
|
+
float _e66 = S;
|
|
95
|
+
metal::float2 _e70 = UV;
|
|
96
|
+
float _e71 = S;
|
|
97
|
+
float _e72 = C;
|
|
98
|
+
UV = metal::float2(metal::dot(_e64, metal::float2(_e65, -(_e66))), metal::dot(_e70, metal::float2(_e71, _e72)));
|
|
99
|
+
}
|
|
100
|
+
metal::float2 _e76 = UV;
|
|
101
|
+
UV = _e76 + metal::float2(0.5, 0.5);
|
|
102
|
+
metal::float2 _e78 = UV;
|
|
103
|
+
param = _e78;
|
|
104
|
+
metal::float4 _e79 = getFromColor(param, _from, _sampler);
|
|
105
|
+
C0_ = _e79;
|
|
106
|
+
metal::float2 _e80 = UV;
|
|
107
|
+
param_1 = _e80;
|
|
108
|
+
metal::float4 _e81 = getToColor(param_1, _sampler, _to);
|
|
109
|
+
C1_ = _e81;
|
|
110
|
+
metal::float4 _e82 = C0_;
|
|
111
|
+
metal::float4 _e83 = C1_;
|
|
112
|
+
float _e84 = T;
|
|
113
|
+
return metal::mix(_e82, _e83, metal::float4(_e84));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
void main_1(
|
|
117
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
118
|
+
metal::sampler _sampler,
|
|
119
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
120
|
+
constant Uniforms& uniforms,
|
|
121
|
+
thread metal::float4& _fragColor,
|
|
122
|
+
thread metal::float2& _uv_1
|
|
123
|
+
) {
|
|
124
|
+
metal::float2 param_2 = {};
|
|
125
|
+
metal::float2 _e16 = _uv_1;
|
|
126
|
+
param_2 = _e16;
|
|
127
|
+
metal::float4 _e17 = transition(param_2, _from, _sampler, _to, uniforms);
|
|
128
|
+
_fragColor = _e17;
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
struct main_Input {
|
|
133
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
134
|
+
};
|
|
135
|
+
struct main_Output {
|
|
136
|
+
metal::float4 member [[color(0)]];
|
|
137
|
+
};
|
|
138
|
+
fragment main_Output main_(
|
|
139
|
+
main_Input varyings [[stage_in]]
|
|
140
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
141
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
142
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
143
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
144
|
+
) {
|
|
145
|
+
metal::float4 _fragColor = {};
|
|
146
|
+
metal::float2 _uv_1 = {};
|
|
147
|
+
const auto _uv = varyings._uv;
|
|
148
|
+
_uv_1 = _uv;
|
|
149
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
150
|
+
metal::float4 _e3 = _fragColor;
|
|
151
|
+
return main_Output { _e3 };
|
|
152
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// TVStatic — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TVStatic.glsl
|
|
2
|
+
// Author: Brandon Anzaldi
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: Cuts to full-screen TV static, then to the incoming image
|
|
5
|
+
// Bindings and uniform layout: see the gl-transitions package README
|
|
6
|
+
|
|
7
|
+
// language: metal1.0
|
|
8
|
+
#include <metal_stdlib>
|
|
9
|
+
#include <simd/simd.h>
|
|
10
|
+
|
|
11
|
+
using metal::uint;
|
|
12
|
+
|
|
13
|
+
struct Uniforms {
|
|
14
|
+
float progress;
|
|
15
|
+
float ratio;
|
|
16
|
+
float offset;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
float noise(
|
|
20
|
+
thread metal::float2& co,
|
|
21
|
+
constant Uniforms& uniforms
|
|
22
|
+
) {
|
|
23
|
+
float a = {};
|
|
24
|
+
float b = {};
|
|
25
|
+
float c = {};
|
|
26
|
+
float dt = {};
|
|
27
|
+
float sn = {};
|
|
28
|
+
a = 12.9898;
|
|
29
|
+
b = 78.233;
|
|
30
|
+
c = 43758.547;
|
|
31
|
+
metal::float2 _e22 = co;
|
|
32
|
+
float _e24 = uniforms.progress;
|
|
33
|
+
float _e26 = a;
|
|
34
|
+
float _e27 = b;
|
|
35
|
+
dt = metal::dot(_e22 * _e24, metal::float2(_e26, _e27));
|
|
36
|
+
float _e30 = dt;
|
|
37
|
+
sn = _e30 - (metal::floor(_e30 / 3.14) * 3.14);
|
|
38
|
+
float _e35 = sn;
|
|
39
|
+
float _e37 = c;
|
|
40
|
+
return metal::fract(metal::sin(_e35) * _e37);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
metal::float4 getToColor(
|
|
44
|
+
thread metal::float2& uv,
|
|
45
|
+
metal::sampler _sampler,
|
|
46
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
47
|
+
) {
|
|
48
|
+
float _e18 = uv[0u];
|
|
49
|
+
float _e20 = uv[1u];
|
|
50
|
+
metal::float4 _e23 = _to.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
51
|
+
return _e23;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
metal::float4 getFromColor(
|
|
55
|
+
thread metal::float2& uv_1,
|
|
56
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
57
|
+
metal::sampler _sampler
|
|
58
|
+
) {
|
|
59
|
+
float _e18 = uv_1[0u];
|
|
60
|
+
float _e20 = uv_1[1u];
|
|
61
|
+
metal::float4 _e23 = _from.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
62
|
+
return _e23;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
metal::float4 transition(
|
|
66
|
+
thread metal::float2& p,
|
|
67
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
68
|
+
metal::sampler _sampler,
|
|
69
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
70
|
+
constant Uniforms& uniforms
|
|
71
|
+
) {
|
|
72
|
+
metal::float2 param = {};
|
|
73
|
+
metal::float2 param_1 = {};
|
|
74
|
+
metal::float2 param_2 = {};
|
|
75
|
+
float _e21 = uniforms.progress;
|
|
76
|
+
float _e23 = uniforms.offset;
|
|
77
|
+
if (_e21 < _e23) {
|
|
78
|
+
metal::float2 _e25 = p;
|
|
79
|
+
param = _e25;
|
|
80
|
+
metal::float4 _e26 = getFromColor(param, _from, _sampler);
|
|
81
|
+
return _e26;
|
|
82
|
+
} else {
|
|
83
|
+
float _e28 = uniforms.progress;
|
|
84
|
+
float _e30 = uniforms.offset;
|
|
85
|
+
if (_e28 > (1.0 - _e30)) {
|
|
86
|
+
metal::float2 _e33 = p;
|
|
87
|
+
param_1 = _e33;
|
|
88
|
+
metal::float4 _e34 = getToColor(param_1, _sampler, _to);
|
|
89
|
+
return _e34;
|
|
90
|
+
} else {
|
|
91
|
+
metal::float2 _e35 = p;
|
|
92
|
+
param_2 = _e35;
|
|
93
|
+
float _e36 = noise(param_2, uniforms);
|
|
94
|
+
metal::float3 _e37 = metal::float3(_e36);
|
|
95
|
+
return metal::float4(_e37.x, _e37.y, _e37.z, 1.0);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
void main_1(
|
|
101
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
102
|
+
metal::sampler _sampler,
|
|
103
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
104
|
+
constant Uniforms& uniforms,
|
|
105
|
+
thread metal::float4& _fragColor,
|
|
106
|
+
thread metal::float2& _uv_1
|
|
107
|
+
) {
|
|
108
|
+
metal::float2 param_3 = {};
|
|
109
|
+
metal::float2 _e17 = _uv_1;
|
|
110
|
+
param_3 = _e17;
|
|
111
|
+
metal::float4 _e18 = transition(param_3, _from, _sampler, _to, uniforms);
|
|
112
|
+
_fragColor = _e18;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
struct main_Input {
|
|
117
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
118
|
+
};
|
|
119
|
+
struct main_Output {
|
|
120
|
+
metal::float4 member [[color(0)]];
|
|
121
|
+
};
|
|
122
|
+
fragment main_Output main_(
|
|
123
|
+
main_Input varyings [[stage_in]]
|
|
124
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
125
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
126
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
127
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
128
|
+
) {
|
|
129
|
+
metal::float4 _fragColor = {};
|
|
130
|
+
metal::float2 _uv_1 = {};
|
|
131
|
+
const auto _uv = varyings._uv;
|
|
132
|
+
_uv_1 = _uv;
|
|
133
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
134
|
+
metal::float4 _e3 = _fragColor;
|
|
135
|
+
return main_Output { _e3 };
|
|
136
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
// TilesWave — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TilesWave.glsl
|
|
2
|
+
// Author: numb3r23
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The incoming image is revealed tile by tile in a diagonal wave
|
|
5
|
+
// Bindings and uniform layout: see the gl-transitions package README
|
|
6
|
+
|
|
7
|
+
// language: metal1.0
|
|
8
|
+
#include <metal_stdlib>
|
|
9
|
+
#include <simd/simd.h>
|
|
10
|
+
|
|
11
|
+
using metal::uint;
|
|
12
|
+
|
|
13
|
+
struct Uniforms {
|
|
14
|
+
float progress;
|
|
15
|
+
float ratio;
|
|
16
|
+
metal::int2 tileCount;
|
|
17
|
+
int flipX;
|
|
18
|
+
int flipY;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
metal::float4 getToColor(
|
|
22
|
+
thread metal::float2& uv,
|
|
23
|
+
metal::sampler _sampler,
|
|
24
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
25
|
+
) {
|
|
26
|
+
float _e18 = uv[0u];
|
|
27
|
+
float _e20 = uv[1u];
|
|
28
|
+
metal::float4 _e23 = _to.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
29
|
+
return _e23;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
metal::float4 getFromColor(
|
|
33
|
+
thread metal::float2& uv_1,
|
|
34
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
35
|
+
metal::sampler _sampler
|
|
36
|
+
) {
|
|
37
|
+
float _e18 = uv_1[0u];
|
|
38
|
+
float _e20 = uv_1[1u];
|
|
39
|
+
metal::float4 _e23 = _from.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
40
|
+
return _e23;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
metal::float4 transition(
|
|
44
|
+
thread metal::float2& uv_2,
|
|
45
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
46
|
+
metal::sampler _sampler,
|
|
47
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
48
|
+
constant Uniforms& uniforms
|
|
49
|
+
) {
|
|
50
|
+
metal::float2 tileSize = {};
|
|
51
|
+
metal::float2 posInTile = {};
|
|
52
|
+
metal::float2 tileNum = {};
|
|
53
|
+
float countTiles = {};
|
|
54
|
+
float offset = {};
|
|
55
|
+
float timeOffset = {};
|
|
56
|
+
float sinTime = {};
|
|
57
|
+
metal::float2 texC = {};
|
|
58
|
+
metal::float2 param = {};
|
|
59
|
+
float local = {};
|
|
60
|
+
metal::float2 param_1 = {};
|
|
61
|
+
float local_1 = {};
|
|
62
|
+
metal::float2 globalUV = {};
|
|
63
|
+
metal::float2 param_2 = {};
|
|
64
|
+
metal::float2 param_3 = {};
|
|
65
|
+
float local_2 = {};
|
|
66
|
+
metal::float2 param_4 = {};
|
|
67
|
+
float local_3 = {};
|
|
68
|
+
metal::float2 globalUV_1 = {};
|
|
69
|
+
metal::float2 param_5 = {};
|
|
70
|
+
bool phi_149_ = {};
|
|
71
|
+
bool phi_199_ = {};
|
|
72
|
+
bool phi_261_ = {};
|
|
73
|
+
bool phi_314_ = {};
|
|
74
|
+
metal::int2 _e38 = uniforms.tileCount;
|
|
75
|
+
tileSize = metal::float2(1.0) / static_cast<metal::float2>(_e38);
|
|
76
|
+
metal::float2 _e42 = uv_2;
|
|
77
|
+
metal::int2 _e44 = uniforms.tileCount;
|
|
78
|
+
posInTile = metal::fract(_e42 * static_cast<metal::float2>(_e44));
|
|
79
|
+
metal::float2 _e48 = uv_2;
|
|
80
|
+
metal::int2 _e50 = uniforms.tileCount;
|
|
81
|
+
tileNum = metal::floor(_e48 * static_cast<metal::float2>(_e50));
|
|
82
|
+
int _e56 = uniforms.tileCount[0u];
|
|
83
|
+
int _e59 = uniforms.tileCount[1u];
|
|
84
|
+
countTiles = static_cast<float>(as_type<int>(as_type<uint>(_e56) * as_type<uint>(_e59)));
|
|
85
|
+
float _e63 = tileNum[1u];
|
|
86
|
+
float _e65 = tileNum[0u];
|
|
87
|
+
int _e68 = uniforms.tileCount[1u];
|
|
88
|
+
float _e72 = countTiles;
|
|
89
|
+
offset = (_e63 + (_e65 * static_cast<float>(_e68))) / _e72;
|
|
90
|
+
float _e75 = uniforms.progress;
|
|
91
|
+
float _e76 = offset;
|
|
92
|
+
float _e78 = countTiles;
|
|
93
|
+
timeOffset = metal::clamp((_e75 - _e76) * _e78, 0.0, 0.5);
|
|
94
|
+
float _e81 = timeOffset;
|
|
95
|
+
sinTime = 1.0 - metal::abs(metal::cos(metal::fract(_e81) * 3.1415925));
|
|
96
|
+
metal::float2 _e87 = posInTile;
|
|
97
|
+
texC = _e87;
|
|
98
|
+
float _e88 = sinTime;
|
|
99
|
+
if (_e88 <= 0.5) {
|
|
100
|
+
int _e91 = uniforms.flipX;
|
|
101
|
+
if (_e91 != 0) {
|
|
102
|
+
float _e94 = texC[0u];
|
|
103
|
+
float _e95 = sinTime;
|
|
104
|
+
bool _e96 = _e94 < _e95;
|
|
105
|
+
phi_149_ = _e96;
|
|
106
|
+
if (!(_e96)) {
|
|
107
|
+
float _e99 = texC[0u];
|
|
108
|
+
float _e100 = sinTime;
|
|
109
|
+
phi_149_ = _e99 > (1.0 - _e100);
|
|
110
|
+
}
|
|
111
|
+
bool _e104 = phi_149_;
|
|
112
|
+
if (_e104) {
|
|
113
|
+
metal::float2 _e105 = uv_2;
|
|
114
|
+
param = _e105;
|
|
115
|
+
metal::float4 _e106 = getFromColor(param, _from, _sampler);
|
|
116
|
+
return _e106;
|
|
117
|
+
}
|
|
118
|
+
float _e108 = texC[0u];
|
|
119
|
+
if (_e108 < 0.5) {
|
|
120
|
+
float _e111 = texC[0u];
|
|
121
|
+
float _e112 = sinTime;
|
|
122
|
+
float _e115 = sinTime;
|
|
123
|
+
local = ((_e111 - _e112) * 0.5) / (0.5 - _e115);
|
|
124
|
+
} else {
|
|
125
|
+
float _e119 = texC[0u];
|
|
126
|
+
float _e122 = sinTime;
|
|
127
|
+
local = (((_e119 - 0.5) * 0.5) / (0.5 - _e122)) + 0.5;
|
|
128
|
+
}
|
|
129
|
+
float _e126 = local;
|
|
130
|
+
texC[0u] = _e126;
|
|
131
|
+
}
|
|
132
|
+
int _e129 = uniforms.flipY;
|
|
133
|
+
if (_e129 != 0) {
|
|
134
|
+
float _e132 = texC[1u];
|
|
135
|
+
float _e133 = sinTime;
|
|
136
|
+
bool _e134 = _e132 < _e133;
|
|
137
|
+
phi_199_ = _e134;
|
|
138
|
+
if (!(_e134)) {
|
|
139
|
+
float _e137 = texC[1u];
|
|
140
|
+
float _e138 = sinTime;
|
|
141
|
+
phi_199_ = _e137 > (1.0 - _e138);
|
|
142
|
+
}
|
|
143
|
+
bool _e142 = phi_199_;
|
|
144
|
+
if (_e142) {
|
|
145
|
+
metal::float2 _e143 = uv_2;
|
|
146
|
+
param_1 = _e143;
|
|
147
|
+
metal::float4 _e144 = getFromColor(param_1, _from, _sampler);
|
|
148
|
+
return _e144;
|
|
149
|
+
}
|
|
150
|
+
float _e146 = texC[1u];
|
|
151
|
+
if (_e146 < 0.5) {
|
|
152
|
+
float _e149 = texC[1u];
|
|
153
|
+
float _e150 = sinTime;
|
|
154
|
+
float _e153 = sinTime;
|
|
155
|
+
local_1 = ((_e149 - _e150) * 0.5) / (0.5 - _e153);
|
|
156
|
+
} else {
|
|
157
|
+
float _e157 = texC[1u];
|
|
158
|
+
float _e160 = sinTime;
|
|
159
|
+
local_1 = (((_e157 - 0.5) * 0.5) / (0.5 - _e160)) + 0.5;
|
|
160
|
+
}
|
|
161
|
+
float _e164 = local_1;
|
|
162
|
+
texC[1u] = _e164;
|
|
163
|
+
}
|
|
164
|
+
metal::float2 _e166 = tileNum;
|
|
165
|
+
metal::float2 _e167 = tileSize;
|
|
166
|
+
metal::float2 _e169 = texC;
|
|
167
|
+
metal::float2 _e170 = tileSize;
|
|
168
|
+
globalUV = (_e166 * _e167) + (_e169 * _e170);
|
|
169
|
+
metal::float2 _e173 = globalUV;
|
|
170
|
+
param_2 = _e173;
|
|
171
|
+
metal::float4 _e174 = getFromColor(param_2, _from, _sampler);
|
|
172
|
+
return _e174;
|
|
173
|
+
} else {
|
|
174
|
+
int _e176 = uniforms.flipX;
|
|
175
|
+
if (_e176 != 0) {
|
|
176
|
+
float _e179 = texC[0u];
|
|
177
|
+
float _e180 = sinTime;
|
|
178
|
+
bool _e181 = _e179 > _e180;
|
|
179
|
+
phi_261_ = _e181;
|
|
180
|
+
if (!(_e181)) {
|
|
181
|
+
float _e184 = texC[0u];
|
|
182
|
+
float _e185 = sinTime;
|
|
183
|
+
phi_261_ = _e184 < (1.0 - _e185);
|
|
184
|
+
}
|
|
185
|
+
bool _e189 = phi_261_;
|
|
186
|
+
if (_e189) {
|
|
187
|
+
metal::float2 _e190 = uv_2;
|
|
188
|
+
param_3 = _e190;
|
|
189
|
+
metal::float4 _e191 = getToColor(param_3, _sampler, _to);
|
|
190
|
+
return _e191;
|
|
191
|
+
}
|
|
192
|
+
float _e193 = texC[0u];
|
|
193
|
+
if (_e193 < 0.5) {
|
|
194
|
+
float _e196 = texC[0u];
|
|
195
|
+
float _e197 = sinTime;
|
|
196
|
+
float _e200 = sinTime;
|
|
197
|
+
local_2 = ((_e196 - _e197) * 0.5) / (0.5 - _e200);
|
|
198
|
+
} else {
|
|
199
|
+
float _e204 = texC[0u];
|
|
200
|
+
float _e207 = sinTime;
|
|
201
|
+
local_2 = (((_e204 - 0.5) * 0.5) / (0.5 - _e207)) + 0.5;
|
|
202
|
+
}
|
|
203
|
+
float _e211 = local_2;
|
|
204
|
+
texC[0u] = _e211;
|
|
205
|
+
float _e214 = texC[0u];
|
|
206
|
+
texC[0u] = 1.0 - _e214;
|
|
207
|
+
}
|
|
208
|
+
int _e218 = uniforms.flipY;
|
|
209
|
+
if (_e218 != 0) {
|
|
210
|
+
float _e221 = texC[1u];
|
|
211
|
+
float _e222 = sinTime;
|
|
212
|
+
bool _e223 = _e221 > _e222;
|
|
213
|
+
phi_314_ = _e223;
|
|
214
|
+
if (!(_e223)) {
|
|
215
|
+
float _e226 = texC[1u];
|
|
216
|
+
float _e227 = sinTime;
|
|
217
|
+
phi_314_ = _e226 < (1.0 - _e227);
|
|
218
|
+
}
|
|
219
|
+
bool _e231 = phi_314_;
|
|
220
|
+
if (_e231) {
|
|
221
|
+
metal::float2 _e232 = uv_2;
|
|
222
|
+
param_4 = _e232;
|
|
223
|
+
metal::float4 _e233 = getToColor(param_4, _sampler, _to);
|
|
224
|
+
return _e233;
|
|
225
|
+
}
|
|
226
|
+
float _e235 = texC[1u];
|
|
227
|
+
if (_e235 < 0.5) {
|
|
228
|
+
float _e238 = texC[1u];
|
|
229
|
+
float _e239 = sinTime;
|
|
230
|
+
float _e242 = sinTime;
|
|
231
|
+
local_3 = ((_e238 - _e239) * 0.5) / (0.5 - _e242);
|
|
232
|
+
} else {
|
|
233
|
+
float _e246 = texC[1u];
|
|
234
|
+
float _e249 = sinTime;
|
|
235
|
+
local_3 = (((_e246 - 0.5) * 0.5) / (0.5 - _e249)) + 0.5;
|
|
236
|
+
}
|
|
237
|
+
float _e253 = local_3;
|
|
238
|
+
texC[1u] = _e253;
|
|
239
|
+
float _e256 = texC[1u];
|
|
240
|
+
texC[1u] = 1.0 - _e256;
|
|
241
|
+
}
|
|
242
|
+
metal::float2 _e259 = tileNum;
|
|
243
|
+
metal::float2 _e260 = tileSize;
|
|
244
|
+
metal::float2 _e262 = texC;
|
|
245
|
+
metal::float2 _e263 = tileSize;
|
|
246
|
+
globalUV_1 = (_e259 * _e260) + (_e262 * _e263);
|
|
247
|
+
metal::float2 _e266 = globalUV_1;
|
|
248
|
+
param_5 = _e266;
|
|
249
|
+
metal::float4 _e267 = getToColor(param_5, _sampler, _to);
|
|
250
|
+
return _e267;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
void main_1(
|
|
255
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
256
|
+
metal::sampler _sampler,
|
|
257
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
258
|
+
constant Uniforms& uniforms,
|
|
259
|
+
thread metal::float4& _fragColor,
|
|
260
|
+
thread metal::float2& _uv_1
|
|
261
|
+
) {
|
|
262
|
+
metal::float2 param_6 = {};
|
|
263
|
+
metal::float2 _e17 = _uv_1;
|
|
264
|
+
param_6 = _e17;
|
|
265
|
+
metal::float4 _e18 = transition(param_6, _from, _sampler, _to, uniforms);
|
|
266
|
+
_fragColor = _e18;
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
struct main_Input {
|
|
271
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
272
|
+
};
|
|
273
|
+
struct main_Output {
|
|
274
|
+
metal::float4 member [[color(0)]];
|
|
275
|
+
};
|
|
276
|
+
fragment main_Output main_(
|
|
277
|
+
main_Input varyings [[stage_in]]
|
|
278
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
279
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
280
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
281
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
282
|
+
) {
|
|
283
|
+
metal::float4 _fragColor = {};
|
|
284
|
+
metal::float2 _uv_1 = {};
|
|
285
|
+
const auto _uv = varyings._uv;
|
|
286
|
+
_uv_1 = _uv;
|
|
287
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
288
|
+
metal::float4 _e3 = _fragColor;
|
|
289
|
+
return main_Output { _e3 };
|
|
290
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// TopBottom — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/TopBottom.glsl
|
|
2
|
+
// Author: zhmy
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The outgoing image shrinks away upward while the incoming one slides in from the bottom
|
|
5
|
+
// Bindings and uniform layout: see the gl-transitions package README
|
|
6
|
+
|
|
7
|
+
// language: metal1.0
|
|
8
|
+
#include <metal_stdlib>
|
|
9
|
+
#include <simd/simd.h>
|
|
10
|
+
|
|
11
|
+
using metal::uint;
|
|
12
|
+
|
|
13
|
+
struct Uniforms {
|
|
14
|
+
float progress;
|
|
15
|
+
float ratio;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
metal::float4 getFromColor(
|
|
19
|
+
thread metal::float2& uv,
|
|
20
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
21
|
+
metal::sampler _sampler
|
|
22
|
+
) {
|
|
23
|
+
float _e24 = uv[0u];
|
|
24
|
+
float _e26 = uv[1u];
|
|
25
|
+
metal::float4 _e29 = _from.sample(_sampler, metal::float2(_e24, 1.0 - _e26), metal::level(0.0));
|
|
26
|
+
return _e29;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
metal::float4 getToColor(
|
|
30
|
+
thread metal::float2& uv_1,
|
|
31
|
+
metal::sampler _sampler,
|
|
32
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
33
|
+
) {
|
|
34
|
+
float _e24 = uv_1[0u];
|
|
35
|
+
float _e26 = uv_1[1u];
|
|
36
|
+
metal::float4 _e29 = _to.sample(_sampler, metal::float2(_e24, 1.0 - _e26), metal::level(0.0));
|
|
37
|
+
return _e29;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
bool inBounds(
|
|
41
|
+
thread metal::float2& p
|
|
42
|
+
) {
|
|
43
|
+
bool phi_74_ = {};
|
|
44
|
+
metal::float2 _e23 = p;
|
|
45
|
+
bool _e25 = metal::all(metal::float2(0.0, 0.0) < _e23);
|
|
46
|
+
phi_74_ = _e25;
|
|
47
|
+
if (_e25) {
|
|
48
|
+
metal::float2 _e26 = p;
|
|
49
|
+
phi_74_ = metal::all(_e26 < metal::float2(1.0, 1.0));
|
|
50
|
+
}
|
|
51
|
+
bool _e30 = phi_74_;
|
|
52
|
+
return _e30;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
metal::float4 transition(
|
|
56
|
+
thread metal::float2& uv_2,
|
|
57
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
58
|
+
metal::sampler _sampler,
|
|
59
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
60
|
+
constant Uniforms& uniforms
|
|
61
|
+
) {
|
|
62
|
+
metal::float2 spto = {};
|
|
63
|
+
float size = {};
|
|
64
|
+
metal::float2 spfr = {};
|
|
65
|
+
metal::float2 param = {};
|
|
66
|
+
metal::float2 param_1 = {};
|
|
67
|
+
metal::float2 param_2 = {};
|
|
68
|
+
metal::float2 param_3 = {};
|
|
69
|
+
spto = metal::float2(-1.0, -1.0);
|
|
70
|
+
float _e31 = uniforms.progress;
|
|
71
|
+
size = metal::mix(1.0, 3.0, _e31 * 0.2);
|
|
72
|
+
metal::float2 _e34 = uv_2;
|
|
73
|
+
float _e36 = size;
|
|
74
|
+
spto = ((_e34 + metal::float2(-0.5, -0.5)) * metal::float2(_e36)) + metal::float2(0.5, 0.5);
|
|
75
|
+
metal::float2 _e40 = uv_2;
|
|
76
|
+
float _e42 = uniforms.progress;
|
|
77
|
+
spfr = _e40 + metal::float2(0.0, 1.0 - _e42);
|
|
78
|
+
metal::float2 _e46 = spfr;
|
|
79
|
+
param = _e46;
|
|
80
|
+
bool _e47 = inBounds(param);
|
|
81
|
+
if (_e47) {
|
|
82
|
+
metal::float2 _e48 = spfr;
|
|
83
|
+
param_1 = _e48;
|
|
84
|
+
metal::float4 _e49 = getToColor(param_1, _sampler, _to);
|
|
85
|
+
return _e49;
|
|
86
|
+
} else {
|
|
87
|
+
metal::float2 _e50 = spto;
|
|
88
|
+
param_2 = _e50;
|
|
89
|
+
bool _e51 = inBounds(param_2);
|
|
90
|
+
if (_e51) {
|
|
91
|
+
metal::float2 _e52 = spto;
|
|
92
|
+
param_3 = _e52;
|
|
93
|
+
metal::float4 _e53 = getFromColor(param_3, _from, _sampler);
|
|
94
|
+
float _e55 = uniforms.progress;
|
|
95
|
+
return _e53 * (1.0 - _e55);
|
|
96
|
+
} else {
|
|
97
|
+
return metal::float4(0.0, 0.0, 0.0, 1.0);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
void main_1(
|
|
103
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
104
|
+
metal::sampler _sampler,
|
|
105
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
106
|
+
constant Uniforms& uniforms,
|
|
107
|
+
thread metal::float4& _fragColor,
|
|
108
|
+
thread metal::float2& _uv_1
|
|
109
|
+
) {
|
|
110
|
+
metal::float2 param_4 = {};
|
|
111
|
+
metal::float2 _e23 = _uv_1;
|
|
112
|
+
param_4 = _e23;
|
|
113
|
+
metal::float4 _e24 = transition(param_4, _from, _sampler, _to, uniforms);
|
|
114
|
+
_fragColor = _e24;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
struct main_Input {
|
|
119
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
120
|
+
};
|
|
121
|
+
struct main_Output {
|
|
122
|
+
metal::float4 member [[color(0)]];
|
|
123
|
+
};
|
|
124
|
+
fragment main_Output main_(
|
|
125
|
+
main_Input varyings [[stage_in]]
|
|
126
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
127
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
128
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
129
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
130
|
+
) {
|
|
131
|
+
metal::float4 _fragColor = {};
|
|
132
|
+
metal::float2 _uv_1 = {};
|
|
133
|
+
const auto _uv = varyings._uv;
|
|
134
|
+
_uv_1 = _uv;
|
|
135
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
136
|
+
metal::float4 _e3 = _fragColor;
|
|
137
|
+
return main_Output { _e3 };
|
|
138
|
+
}
|