[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115393":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":16,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":9,"pushedAt":32,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":14,"starSnapshotCount":14,"syncStatus":15,"lastSyncTime":36,"discoverSource":37},115393,"shader-lab","fedesanchez0\u002Fshader-lab","fedesanchez0","A playground for live Metal shaders on iPhone, iPad, iPhone Duo, Apple TV, Apple Vision Pro and Apple Watch. Save any shader as a wallpaper.",null,"Swift",207,15,1,0,2,75,13,75.11,"MIT License",false,"main",[23,24,25,26,27,28,29,30,31],"homeview","iphone-duo","metal","shaders","swiftui","tvos","visionos","wallpaper","watchos","2026-11-16 19:55:26","2026-11-23 05:32:16","# Shader Lab\n\n\u003Ca href=\"https:\u002F\u002Fbitrig.link\u002Fshader-lab-gh\">\u003Cimg src=\"Documentation\u002FImages\u002FBadges\u002Fmade-with-bitrig.svg\" alt=\"Made with Bitrig\" height=\"56\">\u003C\u002Fa>\u003Ca href=\"https:\u002F\u002Ffsanchez.io\">\u003Cimg src=\"Documentation\u002FImages\u002FBadges\u002Fdesigned-by.svg\" alt=\"Designed by Fede Sánchez\" height=\"56\">\u003C\u002Fa>\u003Ca href=\"https:\u002F\u002Fclaude.com\u002Fclaude-code\">\u003Cimg src=\"Documentation\u002FImages\u002FBadges\u002Fclaude-code.svg\" alt=\"In collaboration with Claude Code\" height=\"56\">\u003C\u002Fa>\n\n\u003Cp align=\"center\">\u003Cimg src=\"Documentation\u002FMedia\u002Fipad-rain.png\" alt=\"Shader Lab on iPad: the Rain shader running over a photo of El Capitan, with the effects sidebar on the left and the parameters panel on the right\" width=\"720\">\u003C\u002Fp>\n\nShader Lab is a playground for live Metal shaders. Pick one of fifteen effects, drag its parameters and watch the canvas change as you go. There are full-screen generators (gradients, dithering, a fractal plant printed as a cyanotype, an iridescent sphere) and effects that work on a photo: warp, ripple, pinch, fluted glass, chromatic aberration and rain on a window. You can lay text over the result, save any shader as a wallpaper, and read or share the Metal source of the shader on screen.\n\nIt runs on iPhone, iPad, iPhone Duo, Apple TV, Apple Vision Pro and Apple Watch, with a layout made for each.\n\n## Platforms\n\n| Platform | What it does | Minimum |\n| --- | --- | --- |\n| **iPhone** | Full-screen canvas with a drawer of controls that you drag up or tap away. | iOS 26 |\n| **iPad** | The canvas with two floating glass panels: effects on the left, parameters and canvas settings on the right. Editor, Nodes and Code tabs, a touch magnifier, and text and dithered-label overlays. | iPadOS 26 |\n| **iPhone Duo** | The outer display works like iPhone and the inner display like iPad. In book and tabletop poses the panels stay clear of the crease, and in tabletop the picture sits on the upright half above the panels. | iOS 26; hinge-aware layout needs iOS 27.1 |\n| **Apple TV** | One shader fills the screen, with a glass picker for the shader and, for Rain, the photo it falls on. The Siri Remote moves focus, and Play\u002FPause hides the controls and keeps the screen awake. The layout is sized to also fit HomeView's square touch panel. | tvOS 26 |\n| **Apple Vision Pro** | A lobby window, and an immersive space with a floating canvas and controls. | visionOS 26 |\n| **Apple Watch** | A companion app with seven presets drawn with SwiftUI `Canvas` and a speed control. | watchOS 11 |\n\n## Design & Examples\n\nOne goal of the design was controls that sit concentric with the screen: each sheet and panel keeps its corners an even distance from the display's own. You can see it in the iPhone's drawer, the iPhone Duo shots and the iPad's floating panels, which are all SwiftUI `ConcentricRectangle`s.\n\nThe controls are dynamic too, inspired by [DialKit](https:\u002F\u002Fwww.dialkit.dev). When you switch shaders, the panel updates from the bottom up, replacing only what changes. Controls the two shaders share stay where they are, and keep their values when the ranges match. The ones the new shader doesn't have fade out, and its new ones fade in below the rest. Nothing jumps, so you can flip between effects without losing your place. The order is kept in `updateParamOrder` and the values in `carryOverSharedParams`, both in [`ShaderModel.swift`](App\u002FShaderModel.swift).\n\n### iPhone\n\n[\u003Cimg src=\"Documentation\u002FMedia\u002Fiphone.gif\" alt=\"iPhone: opening the shader list and switching from Wave to Sphere, then Rain\" width=\"270\">](Documentation\u002FMedia\u002Fiphone.mp4)\n\u003Cimg src=\"Documentation\u002FMedia\u002Fiphone-wave.png\" alt=\"iPhone: Wave with its parameters\" width=\"270\">\n\u003Cimg src=\"Documentation\u002FMedia\u002Fiphone-shaders.png\" alt=\"iPhone: the list of effects\" width=\"270\">\n\n### iPad\n\n[\u003Cimg src=\"Documentation\u002FMedia\u002Fipad.gif\" alt=\"iPad: switching between Sphere, Fluted Glass, the Code tab and Rain\" width=\"720\">](Documentation\u002FMedia\u002Fipad.mp4)\n\n\u003Cimg src=\"Documentation\u002FMedia\u002Fipad-wave.png\" alt=\"iPad: Wave\" width=\"360\"> \u003Cimg src=\"Documentation\u002FMedia\u002Fipad-fluted-glass.png\" alt=\"iPad: Fluted Glass over a photo\" width=\"360\">\n\u003Cimg src=\"Documentation\u002FMedia\u002Fipad-sphere.png\" alt=\"iPad: Sphere\" width=\"360\"> \u003Cimg src=\"Documentation\u002FMedia\u002Fipad-code.png\" alt=\"iPad: the Code tab showing the Metal source\" width=\"360\">\n\n### iPhone Duo\n\n[\u003Cimg src=\"Documentation\u002FMedia\u002Fduo.gif\" alt=\"iPhone Duo inner display: folding into book pose and back, then switching to Rain\" width=\"720\">](Documentation\u002FMedia\u002Fduo.mp4)\n\n\u003Cimg src=\"Documentation\u002FMedia\u002Fduo-outer.png\" alt=\"iPhone Duo outer display\" width=\"270\"> \u003Cimg src=\"Documentation\u002FMedia\u002Fduo-tabletop.png\" alt=\"iPhone Duo in tabletop pose: the picture above the crease and the panels below\" width=\"270\">\n\u003Cimg src=\"Documentation\u002FMedia\u002Fduo-inner.png\" alt=\"iPhone Duo inner display, open flat\" width=\"360\"> \u003Cimg src=\"Documentation\u002FMedia\u002Fduo-book.png\" alt=\"iPhone Duo inner display in book pose: the tab switcher parts around the crease\" width=\"360\">\n\n### Apple TV\n\n[\u003Cimg src=\"Documentation\u002FMedia\u002Fappletv.gif\" alt=\"Apple TV: moving through the shaders with the Siri Remote, then picking a photo for Rain\" width=\"720\">](Documentation\u002FMedia\u002Fappletv.mp4)\n\n\u003Cimg src=\"Documentation\u002FMedia\u002Fappletv-rain.png\" alt=\"Apple TV: Rain over Yosemite\" width=\"360\"> \u003Cimg src=\"Documentation\u002FMedia\u002Fappletv-sphere.png\" alt=\"Apple TV: Sphere\" width=\"360\">\n\n### HomeView\n\nThe Apple TV layout comes from this HomeView screen: the same pickers, sized for a 544-point square and tapped directly.\n\n[\u003Cimg src=\"Documentation\u002FMedia\u002Fhomeview.gif\" alt=\"HomeView: Rain falling on the square display, through Clownfish, Yosemite, El Capitan, Sierra and High Sierra\" width=\"720\">](Documentation\u002FMedia\u002Fhomeview.mp4)\n\n> [!NOTE]\n> **This HomeView screen runs on Apple's internal HomeView SDK, inside a virtual machine.** Apple hasn't opened that SDK to developers, though it might in the future. Until then, this screen can't run on a real HomeView. That's also why it's built as a tvOS app: tvOS is what the virtual machine's internal SDK takes. What a real HomeView runs today is CarPlay: it has no App Store, and its third-party apps are CarPlay audio and video apps shown from a paired iPhone nearby, [like Spotify](https:\u002F\u002Fmastodon.social\u002F@stroughtonsmith\u002F117543062117057105). Bitrig can build that kind of app today. To try this screen in the virtual machine, see [Run on a HomeView virtual machine](#run-on-a-homeview-virtual-machine).\n\n## Shaders\n\nGenerators fill the canvas. Photo effects work on one of the bundled photos or one you pick from your library. The Code tab shows the selected shader's Metal function with the current parameter values filled in, and Export shares it as a `.metal` file.\n\nEach shader below is shown at its default settings, captured on iPad with the controls hidden. The photo effects are shown on the default El Capitan photo.\n\n\u003Ctable>\n  \u003Ctr>\u003Cth colspan=\"3\" align=\"left\">Generators\u003C\u002Fth>\u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fheatmap.jpg\" alt=\"Heatmap shader\" width=\"260\">\u003Cbr>\u003Cb>Heatmap\u003C\u002Fb>\u003Cbr>Layered noise in thermal-camera colours, flowing in bands.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fwave.jpg\" alt=\"Wave shader\" width=\"260\">\u003Cbr>\u003Cb>Wave\u003C\u002Fb>\u003Cbr>Silky ribbons in four colours, flowing at an angle, straight or radial.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fmesh.jpg\" alt=\"Mesh shader\" width=\"260\">\u003Cbr>\u003Cb>Mesh\u003C\u002Fb>\u003Cbr>A soft gradient of drifting hues, shaped by layered noise.\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fgrain-grad.jpg\" alt=\"Grain Grad shader\" width=\"260\">\u003Cbr>\u003Cb>Grain Grad\u003C\u002Fb>\u003Cbr>A noisy colour gradient with fine film grain.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fdithering.jpg\" alt=\"Dithering shader\" width=\"260\">\u003Cbr>\u003Cb>Dithering\u003C\u002Fb>\u003Cbr>Noise drawn as an 8 × 8 Bayer dither, with an optional pixel-font label.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fgrain.jpg\" alt=\"Grain shader\" width=\"260\">\u003Cbr>\u003Cb>Grain\u003C\u002Fb>\u003Cbr>Animated film grain over the canvas colour, optionally colourised.\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Ffractal.jpg\" alt=\"Fractal shader\" width=\"260\">\u003Cbr>\u003Cb>Fractal\u003C\u002Fb>\u003Cbr>Seaweed printed as a cyanotype, swaying gently, after the cover of Michael Frame’s \u003Ca href=\"https:\u002F\u002Fpress.uchicago.edu\u002Fucp\u002Fbooks\u002Fbook\u002Fchicago\u002FG\u002Fbo113868517.html\">\u003Ci>Geometry of Grief\u003C\u002Fi>\u003C\u002Fa>. Organic straightens it into a symmetric tree; Seed grows another plant; Grow plays its life on a loop, from holdfast to developed print.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fsphere.jpg\" alt=\"Sphere shader\" width=\"260\">\u003Cbr>\u003Cb>Sphere\u003C\u002Fb>\u003Cbr>An iridescent sphere with two moving lights and a slowly turning surface.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fvortex.jpg\" alt=\"Vortex shader\" width=\"260\">\u003Cbr>\u003Cb>Vortex\u003C\u002Fb>\u003Cbr>Spiral arms twisting around the centre, fading toward the edges.\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\u003Cth colspan=\"3\" align=\"left\">Photo effects\u003C\u002Fth>\u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fwarp.jpg\" alt=\"Warp shader\" width=\"260\">\u003Cbr>\u003Cb>Warp\u003C\u002Fb>\u003Cbr>Bends the photo with crossing sine waves.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fripple.jpg\" alt=\"Ripple shader\" width=\"260\">\u003Cbr>\u003Cb>Ripple\u003C\u002Fb>\u003Cbr>Rings spreading out from the centre of the photo.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fpinch.jpg\" alt=\"Pinch shader\" width=\"260\">\u003Cbr>\u003Cb>Pinch\u003C\u002Fb>\u003Cbr>Pulls the photo toward its centre and lets go, over and over.\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Ffluted-glass.jpg\" alt=\"Fluted Glass shader\" width=\"260\">\u003Cbr>\u003Cb>Fluted Glass\u003C\u002Fb>\u003Cbr>The photo through ribbed glass: lines, irregular, wave, zigzag or pattern.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Fchromatic.jpg\" alt=\"Chromatic shader\" width=\"260\">\u003Cbr>\u003Cb>Chromatic\u003C\u002Fb>\u003Cbr>Splits red, green and blue apart from the centre, along an angle.\u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\u003Cimg src=\"Documentation\u002FMedia\u002FShaders\u002Frain.jpg\" alt=\"Rain shader\" width=\"260\">\u003Cbr>\u003Cb>Rain\u003C\u002Fb>\u003Cbr>Drops on the glass, with the photo blurred behind it. Window picks where you watch from: a house, where they run down; a car, where the wind pushes them up; or a plane on a late-night flight, where they streak back past a row of dimmed windows.\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## Shaders as wallpapers\n\nIn the editor on iPhone, iPad or iPhone Duo, tap **Export** to save the shader on screen to Photos as a still, with any text overlay included. It renders at full quality, at your screen's own size and pixel density: 1206 × 2622 on iPhone 18 Pro, and the full display on iPad and on each of the Duo's displays. On iPhone the image is always upright, even if you export in landscape. So it drops straight in as a Lock Screen or Home Screen wallpaper: in Photos, tap Share, then Use as Wallpaper.\n\n## How it works\n\n- **Shaders.** Every effect is a `[[stitchable]]` function in [`App\u002FShaders.metal`](App\u002FShaders.metal), applied with SwiftUI's `colorEffect`, `distortionEffect` and `layerEffect`. [`ShaderModel.swift`](App\u002FShaderModel.swift) lists the shaders, their parameters, ranges and units.\n- **One clock.** [`CanvasClock`](App\u002FCanvasClock.swift) ticks about 30 times a second and stops when the scene isn't active. Every canvas reads it, so the main canvas, the magnifier and the tabletop reflection stay in step.\n- **Render quality.** Soft gradients are rendered on a smaller surface and scaled up ([`ReducedResolution`](App\u002FCanvasView.swift)). Point-sized parameters, like the dither cell size, shrink with the surface so the result looks the same.\n- **Photos.** [`CanvasImageStore`](App\u002FCanvasImageStore.swift) decodes each photo once, at the size the canvas can show, and caches it.\n- **iPhone Duo.** [`DuoRuntime`](App\u002FDuoRuntime.swift) reads the hinge with `onHingeChange`. The layout uses the system's reserved regions for the crease and the camera, so controls never sit under either.\n- **Apple TV.** [`App\u002FTV`](App\u002FTV) reuses the same `CanvasView`. Sizes are in units of a 544-point square, so the layout reads on a square panel and, scaled up, on a television. Opening `shaderlab:\u002F\u002Fshader\u002F\u003Cname>?photo=\u003Cphoto>&chrome=hidden` shows a given shader, which is handy for scripted captures.\n\n## Build and run\n\n1. Use Xcode 27.1 or later (iOS 27.1 SDK), or Bitrig.\n2. Open `Shader Lab.xcodeproj`. The **Shader Lab** scheme builds iPhone, iPad, Apple TV and Apple Vision Pro. The Watch app is embedded in the iPhone app. **Shader Lab Watch App** builds the watch app on its own.\n3. To run on a device, set your development team. The bundle identifier is a placeholder, so change it to one of your own.\n\nNo packages or setup scripts are needed.\n\n### Run on a HomeView virtual machine\n\nThe HomeView screen runs on a virtual HomeView made with [vphone-cli](https:\u002F\u002Fgithub.com\u002FLakr233\u002Fvphone-cli). That's an open-source project (MIT) that runs Apple's device systems in virtual machines on an Apple silicon Mac, with Virtualization.framework and Apple's Private Cloud Compute research VMs. It isn't affiliated with Apple or Bitrig.\n\n1. Set up vphone with its [Quick Start](https:\u002F\u002Flakr233.github.io\u002Fvphone-cli\u002Fget-started\u002Fquick-start). Install the notarized `vphone-launchpad` from the [latest release](https:\u002F\u002Fgithub.com\u002FLakr233\u002Fvphone-cli\u002Freleases\u002Flatest). In Launchpad, grant Developer Tools access, install the helper and install the Core Bundle. Then put `vphone-launchpad-cli` on your `PATH`.\n2. In Launchpad 2.15 or later, click **New Machine** and choose a HomeView firmware (`HomeAccessory17,1` or `17,2`). Launchpad then selects its `homeview` preset itself. Name the machine `HomeView` and click **Create**. Creating it downloads, patches and restores the firmware, so it takes a while and needs plenty of free disk space. For what works in the virtual HomeView so far, see vphone's [HomeView notes](https:\u002F\u002Fgithub.com\u002FLakr233\u002Fvphone-cli\u002Fblob\u002Fmain\u002FResearch\u002FFirmware\u002Fhomeview_bringup.md). Then start it:\n\n   ```sh\n   vphone-launchpad-cli vm start HomeView --wait\n   ```\n\n3. From the repository, build the tvOS app unsigned and wrap it in an `.ipa`:\n\n   ```sh\n   xcodebuild -project \"Shader Lab.xcodeproj\" -scheme \"Shader Lab\" -sdk appletvos \\\n     -destination 'generic\u002Fplatform=tvOS' -configuration Debug \\\n     -derivedDataPath build\u002Fhomeview CODE_SIGNING_ALLOWED=NO build\n   mkdir -p build\u002Fhomeview-ipa\u002FPayload\n   cp -R \"build\u002Fhomeview\u002FBuild\u002FProducts\u002FDebug-appletvos\u002FShader Lab.app\" build\u002Fhomeview-ipa\u002FPayload\u002F\n   (cd build\u002Fhomeview-ipa && zip -qr ..\u002FShaderLab-HomeView.ipa Payload)\n   ```\n\n4. Copy it to the machine, install it and open it on a shader:\n\n   ```sh\n   BUNDLE=$(grep -m1 -o 'PRODUCT_BUNDLE_IDENTIFIER = \"[^\"]*\"' \"Shader Lab.xcodeproj\u002Fproject.pbxproj\" | cut -d'\"' -f2)\n   vphone-launchpad-cli guest push HomeView build\u002FShaderLab-HomeView.ipa \u002Fprivate\u002Fvar\u002Ftmp\u002F\n   vphone-launchpad-cli guest rpc HomeView apps.install '{\"path\":\"\u002Fprivate\u002Fvar\u002Ftmp\u002FShaderLab-HomeView.ipa\"}'\n   vphone-launchpad-cli guest unlock HomeView\n   vphone-launchpad-cli guest rpc HomeView apps.launch \"{\\\"bundle_id\\\":\\\"$BUNDLE\\\",\\\"url\\\":\\\"shaderlab:\u002F\u002Fshader\u002Frain?photo=yosemite\\\"}\"\n   ```\n\n   The URL picks the shader and, for Rain, the photo (see [How it works](#how-it-works)).\n\n## Tests\n\n```sh\n# Unit tests (Swift Testing) and UI tests on an iPhone simulator\nbitrig test -destination 'platform=iOS Simulator,name=iPhone 17'\n\n# iPad-only UI tests\nbitrig test -destination 'platform=iOS Simulator,name=iPad Pro 11-inch (M5)' -only-testing:\"Shader Lab UI Tests\"\n```\n\n`xcodebuild test -scheme \"Shader Lab\"` works the same way.\n\n- **Unit tests** ([`Tests\u002F`](Tests)) check the shader catalog, parameter formatting, render-scale rules, the model, image downsampling and settings.\n- **UI tests** ([`UITests\u002F`](UITests)) walk the iPhone editor and the iPad tabs and sidebar. Tests for the other layout skip themselves.\n\n## Project layout\n\n- `App\u002F`: the app, shared by every platform except watchOS.\n  - `ContentView.swift`: the iPhone, iPad and iPhone Duo editor.\n  - `CanvasView.swift`: the renderer.\n  - `ShaderModel.swift`: the catalog and the model.\n  - `Shaders.metal`: the shaders. `ShaderSource.txt` is the copy the Code tab shows.\n  - `Duo*.swift`, `Fold*.swift`: iPhone Duo.\n  - `VisionShaderViews.swift`: visionOS.\n  - `TV\u002F`: tvOS.\n  - `Resources\u002F`: bundled photos.\n- `Watch App\u002F`: the watchOS companion.\n- `Tests\u002F`, `UITests\u002F`: tests.\n- `Documentation\u002F`: screenshots, video and badges.\n\n## Known issues\n\nBugs and performance work are tracked in this repository's Issues.\n\n## Acknowledgements\n\n**Libraries.** Shader Lab uses no third-party libraries or Swift packages, only Apple's frameworks (SwiftUI, Metal, MetalKit, PhotosUI, RealityKit and UIKit).\n\n**Shader code and techniques**\n\n- **Rain.** Based on [“Heartfelt”](https:\u002F\u002Fwww.shadertoy.com\u002Fview\u002Fltffzl) by Martijn Steinrucken (BigWings), 2017, published on Shadertoy under [CC BY-NC-SA 3.0](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby-nc-sa\u002F3.0\u002F). That licence doesn't allow commercial use, and adaptations must be shared alike. Keep this in mind before shipping Rain in a paid app.\n- **Helpers and inspiration.** The `remap` helper follows [paper-design\u002Fshaders](https:\u002F\u002Fgithub.com\u002Fpaper-design\u002Fshaders) (Apache 2.0). Mesh Gradient, Grain Gradient, Dithering, Heatmap and Fluted Glass are effects that library also offers.\n- **Fluted Glass falloff.** The progressive falloff along the flutes follows a technique by [Janum Trivedi](https:\u002F\u002Fgithub.com\u002Fjtrivedi).\n- **Standard methods.** Sphere uses GGX (Cook–Torrance) specular. Dithering uses an 8×8 Bayer matrix.\n\n**Images and fonts**\n\n- **Apple wallpapers.** The macOS wallpapers in `App\u002FAssets.xcassets` are Apple's and are included for demonstration only: Snow Leopard (10-6), Yosemite (10-10), El Capitan (10-11), Sierra (10-12), High Sierra (10-13) and Ventura's dark wallpaper (13-dark). They come from 512 Pixels' [Default Mac Wallpapers in 5K](https:\u002F\u002F512pixels.net\u002Fprojects\u002Fdefault-mac-wallpapers-in-5k\u002F). The Clownfish photo (`fish.php.jpeg`) is also Apple's wallpaper.\n- **Unsplash photo.** `val-toch-BHeQQmZM8jE-unsplash.jpg` is by [Val Toch](https:\u002F\u002Funsplash.com\u002Fphotos\u002FBHeQQmZM8jE), under the [Unsplash License](https:\u002F\u002Funsplash.com\u002Flicense).\n- **HomeView video.** The HomeView product image in that video is Apple's.\n\n**Tools**\n\n- **vphone-cli.** The virtual HomeView comes from [vphone-cli](https:\u002F\u002Fgithub.com\u002FLakr233\u002Fvphone-cli) by Lakr233 and contributors (MIT).\n\nApple, iPhone, iPad, Apple TV, Apple Watch, Apple Vision Pro, HomeView, macOS and SF are trademarks of Apple Inc. This project isn't affiliated with or endorsed by Apple.\n\nThe badges come from the same set used in Fede Sánchez's other projects.\n\n## Licence\n\nShader Lab's code is released under the [MIT Licence](LICENSE), with one exception: Rain adapts “Heartfelt”, so its section of [`App\u002FShaders.metal`](App\u002FShaders.metal) keeps Heartfelt's [CC BY-NC-SA 3.0](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby-nc-sa\u002F3.0\u002F) licence, and the Code tab shows that notice with Rain's source. The MIT Licence doesn't cover the bundled photos or the Apple imagery in the screenshots and videos. They belong to their owners, listed under Acknowledgements.\n","Shader Lab 是一款面向 Apple 全平台的实时 Metal 着色器交互式实验工具，支持在 iPhone、iPad、iPhone Duo、Apple TV、Vision Pro 和 Apple Watch 上即时预览与调试着色器效果。核心功能包括15种内置着色器（如雨滴、波纹、色差、分形植物、虹彩球体等），支持图像处理与全屏生成两类模式，提供参数实时拖拽调节、文本叠加、Metal 源码查看\u002F分享，以及将任意效果保存为动态壁纸。采用 SwiftUI 构建响应式跨平台 UI，针对各设备形态（如铰链、空间界面、小屏）做了专属布局优化，适用于图形开发学习、创意视觉原型验证及个性化壁纸制作场景。","2026-11-24 04:50:53","CREATED_QUERY"]