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,285 @@
|
|
|
1
|
+
// GridFlip — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/GridFlip.glsl
|
|
2
|
+
// Author: TimDonselaar
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The image splits into a grid of tiles that flip one by one 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
|
+
metal::int2 size;
|
|
17
|
+
float pause;
|
|
18
|
+
float dividerWidth;
|
|
19
|
+
char _pad5[8];
|
|
20
|
+
metal::float4 bgcolor;
|
|
21
|
+
float randomness;
|
|
22
|
+
char _pad7[12];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
metal::float4 getToColor(
|
|
26
|
+
thread metal::float2& uv,
|
|
27
|
+
metal::sampler _sampler,
|
|
28
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
29
|
+
) {
|
|
30
|
+
float _e24 = uv[0u];
|
|
31
|
+
float _e26 = uv[1u];
|
|
32
|
+
metal::float4 _e29 = _to.sample(_sampler, metal::float2(_e24, 1.0 - _e26), metal::level(0.0));
|
|
33
|
+
return _e29;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
float rand(
|
|
37
|
+
thread metal::float2& co
|
|
38
|
+
) {
|
|
39
|
+
metal::float2 _e23 = co;
|
|
40
|
+
return metal::fract(metal::sin(metal::dot(_e23, metal::float2(12.9898, 78.233))) * 43758.547);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
metal::float4 getFromColor(
|
|
44
|
+
thread metal::float2& uv_1,
|
|
45
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
46
|
+
metal::sampler _sampler
|
|
47
|
+
) {
|
|
48
|
+
float _e24 = uv_1[0u];
|
|
49
|
+
float _e26 = uv_1[1u];
|
|
50
|
+
metal::float4 _e29 = _from.sample(_sampler, metal::float2(_e24, 1.0 - _e26), metal::level(0.0));
|
|
51
|
+
return _e29;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
float getDividerSize_u0028_(
|
|
55
|
+
constant Uniforms& uniforms
|
|
56
|
+
) {
|
|
57
|
+
metal::float2 rectangleSize = {};
|
|
58
|
+
metal::int2 _e24 = uniforms.size;
|
|
59
|
+
metal::int2 _e29 = uniforms.size;
|
|
60
|
+
rectangleSize = metal::float2(1.0 / static_cast<metal::float2>(_e24).x, 1.0 / static_cast<metal::float2>(_e29).y);
|
|
61
|
+
float _e35 = rectangleSize[0u];
|
|
62
|
+
float _e37 = rectangleSize[1u];
|
|
63
|
+
float _e40 = uniforms.dividerWidth;
|
|
64
|
+
return metal::min(_e35, _e37) * _e40;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
float getDelta(
|
|
68
|
+
thread metal::float2& p,
|
|
69
|
+
constant Uniforms& uniforms
|
|
70
|
+
) {
|
|
71
|
+
metal::float2 rectanglePos = {};
|
|
72
|
+
metal::float2 rectangleSize_1 = {};
|
|
73
|
+
float top = {};
|
|
74
|
+
float bottom = {};
|
|
75
|
+
float left = {};
|
|
76
|
+
float right = {};
|
|
77
|
+
float minX = {};
|
|
78
|
+
float minY = {};
|
|
79
|
+
metal::int2 _e32 = uniforms.size;
|
|
80
|
+
metal::float2 _e34 = p;
|
|
81
|
+
rectanglePos = metal::floor(static_cast<metal::float2>(_e32) * _e34);
|
|
82
|
+
metal::int2 _e38 = uniforms.size;
|
|
83
|
+
metal::int2 _e43 = uniforms.size;
|
|
84
|
+
rectangleSize_1 = metal::float2(1.0 / static_cast<metal::float2>(_e38).x, 1.0 / static_cast<metal::float2>(_e43).y);
|
|
85
|
+
float _e49 = rectangleSize_1[1u];
|
|
86
|
+
float _e51 = rectanglePos[1u];
|
|
87
|
+
top = _e49 * (_e51 + 1.0);
|
|
88
|
+
float _e55 = rectangleSize_1[1u];
|
|
89
|
+
float _e57 = rectanglePos[1u];
|
|
90
|
+
bottom = _e55 * _e57;
|
|
91
|
+
float _e60 = rectangleSize_1[0u];
|
|
92
|
+
float _e62 = rectanglePos[0u];
|
|
93
|
+
left = _e60 * _e62;
|
|
94
|
+
float _e65 = rectangleSize_1[0u];
|
|
95
|
+
float _e67 = rectanglePos[0u];
|
|
96
|
+
right = _e65 * (_e67 + 1.0);
|
|
97
|
+
float _e71 = p[0u];
|
|
98
|
+
float _e72 = left;
|
|
99
|
+
float _e76 = p[0u];
|
|
100
|
+
float _e77 = right;
|
|
101
|
+
minX = metal::min(metal::abs(_e71 - _e72), metal::abs(_e76 - _e77));
|
|
102
|
+
float _e82 = p[1u];
|
|
103
|
+
float _e83 = top;
|
|
104
|
+
float _e87 = p[1u];
|
|
105
|
+
float _e88 = bottom;
|
|
106
|
+
minY = metal::min(metal::abs(_e82 - _e83), metal::abs(_e87 - _e88));
|
|
107
|
+
float _e92 = minX;
|
|
108
|
+
float _e93 = minY;
|
|
109
|
+
return metal::min(_e92, _e93);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
metal::float4 transition(
|
|
113
|
+
thread metal::float2& p_1,
|
|
114
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
115
|
+
metal::sampler _sampler,
|
|
116
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
117
|
+
constant Uniforms& uniforms
|
|
118
|
+
) {
|
|
119
|
+
float currentProg = {};
|
|
120
|
+
float a = {};
|
|
121
|
+
metal::float2 param = {};
|
|
122
|
+
metal::float2 param_1 = {};
|
|
123
|
+
metal::float2 param_2 = {};
|
|
124
|
+
float currentProg_1 = {};
|
|
125
|
+
metal::float2 q = {};
|
|
126
|
+
metal::float2 rectanglePos_1 = {};
|
|
127
|
+
float r = {};
|
|
128
|
+
metal::float2 param_3 = {};
|
|
129
|
+
float cp = {};
|
|
130
|
+
float rectangleSize_2 = {};
|
|
131
|
+
float delta = {};
|
|
132
|
+
float offset = {};
|
|
133
|
+
metal::float4 a_1 = {};
|
|
134
|
+
metal::float2 param_4 = {};
|
|
135
|
+
metal::float4 b = {};
|
|
136
|
+
metal::float2 param_5 = {};
|
|
137
|
+
float s = {};
|
|
138
|
+
float currentProg_2 = {};
|
|
139
|
+
float a_2 = {};
|
|
140
|
+
metal::float2 param_6 = {};
|
|
141
|
+
metal::float2 param_7 = {};
|
|
142
|
+
float _e47 = uniforms.progress;
|
|
143
|
+
float _e49 = uniforms.pause;
|
|
144
|
+
if (_e47 < _e49) {
|
|
145
|
+
float _e52 = uniforms.progress;
|
|
146
|
+
float _e54 = uniforms.pause;
|
|
147
|
+
currentProg = _e52 / _e54;
|
|
148
|
+
a = 1.0;
|
|
149
|
+
metal::float2 _e56 = p_1;
|
|
150
|
+
param = _e56;
|
|
151
|
+
float _e57 = getDelta(param, uniforms);
|
|
152
|
+
float _e58 = getDividerSize_u0028_(uniforms);
|
|
153
|
+
if (_e57 < _e58) {
|
|
154
|
+
float _e60 = currentProg;
|
|
155
|
+
a = 1.0 - _e60;
|
|
156
|
+
}
|
|
157
|
+
metal::float4 _e63 = uniforms.bgcolor;
|
|
158
|
+
metal::float2 _e64 = p_1;
|
|
159
|
+
param_1 = _e64;
|
|
160
|
+
metal::float4 _e65 = getFromColor(param_1, _from, _sampler);
|
|
161
|
+
float _e66 = a;
|
|
162
|
+
return metal::mix(_e63, _e65, metal::float4(_e66));
|
|
163
|
+
} else {
|
|
164
|
+
float _e70 = uniforms.progress;
|
|
165
|
+
float _e72 = uniforms.pause;
|
|
166
|
+
if (_e70 < (1.0 - _e72)) {
|
|
167
|
+
metal::float2 _e75 = p_1;
|
|
168
|
+
param_2 = _e75;
|
|
169
|
+
float _e76 = getDelta(param_2, uniforms);
|
|
170
|
+
float _e77 = getDividerSize_u0028_(uniforms);
|
|
171
|
+
if (_e76 < _e77) {
|
|
172
|
+
metal::float4 _e80 = uniforms.bgcolor;
|
|
173
|
+
return _e80;
|
|
174
|
+
} else {
|
|
175
|
+
float _e82 = uniforms.progress;
|
|
176
|
+
float _e84 = uniforms.pause;
|
|
177
|
+
float _e87 = uniforms.pause;
|
|
178
|
+
currentProg_1 = (_e82 - _e84) / (1.0 - (_e87 * 2.0));
|
|
179
|
+
metal::float2 _e91 = p_1;
|
|
180
|
+
q = _e91;
|
|
181
|
+
metal::int2 _e93 = uniforms.size;
|
|
182
|
+
metal::float2 _e95 = q;
|
|
183
|
+
rectanglePos_1 = metal::floor(static_cast<metal::float2>(_e93) * _e95);
|
|
184
|
+
metal::float2 _e98 = rectanglePos_1;
|
|
185
|
+
param_3 = _e98;
|
|
186
|
+
float _e99 = rand(param_3);
|
|
187
|
+
float _e101 = uniforms.randomness;
|
|
188
|
+
r = _e99 - _e101;
|
|
189
|
+
float _e103 = r;
|
|
190
|
+
float _e105 = currentProg_1;
|
|
191
|
+
cp = metal::smoothstep(0.0, 1.0 - _e103, _e105);
|
|
192
|
+
metal::int2 _e108 = uniforms.size;
|
|
193
|
+
rectangleSize_2 = 1.0 / static_cast<metal::float2>(_e108).x;
|
|
194
|
+
float _e113 = rectanglePos_1[0u];
|
|
195
|
+
float _e114 = rectangleSize_2;
|
|
196
|
+
delta = _e113 * _e114;
|
|
197
|
+
float _e116 = rectangleSize_2;
|
|
198
|
+
float _e118 = delta;
|
|
199
|
+
offset = (_e116 / 2.0) + _e118;
|
|
200
|
+
float _e121 = p_1[0u];
|
|
201
|
+
float _e122 = offset;
|
|
202
|
+
float _e124 = cp;
|
|
203
|
+
float _e129 = offset;
|
|
204
|
+
p_1[0u] = (((_e121 - _e122) / metal::abs(_e124 - 0.5)) * 0.5) + _e129;
|
|
205
|
+
metal::float2 _e132 = p_1;
|
|
206
|
+
param_4 = _e132;
|
|
207
|
+
metal::float4 _e133 = getFromColor(param_4, _from, _sampler);
|
|
208
|
+
a_1 = _e133;
|
|
209
|
+
metal::float2 _e134 = p_1;
|
|
210
|
+
param_5 = _e134;
|
|
211
|
+
metal::float4 _e135 = getToColor(param_5, _sampler, _to);
|
|
212
|
+
b = _e135;
|
|
213
|
+
metal::int2 _e137 = uniforms.size;
|
|
214
|
+
float _e141 = q[0u];
|
|
215
|
+
float _e142 = delta;
|
|
216
|
+
float _e147 = cp;
|
|
217
|
+
s = metal::step(metal::abs((static_cast<metal::float2>(_e137).x * (_e141 - _e142)) - 0.5), metal::abs(_e147 - 0.5));
|
|
218
|
+
metal::float4 _e152 = uniforms.bgcolor;
|
|
219
|
+
metal::float4 _e153 = b;
|
|
220
|
+
metal::float4 _e154 = a_1;
|
|
221
|
+
float _e155 = cp;
|
|
222
|
+
float _e159 = s;
|
|
223
|
+
return metal::mix(_e152, metal::mix(_e153, _e154, metal::float4(metal::step(_e155, 0.5))), metal::float4(_e159));
|
|
224
|
+
}
|
|
225
|
+
} else {
|
|
226
|
+
float _e163 = uniforms.progress;
|
|
227
|
+
float _e166 = uniforms.pause;
|
|
228
|
+
float _e169 = uniforms.pause;
|
|
229
|
+
currentProg_2 = ((_e163 - 1.0) + _e166) / _e169;
|
|
230
|
+
a_2 = 1.0;
|
|
231
|
+
metal::float2 _e171 = p_1;
|
|
232
|
+
param_6 = _e171;
|
|
233
|
+
float _e172 = getDelta(param_6, uniforms);
|
|
234
|
+
float _e173 = getDividerSize_u0028_(uniforms);
|
|
235
|
+
if (_e172 < _e173) {
|
|
236
|
+
float _e175 = currentProg_2;
|
|
237
|
+
a_2 = _e175;
|
|
238
|
+
}
|
|
239
|
+
metal::float4 _e177 = uniforms.bgcolor;
|
|
240
|
+
metal::float2 _e178 = p_1;
|
|
241
|
+
param_7 = _e178;
|
|
242
|
+
metal::float4 _e179 = getToColor(param_7, _sampler, _to);
|
|
243
|
+
float _e180 = a_2;
|
|
244
|
+
return metal::mix(_e177, _e179, metal::float4(_e180));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
void main_1(
|
|
250
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
251
|
+
metal::sampler _sampler,
|
|
252
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
253
|
+
constant Uniforms& uniforms,
|
|
254
|
+
thread metal::float4& _fragColor,
|
|
255
|
+
thread metal::float2& _uv_1
|
|
256
|
+
) {
|
|
257
|
+
metal::float2 param_8 = {};
|
|
258
|
+
metal::float2 _e23 = _uv_1;
|
|
259
|
+
param_8 = _e23;
|
|
260
|
+
metal::float4 _e24 = transition(param_8, _from, _sampler, _to, uniforms);
|
|
261
|
+
_fragColor = _e24;
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
struct main_Input {
|
|
266
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
267
|
+
};
|
|
268
|
+
struct main_Output {
|
|
269
|
+
metal::float4 member [[color(0)]];
|
|
270
|
+
};
|
|
271
|
+
fragment main_Output main_(
|
|
272
|
+
main_Input varyings [[stage_in]]
|
|
273
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
274
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
275
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
276
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
277
|
+
) {
|
|
278
|
+
metal::float4 _fragColor = {};
|
|
279
|
+
metal::float2 _uv_1 = {};
|
|
280
|
+
const auto _uv = varyings._uv;
|
|
281
|
+
_uv_1 = _uv;
|
|
282
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
283
|
+
metal::float4 _e3 = _fragColor;
|
|
284
|
+
return main_Output { _e3 };
|
|
285
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// HSVfade — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HSVfade.glsl
|
|
2
|
+
// Author: nwoeanhinnogaehr
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: A crossfade through the HSV color space that cycles through hues
|
|
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::float3 hsv2rgb(
|
|
19
|
+
thread metal::float3& c
|
|
20
|
+
) {
|
|
21
|
+
metal::float3 p = {};
|
|
22
|
+
metal::float3 _e27 = c;
|
|
23
|
+
p = metal::abs((metal::fract(_e27.xxx + metal::float3(1.0, 0.6666667, 0.33333334)) * 6.0) - metal::float3(3.0, 3.0, 3.0));
|
|
24
|
+
float _e35 = c[2u];
|
|
25
|
+
metal::float3 _e36 = p;
|
|
26
|
+
float _e42 = c[1u];
|
|
27
|
+
return metal::mix(metal::float3(1.0, 1.0, 1.0), metal::clamp(_e36 - metal::float3(1.0, 1.0, 1.0), metal::float3(0.0), metal::float3(1.0)), metal::float3(_e42)) * _e35;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
metal::float4 getToColor(
|
|
31
|
+
thread metal::float2& uv,
|
|
32
|
+
metal::sampler _sampler,
|
|
33
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
34
|
+
) {
|
|
35
|
+
float _e27 = uv[0u];
|
|
36
|
+
float _e29 = uv[1u];
|
|
37
|
+
metal::float4 _e32 = _to.sample(_sampler, metal::float2(_e27, 1.0 - _e29), metal::level(0.0));
|
|
38
|
+
return _e32;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
metal::float3 rgb2hsv(
|
|
42
|
+
thread metal::float3& c_1
|
|
43
|
+
) {
|
|
44
|
+
metal::float4 p_1 = {};
|
|
45
|
+
metal::float4 q = {};
|
|
46
|
+
float d = {};
|
|
47
|
+
metal::float3 _e29 = c_1;
|
|
48
|
+
metal::float2 _e30 = _e29.zy;
|
|
49
|
+
metal::float3 _e36 = c_1;
|
|
50
|
+
metal::float2 _e37 = _e36.yz;
|
|
51
|
+
float _e44 = c_1[2u];
|
|
52
|
+
float _e46 = c_1[1u];
|
|
53
|
+
p_1 = metal::mix(metal::float4(_e30.x, _e30.y, metal::float2(-1.0, 0.6666667).x, metal::float2(-1.0, 0.6666667).y), metal::float4(_e37.x, _e37.y, metal::float2(0.0, -0.33333334).x, metal::float2(0.0, -0.33333334).y), metal::float4(metal::step(_e44, _e46)));
|
|
54
|
+
metal::float4 _e50 = p_1;
|
|
55
|
+
metal::float3 _e51 = _e50.xyw;
|
|
56
|
+
float _e53 = c_1[0u];
|
|
57
|
+
float _e59 = c_1[0u];
|
|
58
|
+
metal::float4 _e60 = p_1;
|
|
59
|
+
metal::float3 _e61 = _e60.yzx;
|
|
60
|
+
float _e67 = p_1[0u];
|
|
61
|
+
float _e69 = c_1[0u];
|
|
62
|
+
q = metal::mix(metal::float4(_e51.x, _e51.y, _e51.z, _e53), metal::float4(_e59, _e61.x, _e61.y, _e61.z), metal::float4(metal::step(_e67, _e69)));
|
|
63
|
+
float _e74 = q[0u];
|
|
64
|
+
float _e76 = q[3u];
|
|
65
|
+
float _e78 = q[1u];
|
|
66
|
+
d = _e74 - metal::min(_e76, _e78);
|
|
67
|
+
float _e82 = q[2u];
|
|
68
|
+
float _e84 = q[3u];
|
|
69
|
+
float _e86 = q[1u];
|
|
70
|
+
float _e88 = d;
|
|
71
|
+
float _e94 = d;
|
|
72
|
+
float _e96 = q[0u];
|
|
73
|
+
float _e100 = q[0u];
|
|
74
|
+
return metal::float3(metal::abs(_e82 + ((_e84 - _e86) / ((6.0 * _e88) + 0.001))), _e94 / (_e96 + 0.001), _e100);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
metal::float4 getFromColor(
|
|
78
|
+
thread metal::float2& uv_1,
|
|
79
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
80
|
+
metal::sampler _sampler
|
|
81
|
+
) {
|
|
82
|
+
float _e27 = uv_1[0u];
|
|
83
|
+
float _e29 = uv_1[1u];
|
|
84
|
+
metal::float4 _e32 = _from.sample(_sampler, metal::float2(_e27, 1.0 - _e29), metal::level(0.0));
|
|
85
|
+
return _e32;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
metal::float4 transition(
|
|
89
|
+
thread metal::float2& uv_2,
|
|
90
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
91
|
+
metal::sampler _sampler,
|
|
92
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
93
|
+
constant Uniforms& uniforms
|
|
94
|
+
) {
|
|
95
|
+
metal::float3 a = {};
|
|
96
|
+
metal::float2 param = {};
|
|
97
|
+
metal::float3 param_1 = {};
|
|
98
|
+
metal::float3 b = {};
|
|
99
|
+
metal::float2 param_2 = {};
|
|
100
|
+
metal::float3 param_3 = {};
|
|
101
|
+
metal::float3 m = {};
|
|
102
|
+
metal::float3 param_4 = {};
|
|
103
|
+
metal::float2 _e34 = uv_2;
|
|
104
|
+
param = _e34;
|
|
105
|
+
metal::float4 _e35 = getFromColor(param, _from, _sampler);
|
|
106
|
+
param_1 = _e35.xyz;
|
|
107
|
+
metal::float3 _e37 = rgb2hsv(param_1);
|
|
108
|
+
a = _e37;
|
|
109
|
+
metal::float2 _e38 = uv_2;
|
|
110
|
+
param_2 = _e38;
|
|
111
|
+
metal::float4 _e39 = getToColor(param_2, _sampler, _to);
|
|
112
|
+
param_3 = _e39.xyz;
|
|
113
|
+
metal::float3 _e41 = rgb2hsv(param_3);
|
|
114
|
+
b = _e41;
|
|
115
|
+
metal::float3 _e42 = a;
|
|
116
|
+
metal::float3 _e43 = b;
|
|
117
|
+
float _e45 = uniforms.progress;
|
|
118
|
+
m = metal::mix(_e42, _e43, metal::float3(_e45));
|
|
119
|
+
metal::float3 _e48 = m;
|
|
120
|
+
param_4 = _e48;
|
|
121
|
+
metal::float3 _e49 = hsv2rgb(param_4);
|
|
122
|
+
return metal::float4(_e49.x, _e49.y, _e49.z, 1.0);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
void main_1(
|
|
126
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
127
|
+
metal::sampler _sampler,
|
|
128
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
129
|
+
constant Uniforms& uniforms,
|
|
130
|
+
thread metal::float4& _fragColor,
|
|
131
|
+
thread metal::float2& _uv_1
|
|
132
|
+
) {
|
|
133
|
+
metal::float2 param_5 = {};
|
|
134
|
+
metal::float2 _e26 = _uv_1;
|
|
135
|
+
param_5 = _e26;
|
|
136
|
+
metal::float4 _e27 = transition(param_5, _from, _sampler, _to, uniforms);
|
|
137
|
+
_fragColor = _e27;
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
struct main_Input {
|
|
142
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
143
|
+
};
|
|
144
|
+
struct main_Output {
|
|
145
|
+
metal::float4 member [[color(0)]];
|
|
146
|
+
};
|
|
147
|
+
fragment main_Output main_(
|
|
148
|
+
main_Input varyings [[stage_in]]
|
|
149
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
150
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
151
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
152
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
153
|
+
) {
|
|
154
|
+
metal::float4 _fragColor = {};
|
|
155
|
+
metal::float2 _uv_1 = {};
|
|
156
|
+
const auto _uv = varyings._uv;
|
|
157
|
+
_uv_1 = _uv;
|
|
158
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
159
|
+
metal::float4 _e3 = _fragColor;
|
|
160
|
+
return main_Output { _e3 };
|
|
161
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// HorizontalClose — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HorizontalClose.glsl
|
|
2
|
+
// Author: martiniti
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The incoming image closes in from the top and bottom edges toward the middle
|
|
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 _e15 = uv[0u];
|
|
24
|
+
float _e17 = uv[1u];
|
|
25
|
+
metal::float4 _e20 = _to.sample(_sampler, metal::float2(_e15, 1.0 - _e17), metal::level(0.0));
|
|
26
|
+
return _e20;
|
|
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 _e15 = uv_1[0u];
|
|
35
|
+
float _e17 = uv_1[1u];
|
|
36
|
+
metal::float4 _e20 = _from.sample(_sampler, metal::float2(_e15, 1.0 - _e17), metal::level(0.0));
|
|
37
|
+
return _e20;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
metal::float4 transition(
|
|
41
|
+
thread metal::float2& uv_2,
|
|
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 s = {};
|
|
48
|
+
metal::float2 param = {};
|
|
49
|
+
metal::float2 param_1 = {};
|
|
50
|
+
float _e18 = uv_2[1u];
|
|
51
|
+
float _e21 = uniforms.progress;
|
|
52
|
+
float _e27 = uniforms.progress;
|
|
53
|
+
s = (2.0 - metal::abs((_e18 - 0.5) / (_e21 - 1.0))) - (2.0 * _e27);
|
|
54
|
+
metal::float2 _e30 = uv_2;
|
|
55
|
+
param = _e30;
|
|
56
|
+
metal::float4 _e31 = getFromColor(param, _from, _sampler);
|
|
57
|
+
metal::float2 _e32 = uv_2;
|
|
58
|
+
param_1 = _e32;
|
|
59
|
+
metal::float4 _e33 = getToColor(param_1, _sampler, _to);
|
|
60
|
+
float _e34 = s;
|
|
61
|
+
return metal::mix(_e31, _e33, metal::float4(metal::smoothstep(0.5, 0.0, _e34)));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
void main_1(
|
|
65
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
66
|
+
metal::sampler _sampler,
|
|
67
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
68
|
+
constant Uniforms& uniforms,
|
|
69
|
+
thread metal::float4& _fragColor,
|
|
70
|
+
thread metal::float2& _uv_1
|
|
71
|
+
) {
|
|
72
|
+
metal::float2 param_2 = {};
|
|
73
|
+
metal::float2 _e14 = _uv_1;
|
|
74
|
+
param_2 = _e14;
|
|
75
|
+
metal::float4 _e15 = transition(param_2, _from, _sampler, _to, uniforms);
|
|
76
|
+
_fragColor = _e15;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
struct main_Input {
|
|
81
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
82
|
+
};
|
|
83
|
+
struct main_Output {
|
|
84
|
+
metal::float4 member [[color(0)]];
|
|
85
|
+
};
|
|
86
|
+
fragment main_Output main_(
|
|
87
|
+
main_Input varyings [[stage_in]]
|
|
88
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
89
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
90
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
91
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
92
|
+
) {
|
|
93
|
+
metal::float4 _fragColor = {};
|
|
94
|
+
metal::float2 _uv_1 = {};
|
|
95
|
+
const auto _uv = varyings._uv;
|
|
96
|
+
_uv_1 = _uv;
|
|
97
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
98
|
+
metal::float4 _e3 = _fragColor;
|
|
99
|
+
return main_Output { _e3 };
|
|
100
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// HorizontalOpen — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/HorizontalOpen.glsl
|
|
2
|
+
// Author: martiniti
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The incoming image opens from a line in the middle toward the top and bottom edges
|
|
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 _e15 = uv[0u];
|
|
24
|
+
float _e17 = uv[1u];
|
|
25
|
+
metal::float4 _e20 = _to.sample(_sampler, metal::float2(_e15, 1.0 - _e17), metal::level(0.0));
|
|
26
|
+
return _e20;
|
|
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 _e15 = uv_1[0u];
|
|
35
|
+
float _e17 = uv_1[1u];
|
|
36
|
+
metal::float4 _e20 = _from.sample(_sampler, metal::float2(_e15, 1.0 - _e17), metal::level(0.0));
|
|
37
|
+
return _e20;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
metal::float4 transition(
|
|
41
|
+
thread metal::float2& uv_2,
|
|
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 regress = {};
|
|
48
|
+
float s = {};
|
|
49
|
+
metal::float2 param = {};
|
|
50
|
+
metal::float2 param_1 = {};
|
|
51
|
+
float _e19 = uniforms.progress;
|
|
52
|
+
regress = 1.0 - _e19;
|
|
53
|
+
float _e22 = uv_2[1u];
|
|
54
|
+
float _e24 = regress;
|
|
55
|
+
float _e29 = regress;
|
|
56
|
+
s = (2.0 - metal::abs((_e22 - 0.5) / (_e24 - 1.0))) - (2.0 * _e29);
|
|
57
|
+
metal::float2 _e32 = uv_2;
|
|
58
|
+
param = _e32;
|
|
59
|
+
metal::float4 _e33 = getFromColor(param, _from, _sampler);
|
|
60
|
+
metal::float2 _e34 = uv_2;
|
|
61
|
+
param_1 = _e34;
|
|
62
|
+
metal::float4 _e35 = getToColor(param_1, _sampler, _to);
|
|
63
|
+
float _e36 = s;
|
|
64
|
+
return metal::mix(_e33, _e35, metal::float4(metal::smoothstep(0.0, 0.5, _e36)));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
void main_1(
|
|
68
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
69
|
+
metal::sampler _sampler,
|
|
70
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
71
|
+
constant Uniforms& uniforms,
|
|
72
|
+
thread metal::float4& _fragColor,
|
|
73
|
+
thread metal::float2& _uv_1
|
|
74
|
+
) {
|
|
75
|
+
metal::float2 param_2 = {};
|
|
76
|
+
metal::float2 _e14 = _uv_1;
|
|
77
|
+
param_2 = _e14;
|
|
78
|
+
metal::float4 _e15 = transition(param_2, _from, _sampler, _to, uniforms);
|
|
79
|
+
_fragColor = _e15;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
struct main_Input {
|
|
84
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
85
|
+
};
|
|
86
|
+
struct main_Output {
|
|
87
|
+
metal::float4 member [[color(0)]];
|
|
88
|
+
};
|
|
89
|
+
fragment main_Output main_(
|
|
90
|
+
main_Input varyings [[stage_in]]
|
|
91
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
92
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
93
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
94
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
95
|
+
) {
|
|
96
|
+
metal::float4 _fragColor = {};
|
|
97
|
+
metal::float2 _uv_1 = {};
|
|
98
|
+
const auto _uv = varyings._uv;
|
|
99
|
+
_uv_1 = _uv;
|
|
100
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
101
|
+
metal::float4 _e3 = _fragColor;
|
|
102
|
+
return main_Output { _e3 };
|
|
103
|
+
}
|