Forging Ferox

Open source ยท Apache 2.0 Pre-release 0.1.0

Swift Engine Ferox

Forged in Swift. Fired by Metal.

The open-source game engine for Apple Silicon.

Ferox is a Metal-native game engine for macOS, written in Swift. 2D and 3D, physically based rendering, hybrid ray tracing, MetalFX upscaling, physics and an editor, all in small Swift modules you can read.

Features

Open source, and everything a small or medium game needs.

Ferox provides the parts a small or medium 2D or 3D game normally needs, and every part is open source under the Apache License 2.0.

  • 2D rendering

    Batched sprites, shapes and chunk-cached tilemaps, 2D lights with normal maps, sprite masks, parallax and pixel-perfect cameras.

  • Physically based 3D

    Clustered PBR with metallic-roughness materials (glTF compatible), skinned meshes, LOD, cascaded shadows and image-based lighting.

  • Hybrid ray tracing

    Ray-traced shadows, reflections and ambient occlusion where the GPU supports them, with raster fallbacks.

  • MetalFX upscaling

    The Ferox temporal upscaler, MetalFX spatial and temporal upscaling, dynamic resolution and quality presets.

  • Entity-component-system

    A sparse-set ECS with hierarchy, a fixed-timestep loop with interpolation, events and a job system.

  • Physics in 2D and 3D

    Rigid bodies with sequential impulses, joints, triggers, queries and a character controller.

  • Audio, UI and animation

    Spatial audio, retained-mode UI, animation clips and state machines, and CPU and GPU particles.

  • Editor

    FeroxEditor offers a hierarchy, inspector, Play, Pause, Step and Stop, snapshot undo and redo, and scene files.

  • Networking foundations

    Transport, reliable channels and snapshot replication. Scoped as foundations, not a finished multiplayer stack.

Apple Silicon

Built for Apple Silicon

Ferox renders only through Metal and avoids cross-platform abstraction layers, so the renderer can use what the hardware offers.

  • Unified memory
  • Tile memory for transient attachments
  • Argument buffers
  • Metal ray tracing
  • MetalFX

When a feature is unavailable, Ferox checks for it at run time and falls back cleanly.

Platform support
PlatformStatus
macOS 14+, Apple SiliconPrimary target: full renderer, ray tracing and MetalFX where the GPU supports them.
macOS 14+, Intel with a Metal GPUIntended to work, with features chosen by run-time capability checks.
LinuxThe platform-independent modules build and are tested in CI. No renderer, window or audio. Headless mode works.

Pre-release. The Swift sources and Metal shaders have been syntax-checked but not yet compiled, run or profiled on Apple hardware. Expect compile errors on the first build, and please report them. This site publishes no benchmark figures, because none have been recorded.

Quick start

Clone, build and run.

You need macOS 14 or later and Xcode 15.3 or later, which provides Swift 5.10. Apple Silicon is recommended.

Terminal
git clone https://github.com/virajshoor/Ferox.git
cd Ferox
swift build
swift test
swift run HelloFerox

Every example also runs headless, without a window. This mode works on Linux too: swift run HelloFerox --headless --frames 120

Tools

Editor, diagnostics and benchmarks.

  • FeroxEditor

    Hierarchy, inspector, gizmos, Play and Stop, undo, and opening and saving .fxscene files. It is still a basic editor, with no viewport picking and a fixed toolbar layout.

    swift run FeroxEditor

  • FeroxDiag

    Reports the GPU's capabilities and which features each quality preset enables, with an optional offscreen render smoke test.

    swift run FeroxDiag --render

  • FeroxBenchmarks

    Repeatable CPU and offscreen GPU benchmarks with JSON output. Run them in release mode on your own machine. No results are published here.

    swift run -c release FeroxBenchmarks --quick

Modules

Small Swift modules you can use on their own.

Importing Ferox gives you every module. The individual modules can also be used on their own. Most of them do not need a GPU.

  • FeroxMathVectors, matrices, quaternions, colour, geometry, transforms and random numbers.
  • FeroxCoreTime, events, jobs, logging, profiler, JSON values, handles and safe paths.
  • FeroxSceneECS world, hierarchy, system scheduler and scene serialisation.
  • FeroxPhysics2D and 3D rigid bodies, joints, queries and a character controller.
  • FeroxAnimationAnimation clips and animator, tweens, timelines, and CPU and GPU particles.
  • FeroxInputKeys, gamepads, action maps and contexts, and input recording and playback.
  • FeroxAssetsAsset manager and database, glTF 2.0 import, and PNG and JPEG decoding.
  • FeroxRenderMetal renderer: frame graph, passes, lighting, post-processing, ray tracing and 2D batching.
  • FeroxUIControls, layout anchors, draw lists, text and fonts.
  • FeroxAudioAudio model and the AVFoundation backend.
  • FeroxNetTransport, connections, peers, replication and message coding.
  • FeroxUmbrella module: Engine, Game, GameLauncher and the editor core. Re-exports every module.