Skip to content

Release 1.3.4: New backgrounds, bug fixes, and WarpLayer with relativistic physics#25

Open
ppamorim wants to merge 15 commits intodevelopmentfrom
feature/corrections
Open

Release 1.3.4: New backgrounds, bug fixes, and WarpLayer with relativistic physics#25
ppamorim wants to merge 15 commits intodevelopmentfrom
feature/corrections

Conversation

@ppamorim
Copy link
Member

Summary

  • New backgrounds: Psychedelic, Liquid, PuppyLayer (Apple logo tunnel zoom), and Warp Speed (relativistic star field with Metal shaders)
  • WarpLayer: The most complex rendering in the project — features relativistic aberration, Doppler color shift, beaming, streak taper, dynamic tunnel vignette, micro vibrations during speed transitions, back-easing curves with anticipation/overshoot, per-layer depth noise, and speed-dependent star density
  • Bug fixes: 13 bugs from code review, macOS Sonoma lifecycle issues, Metal layer resolution on resize, star artifact in Liquid/Psychedelic shaders, contentsScale for external monitors, critical CPU usage fix, memory leaks, SwiftLint warnings, release workflow fixes
  • CI: Added Xcode build verification to workflow
  • Docs: Updated CHANGELOG and README for 1.3.4

Test plan

  • Verify all background modes render correctly: Rainbow, Solid, Linear Gradient, Circular Gradient, Psychedelic, Liquid, Puppy, Warp Speed
  • Confirm WarpLayer idle phase shows dense twinkling stars with good brightness
  • Confirm WarpLayer acceleration has anticipation dip, overshoot, and micro vibrations
  • Confirm WarpLayer at full warp shows aberration, Doppler shift, beaming, and tunnel vignette
  • Confirm WarpLayer deceleration is gradual with vibrations
  • Test on external/HiDPI monitors for correct contentsScale
  • Verify no CPU spikes when screensaver is inactive
  • Confirm macOS Sonoma lifecycle (preview, multi-instance, terminate) works correctly

Introduce two new GPU-rendered background types using MetalKit:
- PsyLayer: kaleidoscopic mandala with domain warping, plasma, and HSV color cycling
- LiquidLayer: organic flowing effect using fruit-shaped SDF contours

Both layers use signed distance fields derived from the Fruit/Leaf bezier
paths so concentric rings and spirals follow the apple silhouette.
Remove atan2-based angular patterns and SDF contour rings that created
a visible star/cross at the center due to the atan2 singularity at the
origin. Replace with multi-chain domain warping and plasma fields for
smooth organic flow. Make PsyLayer more aggressive with higher
frequencies, stronger contrast, and faster animation.
Metal SDF shader renders the Apple logo silhouette using two
circles with aspect correction, circular bite, and a rotated
ellipse leaf. Multiple concentric copies scale down toward the
center with smooth cosine-based color alternation and edge glow,
creating an infinite zoom tunnel animation.
Metal shader renders a 3D star field as dot particles that stretch
into radial streaks during warp. Speed oscillates between calm
cruise (twinkling dots) and intense warp bursts (dense streaks
with central glow). Registered as "Warp Speed" in FruitType enum
and preferences UI.
Update drawableSize when CAMetalLayer frame changes so the shader
renders at the correct resolution instead of stretching a stale
texture. Also switch WarpLayer UV normalization to a fixed reference
size so particle density stays consistent across view sizes, and
simplify init(layer:) presentation copies to avoid accessing
invalid Metal state.
Make particles nearly stationary at idle (0.05-0.15) with speed-dependent
scroll rate, increase warp speed range (8-14) for more dramatic effect,
and replace generic easeInOut with back-easing curves that reverse before
accelerating and overshoot before settling.
Add aberration, Doppler shift, beaming, streak taper, and dynamic
tunnel vignette to the warp shader. Increase star density at idle,
add gentle deceleration easing, micro vibrations during speed
transitions, and longer idle phases. Update CHANGELOG and README
with all 1.3.4 features and fixes.
Break up uniform layer spacing with a small hash-based offset so
stars don't scroll in lockstep across depth layers.
Raise base brightness from 1.0 to 2.0 so twinkling stars are more
visible when not in warp mode.
Reverts all changes to FruitScreensaver.swift that broke multi-monitor
support and caused FPS degradation.
Move all speed-dependent smoothstep/mix computations from fragment
shader to CPU-side precomputation, passed via expanded uniform buffer.
Replace exp() with rational falloff, reduce layers 30->20, add
warp_hash2 to halve hash calls, and use Reinhard tonemapping.
Use per-component hash multipliers to prevent warp_hash2 from producing
identical x/y outputs when input has x==y, which caused stars to align
on the diagonal. Also skip twinkle/color work for negligible-brightness
stars.
Constrain fragment shader execution to the fruit's bounding area across
all layer types (Warp, Puppy, Psy, Liquid, CircularGradient, LinearGradient,
Solid), skipping GPU work for pixels outside the visible fruit region.
WarpLayer also gains CPU-side pre-computation of per-layer constants.
Dark North Atlantic ocean simulation featuring rolling wave fronts,
deep Titanic-style blue palette, foam and spray on crests, and
visible surface current swirls via chained FBM.
Add DebugStatsView with CATextLayer-based rendering for FPS, per-process
CPU usage (Mach thread info), and system GPU utilization (IOKit). Wired
into both FruitScreensaver and PreferencesViewController behind a
showDebugStats toggle. Fix missing Metal resource copies in
CircularGradientLayer, LinearGradientLayer, and SolidLayer init(layer:).
Update multiscreen lame-duck docs with window-identity safe variant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant