如何判斷特定裝置和 AR 工作階段是否具備影格緩衝區 (以及
稱為影格延遲),使用 adb Logcat 輸出內容:
# Camera frame buffering is turned off when frame delay is zero.adblogcat|grep'Update Frame Delay'…Inative:session.cc:3141UpdateFrameDelayto0frames.
# Camera frame buffering is turned on when frame count is non-zero.# Note: The size of the buffer can vary over time.adblogcat|grep'Update Frame Delay'…Inative:session.cc:3141UpdateFrameDelayto6frames.……Inative:session.cc:3141UpdateFrameDelayto4frames.……Inative:session.cc:3141UpdateFrameDelayto2frames.
記憶體
每增加一個相機影格,就會提高記憶體使用率。例如:
1080p 紋理會消耗約 6 MB 的記憶體 (只要將
解析度為 1920 x 1080 x 3 位元組 RGB 資料。
[null,null,["上次更新時間:2024-10-14 (世界標準時間)。"],[[["ARCore's camera frame buffering, enabled by default for some features or manually by the app, enhances rendering by storing multiple camera frames."],["Buffering improves rendering performance and reduces stutter, especially in apps with multithreaded rendering pipelines, but it increases memory usage."],["ARCore dynamically adjusts the buffer size, and the `adb logcat` output reveals whether frame delay (buffering) is enabled and the current buffer size."],["Performance gains from buffering depend on factors like the app's rendering pipeline, threading model, device, and OS, so thorough testing on target devices is crucial."],["Apps can enable buffering and manage textures through specific ARCore functions, ensuring the efficient utilization of camera frames for rendering."]]],["ARCore 1.17.0 supports buffering multiple camera frames in a texture queue to enhance rendering performance, particularly for multithreaded pipelines. Buffering is enabled by providing multiple texture IDs via `ArSession_setCameraTextureNames(ids)`, or when certain ARCore features like Augmented Images or Faces are active, or on some specific ARCore devices. Frame delay, indicating active buffering, can be monitored via `adb logcat`. Each additional buffered frame increases memory use. Apps can use `ArFrame_getCameraTextureName()` to get the texture ID. The frame rate improvement depends on device and app design.\n"]]