-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OBJLoader2 and OBJLoader2Parallel V3.0.0-beta2 #16887
Conversation
Seems like you included three.js builds in the PR by mistake. |
Deleted non jsm code and removed obj2 examples currently not working.
…dules. WorkerExecutionSupport allows to run runtime code or pre-defined modules (if browser support is available) in a web worker.
6997bf4
to
f42bb73
Compare
Sorry for that. I fixed first commit and force pushed the branch. |
WorkerExecutionSupport: buildWorker uses CodeBuilderInstructions to decide how to internally build the worker (standard or jsm based)
This good to go from my side (see updated description). What about the Typescript definitions? |
I think it's okay if you add it with a different PR. This one is already big and contains many changes. |
examples/jsm/loaders/obj2/worker/main/WorkerExecutionSupport.js
Outdated
Show resolved
Hide resolved
All LGTM issues are fixed and I updated the description once more. I did it in a rush yesterday. |
Thanks! |
Hi, I'm trying out ES6 modules and r106, I successfully got THREE imported as modules in my code like so:
The problem that I have is that the loadMtl function has completely vanished from OBJLoader2, so I don't know how to make my code work again. I will start to tie the code to r105 for the time being. Was hoping you guys could point me in a direction. I wonder if I'm trying to use modules too early.
gives me no output either. |
Hi @unphased please look at the basic example. The decision to remove mtl related functions was taken by me in the last release already (jsm code). I have introduced Maybe, we should add something to the migration guide. @Mugen87 what do you think? |
Good idea. If you can formulate one or two (short) sentences, I'll put it in the migration guide. |
What about this? I activated "Allow edits from maintainers", so you can hopefully copy the raw content: |
This addresses #16688 and it brings back worker based parsing via
OBJLoader2Parallel
and independentWorkerExecutionSupport
.POIs:
OBJLoader2Parallel
extendsOBJLoader2
and runs the parser inside a worker. Nothing the old version didn't do.obj2
to build the worker code or it uses OBJLoader2Worker to directly feed a module into the Worker both viaWorkerExecutionSupport
. This feature is only experimentally available in Chrome and no other browser as far as I know. It is beautifully simple that's why I put it in already. See for yourself:WorkerExecutionSupport
takes modules loaded into memory and serializes them to a Blob. I wanted to use rollup/babel directly in the browser, but it was always a dead end street. The solution now allows to serialize any module that is available when serialization takes place code (see OBJLoader2Parallel imports imports and OBJLoader2Parallel buildWorkerCode. @donmccurdy this part could be of interest also to you: I want to further modularizeWorkerExecutionSupport
so you can plug in a standard or own com-protocol on main and worker and are able to use common serialization functions, etc. I will write my ideas down in the Generic Worker Loader issue in the upcoming days.Typescript bindings are missing. Can you hint me to a guide/issue how to approach this? Thank you...