[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-82891":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":14,"starSnapshotCount":14,"syncStatus":13,"lastSyncTime":35,"discoverSource":36},82891,"SwiftUIShaders","krispuckett\u002FSwiftUIShaders","krispuckett","41 hand-curated drop-in SwiftUI Metal shader effects — holographic foil, kaleidoscope, magnetic fields, glitch, neon edges and more. Typed View modifiers, agent-friendly docs.",null,"Metal",175,5,2,0,1,23,64,7,62.23,"MIT License",false,"main",true,[25,26,27,28,29,30,31],"ios","metal","metal-shaders","shaders","swift","swift-package","swiftui","2026-06-12 04:01:39","# SwiftUIShaders\n\n41 SwiftUI Metal shaders. Holographic foil, kaleidoscope mandalas, magnetic fields, glitch, neon edges, and a pile more. Each one is a `[[ stitchable ]]` Metal function with a typed SwiftUI `View` modifier wrapped around it, so dropping one onto a view is a single line.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"Docs\u002Fdemo.gif\" width=\"280\" alt=\"SwiftUIShaders running live in the shader lab\" \u002F>\n\u003C\u002Fp>\n\nThese started as a hidden shader lab inside Epilogue, my reading app. I built way more than I ever shipped, so I pulled the good ones out to share. Every shader here got rendered on a real book cover and kept only if it actually looked good. The duds, the washed-out ones, and the ones that only work on a blank gradient got cut. What's left is the set I'd reach for myself.\n\nDrop them into your own project and mess around. They're also built to hand straight to a coding agent like Claude Code or Codex. If one sparks an idea, point your agent at [AGENTS.md](AGENTS.md) and let it riff.\n\nWant to dial them in by eye? Hand the repo to your agent and ask it to build a slider-based tuning tool. Everything it needs is in [`Docs\u002Fparameters.json`](Docs\u002Fparameters.json), and the recipe is in [AGENTS.md](AGENTS.md). Tune against your own content, copy the line it spits out, paste it into your code.\n\n> The `bcs_` prefix is just the shader namespace. Nothing here is wired to Epilogue's actual app code.\n\n## Requirements\n\n- iOS 17+ \u002F macOS 14+ \u002F tvOS 17+ \u002F visionOS 1+\n- Xcode 15+ (the Metal toolchain compiles the shaders into the package's `default.metallib`)\n\n> One gotcha: build with Xcode or `xcodebuild`, not bare `swift build`. SwiftPM's command-line driver on macOS doesn't run the Metal toolchain, so `Bundle.module` and `default.metallib` never get produced. In Xcode it just works.\n\n## Install\n\nSwift Package Manager. In Xcode, go to **File ▸ Add Package Dependencies** and point it at this repo's URL. Or add it in `Package.swift`:\n\n```swift\n.package(url: \"https:\u002F\u002Fgithub.com\u002Fkrispuckett\u002FSwiftUIShaders.git\", from: \"1.0.0\")\n```\n\nThen add `SwiftUIShaders` to your target's dependencies.\n\n## Quick start\n\n```swift\nimport SwiftUI\nimport SwiftUIShaders\n\nstruct ContentView: View {\n    var body: some View {\n        Image(\"book-cover\")\n            .resizable()\n            .scaledToFit()\n            .bcsHolographic(intensity: 0.6, scale: 12, speed: 1.2)  \u002F\u002F animated, self-driving\n    }\n}\n```\n\nEvery shader is a `View` modifier. The animated ones run themselves with `TimelineView(.animation)`, so there's no timer for you to babysit. Every parameter has a sensible default, so `.bcsKaleidoscope()` works on its own.\n\n```swift\nText(\"Chapter One\")\n    .font(.largeTitle)\n    .bcsChromaticSplit(spread: 8, angle: .pi \u002F 4)\n\nbookCover\n    .bcsAurora()             \u002F\u002F ambient animated glow\n\nmyView\n    .bcsEmboss(strength: 3)  \u002F\u002F static relief\n```\n\nOne heads up: these want real content. Photos, book covers, illustrations, text. Drop one on a flat single-color fill and the displacement and edge effects have nothing to grab onto.\n\n## How it works (conventions)\n\nEach wrapper applies one Metal `layerEffect`. The mapping is uniform:\n\n| Shader argument | Supplied by the wrapper |\n|---|---|\n| `position`, `layer` | SwiftUI (automatic) |\n| `size` | The view's pixel size, from `GeometryProxy` |\n| `time` | Elapsed seconds, from `TimelineView(.animation)` (animated shaders only) |\n| interaction point (e.g. `touchPos`) | A `UnitPoint` (0...1) you pass, converted to pixels |\n| everything else | Typed `Float` parameters with defaults |\n\nEvery method also takes `maxSampleOffset:` (default `64×64`). Raise it if a heavy displacement effect looks clipped at the edges. Lower it for a small perf win on cheap effects.\n\n## The shaders\n\n37 animate. 4 are static (`bcsEmboss`, `bcsFrosted`, and the two interaction-driven ripples). Ranges in parentheses are the sweet spots. The defaults are tuned values that look good out of the box, so you can call any of these with no arguments and get something real.\n\n| Shader | Type | Parameters |\n|---|---|---|\n| **`.bcsAurora`**: Aurora | animated | `intensity` (0–1), `bands` (1–8), `speed` (0.3–3), `colorShift` (0–1) |\n| **`.bcsBlackHole`**: Black Hole | animated | `mass` (0.05–0.5), `spin` (0–5), `distortion` (10–200), `ringBrightness` (0–2) |\n| **`.bcsChromaticSplit`**: Chromatic Split | animated | `spread` (0–30), `angle` (0–6.28), `edgeOnly` (0–1), `animate` (0–1) |\n| **`.bcsDatamosh`**: Datamosh | animated | `blockCorruption` (0–1), `smearAmount` (0–60), `colorBleed` (0–1), `glitchRate` (0.5–5) |\n| **`.bcsDisintegrate`**: Disintegrate | animated | `threshold` (0–1), `edgeWidth` (0.05–0.3), `driftAmount` (0–50), `direction` (0–6.28) |\n| **`.bcsDuochrome`**: Duochrome | animated | `intensity` (0–1), `hue1` (0–1), `hue2` (0–1), `contrast` (0.5–2) |\n| **`.bcsEcho`**: Echo \u002F Ghost | animated | `echoCount` (2–8), `spread` (5–50), `direction` (0–6.28), `fade` (0.3–0.9) |\n| **`.bcsEmboss`**: Emboss \u002F Relief | static | `strength` (0–5), `angle` (0–6.28), `mixAmount` (0–1) |\n| **`.bcsEtherealAura`**: Ethereal Aura (v2) | animated | `auraWidth`, `auraIntensity`, `pulseSpeed`, `distortion`, `hueShift` |\n| **`.bcsFrosted`**: Frosted Glass | static | `frostAmount` (0–1), `grainSize` (1–20), `clearRadius` (0–1), `clearSoftness` (0–1) |\n| **`.bcsGeometricWarp`**: Geometric Warp | animated | `spiralTight` (1–8), `zoomRepeat` (0.3–2), `rotation` (0–6.28), `blend` (0–1) |\n| **`.bcsGlitch`**: Glitch | animated | `intensity` (0–1), `blockSize` (2–50), `scanLines` (0–1), `colorShift` (0–20) |\n| **`.bcsGravityWells`**: Gravity Wells | animated | `wellStrength` (10–200), `wellCount` (1–5), `orbitSpeed` (0.1–3), `warpFalloff` (0.5–5) |\n| **`.bcsHeatShimmer`**: Heat Shimmer | animated | `amplitude` (0–20), `frequency` (1–30), `speed` (0.5–5), `verticalBias` (0–1) |\n| **`.bcsHolographic`**: Holographic \u002F Prismatic | animated | `intensity` (0–1), `scale` (1–20), `speed` (0.1–3), `angleOffset` (0–6.28) |\n| **`.bcsInkBleed`**: Ink Bleed \u002F Domain Warp | animated | `warpStrength` (0–50), `scale` (1–10), `speed` (0.1–2), `detail` (2–8) |\n| **`.bcsKaleidoscope`**: Kaleidoscope | animated | `segments` (2–16), `rotation` (0–6.28), `zoom` (0.5–3), `animateSpeed` (0–2) |\n| **`.bcsLiquidChrome`**: Liquid Chrome | animated | `distortion` (0–30), `chromeIntensity` (0–1), `flowSpeed` (0.1–3), `reflectionScale` (1–10) |\n| **`.bcsLiquidMirror`**: Liquid Mirror | animated | `mirrorAxis` (0.3–0.7), `ripple` (2–30), `speed` (0.5–3), `depth` (0–1) |\n| **`.bcsLiveRipple`**: Live Ripple | animated | `amplitude` (0–30), `frequency` (5–60), `speed` (1–10), `damping` (0.5–5), `ringCount` (1–5) |\n| **`.bcsMagneticField`**: Magnetic Field | animated | `fieldStrength` (5–80), `lineCount` (3–20), `fieldTurbulence` (0–1), `polarity` (0–1) |\n| **`.bcsMelt`**: Melt | animated | `meltAmount` (0–100), `dripScale` (1–15), `speed` (0.1–3), `heat` (0–1) |\n| **`.bcsMorphBreathe`**: Morph Breathe | animated | `breatheDepth` (5–50), `breatheRate` (0.3–3), `warpComplexity` (1–8), `organic` (0–1) |\n| **`.bcsNeonEdge`**: Neon Edge | animated | `edgeStrength` (1–10), `glowAmount` (0–2), `colorCycle` (0–3), `mixOriginal` (0–1) |\n| **`.bcsPixelateMosaic`**: Pixelate Mosaic | animated | `pixelSize` (4–60), `bevel` (0–1), `animateAssemble` (0–1), `gap` (0–0.3) |\n| **`.bcsPixelateStorm`**: Pixelate Storm | animated | `pixelSize` (2–40), `stormAmount` (0–1), `swirl` (0–3), `pulse` (0–3) |\n| **`.bcsPlasma`**: Plasma | animated | `intensity` (0–1), `scale` (1–10), `speed` (0.5–5), `colorMode` (0–1) |\n| **`.bcsPulse`**: Pulse \u002F Heartbeat | animated | `amplitude` (0–30), `bpm` (30–180), `sharpness` (1–10), `glowIntensity` (0–1) |\n| **`.bcsRefractLens`**: Refract Lens (Interactive) | static | `touchPos` (UnitPoint), `lensRadius` (0.1–0.5), `refraction` (1–3), `aberration` (0–15), `wobble` (0–1) |\n| **`.bcsShatter`**: Shatter | animated | `shardCount` (3–30), `explode` (0–1), `rotationAmt` (0–3), `edgeGlow` (0–2) |\n| **`.bcsShatterGlass`**: Shatter Glass | animated | `crackDensity` (3–15), `glassRefraction` (0–20), `prismStrength` (0–1), `shatterSpread` (0–1) |\n| **`.bcsShockwave`**: Shockwave | animated | `waveSpeed` (50–500), `ringWidth` (5–60), `strength` (5–80), `repeatRate` (0.5–5) |\n| **`.bcsSmokeReveal`**: Smoke Reveal | animated | `smokeAmount` (0–1), `smokeScale` (2–10), `windSpeed` (0.5–3), `smokeTurb` (0.5–3) |\n| **`.bcsSolarize`**: Solarize | animated | `threshold` (0.2–0.8), `curveIntensity` (0–3), `colorSeparation` (0–1), `animate` (0–1) |\n| **`.bcsThermal`**: Thermal | animated | `intensity` (0–1), `shimmer` (0–15), `noiseSpeed` (0.5–3), `paletteShift` (0–1) |\n| **`.bcsTopographic`**: Topographic | animated | `lineCount` (5–40), `lineWidth` (0.01–0.15), `colorize` (0–1), `animate` (0–1) |\n| **`.bcsTouchRipple`**: Touch Ripple | static | `touchPos` (UnitPoint), `touchAge`, `amplitude` (0–30), `frequency` (5–40), `speed` (50–500), `decay` (0.5–4) |\n| **`.bcsUnderwaterCaustics`**: Underwater Caustics | animated | `causticScale` (2–15), `causticIntensity` (0–2), `waterDistortion` (0–30), `waterDepth` (0–1) |\n| **`.bcsVortex`**: Vortex Spiral | animated | `twistAmount` (0–10), `radius` (0.1–1), `speed` (0.1–3), `falloff` (0.5–5) |\n| **`.bcsWavePool`**: Wave Pool | animated | `amplitude` (0–25), `wavelength` (5–40), `speed` (0.5–5), `complexity` (1–6) |\n| **`.bcsWormhole`**: Wormhole | animated | `depth` (1–8), `speed` (0.3–3), `twist` (0–5), `radius` (0.1–0.5) |\n\n### Interaction-driven shaders\n\n`bcsTouchRipple` and `bcsRefractLens` take a `touchPos: UnitPoint`. Feed them a drag location for a touch-reactive effect, and use a `GeometryReader` to normalize the point:\n\n```swift\n@State private var touch: UnitPoint = .center\n\nGeometryReader { geo in\n    myView\n        .bcsRefractLens(touchPos: touch, lensRadius: 0.3)\n        .gesture(DragGesture(minimumDistance: 0).onChanged { v in\n            touch = UnitPoint(x: v.location.x \u002F geo.size.width,\n                              y: v.location.y \u002F geo.size.height)\n        })\n}\n```\n\n## Performance notes\n\n- These are GPU fragment effects. Most are cheap, but the blur and displacement-heavy ones (`bcsFrosted`, `bcsShatterGlass`, `bcsMagneticField`) sample a lot of neighbors, so profile before you stack them on big, fast-scrolling views.\n- Animated shaders re-render every frame while they're on screen. Don't leave dozens running off-screen.\n- `half`-precision is used throughout for speed. Expect a little banding at extreme parameter values.\n\n## License\n\nMIT. See [LICENSE](LICENSE). Use them, ship them, remix them. Attribution's appreciated, never required.\n","SwiftUIShaders 是一个包含41种精选的 SwiftUI Metal 着色器效果的项目，包括全息箔、万花筒、磁场、故障效果、霓虹边缘等。每个着色器都是一个可直接嵌入的 Metal 函数，并通过类型化的 SwiftUI `View` 修饰符进行封装，使得在视图中应用这些效果只需一行代码。该项目适合需要为iOS、macOS、tvOS 或 visionOS 应用添加独特视觉效果的场景，特别是那些希望增强用户界面吸引力或创造独特视觉体验的应用。此外，文档友好且支持编码代理，便于开发者快速上手和集成。","2026-06-11 04:09:33","CREATED_QUERY"]