Mac版のELEX II:テクニカルFAQ

MacへのELEX IIの導入

Piranha Bytesは常に複雑で高度なゲームを提供することを目指しており、MacへのELEX IIの導入も例外ではありませんでした。ELEX IIは、Metalシェーディング言語を利用してAppleのシリコンのパフォーマンスを引き出しています。MacではMetalのIndirect Command Buffer(ICB)のアプローチを完全に活用しており、ゲームはGPU駆動のパイプラインにも完全に対応しています。GPUとMetalに特化したチームが、DX12バージョンのELEX IIをMacにポートするのに約8ヶ月かかりました。

Mac版ELEX IIのテクニカルFAQ
概要

・カリングプロセスの最後にICBを埋めたGPU駆動のパイプライン
・フレーム内には6つ以上のGPUカリングセグメント(デプスプリパス、シャドウなど)があり、すべてのセグメントでICBが使用されます。

テクニカル機能の詳細

ELEX IIは、Metalエンジニアと緊密に連携して、多くの強力な機能とツールを最大限に活用し、本当に素晴らしいゲームを提供しました。以下にいくつかの機能を紹介します:

ICB:ICBは次のパラメータで使用されました

・継承されたパイプライン
・継承されたバッファ
・レンダリングのみ(計算ではない)
・ドローとテッセレーションのすべてのタイプに対応

シェーダー(Shaders)

・SlangツールをmacOSにポートし、ソースレベルでのHLSL→Metal 2.xへの変換を行いました。

macOS上のMetalアプローチ

マルチスレッドのコマンドバッファのエンコーディングと送信を利用し、ゲームは巨大なオープンワールドを並列的に効率的にレンダリングできます。
・ゲームはダブルバッファリングを使用し、単一の「待機」はなく、すべての処理がCPUとGPUの同期ポイントなしに行われます。
・ゲームはシェーダー内でテクスチャとサンプラーを渡すためにアーギュメントバッファを完全に活用しています。

Metalに使用され、ポートされたゲームテクノロジー

・グローバルイルミネーション
・ボリューメトリックフォグ
・ディファードクラスタードライティング
・プロシージャルスカイ
・GPU駆動のクロス
・GPU駆動のパーティクル
・リアルな雪と雨
・リレフレクションプローブ付きの昼夜サイクル

Metalとの完全な互換性

テッセレーションシェーダー:

・通常のHLSLシェーダーをMetalベースのアプローチに変換しました。
・エフェクト(火、水)や、極めてテッセレートされたオブジェクト(異星生物)などでテッセレーションが大量に使用されました。
・何も妥協せず、テッセレーションのすべての側面が保持されました。

DX12 APIからMetalへ

・ルートシグネチャの模倣
・リソースの割り当て/使用/デスクリプタテーブルの模倣
・Render Command Encoderとパイプラインステートの裏側での切り替えを、Engineが通常通りに使用し、Metal APIを意識する必要はありません。

ポートされたゲームテクノロジー

・ハプティックフィードバックを備えたフルコントローラーサポート
・キーボード/ゲームパッドのオンザフライ切り替え
・ゲームがレンダリングするモニターの選択機能
・Mac上でのゲームの調理とパッキングが完全に行われます。
・ARMおよびx64のサポート
・主なビルドツールとしてXcode 13.xを使用
・主な開発ツールとしてXcode 14.xを使用
・アチーブメントを備えたGameCenter統合
・サンドボックス付きのAppStore対応バンドル

ELEX II on Mac: Tech FAQ

Bringing ELEX II to Mac

Piranha Bytes always strives to deliver more complex and enhanced games, and bringing ELEX II to Mac was no exception. ELEX II takes advantage of the Metal shading language to tap into Apple silicon performance. With Metal's Indirect Command Buffer (ICB) approach on Mac, the game also fully embraces GPU driven pipelines. In a little over eight months, a team specializing in GPU and Metal ported the DX12 version of ELEX II to Mac.

Tech FAQ of ELEX II on Mac
Overview

• GPU driven pipeline with ICB filled at the end of culling process
• There are more than 6+ GPU culling segments (Depth Pre-Pass, Shadows) in the frame with ICB used in every segment

Tech Features Deep Dive

ELEX II worked closely with Metal engineers to take full advantage of the many powerful features and tools to deliver a truly wonderful game. We’ve outlined some of these features below:

ICB: ICB was used with the following parameters

• Inherited pipelines
• Inherited buffers
• Render only (not compute)
• All types of draw + tessellation as well

Shaders

• Slang tool ported to macOS with the source level HLSL->Metal 2.x conversion for:
  - Vertex and Fragment shaders
  - Geometry shaders
  - Tessellation shaders
  - On/Off support for argument buffers
  - Emulation of DX12 RootSignatures
  - Support for most of ‘non-typical’ stuff like atomics, SIMD groups

Metal approaches on macOS

• Utilizing multi-threaded Command Buffer encoding and submission, which means the game can efficiently render the massive open-world in a parallel manner.
• The game uses double buffering and not a single ‘wait’, everything is happening without any CPU-GPU synchronization point.
• The game fully embraces Argument buffers for passing textures and samplers inside shaders.

Game Technology used and ported to Metal

• Global Illumination
• Volumetric Fog
• Deferred Clustered Lighting
• Procedural Sky
• GPU driven cloth
• GPU driven particles
• Realistic snow and rain
• Day/night cycles with relit reflection probes

Full compatibility with Metal
Tessellation shaders:

• Conversion of normal HLSL shaders into Metal based approaches
• Massive use of tessellation in effects (fire, water), extremely tessellated objects (alien lifeforms)
• Nothing was compromised, every aspect of tessellation was preserved

DX12 API to Metal

• Imitation of Root Signatures
• Imitation of Resources allocation/usage/DescriptorTables
• Behind the scenes switching of Render Command Encoder and pipeline states, into a separate library, which Engine just normally uses unaware of Metal API

Game Technologies Ported

• Full controller support with haptic feedback
• On-the-fly keyboard / gamepad switching
• Game ability to choose monitor to render
• Game cooking and packing is fully done on Mac
• ARM and x64 support
• Xcode 13.x used as main build tool
• Xcode 14.x used as main development tool
• GameCenter integration with achievements
• AppStore ready bundle with Sandboxing