viro
viro copied to clipboard
Loading multiple ViroARImageMarker without blocking the UI
Environment
- Development OS: Mac
- Device OS & Version: iOS 13
- Version: ViroReact 2.17.4, React Native 0.62.2
- Device(s): iPhone 7 Plus
Description
I need to track multiple images using ViroARImageMarker. The only problem I have is that when I mount Viro with all my ViroARImageMarker
components, the UI freezes for 1-2 seconds. It seems like all the loading is done on the UIThread.
The 1-2 seconds loading time is not an issue for me, but the UI freezed is. Is there a way to move the ViroARImageMarker loading away from the UIThread?
Reproducible Demo
Just create a ViroArScene
with 20-30 ViroARImageMarker
hi @gbalduzzi Have you solved this problem yet
I noticed also there is an issue that it consumes a lot of device power when rendering multiple markers.
No, I have not solved it yet. I mitigated the problem by:
-
Lowering the targets resolution and size (it probably is a best practice anyway to use low-resolution targets). My original targets photos were 2500x1400 and I compressed them to 500x280 jpg with 70 compression quality. The targets were still identified pretty easily
-
Rendering an empty scene initially and only adding the image markers in a second step. This way the markers loading do not interfere with the screen presentation and the UI freezing is way less noticeable
hi @gbalduzzi do you know how to check target center in image center in a rectangle
hi @gbalduzzi, I have this issue when use multiples targets (If i find target 1 then find target 2 I can't find target 1 again), https://github.com/ViroCommunity/viro/issues/160. Do you have it too? or is something on my code. Thanks.