This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import AVFoundation | |
| import Foundation | |
| @main | |
| struct SpeedUpRecording { | |
| static func main() async throws { | |
| guard CommandLine.arguments.count == 3 else { | |
| print("Usage: speed-up input.mov output.mov") | |
| return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| # SKCameraNode vs Manual Camera: Fiters & Snapshots | |
| A scene that compares SKCameraNode with a manual camera setup. | |
| https://gist.github.com/AchrafKassioui/9f23cef667aba3ca45c4fc21d48c4acf | |
| ## Dependencies | |
| - SpriteKit Inertial Camera: https://www.achrafkassioui.com/spritekit-inertial-camera/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| # SKLight | |
| A sample scene using SpriteKit built-in lighting and hard shadows. | |
| Achraf Kassioui | |
| Created 27 Jun 2026 | |
| Updated 2 Jul 2026 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| # SKRenderer + Metal Shader | |
| This experiment applies a Metal shader to a specific layer in the scene. | |
| Achraf Kassioui | |
| Created 1 Jul 2026 | |
| Updated 5 Jul 2026 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| # SKRenderer + MetalKit View | |
| A minimal setup to render a SpriteKit scene with SKRenderer and MTKView. | |
| The same scene can run in two modes: | |
| - Presented with SpriteView/SKView. | |
| - Rendered manually with SKRenderer and MTKView. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| # Sprite Motion Blur | |
| This scene implements per-sprite motion blur with a fragment shader. | |
| The sprite is larger than the visible shape, so the shader has transparent drawing room around the circle. | |
| Each fragment samples the sprite texture several times along the current movement direction, then averages those samples into one final color. | |
| The scene updates the blur direction and length from the sprite physics velocity. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| # Line Shader | |
| A minimal setup to start with SpriteKit shaders. | |
| This setup uses a sprite as a drawing canvas. | |
| A shader draws a line from point A to point B. | |
| Touching the scene anywhere updates the point B location and the shader's drawing. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| # SpriteKit Physics Determinism | |
| Is SpriteKit's physics engine deterministic? | |
| In some cases, the physics-based behavior is quite repeatable. | |
| In other cases, the simulation yields a different outcome every run. | |
| This is a setup to explore such behaviors. | |
| Press one of the buttons to play a sequence. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| Code sample for manual camera setup in SpriteKit. | |
| Achraf Kassioui | |
| Created 27 August 2025 | |
| Updated 28 August 2025 | |
| */ | |
| import SpriteKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| # SpriteKit Memory Buildup | |
| Testing memory build up of a SpriteKit scene when it is presented again and again. | |
| Achraf Kassioui | |
| Created 23 November 2024 | |
| Updated 23 November 2024 | |
NewerOlder