-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Should OBJLoader2 become OBJLoader? #13663
Comments
Description has been updated (overhauled it again this morning). /cc @mrdoob @jonnenauha |
Yes, I'm all for this. It just depends if backwards compatibility is more important to doob than removing old code from the repo. I assume if the class |
Functional compatibility parse, load, setMaterials is already provided. It is currently a drop in replacement on dev branch that loads the existing original obj examples. |
Updated 2018-04-17 Multi-usage options example now realized with The original OBJ&MTL example: OBJ verify: |
Hey @mrdoob and @jonnenauha I thought a about the whole thing again. What about we introduced the re-worked version of Status: |
Thought i'd ask what's probably a controversial question but is there any reason to keep the async/sync flag? Why not just always be async? Browser vendors have been trying to get rid of sync IO in browsers for ages. They've printed a warning that sync loading using XMLHttpRequest is deprecated for over 10 years now. I think (could be wrong) the Fetch API meant to replace XHR has no sync option at all. One of THREE.js's goals is to be simple so maybe it shouldn't provide extra options that lead users down deprecated paths? This is especially true in the ES6/ES7 world where it's trivial to async/await if you want your code to look sync even though it's async. Even worse, if you're loading any textures then AFAIK it's impossible to be sync so it ends up giving a false sense no? Even using a sync XHR to download the image, putting the image into a texture requires decoding it and both img elements and ImageBitmap are both async for decoding. Just thought I'd ask. |
Actually I think I don't actually understand the Maybe consider updating the docs and or renaming the flag to something that's more descriptive of what it actually does? |
Maybe I should be opening a new issue but lots of question here
|
@greggman didn't expect that this thread receives much attention again, but it is ok to raise your questions here, I think. To further answer your questions:
Regarding the async. Yes, it means "use worker to parse file" which is done in parallel, but also not synchronous to main thread. The main receives answers from parser running in the worker. I will think about, whether naming and description can be improved. |
Preview of WorkerLoader with examples for implementations or wrappers for PCDLoader, GLTFDRACO and OBJLoader2 Kept two V2.5.0 OBJLoader2 examples. All loader_worker examples rely on WorkerLoader including the OBJLoader2 examples
Preview of WorkerLoader with examples for implementations or wrappers for PCDLoader, GLTFDRACO and OBJLoader2 Kept two V2.5.0 OBJLoader2 examples. All loader_worker examples rely on WorkerLoader including the OBJLoader2 examples Fixed webgl_loader_worker_gltf only using extension of DRACLoader and not worker
Preview of WorkerLoader with examples for implementations or wrappers for PCDLoader, GLTFDRACO and OBJLoader2 Kept two V2.5.0 OBJLoader2 examples. All loader_worker examples rely on WorkerLoader including the OBJLoader2 examples Fixed webgl_loader_worker_gltf only using extension of DRACLoader and not worker
Closing, see #21014. |
OBJLoader2
is now around for a while and I think that especially the Parser has reached at least feature parity with the other implementation. It currently has less known bugs and the code is now more accessible to others than it has been in the past (code reviews&verification in R90 and R91).OBJLoader
is more widely used and replacing it withOBJLoader2
will only be smooth once the following issues and questions are solved and answers are found together with you:LoaderSupport
needs to be removed. The current dev version ofOBJLoader2
already solved this.MeshBuilder
. It provides among other things a mesh building function which uses data directly or data from web worker (buffers as Transferables). It could stay insideOBJLoader
, but logically it should be outside violating the first assumption. I currently don't have a good answer for this problem. One solution is to putMeshBuilder
inside `WorkerLoader´ where it is needed, but then it cannot be used here. I don't like having code duplicates. Do you at all see that this is a useful feature for other loader or beyond? What's you opinion?OBJLoader
Async loading/parsing currently available with
OBJLoader2
/LoaderSupport
will be realized by Generic WorkerLoader.The following table outlines the major features of both loaders:
MTLLoader
if desiredProgress can be tracked in the dev branch mentioned above and in the external OBJLoader2 repo.
I hope you agree that the time has come to replace
OBJLoader
and we can maintain one implementation in the future.Three.js version
The text was updated successfully, but these errors were encountered: