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
|
+
// LeftRight — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LeftRight.glsl
|
|
2
|
+
// Author: zhmy
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The outgoing image shrinks away to the left while the incoming one slides in from the right
|
|
5
|
+
// Bindings and uniform layout: see the gl-transitions package README
|
|
6
|
+
|
|
7
|
+
// language: metal1.0
|
|
8
|
+
#include <metal_stdlib>
|
|
9
|
+
#include <simd/simd.h>
|
|
10
|
+
|
|
11
|
+
using metal::uint;
|
|
12
|
+
|
|
13
|
+
struct Uniforms {
|
|
14
|
+
float progress;
|
|
15
|
+
float ratio;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
metal::float4 getFromColor(
|
|
19
|
+
thread metal::float2& uv,
|
|
20
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
21
|
+
metal::sampler _sampler
|
|
22
|
+
) {
|
|
23
|
+
float _e24 = uv[0u];
|
|
24
|
+
float _e26 = uv[1u];
|
|
25
|
+
metal::float4 _e29 = _from.sample(_sampler, metal::float2(_e24, 1.0 - _e26), metal::level(0.0));
|
|
26
|
+
return _e29;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
metal::float4 getToColor(
|
|
30
|
+
thread metal::float2& uv_1,
|
|
31
|
+
metal::sampler _sampler,
|
|
32
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
33
|
+
) {
|
|
34
|
+
float _e24 = uv_1[0u];
|
|
35
|
+
float _e26 = uv_1[1u];
|
|
36
|
+
metal::float4 _e29 = _to.sample(_sampler, metal::float2(_e24, 1.0 - _e26), metal::level(0.0));
|
|
37
|
+
return _e29;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
bool inBounds(
|
|
41
|
+
thread metal::float2& p
|
|
42
|
+
) {
|
|
43
|
+
bool phi_74_ = {};
|
|
44
|
+
metal::float2 _e23 = p;
|
|
45
|
+
bool _e25 = metal::all(metal::float2(0.0, 0.0) < _e23);
|
|
46
|
+
phi_74_ = _e25;
|
|
47
|
+
if (_e25) {
|
|
48
|
+
metal::float2 _e26 = p;
|
|
49
|
+
phi_74_ = metal::all(_e26 < metal::float2(1.0, 1.0));
|
|
50
|
+
}
|
|
51
|
+
bool _e30 = phi_74_;
|
|
52
|
+
return _e30;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
metal::float4 transition(
|
|
56
|
+
thread metal::float2& uv_2,
|
|
57
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
58
|
+
metal::sampler _sampler,
|
|
59
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
60
|
+
constant Uniforms& uniforms
|
|
61
|
+
) {
|
|
62
|
+
metal::float2 spto = {};
|
|
63
|
+
float size = {};
|
|
64
|
+
metal::float2 spfr = {};
|
|
65
|
+
metal::float2 param = {};
|
|
66
|
+
metal::float2 param_1 = {};
|
|
67
|
+
metal::float2 param_2 = {};
|
|
68
|
+
metal::float2 param_3 = {};
|
|
69
|
+
spto = metal::float2(-1.0, -1.0);
|
|
70
|
+
float _e31 = uniforms.progress;
|
|
71
|
+
size = metal::mix(1.0, 3.0, _e31 * 0.2);
|
|
72
|
+
metal::float2 _e34 = uv_2;
|
|
73
|
+
float _e36 = size;
|
|
74
|
+
spto = ((_e34 + metal::float2(-0.5, -0.5)) * metal::float2(_e36)) + metal::float2(0.5, 0.5);
|
|
75
|
+
metal::float2 _e40 = uv_2;
|
|
76
|
+
float _e42 = uniforms.progress;
|
|
77
|
+
spfr = _e40 - metal::float2(1.0 - _e42, 0.0);
|
|
78
|
+
metal::float2 _e46 = spfr;
|
|
79
|
+
param = _e46;
|
|
80
|
+
bool _e47 = inBounds(param);
|
|
81
|
+
if (_e47) {
|
|
82
|
+
metal::float2 _e48 = spfr;
|
|
83
|
+
param_1 = _e48;
|
|
84
|
+
metal::float4 _e49 = getToColor(param_1, _sampler, _to);
|
|
85
|
+
return _e49;
|
|
86
|
+
} else {
|
|
87
|
+
metal::float2 _e50 = spto;
|
|
88
|
+
param_2 = _e50;
|
|
89
|
+
bool _e51 = inBounds(param_2);
|
|
90
|
+
if (_e51) {
|
|
91
|
+
metal::float2 _e52 = spto;
|
|
92
|
+
param_3 = _e52;
|
|
93
|
+
metal::float4 _e53 = getFromColor(param_3, _from, _sampler);
|
|
94
|
+
float _e55 = uniforms.progress;
|
|
95
|
+
return _e53 * (1.0 - _e55);
|
|
96
|
+
} else {
|
|
97
|
+
return metal::float4(0.0, 0.0, 0.0, 1.0);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
void main_1(
|
|
103
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
104
|
+
metal::sampler _sampler,
|
|
105
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
106
|
+
constant Uniforms& uniforms,
|
|
107
|
+
thread metal::float4& _fragColor,
|
|
108
|
+
thread metal::float2& _uv_1
|
|
109
|
+
) {
|
|
110
|
+
metal::float2 param_4 = {};
|
|
111
|
+
metal::float2 _e23 = _uv_1;
|
|
112
|
+
param_4 = _e23;
|
|
113
|
+
metal::float4 _e24 = transition(param_4, _from, _sampler, _to, uniforms);
|
|
114
|
+
_fragColor = _e24;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
struct main_Input {
|
|
119
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
120
|
+
};
|
|
121
|
+
struct main_Output {
|
|
122
|
+
metal::float4 member [[color(0)]];
|
|
123
|
+
};
|
|
124
|
+
fragment main_Output main_(
|
|
125
|
+
main_Input varyings [[stage_in]]
|
|
126
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
127
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
128
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
129
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
130
|
+
) {
|
|
131
|
+
metal::float4 _fragColor = {};
|
|
132
|
+
metal::float2 _uv_1 = {};
|
|
133
|
+
const auto _uv = varyings._uv;
|
|
134
|
+
_uv_1 = _uv;
|
|
135
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
136
|
+
metal::float4 _e3 = _fragColor;
|
|
137
|
+
return main_Output { _e3 };
|
|
138
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// LinearBlur — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/LinearBlur.glsl
|
|
2
|
+
// Author: gre
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: A crossfade through a blur
|
|
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 intensity;
|
|
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 _e20 = uv[0u];
|
|
25
|
+
float _e22 = uv[1u];
|
|
26
|
+
metal::float4 _e25 = _to.sample(_sampler, metal::float2(_e20, 1.0 - _e22), metal::level(0.0));
|
|
27
|
+
return _e25;
|
|
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 _e20 = uv_1[0u];
|
|
36
|
+
float _e22 = uv_1[1u];
|
|
37
|
+
metal::float4 _e25 = _from.sample(_sampler, metal::float2(_e20, 1.0 - _e22), metal::level(0.0));
|
|
38
|
+
return _e25;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
metal::float4 transition(
|
|
42
|
+
thread metal::float2& uv_2,
|
|
43
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
44
|
+
metal::sampler _sampler,
|
|
45
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
46
|
+
constant Uniforms& uniforms
|
|
47
|
+
) {
|
|
48
|
+
metal::float4 c1_ = {};
|
|
49
|
+
metal::float4 c2_ = {};
|
|
50
|
+
float disp = {};
|
|
51
|
+
int xi = {};
|
|
52
|
+
float x = {};
|
|
53
|
+
int yi = {};
|
|
54
|
+
float y = {};
|
|
55
|
+
metal::float2 v = {};
|
|
56
|
+
float d = {};
|
|
57
|
+
metal::float2 param = {};
|
|
58
|
+
metal::float2 param_1 = {};
|
|
59
|
+
c1_ = metal::float4(0.0, 0.0, 0.0, 0.0);
|
|
60
|
+
c2_ = metal::float4(0.0, 0.0, 0.0, 0.0);
|
|
61
|
+
float _e31 = uniforms.intensity;
|
|
62
|
+
float _e33 = uniforms.progress;
|
|
63
|
+
disp = _e31 * (0.5 - metal::abs(0.5 - _e33));
|
|
64
|
+
xi = 0;
|
|
65
|
+
uint2 loop_bound = uint2(4294967295u);
|
|
66
|
+
bool loop_init = true;
|
|
67
|
+
while(true) {
|
|
68
|
+
if (metal::all(loop_bound == uint2(0u))) { break; }
|
|
69
|
+
loop_bound -= uint2(loop_bound.y == 0u, 1u);
|
|
70
|
+
if (!loop_init) {
|
|
71
|
+
int _e71 = xi;
|
|
72
|
+
xi = as_type<int>(as_type<uint>(_e71) + as_type<uint>(1));
|
|
73
|
+
}
|
|
74
|
+
loop_init = false;
|
|
75
|
+
int _e37 = xi;
|
|
76
|
+
if (_e37 < 6) {
|
|
77
|
+
int _e39 = xi;
|
|
78
|
+
x = (static_cast<float>(_e39) / 6.0) - 0.5;
|
|
79
|
+
yi = 0;
|
|
80
|
+
uint2 loop_bound_1 = uint2(4294967295u);
|
|
81
|
+
bool loop_init_1 = true;
|
|
82
|
+
while(true) {
|
|
83
|
+
if (metal::all(loop_bound_1 == uint2(0u))) { break; }
|
|
84
|
+
loop_bound_1 -= uint2(loop_bound_1.y == 0u, 1u);
|
|
85
|
+
if (!loop_init_1) {
|
|
86
|
+
int _e69 = yi;
|
|
87
|
+
yi = as_type<int>(as_type<uint>(_e69) + as_type<uint>(1));
|
|
88
|
+
}
|
|
89
|
+
loop_init_1 = false;
|
|
90
|
+
int _e43 = yi;
|
|
91
|
+
if (_e43 < 6) {
|
|
92
|
+
int _e45 = yi;
|
|
93
|
+
y = (static_cast<float>(_e45) / 6.0) - 0.5;
|
|
94
|
+
float _e49 = x;
|
|
95
|
+
float _e50 = y;
|
|
96
|
+
v = metal::float2(_e49, _e50);
|
|
97
|
+
float _e52 = disp;
|
|
98
|
+
d = _e52;
|
|
99
|
+
metal::float2 _e53 = uv_2;
|
|
100
|
+
float _e54 = d;
|
|
101
|
+
metal::float2 _e55 = v;
|
|
102
|
+
param = _e53 + (_e55 * _e54);
|
|
103
|
+
metal::float4 _e58 = getFromColor(param, _from, _sampler);
|
|
104
|
+
metal::float4 _e59 = c1_;
|
|
105
|
+
c1_ = _e59 + _e58;
|
|
106
|
+
metal::float2 _e61 = uv_2;
|
|
107
|
+
float _e62 = d;
|
|
108
|
+
metal::float2 _e63 = v;
|
|
109
|
+
param_1 = _e61 + (_e63 * _e62);
|
|
110
|
+
metal::float4 _e66 = getToColor(param_1, _sampler, _to);
|
|
111
|
+
metal::float4 _e67 = c2_;
|
|
112
|
+
c2_ = _e67 + _e66;
|
|
113
|
+
continue;
|
|
114
|
+
} else {
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
continue;
|
|
119
|
+
} else {
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
metal::float4 _e73 = c1_;
|
|
124
|
+
c1_ = _e73 / metal::float4(36.0);
|
|
125
|
+
metal::float4 _e76 = c2_;
|
|
126
|
+
c2_ = _e76 / metal::float4(36.0);
|
|
127
|
+
metal::float4 _e79 = c1_;
|
|
128
|
+
metal::float4 _e80 = c2_;
|
|
129
|
+
float _e82 = uniforms.progress;
|
|
130
|
+
return metal::mix(_e79, _e80, metal::float4(_e82));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
void main_1(
|
|
134
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
135
|
+
metal::sampler _sampler,
|
|
136
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
137
|
+
constant Uniforms& uniforms,
|
|
138
|
+
thread metal::float4& _fragColor,
|
|
139
|
+
thread metal::float2& _uv_1
|
|
140
|
+
) {
|
|
141
|
+
metal::float2 param_2 = {};
|
|
142
|
+
metal::float2 _e19 = _uv_1;
|
|
143
|
+
param_2 = _e19;
|
|
144
|
+
metal::float4 _e20 = transition(param_2, _from, _sampler, _to, uniforms);
|
|
145
|
+
_fragColor = _e20;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
struct main_Input {
|
|
150
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
151
|
+
};
|
|
152
|
+
struct main_Output {
|
|
153
|
+
metal::float4 member [[color(0)]];
|
|
154
|
+
};
|
|
155
|
+
fragment main_Output main_(
|
|
156
|
+
main_Input varyings [[stage_in]]
|
|
157
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
158
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
159
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
160
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
161
|
+
) {
|
|
162
|
+
metal::float4 _fragColor = {};
|
|
163
|
+
metal::float2 _uv_1 = {};
|
|
164
|
+
const auto _uv = varyings._uv;
|
|
165
|
+
_uv_1 = _uv;
|
|
166
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
167
|
+
metal::float4 _e3 = _fragColor;
|
|
168
|
+
return main_Output { _e3 };
|
|
169
|
+
}
|
package/msl/Mosaic.metal
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
// Mosaic — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Mosaic.glsl
|
|
2
|
+
// Author: Xaychru
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: The view pans across a mosaic of rotated tiles from both images and settles on the incoming one
|
|
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 endx;
|
|
17
|
+
int endy;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
metal::float4 getFromColor(
|
|
21
|
+
thread metal::float2& uv,
|
|
22
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
23
|
+
metal::sampler _sampler
|
|
24
|
+
) {
|
|
25
|
+
float _e26 = uv[0u];
|
|
26
|
+
float _e28 = uv[1u];
|
|
27
|
+
metal::float4 _e31 = _from.sample(_sampler, metal::float2(_e26, 1.0 - _e28), metal::level(0.0));
|
|
28
|
+
return _e31;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
metal::float4 getToColor(
|
|
32
|
+
thread metal::float2& uv_1,
|
|
33
|
+
metal::sampler _sampler,
|
|
34
|
+
metal::texture2d<float, metal::access::sample> _to
|
|
35
|
+
) {
|
|
36
|
+
float _e26 = uv_1[0u];
|
|
37
|
+
float _e28 = uv_1[1u];
|
|
38
|
+
metal::float4 _e31 = _to.sample(_sampler, metal::float2(_e26, 1.0 - _e28), metal::level(0.0));
|
|
39
|
+
return _e31;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
metal::float2 Rotate(
|
|
43
|
+
thread metal::float2& v,
|
|
44
|
+
thread float& a
|
|
45
|
+
) {
|
|
46
|
+
metal::float2x2 rm = {};
|
|
47
|
+
float _e27 = a;
|
|
48
|
+
float _e29 = a;
|
|
49
|
+
float _e32 = a;
|
|
50
|
+
float _e34 = a;
|
|
51
|
+
rm = metal::float2x2(metal::float2(metal::cos(_e27), -(metal::sin(_e29))), metal::float2(metal::sin(_e32), metal::cos(_e34)));
|
|
52
|
+
metal::float2x2 _e39 = rm;
|
|
53
|
+
metal::float2 _e40 = v;
|
|
54
|
+
return _e39 * _e40;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
float Rand(
|
|
58
|
+
thread metal::float2& v_1
|
|
59
|
+
) {
|
|
60
|
+
metal::float2 _e25 = v_1;
|
|
61
|
+
return metal::fract(metal::sin(metal::dot(_e25, metal::float2(12.9898, 78.233))) * 43758.547);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
float CosInterpolation(
|
|
65
|
+
thread float& x
|
|
66
|
+
) {
|
|
67
|
+
float _e25 = x;
|
|
68
|
+
return (-(metal::cos(_e25 * 3.1415927)) / 2.0) + 0.5;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
int naga_f2i32(float value) {
|
|
72
|
+
return static_cast<int>(metal::clamp(value, -2147483600.0, 2147483500.0));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
metal::float4 transition(
|
|
76
|
+
thread metal::float2& uv_2,
|
|
77
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
78
|
+
metal::sampler _sampler,
|
|
79
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
80
|
+
constant Uniforms& uniforms
|
|
81
|
+
) {
|
|
82
|
+
metal::float2 p = {};
|
|
83
|
+
metal::float2 rp = {};
|
|
84
|
+
float rpr = {};
|
|
85
|
+
float z = {};
|
|
86
|
+
float az = {};
|
|
87
|
+
float param = {};
|
|
88
|
+
float param_1 = {};
|
|
89
|
+
metal::float2 mrp = {};
|
|
90
|
+
metal::float2 crp = {};
|
|
91
|
+
bool onEnd = {};
|
|
92
|
+
float ang = {};
|
|
93
|
+
metal::float2 param_2 = {};
|
|
94
|
+
metal::float2 param_3 = {};
|
|
95
|
+
float param_4 = {};
|
|
96
|
+
metal::float2 param_5 = {};
|
|
97
|
+
metal::float2 param_6 = {};
|
|
98
|
+
metal::float2 param_7 = {};
|
|
99
|
+
bool phi_197_ = {};
|
|
100
|
+
bool phi_229_ = {};
|
|
101
|
+
metal::float2 _e42 = uv_2;
|
|
102
|
+
p = (_e42 / metal::float2(1.0, 1.0)) - metal::float2(0.5);
|
|
103
|
+
metal::float2 _e46 = p;
|
|
104
|
+
rp = _e46;
|
|
105
|
+
float _e48 = uniforms.progress;
|
|
106
|
+
rpr = (_e48 * 2.0) - 1.0;
|
|
107
|
+
float _e51 = rpr;
|
|
108
|
+
float _e52 = rpr;
|
|
109
|
+
z = -(((_e51 * _e52) * 2.0)) + 3.0;
|
|
110
|
+
float _e57 = z;
|
|
111
|
+
az = metal::abs(_e57);
|
|
112
|
+
float _e59 = az;
|
|
113
|
+
metal::float2 _e60 = rp;
|
|
114
|
+
rp = _e60 * _e59;
|
|
115
|
+
int _e63 = uniforms.endx;
|
|
116
|
+
int _e67 = uniforms.endy;
|
|
117
|
+
float _e72 = uniforms.progress;
|
|
118
|
+
param = _e72;
|
|
119
|
+
float _e73 = CosInterpolation(param);
|
|
120
|
+
float _e75 = uniforms.progress;
|
|
121
|
+
param_1 = _e75;
|
|
122
|
+
float _e76 = CosInterpolation(param_1);
|
|
123
|
+
metal::float2 _e80 = rp;
|
|
124
|
+
rp = _e80 + metal::mix(metal::float2(0.5, 0.5), metal::float2(static_cast<float>(_e63) + 0.5, static_cast<float>(_e67) + 0.5), metal::float2(_e73 * _e76));
|
|
125
|
+
metal::float2 _e82 = rp;
|
|
126
|
+
metal::float2 _e83 = metal::float2(1.0);
|
|
127
|
+
mrp = _e82 - (metal::floor(_e82 / _e83) * _e83);
|
|
128
|
+
metal::float2 _e88 = rp;
|
|
129
|
+
crp = _e88;
|
|
130
|
+
float _e90 = crp[0u];
|
|
131
|
+
int _e94 = uniforms.endx;
|
|
132
|
+
bool _e95 = naga_f2i32(metal::floor(_e90)) == _e94;
|
|
133
|
+
phi_197_ = _e95;
|
|
134
|
+
if (_e95) {
|
|
135
|
+
float _e97 = crp[1u];
|
|
136
|
+
int _e101 = uniforms.endy;
|
|
137
|
+
phi_197_ = naga_f2i32(metal::floor(_e97)) == _e101;
|
|
138
|
+
}
|
|
139
|
+
bool _e104 = phi_197_;
|
|
140
|
+
onEnd = _e104;
|
|
141
|
+
bool _e105 = onEnd;
|
|
142
|
+
if (!(_e105)) {
|
|
143
|
+
metal::float2 _e107 = crp;
|
|
144
|
+
param_2 = metal::floor(_e107);
|
|
145
|
+
float _e109 = Rand(param_2);
|
|
146
|
+
ang = (static_cast<float>(naga_f2i32(_e109 * 4.0)) * 0.5) * 3.1415927;
|
|
147
|
+
metal::float2 _e115 = mrp;
|
|
148
|
+
param_3 = _e115 - metal::float2(0.5, 0.5);
|
|
149
|
+
float _e117 = ang;
|
|
150
|
+
param_4 = _e117;
|
|
151
|
+
metal::float2 _e118 = Rotate(param_3, param_4);
|
|
152
|
+
mrp = metal::float2(0.5, 0.5) + _e118;
|
|
153
|
+
}
|
|
154
|
+
bool _e120 = onEnd;
|
|
155
|
+
phi_229_ = _e120;
|
|
156
|
+
if (!(_e120)) {
|
|
157
|
+
metal::float2 _e122 = crp;
|
|
158
|
+
param_5 = metal::floor(_e122);
|
|
159
|
+
float _e124 = Rand(param_5);
|
|
160
|
+
phi_229_ = _e124 > 0.5;
|
|
161
|
+
}
|
|
162
|
+
bool _e127 = phi_229_;
|
|
163
|
+
if (_e127) {
|
|
164
|
+
metal::float2 _e128 = mrp;
|
|
165
|
+
param_6 = _e128;
|
|
166
|
+
metal::float4 _e129 = getToColor(param_6, _sampler, _to);
|
|
167
|
+
return _e129;
|
|
168
|
+
} else {
|
|
169
|
+
metal::float2 _e130 = mrp;
|
|
170
|
+
param_7 = _e130;
|
|
171
|
+
metal::float4 _e131 = getFromColor(param_7, _from, _sampler);
|
|
172
|
+
return _e131;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
void main_1(
|
|
177
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
178
|
+
metal::sampler _sampler,
|
|
179
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
180
|
+
constant Uniforms& uniforms,
|
|
181
|
+
thread metal::float4& _fragColor,
|
|
182
|
+
thread metal::float2& _uv_1
|
|
183
|
+
) {
|
|
184
|
+
metal::float2 param_8 = {};
|
|
185
|
+
metal::float2 _e25 = _uv_1;
|
|
186
|
+
param_8 = _e25;
|
|
187
|
+
metal::float4 _e26 = transition(param_8, _from, _sampler, _to, uniforms);
|
|
188
|
+
_fragColor = _e26;
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
struct main_Input {
|
|
193
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
194
|
+
};
|
|
195
|
+
struct main_Output {
|
|
196
|
+
metal::float4 member [[color(0)]];
|
|
197
|
+
};
|
|
198
|
+
fragment main_Output main_(
|
|
199
|
+
main_Input varyings [[stage_in]]
|
|
200
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
201
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
202
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
203
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
204
|
+
) {
|
|
205
|
+
metal::float4 _fragColor = {};
|
|
206
|
+
metal::float2 _uv_1 = {};
|
|
207
|
+
const auto _uv = varyings._uv;
|
|
208
|
+
_uv_1 = _uv;
|
|
209
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
210
|
+
metal::float4 _e3 = _fragColor;
|
|
211
|
+
return main_Output { _e3 };
|
|
212
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// Overexposure — MSL, generated from https://github.com/gl-transitions/gl-transitions/blob/master/transitions/Overexposure.glsl
|
|
2
|
+
// Author: Ben Zhang
|
|
3
|
+
// License: MIT
|
|
4
|
+
// Description: A crossfade through a washed-out, overexposed white
|
|
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 strength;
|
|
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 _e17 = uv[0u];
|
|
25
|
+
float _e19 = uv[1u];
|
|
26
|
+
metal::float4 _e22 = _to.sample(_sampler, metal::float2(_e17, 1.0 - _e19), metal::level(0.0));
|
|
27
|
+
return _e22;
|
|
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 _e17 = uv_1[0u];
|
|
36
|
+
float _e19 = uv_1[1u];
|
|
37
|
+
metal::float4 _e22 = _from.sample(_sampler, metal::float2(_e17, 1.0 - _e19), metal::level(0.0));
|
|
38
|
+
return _e22;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
metal::float4 transition(
|
|
42
|
+
thread metal::float2& uv_2,
|
|
43
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
44
|
+
metal::sampler _sampler,
|
|
45
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
46
|
+
constant Uniforms& uniforms
|
|
47
|
+
) {
|
|
48
|
+
metal::float4 from = {};
|
|
49
|
+
metal::float2 param = {};
|
|
50
|
+
metal::float4 to = {};
|
|
51
|
+
metal::float2 param_1 = {};
|
|
52
|
+
float from_m = {};
|
|
53
|
+
float to_m = {};
|
|
54
|
+
metal::float2 _e22 = uv_2;
|
|
55
|
+
param = _e22;
|
|
56
|
+
metal::float4 _e23 = getFromColor(param, _from, _sampler);
|
|
57
|
+
from = _e23;
|
|
58
|
+
metal::float2 _e24 = uv_2;
|
|
59
|
+
param_1 = _e24;
|
|
60
|
+
metal::float4 _e25 = getToColor(param_1, _sampler, _to);
|
|
61
|
+
to = _e25;
|
|
62
|
+
float _e27 = uniforms.progress;
|
|
63
|
+
float _e30 = uniforms.progress;
|
|
64
|
+
float _e34 = uniforms.strength;
|
|
65
|
+
from_m = (1.0 - _e27) + (metal::sin(3.1415927 * _e30) * _e34);
|
|
66
|
+
float _e38 = uniforms.progress;
|
|
67
|
+
float _e40 = uniforms.progress;
|
|
68
|
+
float _e44 = uniforms.strength;
|
|
69
|
+
to_m = _e38 + (metal::sin(3.1415927 * _e40) * _e44);
|
|
70
|
+
float _e48 = from[0u];
|
|
71
|
+
float _e50 = from[3u];
|
|
72
|
+
float _e52 = from_m;
|
|
73
|
+
float _e55 = to[0u];
|
|
74
|
+
float _e57 = to[3u];
|
|
75
|
+
float _e59 = to_m;
|
|
76
|
+
float _e63 = from[1u];
|
|
77
|
+
float _e65 = from[3u];
|
|
78
|
+
float _e67 = from_m;
|
|
79
|
+
float _e70 = to[1u];
|
|
80
|
+
float _e72 = to[3u];
|
|
81
|
+
float _e74 = to_m;
|
|
82
|
+
float _e78 = from[2u];
|
|
83
|
+
float _e80 = from[3u];
|
|
84
|
+
float _e82 = from_m;
|
|
85
|
+
float _e85 = to[2u];
|
|
86
|
+
float _e87 = to[3u];
|
|
87
|
+
float _e89 = to_m;
|
|
88
|
+
float _e93 = from[3u];
|
|
89
|
+
float _e95 = to[3u];
|
|
90
|
+
float _e97 = uniforms.progress;
|
|
91
|
+
return metal::float4(((_e48 * _e50) * _e52) + ((_e55 * _e57) * _e59), ((_e63 * _e65) * _e67) + ((_e70 * _e72) * _e74), ((_e78 * _e80) * _e82) + ((_e85 * _e87) * _e89), metal::mix(_e93, _e95, _e97));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
void main_1(
|
|
95
|
+
metal::texture2d<float, metal::access::sample> _from,
|
|
96
|
+
metal::sampler _sampler,
|
|
97
|
+
metal::texture2d<float, metal::access::sample> _to,
|
|
98
|
+
constant Uniforms& uniforms,
|
|
99
|
+
thread metal::float4& _fragColor,
|
|
100
|
+
thread metal::float2& _uv_1
|
|
101
|
+
) {
|
|
102
|
+
metal::float2 param_2 = {};
|
|
103
|
+
metal::float2 _e16 = _uv_1;
|
|
104
|
+
param_2 = _e16;
|
|
105
|
+
metal::float4 _e17 = transition(param_2, _from, _sampler, _to, uniforms);
|
|
106
|
+
_fragColor = _e17;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
struct main_Input {
|
|
111
|
+
metal::float2 _uv [[user(loc0), center_perspective]];
|
|
112
|
+
};
|
|
113
|
+
struct main_Output {
|
|
114
|
+
metal::float4 member [[color(0)]];
|
|
115
|
+
};
|
|
116
|
+
fragment main_Output main_(
|
|
117
|
+
main_Input varyings [[stage_in]]
|
|
118
|
+
, metal::texture2d<float, metal::access::sample> _from [[texture(0)]]
|
|
119
|
+
, metal::sampler _sampler [[sampler(0)]]
|
|
120
|
+
, metal::texture2d<float, metal::access::sample> _to [[texture(1)]]
|
|
121
|
+
, constant Uniforms& uniforms [[buffer(0)]]
|
|
122
|
+
) {
|
|
123
|
+
metal::float4 _fragColor = {};
|
|
124
|
+
metal::float2 _uv_1 = {};
|
|
125
|
+
const auto _uv = varyings._uv;
|
|
126
|
+
_uv_1 = _uv;
|
|
127
|
+
main_1(_from, _sampler, _to, uniforms, _fragColor, _uv_1);
|
|
128
|
+
metal::float4 _e3 = _fragColor;
|
|
129
|
+
return main_Output { _e3 };
|
|
130
|
+
}
|