ARDK 教學

ARDK 是一套支援 Unity 遊戲引擎的 AR 擴增實境開發套件,可用於製作 SLAM 同步定位與地圖構建的應用程式。

相關報導 - Niantic 向全球 AR 開發者啟用 Lightship 平台 [ 巴哈姆特

設定教學 - https://lightship.dev/docs/ardk/setup/

訂閱價格 - https://www.nianticspatial.com/pricing

本教學使用 Unity 2022.3.29 版本,建立專案時選擇 Universal 3D (Core) ,可先用 Built-in 渲染管線。

開啟 Package Manager 選擇 Add package from git URL...

輸入 https://github.com/niantic-lightship/ardk-upm.git

增加 SharedAR 資源,重複以上步驟並使用此網址 https://github.com/niantic-lightship/sharedar-upm.git

安裝時選擇啟用 New Input System 並重新啟動,

注意!若出現錯誤請更換不同的 Unity 版本,例如使用 Unity 2022.3.62 LTS 版本曾出現錯誤無法執行!

 

 

創建 Lightship 帳號

  1. 點擊 [ Lightship > Settings ] 開啟專案設定,按下 Get API Key  按鈕
  2. 開啟 lightship.dev 開發者網站,建立 Lightship 帳號並登入網站。
  3. 開啟 Projects 網頁,按下 New Project 建立新專案,或選擇現有專案。
  4. In your project's Overview, copy the API Key by clicking the copy icon next to it.
  5. 回到 Unity 的 Lightship Settings 視窗,貼上剛才複製的 API Key 到 API Key 欄位。

 

啟用 XR Loader

  1. XR Plug-in Management
  2. In the XR Plug-in Management menu, select the Android tab, then check the box labeled Niantic Lightship SDK + Google ARCore.

 

設定建置平台

1. 執行 File > Build Settings 開啟建置設定視窗

2. 選擇 Android 平台,開啟 Player Settings 進入Other Settings 進行以下設定:

  • Rendering - 取消 Auto Graphics API. 如果看到 Vulkan 出現在 Graphics API list 請移除!
  • Identification - 設定 Minimum API Level = Android 7.0 'Nougat' (API Level 24) 以上版本
  • Configuration - 設定 Scripting Backend = IL2CPP 然後啟用 ARMv7 與 ARM64

 

Gradle installation instructions

  1. 下載與安裝 Gradle 6.7.1 from the Gradle Releases page.
  2. 替換 Unity 預設的 default Gradle install in Unity
  3. 開啟偏好設定 Preferences > External Tools > Android.
  4. 取消勾選 labeled Gradle installed with Unity (recommended), then replace the path with your local installation of Gradle 6.7.1.

 

設定基本 AR 場景

建立新場景,選擇 Basic (Built-in) 按 Create 建立

刪除 Main Camera 攝影機 

新增 ARSession 與 XROrigin 到您的新場景:

執行 [ Game Object > XR > AR Session ]

Repeat to add an XR Origin (Mobile AR).

執行 File > Save 儲存場景。

 

 

VPS ( Visual Positioning System )

Niantic's VPS (Visual Positioning System) enables centimeter-accurate localization for users and AR content at real-world locations. VPS usage is billed based on monthly VPS calls to the localization server.

Up to 10,000 calls 免費

 

Private VPS Locations

Private VPS enables the creation and usage of access-controlled VPS locations. Owners of these locations have control over visibility, access, and life cycle of the location and its scan data. Billing is based on number of locations.

Note that creation of public VPS locations is free.

 

Shared AR

Shared AR enables collaborative or competitive experiences with up to 10 simultaneous users. Shared AR usage is billed based on the number of multiplayer sessions each month.

Up to 2,500 sessions 免費

 

Niantic SDK

The Niantic SDK provides a powerful suite of on-device computer vision features, including depth, occlusion, semantics and real-time meshing. SDK usage is billed based on the number of unique active users each month (MAU).

Up to 500 MAU 免費

 

Maps SDK

Customizable basemaps optimized for XR use cases, with vector-based tiles for smooth zooming and panning and caching for fast loading in low connectivity. Maps SDK is billed based on the number of unique active users each month (MAU).

Up to 25,000 MAU 免費