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,157 @@
|
|
|
1
|
+
// kaleidoscope — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/kaleidoscope.glsl
|
|
2
|
+
// Author: nwoeanhinnogaehr
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: A crossfade through a spinning kaleidoscope
|
|
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 speed;
|
|
17
|
+
float angle;
|
|
18
|
+
float power;
|
|
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 _e21 = uv[0u];
|
|
27
|
+
float _e23 = uv[1u];
|
|
28
|
+
metal::float4 _e26 = _to.sample(_sampler, metal::float2(_e21, 1.0 - _e23), metal::level(0.0));
|
|
29
|
+
return _e26;
|
|
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 _e21 = uv_1[0u];
|
|
38
|
+
float _e23 = uv_1[1u];
|
|
39
|
+
metal::float4 _e26 = _from.sample(_sampler, metal::float2(_e21, 1.0 - _e23), metal::level(0.0));
|
|
40
|
+
return _e26;
|
|
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 p = {};
|
|
51
|
+
metal::float2 q = {};
|
|
52
|
+
float t = {};
|
|
53
|
+
int i = {};
|
|
54
|
+
metal::float2 param = {};
|
|
55
|
+
metal::float2 param_1 = {};
|
|
56
|
+
metal::float2 param_2 = {};
|
|
57
|
+
metal::float2 param_3 = {};
|
|
58
|
+
metal::float2 _e28 = uv_2;
|
|
59
|
+
p = _e28 / metal::float2(1.0, 1.0);
|
|
60
|
+
metal::float2 _e30 = p;
|
|
61
|
+
q = _e30;
|
|
62
|
+
float _e32 = uniforms.progress;
|
|
63
|
+
float _e34 = uniforms.power;
|
|
64
|
+
float _e37 = uniforms.speed;
|
|
65
|
+
t = metal::pow(_e32, _e34) * _e37;
|
|
66
|
+
metal::float2 _e39 = p;
|
|
67
|
+
p = _e39 - metal::float2(0.5);
|
|
68
|
+
i = 0;
|
|
69
|
+
uint2 loop_bound = uint2(4294967295u);
|
|
70
|
+
bool loop_init = true;
|
|
71
|
+
while(true) {
|
|
72
|
+
if (metal::all(loop_bound == uint2(0u))) { break; }
|
|
73
|
+
loop_bound -= uint2(loop_bound.y == 0u, 1u);
|
|
74
|
+
if (!loop_init) {
|
|
75
|
+
int _e80 = i;
|
|
76
|
+
i = as_type<int>(as_type<uint>(_e80) + as_type<uint>(1));
|
|
77
|
+
}
|
|
78
|
+
loop_init = false;
|
|
79
|
+
int _e42 = i;
|
|
80
|
+
if (_e42 < 7) {
|
|
81
|
+
float _e44 = t;
|
|
82
|
+
float _e47 = p[0u];
|
|
83
|
+
float _e49 = t;
|
|
84
|
+
float _e52 = p[1u];
|
|
85
|
+
float _e55 = t;
|
|
86
|
+
float _e58 = p[1u];
|
|
87
|
+
float _e60 = t;
|
|
88
|
+
float _e63 = p[0u];
|
|
89
|
+
p = metal::float2((metal::sin(_e44) * _e47) + (metal::cos(_e49) * _e52), (metal::sin(_e55) * _e58) - (metal::cos(_e60) * _e63));
|
|
90
|
+
float _e68 = uniforms.angle;
|
|
91
|
+
float _e69 = t;
|
|
92
|
+
t = _e69 + _e68;
|
|
93
|
+
metal::float2 _e71 = p;
|
|
94
|
+
metal::float2 _e72 = metal::float2(2.0);
|
|
95
|
+
p = metal::abs((_e71 - (metal::floor(_e71 / _e72) * _e72)) - metal::float2(1.0));
|
|
96
|
+
continue;
|
|
97
|
+
} else {
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
metal::float2 _e82 = p;
|
|
102
|
+
metal::float2 _e83 = metal::float2(1.0);
|
|
103
|
+
metal::float2 _e89 = q;
|
|
104
|
+
param = _e89;
|
|
105
|
+
metal::float4 _e90 = getFromColor(param, _from, _sampler);
|
|
106
|
+
metal::float2 _e91 = q;
|
|
107
|
+
param_1 = _e91;
|
|
108
|
+
metal::float4 _e92 = getToColor(param_1, _sampler, _to);
|
|
109
|
+
float _e94 = uniforms.progress;
|
|
110
|
+
metal::float2 _e97 = p;
|
|
111
|
+
param_2 = _e97;
|
|
112
|
+
metal::float4 _e98 = getFromColor(param_2, _from, _sampler);
|
|
113
|
+
metal::float2 _e99 = p;
|
|
114
|
+
param_3 = _e99;
|
|
115
|
+
metal::float4 _e100 = getToColor(param_3, _sampler, _to);
|
|
116
|
+
float _e102 = uniforms.progress;
|
|
117
|
+
float _e106 = uniforms.progress;
|
|
118
|
+
return metal::mix(metal::mix(_e90, _e92, metal::float4(_e94)), metal::mix(_e98, _e100, metal::float4(_e102)), metal::float4(1.0 - (2.0 * metal::abs(_e106 - 0.5))));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
void main_1(
|
|
122
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
123
|
+
metal::sampler _sampler,
|
|
124
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
125
|
+
constant Uniforms& uniforms,
|
|
126
|
+
thread metal::float4& _fragColor,
|
|
127
|
+
thread metal::float2& _uv_1
|
|
128
|
+
) {
|
|
129
|
+
metal::float2 param_4 = {};
|
|
130
|
+
metal::float2 _e20 = _uv_1;
|
|
131
|
+
param_4 = _e20;
|
|
132
|
+
metal::float4 _e21 = transition(param_4, _from, _sampler, _to, uniforms);
|
|
133
|
+
_fragColor = _e21;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
struct main_Input {
|
|
138
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
139
|
+
};
|
|
140
|
+
struct main_Output {
|
|
141
|
+
metal::float4 member [[color(0)]];
|
|
142
|
+
};
|
|
143
|
+
fragment main_Output main_(
|
|
144
|
+
main_Input varyings [[stage_in]]
|
|
145
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
146
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
147
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
148
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
149
|
+
) {
|
|
150
|
+
metal::float4 _fragColor = {};
|
|
151
|
+
metal::float2 _uv_1 = {};
|
|
152
|
+
const auto _uv = varyings._uv;
|
|
153
|
+
_uv_1 = _uv;
|
|
154
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
155
|
+
metal::float4 _e3 = _fragColor;
|
|
156
|
+
return main_Output { _e3 };
|
|
157
|
+
}
|
package/msl/luma.metal
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// luma — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/luma.glsl
|
|
2
|
+
// Author: gre
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: A wipe that follows the brightness of a grayscale mask (the luma texture)
|
|
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 _texture_luma(
|
|
19
|
+
thread metal::float2& uv,
|
|
20
|
+
metal::sampler _sampler,
|
|
21
|
+
metal::texture2d<float, metal::access::sample> luma
|
|
22
|
+
) {
|
|
23
|
+
float _e14 = uv[0u];
|
|
24
|
+
float _e16 = uv[1u];
|
|
25
|
+
metal::float4 _e19 = luma.sample(_sampler, metal::float2(_e14, 1.0 - _e16), metal::level(0.0));
|
|
26
|
+
return _e19;
|
|
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 _e14 = uv_1[0u];
|
|
35
|
+
float _e16 = uv_1[1u];
|
|
36
|
+
metal::float4 _e19 = _from.sample(_sampler, metal::float2(_e14, 1.0 - _e16), metal::level(0.0));
|
|
37
|
+
return _e19;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
metal::float4 getToColor(
|
|
41
|
+
thread metal::float2& uv_2,
|
|
42
|
+
metal::sampler _sampler,
|
|
43
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
44
|
+
) {
|
|
45
|
+
float _e14 = uv_2[0u];
|
|
46
|
+
float _e16 = uv_2[1u];
|
|
47
|
+
metal::float4 _e19 = _to.sample(_sampler, metal::float2(_e14, 1.0 - _e16), metal::level(0.0));
|
|
48
|
+
return _e19;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
metal::float4 transition(
|
|
52
|
+
thread metal::float2& uv_3,
|
|
53
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
54
|
+
metal::sampler _sampler,
|
|
55
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
56
|
+
metal::texture2d<float, metal::access::sample> luma,
|
|
57
|
+
constant Uniforms& uniforms
|
|
58
|
+
) {
|
|
59
|
+
metal::float2 param = {};
|
|
60
|
+
metal::float2 param_1 = {};
|
|
61
|
+
metal::float2 param_2 = {};
|
|
62
|
+
metal::float2 _e16 = uv_3;
|
|
63
|
+
param = _e16;
|
|
64
|
+
metal::float4 _e17 = getToColor(param, _sampler, _to);
|
|
65
|
+
metal::float2 _e18 = uv_3;
|
|
66
|
+
param_1 = _e18;
|
|
67
|
+
metal::float4 _e19 = getFromColor(param_1, _from, _sampler);
|
|
68
|
+
float _e21 = uniforms.progress;
|
|
69
|
+
metal::float2 _e22 = uv_3;
|
|
70
|
+
param_2 = _e22;
|
|
71
|
+
metal::float4 _e23 = _texture_luma(param_2, _sampler, luma);
|
|
72
|
+
return metal::mix(_e17, _e19, metal::float4(metal::step(_e21, _e23.x)));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
void main_1(
|
|
76
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
77
|
+
metal::sampler _sampler,
|
|
78
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
79
|
+
metal::texture2d<float, metal::access::sample> luma,
|
|
80
|
+
constant Uniforms& uniforms,
|
|
81
|
+
thread metal::float4& _fragColor,
|
|
82
|
+
thread metal::float2& _uv_1
|
|
83
|
+
) {
|
|
84
|
+
metal::float2 param_3 = {};
|
|
85
|
+
metal::float2 _e13 = _uv_1;
|
|
86
|
+
param_3 = _e13;
|
|
87
|
+
metal::float4 _e14 = transition(param_3, _from, _sampler, _to, luma, uniforms);
|
|
88
|
+
_fragColor = _e14;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
struct main_Input {
|
|
93
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
94
|
+
};
|
|
95
|
+
struct main_Output {
|
|
96
|
+
metal::float4 member [[color(0)]];
|
|
97
|
+
};
|
|
98
|
+
fragment main_Output main_(
|
|
99
|
+
main_Input varyings [[stage_in]]
|
|
100
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
101
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
102
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
103
|
+
, metal::texture2d<float, metal::access::sample> luma [[texture(2)]]
|
|
104
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
105
|
+
) {
|
|
106
|
+
metal::float4 _fragColor = {};
|
|
107
|
+
metal::float2 _uv_1 = {};
|
|
108
|
+
const auto _uv = varyings._uv;
|
|
109
|
+
_uv_1 = _uv;
|
|
110
|
+
main_1(_from, _sampler, _to, luma, uniforms, _fragColor, _uv_1);
|
|
111
|
+
metal::float4 _e3 = _fragColor;
|
|
112
|
+
return main_Output { _e3 };
|
|
113
|
+
}
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
// luminance_melt — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/luminance_melt.glsl
|
|
2
|
+
// Author: 0gust1
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The outgoing image melts away in noisy vertical streaks, depending on its brightness
|
|
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 direction;
|
|
17
|
+
float l_threshold;
|
|
18
|
+
int above;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
float luminance(
|
|
22
|
+
thread metal::float4& color
|
|
23
|
+
) {
|
|
24
|
+
float _e44 = color[0u];
|
|
25
|
+
float _e47 = color[1u];
|
|
26
|
+
float _e51 = color[2u];
|
|
27
|
+
return ((_e44 * 0.299) + (_e47 * 0.587)) + (_e51 * 0.114);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
float rand(
|
|
31
|
+
thread metal::float2& co
|
|
32
|
+
) {
|
|
33
|
+
metal::float2 _e43 = co;
|
|
34
|
+
return metal::fract(metal::sin(metal::dot(_e43, metal::float2(12.9898, 78.233))) * 43758.547);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
metal::float3 mod289_u0028_vf3_u003b(
|
|
38
|
+
thread metal::float3& x
|
|
39
|
+
) {
|
|
40
|
+
metal::float3 _e43 = x;
|
|
41
|
+
metal::float3 _e44 = x;
|
|
42
|
+
return _e43 - (metal::floor(_e44 * 0.0034602077) * 289.0);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
metal::float3 permute(
|
|
46
|
+
thread metal::float3& x_1
|
|
47
|
+
) {
|
|
48
|
+
metal::float3 param = {};
|
|
49
|
+
metal::float3 _e44 = x_1;
|
|
50
|
+
metal::float3 _e48 = x_1;
|
|
51
|
+
param = ((_e44 * 34.0) + metal::float3(1.0)) * _e48;
|
|
52
|
+
metal::float3 _e50 = mod289_u0028_vf3_u003b(param);
|
|
53
|
+
return _e50;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
metal::float2 mod289_u0028_vf2_u003b(
|
|
57
|
+
thread metal::float2& x_2
|
|
58
|
+
) {
|
|
59
|
+
metal::float2 _e43 = x_2;
|
|
60
|
+
metal::float2 _e44 = x_2;
|
|
61
|
+
return _e43 - (metal::floor(_e44 * 0.0034602077) * 289.0);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
float snoise(
|
|
65
|
+
thread metal::float2& v
|
|
66
|
+
) {
|
|
67
|
+
metal::float2 i = {};
|
|
68
|
+
metal::float2 x0_ = {};
|
|
69
|
+
metal::float2 i1_ = {};
|
|
70
|
+
metal::float4 x12_ = {};
|
|
71
|
+
metal::float2 param_1 = {};
|
|
72
|
+
metal::float3 p = {};
|
|
73
|
+
metal::float3 param_2 = {};
|
|
74
|
+
metal::float3 param_3 = {};
|
|
75
|
+
metal::float3 m = {};
|
|
76
|
+
metal::float3 x_3 = {};
|
|
77
|
+
metal::float3 h = {};
|
|
78
|
+
metal::float3 ox = {};
|
|
79
|
+
metal::float3 a0_ = {};
|
|
80
|
+
metal::float3 g = {};
|
|
81
|
+
metal::float2 _e57 = v;
|
|
82
|
+
metal::float2 _e58 = v;
|
|
83
|
+
i = metal::floor(_e57 + metal::float2(metal::dot(_e58, metal::float2(0.36602542, 0.36602542))));
|
|
84
|
+
metal::float2 _e63 = v;
|
|
85
|
+
metal::float2 _e64 = i;
|
|
86
|
+
metal::float2 _e66 = i;
|
|
87
|
+
x0_ = (_e63 - _e64) + metal::float2(metal::dot(_e66, metal::float2(0.21132487, 0.21132487)));
|
|
88
|
+
float _e71 = x0_[0u];
|
|
89
|
+
float _e73 = x0_[1u];
|
|
90
|
+
i1_ = metal::select(metal::float2(0.0, 1.0), metal::float2(1.0, 0.0), metal::bool2(_e71 > _e73));
|
|
91
|
+
metal::float2 _e77 = x0_;
|
|
92
|
+
x12_ = _e77.xyxy + metal::float4(0.21132487, 0.21132487, -0.57735026, -0.57735026);
|
|
93
|
+
metal::float2 _e80 = i1_;
|
|
94
|
+
metal::float4 _e81 = x12_;
|
|
95
|
+
metal::float2 _e83 = _e81.xy - _e80;
|
|
96
|
+
x12_[0u] = _e83.x;
|
|
97
|
+
x12_[1u] = _e83.y;
|
|
98
|
+
metal::float2 _e88 = i;
|
|
99
|
+
param_1 = _e88;
|
|
100
|
+
metal::float2 _e89 = mod289_u0028_vf2_u003b(param_1);
|
|
101
|
+
i = _e89;
|
|
102
|
+
float _e91 = i[1u];
|
|
103
|
+
float _e93 = i1_[1u];
|
|
104
|
+
param_2 = metal::float3(_e91) + metal::float3(0.0, _e93, 1.0);
|
|
105
|
+
metal::float3 _e97 = permute(param_2);
|
|
106
|
+
float _e99 = i[0u];
|
|
107
|
+
float _e103 = i1_[0u];
|
|
108
|
+
param_3 = (_e97 + metal::float3(_e99)) + metal::float3(0.0, _e103, 1.0);
|
|
109
|
+
metal::float3 _e106 = permute(param_3);
|
|
110
|
+
p = _e106;
|
|
111
|
+
metal::float2 _e107 = x0_;
|
|
112
|
+
metal::float2 _e108 = x0_;
|
|
113
|
+
metal::float4 _e110 = x12_;
|
|
114
|
+
metal::float4 _e112 = x12_;
|
|
115
|
+
metal::float4 _e115 = x12_;
|
|
116
|
+
metal::float4 _e117 = x12_;
|
|
117
|
+
m = metal::max(metal::float3(0.5) - metal::float3(metal::dot(_e107, _e108), metal::dot(_e110.xy, _e112.xy), metal::dot(_e115.zw, _e117.zw)), metal::float3(0.0));
|
|
118
|
+
metal::float3 _e125 = m;
|
|
119
|
+
metal::float3 _e126 = m;
|
|
120
|
+
m = _e125 * _e126;
|
|
121
|
+
metal::float3 _e128 = m;
|
|
122
|
+
metal::float3 _e129 = m;
|
|
123
|
+
m = _e128 * _e129;
|
|
124
|
+
metal::float3 _e131 = p;
|
|
125
|
+
x_3 = (metal::fract(_e131 * metal::float3(0.024390243, 0.024390243, 0.024390243)) * 2.0) - metal::float3(1.0);
|
|
126
|
+
metal::float3 _e137 = x_3;
|
|
127
|
+
h = metal::abs(_e137) - metal::float3(0.5);
|
|
128
|
+
metal::float3 _e141 = x_3;
|
|
129
|
+
ox = metal::floor(_e141 + metal::float3(0.5));
|
|
130
|
+
metal::float3 _e145 = x_3;
|
|
131
|
+
metal::float3 _e146 = ox;
|
|
132
|
+
a0_ = _e145 - _e146;
|
|
133
|
+
metal::float3 _e148 = a0_;
|
|
134
|
+
metal::float3 _e149 = a0_;
|
|
135
|
+
metal::float3 _e151 = h;
|
|
136
|
+
metal::float3 _e152 = h;
|
|
137
|
+
metal::float3 _e158 = m;
|
|
138
|
+
m = _e158 * (metal::float3(1.7928429) - (((_e148 * _e149) + (_e151 * _e152)) * 0.85373473));
|
|
139
|
+
float _e161 = a0_[0u];
|
|
140
|
+
float _e163 = x0_[0u];
|
|
141
|
+
float _e166 = h[0u];
|
|
142
|
+
float _e168 = x0_[1u];
|
|
143
|
+
g[0u] = (_e161 * _e163) + (_e166 * _e168);
|
|
144
|
+
metal::float3 _e172 = a0_;
|
|
145
|
+
metal::float4 _e174 = x12_;
|
|
146
|
+
metal::float3 _e177 = h;
|
|
147
|
+
metal::float4 _e179 = x12_;
|
|
148
|
+
metal::float2 _e182 = (_e172.yz * _e174.xz) + (_e177.yz * _e179.yw);
|
|
149
|
+
g[1u] = _e182.x;
|
|
150
|
+
g[2u] = _e182.y;
|
|
151
|
+
metal::float3 _e187 = m;
|
|
152
|
+
metal::float3 _e188 = g;
|
|
153
|
+
return 130.0 * metal::dot(_e187, _e188);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
metal::float4 getToColor(
|
|
157
|
+
thread metal::float2& uv,
|
|
158
|
+
metal::sampler _sampler,
|
|
159
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
160
|
+
) {
|
|
161
|
+
float _e44 = uv[0u];
|
|
162
|
+
float _e46 = uv[1u];
|
|
163
|
+
metal::float4 _e49 = _to.sample(_sampler, metal::float2(_e44, 1.0 - _e46), metal::level(0.0));
|
|
164
|
+
return _e49;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
metal::float4 getFromColor(
|
|
168
|
+
thread metal::float2& uv_1,
|
|
169
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
170
|
+
metal::sampler _sampler
|
|
171
|
+
) {
|
|
172
|
+
float _e44 = uv_1[0u];
|
|
173
|
+
float _e46 = uv_1[1u];
|
|
174
|
+
metal::float4 _e49 = _from.sample(_sampler, metal::float2(_e44, 1.0 - _e46), metal::level(0.0));
|
|
175
|
+
return _e49;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
metal::float4 transition(
|
|
179
|
+
thread metal::float2& uv_2,
|
|
180
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
181
|
+
metal::sampler _sampler,
|
|
182
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
183
|
+
constant Uniforms& uniforms
|
|
184
|
+
) {
|
|
185
|
+
metal::float2 center = {};
|
|
186
|
+
metal::float2 p_1 = {};
|
|
187
|
+
metal::float2 param_4 = {};
|
|
188
|
+
metal::float2 param_5 = {};
|
|
189
|
+
float x_4 = {};
|
|
190
|
+
float dist = {};
|
|
191
|
+
metal::float2 param_6 = {};
|
|
192
|
+
float r = {};
|
|
193
|
+
metal::float2 param_7 = {};
|
|
194
|
+
float m_1 = {};
|
|
195
|
+
metal::float2 param_8 = {};
|
|
196
|
+
metal::float4 param_9 = {};
|
|
197
|
+
float local = {};
|
|
198
|
+
metal::float2 param_10 = {};
|
|
199
|
+
metal::float4 param_11 = {};
|
|
200
|
+
float local_1 = {};
|
|
201
|
+
metal::float2 param_12 = {};
|
|
202
|
+
metal::float2 param_13 = {};
|
|
203
|
+
bool phi_392_ = {};
|
|
204
|
+
bool phi_420_ = {};
|
|
205
|
+
int _e62 = uniforms.direction;
|
|
206
|
+
center = metal::float2(1.0, (_e62 != 0) ? 1.0 : 0.0);
|
|
207
|
+
metal::float2 _e66 = uv_2;
|
|
208
|
+
p_1 = _e66 / metal::float2(1.0, 1.0);
|
|
209
|
+
float _e69 = uniforms.progress;
|
|
210
|
+
if (_e69 == 0.0) {
|
|
211
|
+
metal::float2 _e71 = p_1;
|
|
212
|
+
param_4 = _e71;
|
|
213
|
+
metal::float4 _e72 = getFromColor(param_4, _from, _sampler);
|
|
214
|
+
return _e72;
|
|
215
|
+
} else {
|
|
216
|
+
float _e74 = uniforms.progress;
|
|
217
|
+
if (_e74 == 1.0) {
|
|
218
|
+
metal::float2 _e76 = p_1;
|
|
219
|
+
param_5 = _e76;
|
|
220
|
+
metal::float4 _e77 = getToColor(param_5, _sampler, _to);
|
|
221
|
+
return _e77;
|
|
222
|
+
} else {
|
|
223
|
+
float _e79 = uniforms.progress;
|
|
224
|
+
x_4 = _e79;
|
|
225
|
+
metal::float2 _e80 = center;
|
|
226
|
+
metal::float2 _e81 = p_1;
|
|
227
|
+
float _e84 = uniforms.progress;
|
|
228
|
+
float _e86 = p_1[0u];
|
|
229
|
+
param_6 = metal::float2(_e86, 0.0);
|
|
230
|
+
float _e88 = snoise(param_6);
|
|
231
|
+
dist = metal::distance(_e80, _e81) - (_e84 * metal::exp(_e88));
|
|
232
|
+
float _e92 = x_4;
|
|
233
|
+
float _e94 = p_1[0u];
|
|
234
|
+
param_7 = metal::float2(_e94, 0.1);
|
|
235
|
+
float _e96 = rand(param_7);
|
|
236
|
+
r = _e92 - _e96;
|
|
237
|
+
int _e99 = uniforms.above;
|
|
238
|
+
if (_e99 != 0) {
|
|
239
|
+
float _e101 = dist;
|
|
240
|
+
float _e102 = r;
|
|
241
|
+
bool _e103 = _e101 <= _e102;
|
|
242
|
+
phi_392_ = _e103;
|
|
243
|
+
if (_e103) {
|
|
244
|
+
metal::float2 _e104 = p_1;
|
|
245
|
+
param_8 = _e104;
|
|
246
|
+
metal::float4 _e105 = getFromColor(param_8, _from, _sampler);
|
|
247
|
+
param_9 = _e105;
|
|
248
|
+
float _e106 = luminance(param_9);
|
|
249
|
+
float _e108 = uniforms.l_threshold;
|
|
250
|
+
phi_392_ = _e106 > _e108;
|
|
251
|
+
}
|
|
252
|
+
bool _e111 = phi_392_;
|
|
253
|
+
if (_e111) {
|
|
254
|
+
local = 1.0;
|
|
255
|
+
} else {
|
|
256
|
+
float _e113 = uniforms.progress;
|
|
257
|
+
float _e115 = uniforms.progress;
|
|
258
|
+
float _e118 = uniforms.progress;
|
|
259
|
+
local = (_e113 * _e115) * _e118;
|
|
260
|
+
}
|
|
261
|
+
float _e120 = local;
|
|
262
|
+
m_1 = _e120;
|
|
263
|
+
} else {
|
|
264
|
+
float _e121 = dist;
|
|
265
|
+
float _e122 = r;
|
|
266
|
+
bool _e123 = _e121 <= _e122;
|
|
267
|
+
phi_420_ = _e123;
|
|
268
|
+
if (_e123) {
|
|
269
|
+
metal::float2 _e124 = p_1;
|
|
270
|
+
param_10 = _e124;
|
|
271
|
+
metal::float4 _e125 = getFromColor(param_10, _from, _sampler);
|
|
272
|
+
param_11 = _e125;
|
|
273
|
+
float _e126 = luminance(param_11);
|
|
274
|
+
float _e128 = uniforms.l_threshold;
|
|
275
|
+
phi_420_ = _e126 < _e128;
|
|
276
|
+
}
|
|
277
|
+
bool _e131 = phi_420_;
|
|
278
|
+
if (_e131) {
|
|
279
|
+
local_1 = 1.0;
|
|
280
|
+
} else {
|
|
281
|
+
float _e133 = uniforms.progress;
|
|
282
|
+
float _e135 = uniforms.progress;
|
|
283
|
+
float _e138 = uniforms.progress;
|
|
284
|
+
local_1 = (_e133 * _e135) * _e138;
|
|
285
|
+
}
|
|
286
|
+
float _e140 = local_1;
|
|
287
|
+
m_1 = _e140;
|
|
288
|
+
}
|
|
289
|
+
metal::float2 _e141 = p_1;
|
|
290
|
+
param_12 = _e141;
|
|
291
|
+
metal::float4 _e142 = getFromColor(param_12, _from, _sampler);
|
|
292
|
+
metal::float2 _e143 = p_1;
|
|
293
|
+
param_13 = _e143;
|
|
294
|
+
metal::float4 _e144 = getToColor(param_13, _sampler, _to);
|
|
295
|
+
float _e145 = m_1;
|
|
296
|
+
return metal::mix(_e142, _e144, metal::float4(_e145));
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
void main_1(
|
|
302
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
303
|
+
metal::sampler _sampler,
|
|
304
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
305
|
+
constant Uniforms& uniforms,
|
|
306
|
+
thread metal::float4& _fragColor,
|
|
307
|
+
thread metal::float2& _uv_1
|
|
308
|
+
) {
|
|
309
|
+
metal::float2 param_14 = {};
|
|
310
|
+
metal::float2 _e43 = _uv_1;
|
|
311
|
+
param_14 = _e43;
|
|
312
|
+
metal::float4 _e44 = transition(param_14, _from, _sampler, _to, uniforms);
|
|
313
|
+
_fragColor = _e44;
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
struct main_Input {
|
|
318
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
319
|
+
};
|
|
320
|
+
struct main_Output {
|
|
321
|
+
metal::float4 member [[color(0)]];
|
|
322
|
+
};
|
|
323
|
+
fragment main_Output main_(
|
|
324
|
+
main_Input varyings [[stage_in]]
|
|
325
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
326
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
327
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
328
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
329
|
+
) {
|
|
330
|
+
metal::float4 _fragColor = {};
|
|
331
|
+
metal::float2 _uv_1 = {};
|
|
332
|
+
const auto _uv = varyings._uv;
|
|
333
|
+
_uv_1 = _uv;
|
|
334
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
335
|
+
metal::float4 _e3 = _fragColor;
|
|
336
|
+
return main_Output { _e3 };
|
|
337
|
+
}
|