Skip to content
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 V2.4.0: Parser polishing, ArrayBuffer handling (#13197), LoaderSupport clean-up #13524

Merged
merged 1 commit into from
Mar 8, 2018

Conversation

kaisalmen
Copy link
Contributor

@kaisalmen kaisalmen commented Mar 7, 2018

These are the things addressed:

  • three.js issue FileLoader with ArrayBuffer high loading frequency leads to DOMException #13197:
    • Added forceWorkerDataCopy to THREE.LoaderSupport.WorkerSupport and THREE.LoaderSupport.WorkerDirector
    • THREE.OBJLoader2 handles cached resources properly. This increases overall performance as no unnecessary reloads are requested.
  • THREE.OBJLoader2: Reduced Parser complexity:
    • Simplified slash counting used for face type detection
    • One buildFace function is used for all four face types, lines and points including indices (=vertex reduction) creation if wanted.
    • String processing (o, g, mtllib and usemtl) just concatenates chars
    • Overall speed improvements due simpler code paths
  • Removed THREE.LoaderSupport.ConsoleLogger: Added setLogging function as replacement where. Console logging is behind boolean flags.
  • Removed THREE.LoaderSupport.LoaderBase: Many functions are coupled with OBJLoader2. It was simply not generic enough and added unneeded complexity.
  • Reduced THREE.LoaderSupport.PrepData to minimum set of generic functions. Simple properties are added by demand and are no longer enforced.
  • Renamed THREE.LoaderSupport.Builder to THREE.LoaderSupport.MeshBuilder
  • Updated documentation

@mrdoob Existing examples, verify.obj and gathered OBJ models during bug-fixing are looking good. There are no obvious regressions. Performance was slightly improved, especially parallel usage. OBJ Parser code is really condensed now and I hope it is easier to follow and understand for others.

This represents an intermediate step. My idea for the future: Make OBJLoader2 independent of LoaderSupport. LoaderSupport or pieces of it and parts of OBJLoader2 become generic WorkerLoader. OBJLoader2 replaces OBJLoader. Of course, this requires further discussions and prototyping (R92 seems a good candidate, I personally would like to speed up things more, but this is a spare time activity, currently 😊 )

- three.js issue 13197:
  - Added forceWorkerDataCopy to THREE.LoaderSupport.WorkerSupport and THREE.LoaderSupport.WorkerDirector
  - THREE.OBJLoader2 handles cached resources properly. This increases overall performance as no unnecessary reloads are requested.
- THREE.OBJLoader2: Reduced Parser complexity:
  - Simplified slash counting used for face type detection
  - One buildFace fucntion is used for all four face types, lines and points including indices (=vertex reduction) creation if wanted.
  - String processing (o, g, mtllib and usemtl) just concatenates chars
  - Overall speed improvements due simpler code paths
- Removed THREE.LoaderSupport.ConsoleLogger: Added setLogging function as replacement where. Console logging is behind boolean flags.
- Removed THREE.LoaderSupport.LoaderBase: Many functions are coupled with OBJLoader2. It was simply not generic enough and added unneeded complexity.
- Reduced THREE.LoaderSupport.PrepData to minimum set of generic functions. Simple properties are added by demand and are no longer enforced.
- Renamed THREE.LoaderSupport.Builder to THREE.LoaderSupport.MeshBuilder
- Updated documentation
@mrdoob
Copy link
Owner

mrdoob commented Mar 8, 2018

Looking good!

@mrdoob
Copy link
Owner

mrdoob commented Mar 8, 2018

I'll merge now. Planning on releasing next week so we have some time to test.

@mrdoob mrdoob added this to the r91 milestone Mar 8, 2018
@mrdoob mrdoob merged commit ecfb1a4 into mrdoob:dev Mar 8, 2018
@mrdoob
Copy link
Owner

mrdoob commented Mar 8, 2018

Thanks!

@kaisalmen kaisalmen deleted the OBJLoader2_V240 branch March 8, 2018 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants