Unity 的 AR Foundation 支援 ARCore 的 Vulkan 算繪。請按照這份指南在 Unity 專案中啟用 Vulkan Graphics API。
安裝正確版本的 Unity 套件
您必須使用下列套件版本,才能使用 Vulkan 圖形 API 進行轉譯。在「Window」>「Package Manager」中,確認已安裝下列套件及其對應版本:
- AR Foundation 6.1.0-pre.2 以上版本
- Google ARCore XR 外掛程式 6.1.0-pre.2 以上版本
設定專案
如要在 Unity 專案中啟用 Vulkan 圖形 API,請按照下列步驟操作:
- 依序前往「Edit」>「Project Settings」>「Other」>「Rendering」>「Graphics API」,新增「Vulkan」API 選項。
- Vulkan 算繪需要 Android API 級別 29 以上版本。在 Unity 中,依序前往「Edit」>「Project Settings」>「Other」>「Identification」>,將「Minimum API」設為 API 級別 29 以上。
- 如要將 Vulkan Graphics API 與通用轉譯管道搭配使用,請找出您目前使用的通用轉譯器資產。在專案素材資源中,使用搜尋篩選器
t:UniversalRenderPipelineAsset
。在 Inspector 中,將ARCommandBufferSupportRendererFeature
新增至 Renderer Features 清單。