Fractal Clouds

Drifting fractal cumulus clouds rendered via a SwiftUI Metal stitchable shader, using two-pass 5-octave FBM with domain warping for soft cumulus-like swirls

Free
Free with a ShipSwift account.

Copies a short instruction with your private download link. Paste it into your agent: it downloads the whole skill (the source code, the setup steps and the mistakes we already made for you) and builds the screen.

Works with

+70

What it does

Full-screen drifting fractal clouds rendered through SwiftUI's colorEffect Metal pipeline. Two-pass FBM (5-octave value noise): the first pass perturbs the sample position for the second, producing soft cumulus-like swirls. Sky and cloud colors are mixed by the warped FBM, with an optional warm tint layered on top of the unwarped pass for ambient lift.

Requires iOS 18+ / macOS 15+.

What you get

  • ✓335 lines of source code, ready to paste
  • ✓File Layout
  • ✓Source Code
  • ✓Usage
  • ✓Parameters
  • ✓Integration Checklist
  • ✓Notes / Gotchas
animationmetalshadercloudsbackgroundfbmSwiftUI

Usage

// Default — twilight cumulus, full-screen
ZStack {
    SWFractalClouds()
        .ignoresSafeArea()
    // Your content here
}

// Recolor — daylight sky
SWFractalClouds(
    skyColor: .blue.opacity(0.5),
    cloudColor: .white,
    warmth: 0.0
)

// As a section background
myContent
    .background { SWFractalClouds() }

// Heavier coverage, slower drift
SWFractalClouds(speed: 0.5, coverage: 0.2)

Parameters

ParameterTypeDefaultRangeNotes
skyColorColor#1A2659 (deep twilight blue)—Color of the open sky behind clouds
cloudColorColor#E6E6FF (soft lilac white)—Color of the cloud body
warmTintColor#1A0D00 (deep amber)—Color added on top of the unwarped FBM for ambient lift
warmthFloat0.50…2Multiplier on the warm tint additive layer
speedFloat1.00…3Time multiplier driving drift and warp evolution
zoomFloat3.00.5…10FBM sampling scale — higher = larger features
driftXFloat0.08-0.5…0.5Horizontal drift velocity
driftYFloat0.04-0.5…0.5Vertical drift velocity
warpFloat2.00…5Strength of the first FBM warping the second's sample position; 0 = pure FBM
coverageFloat0.0-1…1Added to warped FBM before clamping — positive widens coverage, negative opens the sky
showsControlsBoolfalse—Demo-only gear ToolbarItem; requires an enclosing NavigationStack

Integration Checklist

  1. Copy SWFractalClouds.swift and SWFractalClouds.metal into your Xcode target.
  2. Confirm the deployment target is iOS 18+ / macOS 15+.
  3. Use it as a ZStack background with .ignoresSafeArea() for full-bleed.
  4. Pick a sky / cloud / warm tint palette that matches your brand — defaults are a twilight palette; for daylight set warmth: 0 and pick a brighter sky/cloud pair.
  5. Keep to one full-screen instance per visible screen.

Notes / Gotchas

  • The shader runs two 5-octave FBM evaluations per pixel — cost is higher than the SWDots family. Keep to one full-screen instance.
  • zoom is clamped internally to >= 0.0001 to avoid division-style blowups in the noise lookup; setting it to 0 still renders cleanly.
  • The 5-octave FBM loop bound is static so the compiler can fully unroll it. Do not turn the octave count into a uniform.
  • When showsControls is true, the gear button is a native ToolbarItem — the call site must be inside a NavigationStack.

More in Effects and animation

Metal shaders: fields of dots that roll like waves and flow into living patterns, all drawn on the GPU.
Metal dot fields
Free
Metal shaders: fields of dots that roll like waves and flow into living patterns, all drawn on the GPU.
A deep-space starfield in Metal: glowing nebulae drift past twinkling stars.
Deep-space starfield
Free
A deep-space starfield in Metal: glowing nebulae drift past twinkling stars.
Neon outlines that bloom from the center with prism-colored edges, rendered live in Metal.
Neon outlines
Free
Neon outlines that bloom from the center with prism-colored edges, rendered live in Metal.
Colored blobs that drift, melt into one another like liquid, and blend their colors as they merge.
Liquid metaballs
Free
Colored blobs that drift, melt into one another like liquid, and blend their colors as they merge.
A 3D network graph you can spin. Tap any node and its links light up, with the details below.
3D network graph
Free
A 3D network graph you can spin. Tap any node and its links light up, with the details below.
Items orbit into a dotted ring, and payment cards fan out of a wallet as the balance rolls in.
Orbit ring and wallet
Free
Items orbit into a dotted ring, and payment cards fan out of a wallet as the balance rolls in.
A field of bright colored dots that float and shimmer across the whole screen.
Floating color dots
Free
A field of bright colored dots that float and shimmer across the whole screen.
Stacked glass panels in mirrored layers, with neon gradients flowing through them.
Glass color panels
Free
Stacked glass panels in mirrored layers, with neon gradients flowing through them.
Drag the slider and scattered points of light pull together into a perfect 3D sphere.
Dot sphere
Free
Drag the slider and scattered points of light pull together into a perfect 3D sphere.
Living patterns: a mosaic of cells that keeps reshaping, then a hypnotic color swirl.
Cells and swirl
Free
Living patterns: a mosaic of cells that keeps reshaping, then a hypnotic color swirl.
Organic noise shaders: glowing veins that pulse through the dark, then bold color blobs in constant flow.
Noise veins and blobs
Free
Organic noise shaders: glowing veins that pulse through the dark, then bold color blobs in constant flow.