使用 Unity 的 AR Foundation 搭配 Vulkan 轉譯 AR 應用程式
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
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 清單。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-14 (世界標準時間)。
[null,null,["上次更新時間:2025-07-14 (世界標準時間)。"],[],[],null,["# Render your AR app using Vulkan with Unity's AR Foundation\n\nVulkan Rendering is supported with ARCore on Unity's AR Foundation. Follow this\nguide to enable the Vulkan Graphics API in your Unity project.\n\nInstall the correct version of Unity packages\n---------------------------------------------\n\nThe following package versions are required to use the Vulkan Graphics API for\nrendering. In **Window \\\u003e Package Manager**, ensure that the following\npackages and their corresponding versions are installed:\n\n1. [AR Foundation](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@6.1/manual) **6.1.0-pre.2 or later**\n2. [Google ARCore XR Plugin](https://docs.unity3d.com/Packages/com.unity.xr.arcore@6.1/manual) **6.1.0-pre.2 or later**\n\nConfigure your project\n----------------------\n\nTo enable the Vulkan Graphics API in your Unity Project, follow these steps:\n\n1. In **Edit \\\u003e Project Settings \\\u003e Other \\\u003e Rendering \\\u003e Graphics API** , add the **Vulkan** API option.\n2. Vulkan Rendering requires Android API Level 29 or higher. In Unity, go to **Edit \\\u003e Project Settings \\\u003e Other \\\u003e Identification \\\u003e** , set the **Minimum API** to API level 29 or higher.\n3. To use the Vulkan Graphics API with the Universal Render Pipeline, locate your active Universal Renderer asset. In your Project assets, use the search filter `t:UniversalRenderPipelineAsset`. In its Inspector, add an `ARCommandBufferSupportRendererFeature` to the list of Renderer Features."]]