Singularity MacOS Metal

Singularity MacOS Metal is a native macOS port of Singularity for Apple silicon that translates Direct3D 9 to Metal and XAudio2 to Core Audio.

README

Singularity for macOS (Apple silicon, Metal)

This project makes a native macOS app of Singularity (2010) from your own copy of the game.

  • The app runs natively on Apple silicon. It does not use Rosetta or Wine.
  • Direct3D 9 goes directly to Metal. XAudio2 goes to Core Audio.
  • The installer translates the game code of your copy on your Mac (static recompilation).

This repository contains no game files and no game code. You must own the game. The installer supports only the GOG release.

Requirements

  • A Mac with Apple silicon (M1 or later).
  • macOS 14 or later.
  • The Xcode Command Line Tools. The installer opens the install window if they are not installed.
  • An internet connection during the install. The installer downloads the Python package capstone and NVIDIA system files that the game needs.
  • Approximately 3 GB of free disk space for the build.
  • The installed game folder of the GOG release, with the Binaries and RvGame folders.

The installer checks the SHA-256 values of the game files. It stops if a file is not the GOG version.

FileSHA-256
Binaries/Singularity.exe8d438b6c0bd51ab8f24a6a2b6ac569ded6def84b20dc407357c4f78e97c0be1e
RvGame/CookedPC/UI_SinglePlayer_SF.xxxc8cdb2e193b53781d7634eee88f2dc90fd168b5dcc639098441a2b489386984f

install.sh lists the values of the other files.

How to get the game folder on a Mac

Install the GOG release of Singularity with CrossOver, as you would any Windows game. Then point Singularity at the installed game folder.

The game folder is inside the CrossOver bottle, usually drive_c/GOG Games/Singularity. In CrossOver, select the bottle and use Open C: Drive to find it. In the folder window of Singularity, press Command-Shift-G to go to a folder by its path.

You can also copy the installed game folder from a Windows PC.

Install

  1. Download Singularity-Mac-ARM64.zip from the latest release and unzip it.
  2. Move Singularity to your Applications folder and open it.
  3. The first time, macOS says it can't check the app. Open System Settings → Privacy & Security, scroll down, click Open Anyway, then open Singularity again.
  4. Choose your Singularity game folder (the GOG release: the folder with Binaries and RvGame).
  5. Wait while Singularity is made for this Mac from your copy. This takes a few minutes and happens only once. If the Xcode Command Line Tools are missing, macOS asks to install them: install them, then open Singularity again.
  6. The launcher window opens. Click Play.

After the first time, opening Singularity goes straight to the launcher window.

The download contains no game files and no game code. Everything is made on your Mac from your own copy.

Install from Terminal

You can also run the installer yourself. Download this repository (Code → Download ZIP, or git clone), then in Terminal:

cd /path/to/the/repository
bash install.sh "/path/to/Singularity"

This puts Singularity in your Applications folder. Use --dest for a different folder:

bash install.sh --dest ~/Applications "/path/to/Singularity"

The app reads the game data from the game folder. Do not delete the game folder after the install. If you move the game folder, select the new folder in the launcher window with Choose Folder….

Launcher window

The launcher window opens each time you open the app. In the launcher window, you can:

  • Select the game folder with Choose Folder…. A green mark shows that the folder can be used. A yellow mark shows the problem of the folder.
  • Change the settings. These are the settings of the Enhancements page of the game.
  • Set the settings in the window to the default values with Restore Defaults.
  • Start the game with Play. The game uses the settings of the window.

To quit without playing, close the window.

The launcher window remembers the game folder of the last Play. If that folder cannot be used, the window shows the game folder that the installer used.

Settings

SettingValuesDefault
Anti-AliasingOff, MetalFX, MetalFX Quality, MetalFX Balanced, MetalFX PerformanceMetalFX
SharpeningOff, Low, Medium, HighMedium
Frame GenerationOff, OnOff
Ambient OcclusionOff, Low, Medium, High, Ray TracedMedium
Global IlluminationOff, Low, Medium, HighOff
ReflectionsOff, Low, Medium, High, Ray TracedOff
Contact ShadowsOff, OnOn
BloomOff, Low, Medium, HighMedium
Tone MappingGame, GT7GT7
Field of View70 to 120 degrees, in steps of 590 (the value of the game)
HDR OutputOff, OnOff
Peak Brightness (HDR)Automatic, 400, 600, 800, 1000, 1200, 1400, 1600, 2000, 3000, 4000 nitsAutomatic
Paper White (HDR)80, 100, 150, 203, 250, 300, 400, 500 nits203 nits (the HDR Reference White of Report ITU-R BT.2408)
Skip Intro VideosOff, OnOff
Frame Rate LimitOff, 30, 40, 60, 120 frames per secondOff

HDR Output needs a display with HDR (EDR) support.

Peak Brightness Automatic uses all the brightness that macOS gives to the app (the EDR headroom of the display at that time). Use a value in nits if the highlights are too bright or if they clip.

With HDR Output, the videos of the game (intro and loading videos) also show in HDR. The app converts the SDR color of each video frame with Method A of Report ITU-R BT.2446-1. Thus the bright parts of a video become brighter than paper white, and the dark parts stay near their SDR level. The Paper White and Peak Brightness settings also apply to the videos.

Frame Rate Limit shows each frame at a refresh of the display, at even intervals. Each frame of the game then takes the same time, for example 25 ms at 40 frames per second. This gives smoother motion than a frame rate that changes. On a display with ProMotion or another variable refresh rate, the app asks for the highest refresh rate of the display. With Frame Generation, the limit is the number of frames that the display shows (the game makes half of them).

Paper White is the brightness of white in the image and the menus of the game, in nits. It does not change with the display brightness. The white of other apps (the SDR white of macOS) changes with the display brightness. Thus at a high display brightness, the game can be darker than other apps. The range of the highlights is the peak divided by paper white: for example, 1600 nits with paper white at 203 nits gives highlights up to 7.9 times paper white. A paper white near the SDR white of macOS gives a smaller range, and the image then looks only brighter.

Enhancements page

In the game, the main menu and the pause menu have the item Enhancements. The Enhancements page shows all the settings of the table on one page, in two columns. HDR Calibration opens the HDR settings (HDR Output, Peak Brightness and Paper White) with a test image. The Back key (Esc) goes from the Enhancements page to the menu that opened it.

The Video options menu (Options, then Video) shows only the settings of the game. The Bloom item of the Video options menu also sets the Bloom setting of the table: Off, or Medium when the setting was Off.

On the Enhancements page:

  • The Up and Down arrow keys move from row to row. The order is the left column from top to bottom, then the right column.
  • On Field of View, Peak Brightness and Paper White, the Left and Right arrow keys change the value.

Reset To Defaults is the command of the game for its own Video options. It does not change the settings of this table.

Anti-Aliasing:

  • MetalFX renders at the size of the display and smooths the edges.
  • MetalFX Quality, MetalFX Balanced and MetalFX Performance render at 67 %, 59 % and 50 % of the width and height of the display. MetalFX then upscales the image to the size of the display.
  • A change of the value on the Enhancements page applies at the next frame.

Sharpening sharpens the MetalFX image. It has an effect only when Anti-Aliasing is not Off.

Frame Generation makes one more frame between two frames of the game. It needs macOS 26 or later and Anti-Aliasing that is not Off. Each frame of the game is shown half a frame later.

Global Illumination adds light that bounces off lit surfaces onto surfaces near them. Each frame adds its result to the result of up to 15 previous frames, so the light has less noise. The light of the previous frame also lights the surfaces for the next frame, so the light bounces two times or more. When the light changes quickly, the old result is removed from the mix. Global Illumination uses only the image on the screen. Light from surfaces that are not on the screen is not added.

Reflections shows the scene on the surfaces of the scene. The game has no data about which surfaces are shiny, so all surfaces are a rough material, for example painted concrete. A surface reflects more when you look at it at a low angle. A reflection is sharp near the reflected object and becomes more blurred at a larger distance from it. Each frame mixes its reflections with the reflections of the previous frames, so the reflections have fewer steps and less flicker. Reflections uses only the image on the screen. Objects that are not on the screen are not in the reflections.

Reflections Ray Traced first finds the reflections of High. Where High has no full reflection (the reflected object is not on the screen, or it is near the edge of the screen), a Metal ray goes along the reflection direction against the geometry of the scene, up to 60 m. The color at the hit comes from the screen if the screen shows that point. If the screen does not show it, the color comes from a cache of the surfaces that the camera saw before. Limits:

  • The ray tracing geometry contains only the static meshes of the scene. Characters, other skinned meshes and particles are not in it. Reflections of these objects come only from the screen.
  • A surface that the camera did not see before has no color in the cache. Its reflection is not added. A surface that the camera does not see for 1800 frames is removed from the cache.
  • Ray Traced needs a GPU with Metal ray tracing. If the GPU does not have it, the scene has the reflections of High.

Ambient Occlusion Ray Traced finds the occlusion with Metal ray tracing against the geometry of the scene. The other values use only the image on the screen. Thus with Ray Traced, objects that are not on the screen also make corners and contact areas darker. Each frame sends 2 rays for each pixel at half the width and height of the image, in the radius of High. Each frame adds its result to the result of up to 15 previous frames, so the occlusion has less noise. Limits:

  • The ray tracing geometry contains only the static meshes of the scene. Characters, other skinned meshes, particles and meshes that the game changes in each frame are not in it. They do not make other surfaces darker.
  • Surfaces with cut-out transparency (for example grates) occlude as solid surfaces.
  • Ray Traced needs a GPU with Metal ray tracing. If the GPU does not have it, the scene has no ambient occlusion.

On an M4 Pro at 1920 x 1080, Ray Traced used approximately 0.5 ms more GPU time for each frame than High.

The app always changes the filter of the baked lighting of the levels (the lightmap and static shadow textures). It is not a setting. The game reads these textures with a bilinear filter, so the edges of the baked light and shadows are angular and show the texels. The app uses a bicubic filter that reads 4 x 4 texels for each pixel, so these edges become smooth curves. The filter does not add detail that is not in the textures, and small details in the baked lighting become slightly softer.

The app always changes the dynamic shadows of characters (the modulated shadows of the game, with an exponential shadow map). It is not a setting. The game filters these shadows over 2 x 2 texels, so their edges are hard and show the texels. The app finds the occluder in the shadow map and makes the edge softer when the distance from the occluder to the shadow is larger. Thus a shadow is sharp near the feet of a character and soft farther away.

When Anti-Aliasing is not Off, the app also changes the edges of cut-out surfaces, for example foliage, grates and fences. The game removes each pixel of such a surface where its opacity is below a limit. Thus the edges show steps and flicker when the camera moves. The app moves the limit by a small noise value in each frame. Then an edge pixel stays in the part of the frames that the surface covers, and MetalFX mixes these frames into a smooth edge.

Ambient Occlusion, Global Illumination, Reflections and Contact Shadows change the scene before the game draws the fog, fire, smoke and other transparent effects. Thus these settings do not change the fog and the transparent effects.

These items are always on: 16x anisotropic texture filtering, and reduced color banding (the game's color render targets keep 16 bits per channel, and the SDR output has 10 bits per channel with a dither of one step).

Saved games and settings

The app keeps saved games, game options and the settings in this folder:

~/Library/Application Support/SingularityMac

The app writes no log files. The installer does not change saved games or settings.

Troubleshooting

  • "is not the supported version": a file in your game folder is not the GOG release. Only the GOG release is supported.
  • "This is the Binaries folder of the game": select the folder above Binaries.
  • The launcher window shows a problem with the game folder: the game folder moved, or the selected folder is not the game folder. Click Choose Folder… and select the game folder (the folder that contains Binaries and RvGame).

Repository contents

Folder or fileContents
install.shThe installer. It checks the game, gets the build tools, translates the game code, builds the app and installs it.
runtime/The Windows runtime for macOS (Win32, Direct3D 9 to Metal, XAudio2 to Core Audio, input), the launcher window and the enhancements.
tools/The translator (x86 to C) and the tool that adds the Enhancements page to the Video options menu of the game, and the Enhancements item to the main menu and the pause menu.
hooks.txtThe calls from the translated code into the runtime (for example, the field of view).
release/The app of the GitHub release: it asks for your game folder, runs install.sh with it, then opens the launcher window. It has no game code (make release).

The build output (build/) contains the translated game code. Do not share it or the app that make app builds. Only build/release (make release) is safe to share.

Credits

  • Capstone disassembler (BSD license): https://www.capstone-engine.org. The installer installs it on your Mac.
  • Singularity is the property of its rights holders. This project is not affiliated with them.