Skip to content

mubarakmarafa/ios-shader-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shader Playground

An iPad-first SwiftUI + Metal playground for experimenting with shaders and UI effects.

Requirements

  • Xcode 16+ (iOS/iPadOS 18+ simulators)
  • Swift 5.10+
  • Xcode Metal components installed

Run the app

  1. Open Shader Playground.xcodeproj in Xcode.
  2. Select an iPad simulator (e.g., iPad Pro 13-inch).
  3. Run (⌘R).

If the canvas is blank: ensure an image named SampleImage exists in Assets.xcassets and has Target Membership checked.

Where to tweak the card look

File: Shader Playground/Shaders/FragmentFX.metal

  • Size/aspect: halfY, maxHalfX, and aspect math in each fragment.
  • Rounded corners: sdRoundRect(...) and corner = min(halfX, halfY) * 0.20.
  • Shadow:
    • Offset: uv + float2(0.0, 0.03)
    • Blur width: * 30.0
    • Intensity: * 0.15

Safe Git + GitHub workflow (beginner-friendly)

Goal: keep a pristine scaffold you can always return to, while you experiment safely in branches.

1) Initialize git (once)

cd "/Users/mubarakmarafa/Documents/Cursor_Experiments/iOS Apps/Shader Playground"

git init
git add .
git commit -m "chore: initial scaffold"

2) Create a GitHub repo (public) and push

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

3) Make a permanent return point (branch + tag)

# 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-scaffold

In GitHub → Settings → Branches, consider protecting template/scaffold.

4) Daily workflow (safe experiments)

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-idea

When happy, open a Pull Request from exp/my-ideamain 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

5) Keep main stable

  • Work in branches (feat/..., exp/..., fix/...).
  • Protect main to require PRs and prevent accidental pushes.

6) Update a clone/fork later

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

Troubleshooting

  • No simulators → install iOS runtimes (Xcode → Settings → Platforms).
  • "Failed to load default Metal library" → ensure .metal files are target members.
  • Image missing → check SampleImage in assets.

License

Private by default. Add a license if you choose to open-source.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published