Swift Render
A code-first video engine for Swift developers.
Build motion graphics, data-driven films, and video tools with SwiftUI, Metal, and native Apple frameworks. Write scenes as functions of time, score them in Swift, and render them to MP4 on your Mac.
Swift Render is an engine and CLI. Use it directly to author films, or embed the library in your own app or workflow.

A 20-second teaser for 0.10. Every frame is SwiftUI and Metal: a glass dome shader, refraction, ripples, a gel, caustics, and type set along a curve, all cut to the beat. The 1,200 frames at 1080p60 rendered in 5.3 s on an Apple M5 Mac, and 4K took 17.8 s. It was directed in Studio with 38 timecoded notes. Claude (Opus 5.5) picked up each note, fixed it, and answered with an after-frame. The macro textures are generated images, and everything they pass through is code. This is a GIF preview; the full 1080p60 MP4 is in the repo.
What you can build
- App launch and product videos, rendered straight from your Swift code.
- Motion graphics with native typography, analytic springs, timelines, and Metal shaders.
- Films driven by JSON props, video clips, images, voiceover, and captions.
- Audio-reactive scenes with a native Swift score, synthesis, samples, and cached local speech.
- Live-action effects using Apple Vision pose, hand tracking, and person masks. The
Rotoscope demo combines these with stylized cut-outs.
- True 3D with
Scene3D: SceneKit rendered offscreen from t, with models (USDZ/OBJ/SCN), PBR materials, SwiftUI views as textures, studio lighting, soft shadows, and depth of field. It composites like any view. See the Showcase3D demo and docs/3d.md.
- Local render workflows with parallel jobs, frame/range exports, contact sheets, and audio reports.
Feature guide · CLI reference · Launch films · Studio · For agents · AI quickstart · Contributing · All docs
Quick start
Requires macOS 14+ and Xcode. CI builds with Xcode 26, which Studio needs; the package declares Swift tools 5.10. Apple silicon is recommended. The bundled prebuilt Metal library lets you use existing shaders without installing the separate Metal compiler; editing shaders needs that compiler.
git clone --depth 1 https://github.com/skyblanket/swift-render.git # ~80 MB; the full history of demo videos is ~190 MB
cd swift-render
swift run swift-render list
swift run swift-render render KineticType --out out/kinetic-type.mp4
KineticType declares its own Swift soundtrack, which is synthesized and muxed automatically. An explicit --audio file overrides a scene's score.
For a short review render:
swift run swift-render check KineticType
swift run swift-render render KineticType --preview --open
check produces a contact sheet and frame/audio report. Inspect the pictures and listen to the actual export: automated checks do not establish visual or musical quality.
A scene is a function of time
import SwiftUI
import SwiftRender
public struct Hello: RenderScene {
public static let defaultDuration: Double = 3.0
@MainActor
public static func body(at t: Double, duration: Double) -> some View {
let p = Ease.spring(t, from: 0, to: 1,
response: 0.5, dampingFraction: 0.6)
Text("hello.")
.font(.system(size: 120, weight: .black))
.foregroundStyle(.white)
.scaleEffect(0.8 + 0.2 * p)
.opacity(Ease.clip(t, 0, 0.4))
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(.black)
}
}
Save it in Sources/SwiftRenderScenes/Hello.swift. The build plugin discovers scenes automatically. Or scaffold a scene with timeline and score hooks:
swift run swift-render new Hello
swift run swift-render check Hello
swift run swift-render render Hello --out out/hello.mp4
Keep scenes free of timers and mutable animation state. Frame time drives the output, so preview, frame export, and full render use the same scene logic.
Sound belongs in the scene
The native Score DSL places drums, melodic voices, samples, and speech on the same timeline as the visuals. Export a scene's track on its own:
swift run swift-render audio KineticType --out out/score.wav
Audio-reactive scenes read cached bass, mid, high, and RMS envelopes. Local voiceover can use macOS say or an optional Kokoro setup. The check command reports clipping, silence, and voice/music balance. See sound and media.
Vision and parallel rendering