ThorstenBux / artoolkitX_em_2d

2d tracking with emscripten
Other
0 stars 1 forks source link

2d tracking with a webworker #7

Open kalwalt opened 4 years ago

kalwalt commented 4 years ago

@ThorstenBux I was thinking to add an example with a worker as in the jsartoolkit5 NFT https://github.com/kalwalt/jsartoolkit5/blob/fixing-nft/examples/nft_improved_worker/main_threejs_worker.html What do you think? May we have some improves in performances?

ThorstenBux commented 4 years ago

Yes, definitely. Looking forward to this :)

kalwalt commented 4 years ago

When i have time i will start!

kalwalt commented 4 years ago

@ThorstenBux just started to test, but i receive this error importing artoolkitX.api.js in the worker:

Live reload enabled.
main_worker.js:107 Uncaught TypeError: Failed to construct 'Worker': Module scripts are not supported on DedicatedWorker yet. You can try the feature with '--enable-experimental-web-platform-features' flag (see https://crbug.com/680046)
    at load (main_worker.js:107)
    at start (main_worker.js:203)
    at HTMLVideoElement.<anonymous> (tracking_worker_2d.html:239)
load @ main_worker.js:107
start @ main_worker.js:203
(anonymous) @ tracking_worker_2d.html:239

i added the worker in this way:

worker = new Worker('../../SDK/lib/artoolkit.worker.js', { type: "module" });

because we need to import as a module but you need to enable the experimental feature '--enable-experimental-web-platform-features' flag in the browser... so i don't know if i can continue on this path, or maybe we can modify artoolkitX.js a bit to import it if we want not as a module? and as a module as well...

kalwalt commented 4 years ago

but maybe this feature will be available in Chrome 80 see this stackoverflow article https://stackoverflow.com/questions/44118600/web-workers-how-to-import-modules

kalwalt commented 4 years ago

I should test again this, also because i'm trying to build the lib as a single file, that make easier the process. I hope to do this one of these days.

kalwalt commented 4 years ago

@ThorstenBux with Chrome version 80 the module flag is enabled in default!! https://www.chromestatus.com/features/5761300827209728

ThorstenBux commented 4 years ago

Yeah, but what about firefox and Safari. And is it true for mobile

Get Outlook for iOShttps://aka.ms/o0ukef


From: Walter Perdan notifications@github.com Sent: Thursday, February 20, 2020 12:57:56 PM To: ThorstenBux/artoolkitX_em_2d artoolkitX_em_2d@noreply.github.com Cc: Thorsten Bux thorsten.bux@outlook.com; Mention mention@noreply.github.com Subject: Re: [ThorstenBux/artoolkitX_em_2d] 2d tracking with a webworker (#7)

@ThorstenBuxhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FThorstenBux&data=02%7C01%7C%7C2f8a0d332638463ad01708d7b5978a78%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637177534767177818&sdata=Ha%2FoYqXWAtwUs9h7Zr0Df4x%2Biu4xiqkeWq4Z9Ir%2BIzM%3D&reserved=0 with Chrome version 80 the module flag is enabled in default!! https://www.chromestatus.com/features/5761300827209728https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.chromestatus.com%2Ffeatures%2F5761300827209728&data=02%7C01%7C%7C2f8a0d332638463ad01708d7b5978a78%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637177534767187823&sdata=XwQT1fUCj%2FY10Z%2BVaFWthqI8gnIVLhX4fOni8S1JxM4%3D&reserved=0

— 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%2FThorstenBux%2FartoolkitX_em_2d%2Fissues%2F7%3Femail_source%3Dnotifications%26email_token%3DAD765PCZJRWFHQX3W3XRPKTRDXBQJA5CNFSM4JZSCT2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMKFZ4Q%23issuecomment-588537074&data=02%7C01%7C%7C2f8a0d332638463ad01708d7b5978a78%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637177534767187823&sdata=v10tdYk6ruxeww%2BvioDjIpgGpgAHWi48TeARP%2FH%2Fz0U%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAD765PHM7IQKNR5BEV7ZOWTRDXBQJANCNFSM4JZSCT2A&data=02%7C01%7C%7C2f8a0d332638463ad01708d7b5978a78%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637177534767197832&sdata=fn7XOptHL47Rgz1x5HyiMpAVLhIY5HyZhW4U2eAhyZ4%3D&reserved=0.