本文所述變更僅適用於使用 ARCore SDK 1.31 以上版本編譯的應用程式。使用舊版 ARCore 編譯的應用程式不會受到影響。
在 2022 年 5 月 1.31 版中,ARCore 的深度範圍上限已從 8.191 公尺提升至 65.535 公尺。Depth API 現在會使用每個像素的所有 16 位元來表示深度,先前只會使用 13 位元表示深度值。雖然使用舊版 ARCore SDK 中下列方法的應用程式仍可透過先前的深度範圍運作,但我們建議您在程式碼集更新這些方法,以提升功能。
平台專屬變更
Android (Kotlin/Java)
| 先前的函式名稱和功能 | 新的方法名稱和功能 |
|---|---|
| 最大範圍 8.191 公尺 | 最大範圍為 65.535 公尺 |
Frame.acquireDepthImage() |
Frame.acquireDepthImage16Bits() |
Frame.acquireRawDepthImage() |
Frame.acquireRawDepthImage16Bits() |
Image.getFormat() 傳回 ImageFormat.DEPTH16 |
Image.getFormat() 傳回 HardwareBuffer.D_16 |
Android NDK (C)
| 先前的函式名稱和功能 | 新的方法名稱和功能 |
|---|---|
| 最大範圍 8.191 公尺 | 最大範圍為 65.535 公尺 |
ArFrame_acquireDepthImage() |
ArFrame_acquireDepthImage16Bits() |
ArFrame_acquireRawDepthImage() |
ArFrame_acquireRawDepthImage16Bits() |
ArImage_getFormat() 傳回 AR_IMAGE_FORMAT_DEPTH16 |
ArImage_getFormat() 傳回 AR_IMAGE_FORMAT_D_16 |
Unity (AR Foundation)
所有變更都由 AR Foundation 處理。使用 ARCore Extensions for AR Foundation 1.31 以上版本建構時,AROcclusionManager.TryAcquireEnvironmentDepthCpuImage 會傳回使用 65.535 公尺新最大範圍的圖像。