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
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// splitSlideInOutHorizontal — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/splitSlideInOutHorizontal.glsl
|
|
2
|
+
// Author: OllyOllyOlly
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The halves of both images slide horizontally in opposite directions, out and in at once
|
|
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
|
+
int reverse;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
metal::float4 getToColor(
|
|
20
|
+
thread metal::float2& uv,
|
|
21
|
+
metal::sampler _sampler,
|
|
22
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
23
|
+
) {
|
|
24
|
+
float _e18 = uv[0u];
|
|
25
|
+
float _e20 = uv[1u];
|
|
26
|
+
metal::float4 _e23 = _to.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
27
|
+
return _e23;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
metal::float4 getFromColor(
|
|
31
|
+
thread metal::float2& uv_1,
|
|
32
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
33
|
+
metal::sampler _sampler
|
|
34
|
+
) {
|
|
35
|
+
float _e18 = uv_1[0u];
|
|
36
|
+
float _e20 = uv_1[1u];
|
|
37
|
+
metal::float4 _e23 = _from.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
38
|
+
return _e23;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
bool inBounds(
|
|
42
|
+
thread metal::float2& p
|
|
43
|
+
) {
|
|
44
|
+
bool phi_74_ = {};
|
|
45
|
+
metal::float2 _e17 = p;
|
|
46
|
+
bool _e19 = metal::all(metal::float2(0.0, 0.0) < _e17);
|
|
47
|
+
phi_74_ = _e19;
|
|
48
|
+
if (_e19) {
|
|
49
|
+
metal::float2 _e20 = p;
|
|
50
|
+
phi_74_ = metal::all(_e20 < metal::float2(1.0, 1.0));
|
|
51
|
+
}
|
|
52
|
+
bool _e24 = phi_74_;
|
|
53
|
+
return _e24;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
metal::float4 transition(
|
|
57
|
+
thread metal::float2& uv_2,
|
|
58
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
59
|
+
metal::sampler _sampler,
|
|
60
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
61
|
+
constant Uniforms& uniforms
|
|
62
|
+
) {
|
|
63
|
+
float modifier = {};
|
|
64
|
+
metal::float2 fromP = {};
|
|
65
|
+
metal::float2 toP = {};
|
|
66
|
+
metal::float2 param = {};
|
|
67
|
+
metal::float4 local = {};
|
|
68
|
+
metal::float2 param_1 = {};
|
|
69
|
+
metal::float2 param_2 = {};
|
|
70
|
+
float _e25 = uv_2[1u];
|
|
71
|
+
int _e29 = uniforms.reverse;
|
|
72
|
+
modifier = ((_e25 > 0.5) ? 1.0 : -1.0) * ((_e29 != 0) ? -1.0 : 1.0);
|
|
73
|
+
float _e34 = uv_2[0u];
|
|
74
|
+
float _e36 = uniforms.progress;
|
|
75
|
+
float _e37 = modifier;
|
|
76
|
+
float _e41 = uv_2[1u];
|
|
77
|
+
fromP = metal::float2(_e34 + (_e36 * _e37), _e41);
|
|
78
|
+
float _e44 = uv_2[0u];
|
|
79
|
+
float _e46 = uniforms.progress;
|
|
80
|
+
float _e47 = modifier;
|
|
81
|
+
float _e50 = modifier;
|
|
82
|
+
float _e53 = uv_2[1u];
|
|
83
|
+
toP = metal::float2((_e44 + (_e46 * _e47)) - _e50, _e53);
|
|
84
|
+
metal::float2 _e55 = fromP;
|
|
85
|
+
param = _e55;
|
|
86
|
+
bool _e56 = inBounds(param);
|
|
87
|
+
if (_e56) {
|
|
88
|
+
metal::float2 _e57 = fromP;
|
|
89
|
+
param_1 = _e57;
|
|
90
|
+
metal::float4 _e58 = getFromColor(param_1, _from, _sampler);
|
|
91
|
+
local = _e58;
|
|
92
|
+
} else {
|
|
93
|
+
metal::float2 _e59 = toP;
|
|
94
|
+
param_2 = _e59;
|
|
95
|
+
metal::float4 _e60 = getToColor(param_2, _sampler, _to);
|
|
96
|
+
local = _e60;
|
|
97
|
+
}
|
|
98
|
+
metal::float4 _e61 = local;
|
|
99
|
+
return _e61;
|
|
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_3 = {};
|
|
111
|
+
metal::float2 _e17 = _uv_1;
|
|
112
|
+
param_3 = _e17;
|
|
113
|
+
metal::float4 _e18 = transition(param_3, _from, _sampler, _to, uniforms);
|
|
114
|
+
_fragColor = _e18;
|
|
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
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// splitSlideInOutVertical — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/splitSlideInOutVertical.glsl
|
|
2
|
+
// Author: OllyOllyOlly
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The halves of both images slide vertically in opposite directions, out and in at once
|
|
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
|
+
int reverse;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
metal::float4 getToColor(
|
|
20
|
+
thread metal::float2& uv,
|
|
21
|
+
metal::sampler _sampler,
|
|
22
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
23
|
+
) {
|
|
24
|
+
float _e18 = uv[0u];
|
|
25
|
+
float _e20 = uv[1u];
|
|
26
|
+
metal::float4 _e23 = _to.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
27
|
+
return _e23;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
metal::float4 getFromColor(
|
|
31
|
+
thread metal::float2& uv_1,
|
|
32
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
33
|
+
metal::sampler _sampler
|
|
34
|
+
) {
|
|
35
|
+
float _e18 = uv_1[0u];
|
|
36
|
+
float _e20 = uv_1[1u];
|
|
37
|
+
metal::float4 _e23 = _from.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
38
|
+
return _e23;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
bool inBounds(
|
|
42
|
+
thread metal::float2& p
|
|
43
|
+
) {
|
|
44
|
+
bool phi_74_ = {};
|
|
45
|
+
metal::float2 _e17 = p;
|
|
46
|
+
bool _e19 = metal::all(metal::float2(0.0, 0.0) < _e17);
|
|
47
|
+
phi_74_ = _e19;
|
|
48
|
+
if (_e19) {
|
|
49
|
+
metal::float2 _e20 = p;
|
|
50
|
+
phi_74_ = metal::all(_e20 < metal::float2(1.0, 1.0));
|
|
51
|
+
}
|
|
52
|
+
bool _e24 = phi_74_;
|
|
53
|
+
return _e24;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
metal::float4 transition(
|
|
57
|
+
thread metal::float2& uv_2,
|
|
58
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
59
|
+
metal::sampler _sampler,
|
|
60
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
61
|
+
constant Uniforms& uniforms
|
|
62
|
+
) {
|
|
63
|
+
float modifier = {};
|
|
64
|
+
metal::float2 fromP = {};
|
|
65
|
+
metal::float2 toP = {};
|
|
66
|
+
metal::float2 param = {};
|
|
67
|
+
metal::float4 local = {};
|
|
68
|
+
metal::float2 param_1 = {};
|
|
69
|
+
metal::float2 param_2 = {};
|
|
70
|
+
float _e25 = uv_2[0u];
|
|
71
|
+
int _e29 = uniforms.reverse;
|
|
72
|
+
modifier = ((_e25 > 0.5) ? 1.0 : -1.0) * ((_e29 != 0) ? -1.0 : 1.0);
|
|
73
|
+
float _e34 = uv_2[0u];
|
|
74
|
+
float _e36 = uv_2[1u];
|
|
75
|
+
float _e38 = uniforms.progress;
|
|
76
|
+
float _e39 = modifier;
|
|
77
|
+
fromP = metal::float2(_e34, _e36 + (_e38 * _e39));
|
|
78
|
+
float _e44 = uv_2[0u];
|
|
79
|
+
float _e46 = uv_2[1u];
|
|
80
|
+
float _e48 = uniforms.progress;
|
|
81
|
+
float _e49 = modifier;
|
|
82
|
+
float _e52 = modifier;
|
|
83
|
+
toP = metal::float2(_e44, (_e46 + (_e48 * _e49)) - _e52);
|
|
84
|
+
metal::float2 _e55 = fromP;
|
|
85
|
+
param = _e55;
|
|
86
|
+
bool _e56 = inBounds(param);
|
|
87
|
+
if (_e56) {
|
|
88
|
+
metal::float2 _e57 = fromP;
|
|
89
|
+
param_1 = _e57;
|
|
90
|
+
metal::float4 _e58 = getFromColor(param_1, _from, _sampler);
|
|
91
|
+
local = _e58;
|
|
92
|
+
} else {
|
|
93
|
+
metal::float2 _e59 = toP;
|
|
94
|
+
param_2 = _e59;
|
|
95
|
+
metal::float4 _e60 = getToColor(param_2, _sampler, _to);
|
|
96
|
+
local = _e60;
|
|
97
|
+
}
|
|
98
|
+
metal::float4 _e61 = local;
|
|
99
|
+
return _e61;
|
|
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_3 = {};
|
|
111
|
+
metal::float2 _e17 = _uv_1;
|
|
112
|
+
param_3 = _e17;
|
|
113
|
+
metal::float4 _e18 = transition(param_3, _from, _sampler, _to, uniforms);
|
|
114
|
+
_fragColor = _e18;
|
|
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
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// splitSlideInVertical — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/splitSlideInVertical.glsl
|
|
2
|
+
// Author: OllyOllyOlly
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The incoming image slides in as two halves moving vertically in opposite directions
|
|
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
|
+
int reverse;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
metal::float4 getFromColor(
|
|
20
|
+
thread metal::float2& uv,
|
|
21
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
22
|
+
metal::sampler _sampler
|
|
23
|
+
) {
|
|
24
|
+
float _e18 = uv[0u];
|
|
25
|
+
float _e20 = uv[1u];
|
|
26
|
+
metal::float4 _e23 = _from.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
27
|
+
return _e23;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
metal::float4 getToColor(
|
|
31
|
+
thread metal::float2& uv_1,
|
|
32
|
+
metal::sampler _sampler,
|
|
33
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
34
|
+
) {
|
|
35
|
+
float _e18 = uv_1[0u];
|
|
36
|
+
float _e20 = uv_1[1u];
|
|
37
|
+
metal::float4 _e23 = _to.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
38
|
+
return _e23;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
bool inBounds(
|
|
42
|
+
thread metal::float2& p
|
|
43
|
+
) {
|
|
44
|
+
bool phi_74_ = {};
|
|
45
|
+
metal::float2 _e17 = p;
|
|
46
|
+
bool _e19 = metal::all(metal::float2(0.0, 0.0) < _e17);
|
|
47
|
+
phi_74_ = _e19;
|
|
48
|
+
if (_e19) {
|
|
49
|
+
metal::float2 _e20 = p;
|
|
50
|
+
phi_74_ = metal::all(_e20 < metal::float2(1.0, 1.0));
|
|
51
|
+
}
|
|
52
|
+
bool _e24 = phi_74_;
|
|
53
|
+
return _e24;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
metal::float4 transition(
|
|
57
|
+
thread metal::float2& uv_2,
|
|
58
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
59
|
+
metal::sampler _sampler,
|
|
60
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
61
|
+
constant Uniforms& uniforms
|
|
62
|
+
) {
|
|
63
|
+
float modifier = {};
|
|
64
|
+
metal::float2 p_1 = {};
|
|
65
|
+
metal::float2 local = {};
|
|
66
|
+
metal::float2 param = {};
|
|
67
|
+
metal::float4 local_1 = {};
|
|
68
|
+
metal::float2 param_1 = {};
|
|
69
|
+
metal::float2 param_2 = {};
|
|
70
|
+
int _e25 = uniforms.reverse;
|
|
71
|
+
modifier = (_e25 != 0) ? -1.0 : 1.0;
|
|
72
|
+
float _e29 = uv_2[0u];
|
|
73
|
+
if (_e29 > 0.5) {
|
|
74
|
+
float _e32 = uv_2[0u];
|
|
75
|
+
float _e34 = uv_2[1u];
|
|
76
|
+
float _e36 = uniforms.progress;
|
|
77
|
+
float _e37 = modifier;
|
|
78
|
+
float _e40 = modifier;
|
|
79
|
+
local = metal::float2(_e32, (_e34 - (_e36 * _e37)) + _e40);
|
|
80
|
+
} else {
|
|
81
|
+
float _e44 = uv_2[0u];
|
|
82
|
+
float _e46 = uv_2[1u];
|
|
83
|
+
float _e48 = uniforms.progress;
|
|
84
|
+
float _e49 = modifier;
|
|
85
|
+
float _e52 = modifier;
|
|
86
|
+
local = metal::float2(_e44, (_e46 + (_e48 * _e49)) - _e52);
|
|
87
|
+
}
|
|
88
|
+
metal::float2 _e55 = local;
|
|
89
|
+
p_1 = _e55;
|
|
90
|
+
metal::float2 _e56 = p_1;
|
|
91
|
+
param = _e56;
|
|
92
|
+
bool _e57 = inBounds(param);
|
|
93
|
+
if (_e57) {
|
|
94
|
+
metal::float2 _e58 = p_1;
|
|
95
|
+
param_1 = _e58;
|
|
96
|
+
metal::float4 _e59 = getToColor(param_1, _sampler, _to);
|
|
97
|
+
local_1 = _e59;
|
|
98
|
+
} else {
|
|
99
|
+
metal::float2 _e60 = uv_2;
|
|
100
|
+
param_2 = _e60;
|
|
101
|
+
metal::float4 _e61 = getFromColor(param_2, _from, _sampler);
|
|
102
|
+
local_1 = _e61;
|
|
103
|
+
}
|
|
104
|
+
metal::float4 _e62 = local_1;
|
|
105
|
+
return _e62;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
void main_1(
|
|
109
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
110
|
+
metal::sampler _sampler,
|
|
111
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
112
|
+
constant Uniforms& uniforms,
|
|
113
|
+
thread metal::float4& _fragColor,
|
|
114
|
+
thread metal::float2& _uv_1
|
|
115
|
+
) {
|
|
116
|
+
metal::float2 param_3 = {};
|
|
117
|
+
metal::float2 _e17 = _uv_1;
|
|
118
|
+
param_3 = _e17;
|
|
119
|
+
metal::float4 _e18 = transition(param_3, _from, _sampler, _to, uniforms);
|
|
120
|
+
_fragColor = _e18;
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
struct main_Input {
|
|
125
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
126
|
+
};
|
|
127
|
+
struct main_Output {
|
|
128
|
+
metal::float4 member [[color(0)]];
|
|
129
|
+
};
|
|
130
|
+
fragment main_Output main_(
|
|
131
|
+
main_Input varyings [[stage_in]]
|
|
132
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
133
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
134
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
135
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
136
|
+
) {
|
|
137
|
+
metal::float4 _fragColor = {};
|
|
138
|
+
metal::float2 _uv_1 = {};
|
|
139
|
+
const auto _uv = varyings._uv;
|
|
140
|
+
_uv_1 = _uv;
|
|
141
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
142
|
+
metal::float4 _e3 = _fragColor;
|
|
143
|
+
return main_Output { _e3 };
|
|
144
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// splitSlideOutHorizontal — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/splitSlideOutHorizontal.glsl
|
|
2
|
+
// Author: OllyOllyOlly
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The outgoing image slides out as two halves moving horizontally in opposite directions
|
|
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
|
+
int reverse;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
metal::float4 getToColor(
|
|
20
|
+
thread metal::float2& uv,
|
|
21
|
+
metal::sampler _sampler,
|
|
22
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
23
|
+
) {
|
|
24
|
+
float _e18 = uv[0u];
|
|
25
|
+
float _e20 = uv[1u];
|
|
26
|
+
metal::float4 _e23 = _to.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
27
|
+
return _e23;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
metal::float4 getFromColor(
|
|
31
|
+
thread metal::float2& uv_1,
|
|
32
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
33
|
+
metal::sampler _sampler
|
|
34
|
+
) {
|
|
35
|
+
float _e18 = uv_1[0u];
|
|
36
|
+
float _e20 = uv_1[1u];
|
|
37
|
+
metal::float4 _e23 = _from.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
38
|
+
return _e23;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
bool inBounds(
|
|
42
|
+
thread metal::float2& p
|
|
43
|
+
) {
|
|
44
|
+
bool phi_74_ = {};
|
|
45
|
+
metal::float2 _e17 = p;
|
|
46
|
+
bool _e19 = metal::all(metal::float2(0.0, 0.0) < _e17);
|
|
47
|
+
phi_74_ = _e19;
|
|
48
|
+
if (_e19) {
|
|
49
|
+
metal::float2 _e20 = p;
|
|
50
|
+
phi_74_ = metal::all(_e20 < metal::float2(1.0, 1.0));
|
|
51
|
+
}
|
|
52
|
+
bool _e24 = phi_74_;
|
|
53
|
+
return _e24;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
metal::float4 transition(
|
|
57
|
+
thread metal::float2& uv_2,
|
|
58
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
59
|
+
metal::sampler _sampler,
|
|
60
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
61
|
+
constant Uniforms& uniforms
|
|
62
|
+
) {
|
|
63
|
+
float modifier = {};
|
|
64
|
+
metal::float2 p_1 = {};
|
|
65
|
+
metal::float2 param = {};
|
|
66
|
+
metal::float4 local = {};
|
|
67
|
+
metal::float2 param_1 = {};
|
|
68
|
+
metal::float2 param_2 = {};
|
|
69
|
+
float _e24 = uv_2[1u];
|
|
70
|
+
int _e28 = uniforms.reverse;
|
|
71
|
+
modifier = ((_e24 > 0.5) ? 1.0 : -1.0) * ((_e28 != 0) ? -1.0 : 1.0);
|
|
72
|
+
float _e33 = uv_2[0u];
|
|
73
|
+
float _e35 = uniforms.progress;
|
|
74
|
+
float _e36 = modifier;
|
|
75
|
+
float _e40 = uv_2[1u];
|
|
76
|
+
p_1 = metal::float2(_e33 + (_e35 * _e36), _e40);
|
|
77
|
+
metal::float2 _e42 = p_1;
|
|
78
|
+
param = _e42;
|
|
79
|
+
bool _e43 = inBounds(param);
|
|
80
|
+
if (_e43) {
|
|
81
|
+
metal::float2 _e44 = p_1;
|
|
82
|
+
param_1 = _e44;
|
|
83
|
+
metal::float4 _e45 = getFromColor(param_1, _from, _sampler);
|
|
84
|
+
local = _e45;
|
|
85
|
+
} else {
|
|
86
|
+
metal::float2 _e46 = uv_2;
|
|
87
|
+
param_2 = _e46;
|
|
88
|
+
metal::float4 _e47 = getToColor(param_2, _sampler, _to);
|
|
89
|
+
local = _e47;
|
|
90
|
+
}
|
|
91
|
+
metal::float4 _e48 = local;
|
|
92
|
+
return _e48;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
void main_1(
|
|
96
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
97
|
+
metal::sampler _sampler,
|
|
98
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
99
|
+
constant Uniforms& uniforms,
|
|
100
|
+
thread metal::float4& _fragColor,
|
|
101
|
+
thread metal::float2& _uv_1
|
|
102
|
+
) {
|
|
103
|
+
metal::float2 param_3 = {};
|
|
104
|
+
metal::float2 _e17 = _uv_1;
|
|
105
|
+
param_3 = _e17;
|
|
106
|
+
metal::float4 _e18 = transition(param_3, _from, _sampler, _to, uniforms);
|
|
107
|
+
_fragColor = _e18;
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
struct main_Input {
|
|
112
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
113
|
+
};
|
|
114
|
+
struct main_Output {
|
|
115
|
+
metal::float4 member [[color(0)]];
|
|
116
|
+
};
|
|
117
|
+
fragment main_Output main_(
|
|
118
|
+
main_Input varyings [[stage_in]]
|
|
119
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
120
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
121
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
122
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
123
|
+
) {
|
|
124
|
+
metal::float4 _fragColor = {};
|
|
125
|
+
metal::float2 _uv_1 = {};
|
|
126
|
+
const auto _uv = varyings._uv;
|
|
127
|
+
_uv_1 = _uv;
|
|
128
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
129
|
+
metal::float4 _e3 = _fragColor;
|
|
130
|
+
return main_Output { _e3 };
|
|
131
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// splitSlideOutVertical — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/splitSlideOutVertical.glsl
|
|
2
|
+
// Author: OllyOllyOlly
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The outgoing image slides out as two halves moving vertically in opposite directions
|
|
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
|
+
int reverse;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
metal::float4 getToColor(
|
|
20
|
+
thread metal::float2& uv,
|
|
21
|
+
metal::sampler _sampler,
|
|
22
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
23
|
+
) {
|
|
24
|
+
float _e18 = uv[0u];
|
|
25
|
+
float _e20 = uv[1u];
|
|
26
|
+
metal::float4 _e23 = _to.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
27
|
+
return _e23;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
metal::float4 getFromColor(
|
|
31
|
+
thread metal::float2& uv_1,
|
|
32
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
33
|
+
metal::sampler _sampler
|
|
34
|
+
) {
|
|
35
|
+
float _e18 = uv_1[0u];
|
|
36
|
+
float _e20 = uv_1[1u];
|
|
37
|
+
metal::float4 _e23 = _from.sample(_sampler, metal::float2(_e18, 1.0 - _e20), metal::level(0.0));
|
|
38
|
+
return _e23;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
bool inBounds(
|
|
42
|
+
thread metal::float2& p
|
|
43
|
+
) {
|
|
44
|
+
bool phi_74_ = {};
|
|
45
|
+
metal::float2 _e17 = p;
|
|
46
|
+
bool _e19 = metal::all(metal::float2(0.0, 0.0) < _e17);
|
|
47
|
+
phi_74_ = _e19;
|
|
48
|
+
if (_e19) {
|
|
49
|
+
metal::float2 _e20 = p;
|
|
50
|
+
phi_74_ = metal::all(_e20 < metal::float2(1.0, 1.0));
|
|
51
|
+
}
|
|
52
|
+
bool _e24 = phi_74_;
|
|
53
|
+
return _e24;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
metal::float4 transition(
|
|
57
|
+
thread metal::float2& uv_2,
|
|
58
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
59
|
+
metal::sampler _sampler,
|
|
60
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
61
|
+
constant Uniforms& uniforms
|
|
62
|
+
) {
|
|
63
|
+
float modifier = {};
|
|
64
|
+
metal::float2 p_1 = {};
|
|
65
|
+
metal::float2 param = {};
|
|
66
|
+
metal::float4 local = {};
|
|
67
|
+
metal::float2 param_1 = {};
|
|
68
|
+
metal::float2 param_2 = {};
|
|
69
|
+
float _e24 = uv_2[0u];
|
|
70
|
+
int _e28 = uniforms.reverse;
|
|
71
|
+
modifier = ((_e24 > 0.5) ? 1.0 : -1.0) * ((_e28 != 0) ? -1.0 : 1.0);
|
|
72
|
+
float _e33 = uv_2[0u];
|
|
73
|
+
float _e35 = uv_2[1u];
|
|
74
|
+
float _e37 = uniforms.progress;
|
|
75
|
+
float _e38 = modifier;
|
|
76
|
+
p_1 = metal::float2(_e33, _e35 + (_e37 * _e38));
|
|
77
|
+
metal::float2 _e42 = p_1;
|
|
78
|
+
param = _e42;
|
|
79
|
+
bool _e43 = inBounds(param);
|
|
80
|
+
if (_e43) {
|
|
81
|
+
metal::float2 _e44 = p_1;
|
|
82
|
+
param_1 = _e44;
|
|
83
|
+
metal::float4 _e45 = getFromColor(param_1, _from, _sampler);
|
|
84
|
+
local = _e45;
|
|
85
|
+
} else {
|
|
86
|
+
metal::float2 _e46 = uv_2;
|
|
87
|
+
param_2 = _e46;
|
|
88
|
+
metal::float4 _e47 = getToColor(param_2, _sampler, _to);
|
|
89
|
+
local = _e47;
|
|
90
|
+
}
|
|
91
|
+
metal::float4 _e48 = local;
|
|
92
|
+
return _e48;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
void main_1(
|
|
96
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
97
|
+
metal::sampler _sampler,
|
|
98
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
99
|
+
constant Uniforms& uniforms,
|
|
100
|
+
thread metal::float4& _fragColor,
|
|
101
|
+
thread metal::float2& _uv_1
|
|
102
|
+
) {
|
|
103
|
+
metal::float2 param_3 = {};
|
|
104
|
+
metal::float2 _e17 = _uv_1;
|
|
105
|
+
param_3 = _e17;
|
|
106
|
+
metal::float4 _e18 = transition(param_3, _from, _sampler, _to, uniforms);
|
|
107
|
+
_fragColor = _e18;
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
struct main_Input {
|
|
112
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
113
|
+
};
|
|
114
|
+
struct main_Output {
|
|
115
|
+
metal::float4 member [[color(0)]];
|
|
116
|
+
};
|
|
117
|
+
fragment main_Output main_(
|
|
118
|
+
main_Input varyings [[stage_in]]
|
|
119
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
120
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
121
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
122
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
123
|
+
) {
|
|
124
|
+
metal::float4 _fragColor = {};
|
|
125
|
+
metal::float2 _uv_1 = {};
|
|
126
|
+
const auto _uv = varyings._uv;
|
|
127
|
+
_uv_1 = _uv;
|
|
128
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
129
|
+
metal::float4 _e3 = _fragColor;
|
|
130
|
+
return main_Output { _e3 };
|
|
131
|
+
}
|