An iPad-first SwiftUI + Metal playground for experimenting with shaders and UI effects.
- Xcode 16+ (iOS/iPadOS 18+ simulators)
- Swift 5.10+
- Xcode Metal components installed
- Open
Shader Playground.xcodeprojin Xcode. - Select an iPad simulator (e.g., iPad Pro 13-inch).
- Run (⌘R).
If the canvas is blank: ensure an image named SampleImage exists in Assets.xcassets and has Target Membership checked.
File: Shader Playground/Shaders/FragmentFX.metal
- Size/aspect:
halfY,maxHalfX, andaspectmath in each fragment. - Rounded corners:
sdRoundRect(...)andcorner = min(halfX, halfY) * 0.20. - Shadow:
- Offset:
uv + float2(0.0, 0.03) - Blur width:
* 30.0 - Intensity:
* 0.15
- Offset:
Goal: keep a pristine scaffold you can always return to, while you experiment safely in branches.
cd "/Users/mubarakmarafa/Documents/Cursor_Experiments/iOS Apps/Shader Playground"
git init
git add .
git commit -m "chore: initial scaffold"Create an empty repo on GitHub named ios-shader-playground under mubarakmarafa. Then:
git branch -M main
git remote add origin git@github.com:mubarakmarafa/ios-shader-playground.git
# or HTTPS:
# git remote add origin https://github.com/mubarakmarafa/ios-shader-playground.git
git push -u origin main# Branch you never change
git branch template/scaffold
git push -u origin template/scaffold
# Exact snapshot tag
git tag -a v0.1.0-scaffold -m "base scaffold"
git push origin v0.1.0-scaffoldIn GitHub → Settings → Branches, consider protecting template/scaffold.
Start a clean experiment from the template:
git switch -c exp/my-idea template/scaffold
# edit code, test
git add -A && git commit -m "feat: my idea"
git push -u origin exp/my-ideaWhen happy, open a Pull Request from exp/my-idea → main and merge.
Want to start over? Create a new exp/... from template/scaffold.
Return to the exact original scaffold:
git switch -c exp/from-tag v0.1.0-scaffold- Work in branches (
feat/...,exp/...,fix/...). - Protect
mainto require PRs and prevent accidental pushes.
git remote add upstream git@github.com:mubarakmarafa/ios-shader-playground.git
git fetch upstream
git switch main
git merge upstream/main # or: git rebase upstream/main- No simulators → install iOS runtimes (Xcode → Settings → Platforms).
- "Failed to load default Metal library" → ensure
.metalfiles are target members. - Image missing → check
SampleImagein assets.
Private by default. Add a license if you choose to open-source.