Open ametis70 opened 4 years ago
How many would you want to load?
Now I'm just trying to load two, but maybe 5 or 6 in the future. I found that if I create another ARController I can load one marker in each controller. If wonder if it is meant to be used that way? Or should I be able to load multiple markers in the same ARController object?
@nicolocarpignoli had played with it. It is certainly not meant to be by loading ARController multiple times. But I thought @nicolocarpignoli had success with 2.
Hi @ianmethyst thanks for reporting this. What does it meams Uncaught in the log error? Can you post the entire log in specific the Uncaught part? I think that could be a memory issue....
I was able to make it work using AR.js version. Honestly we have to check on that and see differences. I'm sure we can make it work with lean jsartoolkit5 (it should be easier, actually).
I'll upload the complete log with an example project to replicate the error later. I'm not at home right now
@ianmethyst Perfect!
Sorry for the delay. Here is the log (which is way too big compared to what is shown in the Chrome DevTools), and a zip with a git repo that contains the example I used when I found this problem. I removed all the files from the jsartoolkit repo that are not related (but kept the directory structure) and added a npm script so you can do npm install && npm run serve
to launch a server with the example.
With git diff 417b1ff HEAD js/artoolkit.worker.js
you can check the changes introduced that make this error happen. I just copied and pasted the block that initializes the NFT marker, but this time I used the same marker twice (I tried using different markers but got the same result).
Is there any way I can help with this? I believe there is missing some documentation and some guidance on how to contribute, because I gladly help but I find myself quite lost when I try to navigate the repo. For instance, I don't fully understand what is built with emscripten and what is plain javascript that ends in the final code
We highly appreciate any help. So yes you can certainly help. What is your experience what would you like to contribute?
Sorry @ianmethyst @ThorstenBux i haven't had the time to look Into this. I will try today.
@ianmethyst i will provide an example soon with a different approach, though i would investigate deeply on that error in a near future.
I tested your code @ianmethyst rebuilding the libs with -s ALLOW_MEMORY_GROWTH=1
and i get again that error. We should try if this error also happens outside the WebWorker and understand well why this happens.
We highly appreciate any help. So yes you can certainly help. What is your experience what would you like to contribute?
I have some experience with JavaScript. I use it for frontend and backend (with Node.js) development. I've also been using three.js for a while.
I'd like to start helping fix this issue as it is something we are aware of, but I'd mostly like to contribute with the documentation, because I believe it's the most important part of any FOSS software. I'm gonna open another issue for that, though.
I tested your code @ianmethyst rebuilding the libs with
-s ALLOW_MEMORY_GROWTH=1
and i get again that error. We should try if this error also happens outside the WebWorker and understand well why this happens.
Alright, thanks for trying that @kalwalt. I'll remove the Worker from the repo from the example I uploaded and see if it stills throws the exception
@ianmethyst i also tested without the WebWorker and happens the same error. I think we should create a multi handler for Multi NFT, starting from the C++ code. We will go in detail in a dedicated issue.
I'd like to start helping fix this issue as it is something we are aware of, but I'd mostly like to contribute with the documentation, because I believe it's the most important part of any FOSS software. I'm gonna open other issue for that, though.
yes this is fundamental. I improved a bit the docs inside the api but should be enhanced. Actually you can create the docs running npm run create-doc
read in the readme.md.
any update on this? or any workaround? thank you for your time, im using artoolkit.min.js and I have same exception. Seem to be blocking in the second call to :
var id = Module._addNFTMarker(arId, prefix); if (callback) callback(id);.
First marker being added succesfully.
@ThorstenBux ThorstenBux @ianmethyst nicolocarpignoli any update? Thank you for your time.
@Memleak1 No any updates from this point, i was focused to solve other part of the code. To handle correctly and efficently a series of NFT markers is required some changes in the C++ code, I think i know how to do but never had the time to implement. :slightly_smiling_face:
Sorry, I was really busy lately and couldn't look into this this before. I just checked the code in the C++ ARToolKit5 repo and found a few things. I don't know C++, so correct me if I'm wrong, but the ARMarkerNFT
class inherits from ARMarker
that has a load()
method and a ARPattern
array (patterns
). Then, in the .cpp file of ARMarkerNFT
, for what I can see, load()
is implemented so that the pattern passed as an argument is saved into the first index of the patterns
array instead of being loaded into the next index. It's just a guess, but I believe that could be the cause of the exception being thrown.
I'll leave the links to the relevant files: ARPattern.h ARPattern.cpp ARMarker.h ARMarker.cpp ARMarkerNFT.h ARMarkerNFT.cpp
@ianmethyst you looked in the right place, we should implement a sort of iterator as it exist in ARMarkerNFT, but without the threaded part of course.
@kalwalt @ianmethyst, thank you for coming back to me, I tried to run the code to take a look and seem like I cannot build it using VS 2017. Did you manage to make it run? Seems I have issues with the KPM library
@Memleak1 You can use (and you should, to avoid unexpected errors due to OS differences) Docker to build jsartoolkit. It takes the C++ and turns it into JS using Emscripten. If you're trying to build C++ artoolkit5, then you can check this section of its readme.
@ianmethyst yes thats what we do to create an js version, but are you suggesting to make the change on the c++ side and test on the js side? I didnt have any luck building the C++ vs project so far 2017 & 2013.
@Memleak1 please open another issue and post some logs, with detailed informations as much as you can. You can file an issue here or at my repository issue tracker Thank you :slightly_smiling_face:
I can confirm this error. I have been digging through the codebase including the underlying artoolkit5 the past couple of days. It was a crazy journey :)
You cannot call addNFTMarker multiple times on a single AR controller. Once the marker dataset is set, calling this again will throw error. I believe there are a couple of logical flaws in the code. I wonder does anyone able to run multiple markers before.
I fixed a couple of things and finally managed to get something working. If you want, you can use my build here: https://github.com/hiukim/jsartoolkit5/tree/fixnft/build You still cannot call loadNFTMarker multiple times here, but I have extended a new method ar.loadNFTMarkers that accept multiple urls.
ar.loadNFTMarkers([markerURI_1, markerURI_2], function (markerIds) {
// console.log(markerIds[0], markerIds[1]);
});
If you want to build yourself, you need to use this artoolkit5 branch https://github.com/hiukim/artoolkit5/tree/nftfix There is a small fix here as well.
@hiukim Nice! What about performances? How many NFT markers is possible to load with your mod? and why do you modify the artoolkit5 source code? Too many questions but i will try your code.... :smile:
@hiukim amazing! how did you manage to build your visual studio project? I'm having a hard time building it. Regarding the multimarker, seem like so people managed to get it working in A-Frame, I didnt look yet a their solution. I wonder what they made differently... https://github.com/kalwalt/jsartoolkit5/issues/40
@kalwalt @Memleak1 Just to make sure everyone's on the same page and save some time for all the fellows who come along next.
The whole ar process consists of two parts: The detection part and the tracking part. The detection part is trying to find a first match in the loaded markers. After first match, the tracking part comes in and keep track of the match. There are actually two different algorithms behind.
The way it is (or supposed to be) working now is that: At the beginner, ONLY the detection part is running. It try to find a match in all the markers loaded (e.g. through the addNFTMarker
. When there is a match, the detection part will stop, and the tracking part comes in. Now the process only keep track of the matched marker, and will not try to detect other markers. When the tracking is lost, the ball is passed back to the detection.
The ar controller as is now cannot track multiple markers. It is supposed be able to accept loading multiple markers for detection though. My fix is for the second part. It's important to point out that all I'm saying is for one AR controller. That's the behaviour of an AR controller. But you can spawn multiple AR controller to track multiple markers.
I hope I explained that clear enough. Now I can come back to the questions :)
Regarding performance, my changes won't hurt the performance because in the tracking part, it is still only tracking one marker. The performance of the detection part will depend on the number of loaded markers and their resolutions.
Regarding why I need to change the artoolkit5 source code. because I think I figured a bug there. If there is anyone here familiar with the source code, it would be great to if he/she can also take a look. I mean, I'm not totally confident too. If anyone interested in, it's good to have another eye to double check. The changes is here: https://github.com/hiukim/artoolkit5/commit/ac5958043f2726b52c409da895535ecd839c5b6d
Regarding tracking multiple markers in another project of aframe. I have also dig into that too. If I understand the code correctly, each anchor spawns their own web workers, and each worker itself spawns an an AR controller. In that case, I'm not surprised if there is a working example that can "track" multiple markers using multiple AR controllers. I'm curious, however, is anyone able to load multiple markers in one AR controller though.
@Memleak1 Regarding building the project. I'm not sure what you mean by building visual studio project. I just follow the README and build with docker.
Hi everybody, I just wanted to add that on AR.js (but should be the same here on jsartoolkitx) I was able to recognise multiple NFT Markers. I have pushed now the branch. There are two images to scan: pinball image and alterra.
Branch and direct link to the example is this one:
To try it out, you should clone the repo, switch on the branch 'multiple-nft-markers' and run the html file above under an https server.
I have not checked this example in a while, so don't know much about performances. I'm sure it works though. Let me know
I can confirm what you said about thé algorithme @hiukim. If your changes to artoolkit5 are necessary maybe @ThorstenBux may integrate them on the main repository. But it should be tested for all the platforms (Linux, Windows, Mac..), maybe Will be better to create a emscripten branch, and enclose that code between defines. So to prevent for other platform to be compiled. But mine Is only a supposition, i have only took a quick look to your code... @nicolocarpignoli yes i remember that code...🙂
Also note that ArtoolkitX should already handle multi NFT, but the problem Is to Port that code to emscripten, because the multi threading part...
Hey guys, though I jump in here. I remember Nicolò reporting to be able to track multiple nft at the beginning of our ntf adventure. Isn’t that already working? As for changes to artoolkit5 sure we can make those. Put them in between Emscripten defines might be best. Artoolkit5 is mainly unmaintained right now. As for artoolkitX I’d love to get nft into there but haven’t checked the threading part yet.
One more thing I’m pretty sure the original artoolkit5 already had multiple nft so maybe we could just change the current version to run the detection every 10th frame or so if multiple markers are registered to check if there is another marker in the view?
Get Outlook for iOShttps://aka.ms/o0ukef
From: Walter Perdan notifications@github.com Sent: Sunday, May 3, 2020 9:12:03 PM To: artoolkitx/jsartoolkit5 jsartoolkit5@noreply.github.com Cc: Thorsten Bux thorsten.bux@outlook.com; Mention mention@noreply.github.com Subject: Re: [artoolkitx/jsartoolkit5] Can't load multiple NFT markers (#95)
I can confirm what you said about thé algorithme @hiukimhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fhiukim&data=02%7C01%7C%7Cd1db7f5d3217487d9a8808d7ef420b6c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240939237513767&sdata=L%2FAUM7ZgWAajeDOKSNlM5mFmLohUXUKLWOzeokOyNOg%3D&reserved=0. If your changes to artoolkit5 are necessary maybe @ThorstenBuxhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FThorstenBux&data=02%7C01%7C%7Cd1db7f5d3217487d9a8808d7ef420b6c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240939237523761&sdata=U%2BJN8sMHU2pYcklz05crPLZl%2F7fn0aS2sgCWNMj4zuY%3D&reserved=0 may integrate them on the main repository. But it should be tested for all the platforms (Linux, Windows, Mac..), maybe Will be better to create a emscripten branch, and enclose that code between defines. So to prevent for other platform to be compiled. But mine Is only a supposition, i have only took a quick look to your code... @nicolocarpignolihttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnicolocarpignoli&data=02%7C01%7C%7Cd1db7f5d3217487d9a8808d7ef420b6c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240939237523761&sdata=CjVXJMrz2CXpiEMbLLya%2Bvk6sqfyfHtu0dcbs%2FnY2v4%3D&reserved=0 yes i remember that code...🙂
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fartoolkitx%2Fjsartoolkit5%2Fissues%2F95%23issuecomment-623079357&data=02%7C01%7C%7Cd1db7f5d3217487d9a8808d7ef420b6c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240939237533758&sdata=UbXcKB1RCF6qvw%2FQtfx5N0yzWTDnxgwy5JrZ2mS9jNo%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD765PEKMIMMAITWCNQ734DRPUYOHANCNFSM4LEK2DXA&data=02%7C01%7C%7Cd1db7f5d3217487d9a8808d7ef420b6c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240939237533758&sdata=nyzAFY0Rg%2BH%2BG0M6C0sEsKgUoRYeFBb9GkbJaU6iIwE%3D&reserved=0.
@nicolocarpignoli @kalwalt You guys have done very nice work in the AR.js! :) I haven't tried running your multiple tracking examples, but I have looked into your implementation a bit. If I understand the thing correctly, there is a performance concern.
As I mentioned before, the whole process consists of detection and tracking. Once detected, the detection stopped and tracking kicks in. It seems fine to me if you are detecting multiple markers and then tracking only one (while at the same time stopping detection). If you run both detection and tracking at the same time, it becomes bad. As a side note, my experience is that tracking performs better than detection.
In AR.js implementation, each markers will spawn a new ar controller. and each controller try to detect and track their corresponding marker. At start, there are two detection process running (which already hurts). Another obvious issue is even one marker is being detected, the detection algorithm for another marker keeps running.
There are two concepts in multiple markers. Able to detect multiple markers and able to track multiple markers simultaneously. At lot of time, we don't need to track multiple simultaneously. Once a marker is found, we don't care about the rest so stopped the detection. It's a compromise to make it performant.
@hiukim the problem with AR.js is that we need to create two instances of ArController: one in the Worker and the other 'outside' in Ar.js, so if you run another nft, there will be 3 ArController. For a performant device maybe is not a problem, but make a difference for another less performant... I tested to run in a worker a nft Marker plus a Pattern Marker, but the result wasn't succesfull, probably is required a deeper investigation on this subject. If you are interested we can discuss on the AR.js issue tracker. Said this, we need for sure to improve jsartoolkit5, because is the base for many projects...
Walter, if you could let me know why you need two controllers that would be great. Cause it was never designed to have two running simultaneously. Is that the same that you did in webarstudio? Then I check there.
Get Outlook for iOShttps://aka.ms/o0ukef
From: Walter Perdan notifications@github.com Sent: Sunday, May 3, 2020 9:54:00 PM To: artoolkitx/jsartoolkit5 jsartoolkit5@noreply.github.com Cc: Thorsten Bux thorsten.bux@outlook.com; Mention mention@noreply.github.com Subject: Re: [artoolkitx/jsartoolkit5] Can't load multiple NFT markers (#95)
@hiukimhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fhiukim&data=02%7C01%7C%7Cfa84e1d847f94c4f12a708d7ef47e82c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240964416920587&sdata=%2FZFePQ8QrZTgByvW7Bwm9rphE5IKa4CyvIcqXPDrNQs%3D&reserved=0 the problem with AR.js is that we need to create two instances of ArController: one in the Worker and the other 'outside' in Ar.js, so if you run another nft, there will be 3 ArController. For a performant device maybe is not a problem, but make a difference for another less performant... I tested to run in a worker a nft Marker plus a Pattern Marker, but the result wasn't succesfull, probably is required a deeper investigation on this subject. If you are interested we can discuss on the AR.js issue tracker. Said this, we need for sure to improve jsartoolkit5, because is the base for many projects...
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fartoolkitx%2Fjsartoolkit5%2Fissues%2F95%23issuecomment-623084079&data=02%7C01%7C%7Cfa84e1d847f94c4f12a708d7ef47e82c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240964416920587&sdata=XA17ylREmesQuT9ZnLQebOdyN24iOW3FqDnfXnaYijc%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD765PA6DAVC4DAN7QS7M43RPU5LRANCNFSM4LEK2DXA&data=02%7C01%7C%7Cfa84e1d847f94c4f12a708d7ef47e82c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240964416930576&sdata=tlV2ER1%2BLo%2FYdmrVCoowo64MWGHU7rMnLb1MfU83Uo0%3D&reserved=0.
Walter, if you could let me know why you need two controllers that would be great. Cause it was never designed to have two running simultaneously. Is that the same that you did in webarstudio?
yes because in the worker you can not share an instanced object, so you are obliged to create two ARController, we haven't found another solution yet. this is valid for AR.js and webartsudio too. But t would be great to found another solution...
@ThorstenBux @kalwalt Yes, I figured artoolkit5 is somewhat unmaintained. Actually, I'm kind of confused with artoolkit5 and artoolkitx. Is the artoolkitx the next version of artoolkit5?
In that case, shouldn't we use artoolkitx as the backend? But that would make it jsartoolkitx. haha
I have already created artoolkitX.js but befor the nft effort. So it hangs a bit in the air. Need to get all in order again. In fact artoolkitX.js the as supposed to have image tracking with jpg. Not marker creation anymore. If you are interested we can take that back on.
Kind regards Thorsten Bux
Sent from my iPhone
On 3/05/2020, at 10:16 PM, hiukim notifications@github.com wrote:
@ThorstenBuxhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FThorstenBux&data=02%7C01%7C%7C8a07c70d38304ef82e1508d7ef4b1499%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240978047378366&sdata=Sg8PIA0qx3MSaQCsgcGeqDEEz62haPjSvcdduwkShfo%3D&reserved=0 @kalwalthttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkalwalt&data=02%7C01%7C%7C8a07c70d38304ef82e1508d7ef4b1499%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240978047388362&sdata=0VbgoJYGItl451IFKK7d9KfZUxIcH0xJRMx19m2utC8%3D&reserved=0 Yes, I figured artoolkit5 is somewhat unmaintained. Actually, I'm kind of confused with artoolkit5 and artoolkitx. Is the artoolkitx the next version of artoolkit5?
In that case, shouldn't we use artoolkitx as the backend? But that would make it jsartoolkitx. haha
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fartoolkitx%2Fjsartoolkit5%2Fissues%2F95%23issuecomment-623086727&data=02%7C01%7C%7C8a07c70d38304ef82e1508d7ef4b1499%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240978047398357&sdata=M4OLy9ZE4mwAQ4SU2AxvdbN7mkF9A0jJnqkEuIoozXg%3D&reserved=0, or unsubscribehttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD765PGQPTRZGXYJ275XQETRPVAAXANCNFSM4LEK2DXA&data=02%7C01%7C%7C8a07c70d38304ef82e1508d7ef4b1499%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240978047408353&sdata=mOlSxkVaz037rUlhWCvP8UpRhvhRmrmVspDoRrmIlC4%3D&reserved=0.
@ThorstenBux @kalwalt Yes, I figured artoolkit5 is somewhat unmaintained. Actually, I'm kind of confused with artoolkit5 and artoolkitx. Is the artoolkitx the next version of artoolkit5?
In that case, shouldn't we use artoolkitx as the backend? But that would make it jsartoolkitx. haha
Yes ArtoolkitX Is the next version of Artoolkit5, but the issue is that with Artoolkit5 is easier to develop for emscripten the JavaScript version of the lib with NFT... That sound strange but is the reality. Anyway @ThorstenBux already did the JavaScript ArtoolkitX version.
You mean nft is easier to develop with jsartoolkit5 or development generally is easier? If the 2nd is the case let me know what should be improved and we make it happen. The whole build process is different and I was always wondering which one is the better
Kind regards Thorsten Bux
Sent from my iPhone
On 3/05/2020, at 10:23 PM, Walter Perdan notifications@github.com wrote:
@ThorstenBuxhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FThorstenBux&data=02%7C01%7C%7C9e640c10ec104638775808d7ef4c01e4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240982027859510&sdata=coYNe3vZ93LGjMmGbALOxCJKyfgaWLH2ZGVkm7uvVpY%3D&reserved=0 @kalwalthttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkalwalt&data=02%7C01%7C%7C9e640c10ec104638775808d7ef4c01e4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240982027859510&sdata=cY%2B5OtBB0%2BX39N%2BMH900h%2BQYio06y0Lo%2Bnho77syu0U%3D&reserved=0 Yes, I figured artoolkit5 is somewhat unmaintained. Actually, I'm kind of confused with artoolkit5 and artoolkitx. Is the artoolkitx the next version of artoolkit5?
In that case, shouldn't we use artoolkitx as the backend? But that would make it jsartoolkitx. haha
Yes ArtoolkitX Is the next versione of Artoolkit5, but the issue is that with Artoolkit5 is easier to develop for emscripten thé JavaScript version of the lib with NFT... That sound strange but is the reality. Anyway @ThorstenBuxhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FThorstenBux&data=02%7C01%7C%7C9e640c10ec104638775808d7ef4c01e4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240982027859510&sdata=coYNe3vZ93LGjMmGbALOxCJKyfgaWLH2ZGVkm7uvVpY%3D&reserved=0 already did the JavaScript ArtoolkitX version.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fartoolkitx%2Fjsartoolkit5%2Fissues%2F95%23issuecomment-623087556&data=02%7C01%7C%7C9e640c10ec104638775808d7ef4c01e4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240982027869503&sdata=cu3kwkrbkn0veGhOeChOnL6OIRcyNRBa9gEwB6snt%2Bo%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD765PGV3VJ6USEY63XCR63RPVAZTANCNFSM4LEK2DXA&data=02%7C01%7C%7C9e640c10ec104638775808d7ef4c01e4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637240982027869503&sdata=jTbZVrjm%2F8wIJT12VcDUca27FEFknAnpHgse5y63hmk%3D&reserved=0.
In AR.js implementation, each markers will spawn a new ar controller. and each controller try to detect and track their corresponding marker. At start, there are two detection process running (which already hurts). Another obvious issue is even one marker is being detected, the detection algorithm for another marker keeps running.
I can confirm this hurts performance badly. Having two ARControllers
in a Xiaomi Redmi Note 7 (it's not a high end device, but most people have devices with worse hardware than this) made a huge drop from 60fps to 15fps even when a marker is found, because the other controller keeps searching for its marker.
This got a lot worse when I tried my code on an iPhone 7, because it drops to 3fps, stays there for a while and then crashes
I fixed a couple of things and finally managed to get something working. If you want, you can use my build here: https://github.com/hiukim/jsartoolkit5/tree/fixnft/build You still cannot call loadNFTMarker multiple times here, but I have extended a new method ar.loadNFTMarkers that accept multiple urls.
@hiukim I'll try it later! Thanks for your efforts
Hi @hiukim @Memleak1 @ianmethyst
@kalwalt and me decided to collect everything we worked on in the past year or two (which is a lot) in a new org called webarkit
we will use this a base from now on to move forward.
Please have a look https://github.com/webarkit
We both would like to invite you to become members of the org. Just let me know if you are interested.
Our big vision is to unify opensource webAR and to be the best opensource SDK for webAR available.
@ThorstenBux Nice. It's good to have a new base to move forward. I'm happy to contribute.
@hiukim you are welcome!
As @ThorstenBux said if anyone is interested just send a message to Thorsten or to me :smile:
@ThorstenBux I'll be happy to join!
what does this mean? that webarkit will be based on artoolkit5 ? what's the difference between ar.js and webarkit? anyway i will keep on following this discussions, very interesting. thank you for sharing
@kalwalt @ThorstenBux great news. I have only one advice: it should be clear to everyone what is the relationships between AR.js, jsartoolkit5, jsartoolkitx, and any other project that is rising/has rised with the '*rtoolkit' name :)
Maybe on each repository a brief description may be useful and should be enough Just my thought.
@nicolocarpignoli Yes i will do an introductory presentation of the project and the idea behind of the organization. A quick clarification: we don't want to replace Ar.js at all, the core of WebArkit will be WebARStudio; improvements that we will do to jsartoolkit5 or artoolkit5 we will be happy to contribute to Ar.js .
I can confirm this error. I have been digging through the codebase including the underlying artoolkit5 the past couple of days. It was a crazy journey :)
You cannot call addNFTMarker multiple times on a single AR controller. Once the marker dataset is set, calling this again will throw error. I believe there are a couple of logical flaws in the code. I wonder does anyone able to run multiple markers before.
I fixed a couple of things and finally managed to get something working. If you want, you can use my build here: https://github.com/hiukim/jsartoolkit5/tree/fixnft/build You still cannot call loadNFTMarker multiple times here, but I have extended a new method ar.loadNFTMarkers that accept multiple urls.
ar.loadNFTMarkers([markerURI_1, markerURI_2], function (markerIds) { // console.log(markerIds[0], markerIds[1]); });
If you want to build yourself, you need to use this artoolkit5 branch https://github.com/hiukim/artoolkit5/tree/nftfix There is a small fix here as well.
Thanks @hiukim for your great efforts. I just tested it and it works. The current problem I'm facing is the amount of markers that can be loaded. I tested it with 10 markers but unfortunately it failed to load (Exceed maximum pages). But, if I decrease it to 9 markers, it works again. Can you tell me how to increase the amount of markers to be loaded? Please help me, because I need to load 10 markers. Thank you.
I'm trying to load multiple NFT markers using
artoolkit.addNFTMarker(markerURI, (id) => { /*...*/})
and its throwing an exception (with a number that is different every time it runs) as soon as the second image set starts to load. I tried recompiling jsartoolkit to enable exception catching, but I didn't help a lot.Did anyone had success with this? I'm using a slightly modified version of one of the Misdake's examples (with jsartoolkit code running on a Worker)