artoolkitx / arunityx

artoolkitX for Unity, providing high-performance video acquisition, marker and texture tracking and full Unity Editor support
https://www.artoolkitx.org/
Other
41 stars 22 forks source link

NFT Marker doesn't track in Android #86

Open gravyday opened 1 year ago

gravyday commented 1 year ago

Hi Phil et al! As you know I've been trying to get my NFT project updated to ARX from AR5. I was able to get it to work on iOS and in fact the newest build package works for me on iOS as is, but I still can't get the Android build to track the gibraltar.jpg.

I realize that you have renamed the NFT scene to "LegacyNFTMarkerScene" which seems to indicate that you are dropping support for NFT tracking, but I'm praying there is still hope to get this legacy scene to work on Android one last time.

So when I follow the quickstart and build the entire 1.1.11 package as is, using "build.sh ios android macos" , then import the package into Unity, it runs native on my mac and works on iOS. When I build and run on Android it does load the gibraltar marker without crashing, but then when I show it the image, the tracking cube doesn't show up.

Looking into the logs I find that it does "see" the marker, because I get messages like: "[info] Page[0] pre: 14, aft: 14, error = 0.593861" indicating that the marker is found, but then it never triggers Unity to show the cube.

I've taken a deep dive into the code, adding logging messages, and I can see that ar2Tracking always returns either error -3 or -4. When I compare the Android output to the working iOS output there seems to be a discrepancy in the surfaceSet matrices.

I assume this is again some sort of libjpeg issue, but I have tried everything I can think of so far, and I'm hoping that someone with deeper knowledge of the codebase will be able to just be able to say AHA! and flip a switch or option and magically make it work on Android again.

Very appreciative of any help or tips you can possibly offer, and let me know if you need more info. Thanks!

philip-lamb commented 1 year ago

The "legacy" name is only to encourage new applications to use the new 2D texture tracker, but there are no intentions to drop the NFT tracker. I'll do a test of the Android package this coming week and see what's going on... it might be the same issue as we had on iOS, but if it is then the fix will be different.