Code Monkey home page Code Monkey logo

Comments (7)

zynga-jpetersen avatar zynga-jpetersen commented on September 18, 2024 1

Are there any known technical barriers to this being implemented?

From reading how the dracomodule is used within the dracoloader, there doesnt look like there is anything that would prevent implementing it in the ctm code pattern.

If no one knows of any reason it wouldnt work, I'm probably going to take a crack at it.

The direction I'm thinking about initially taking is to split up convertDracoGeometryTo3JS so it send back the attributes as {} of transferable attributes (probably just the ArrayBuffer) and fix it up to build the BufferGeometry in the worker's onmessage. That way the worker doesnt need to import three.

Any suggestions are also welcome.

Thanks.

from draco.

zellski avatar zellski commented on September 18, 2024

Strong +1 for this. If nobody else had done it in a month or so, we'd planned to tackle it ourselves.

So, @zynga-jpetersen, go forth and do battle!

from draco.

zynga-jpetersen avatar zynga-jpetersen commented on September 18, 2024

Update on this, I tried the simplified approach, where I import the three js and draco into the worker. That both significantly increased the load times (I'm guessing from both sending data back and forth, but also all that code) and didnt result in good data since of course the THREE.Geometry wasnt transferable (I didnt necessarily expect this to work, just for a test). So as a second attempt at this I'm breaking up convertDracoGeometryTo3JS into 2 phases, 1) where it inflates the data from draco, and then 2) builds the three geometry out of the results. Once I've got that working, I should be able to take phase 1 and move it off into a worker and reuse the same code by doing the same writing the worker source trick that Obj2Loader is doing.

from draco.

drawmindmap avatar drawmindmap commented on September 18, 2024

Check out Babylon.js implements:
babylon.dracoCompression.ts
KHR_draco_mesh_compression.ts

And you can even use draco_decoder.wasm in Web Worker.

from draco.

zynga-jpetersen avatar zynga-jpetersen commented on September 18, 2024

I should have updated this sooner, my apologies.

I've been moved onto another project so I haven't had time to complete my refactoring.

from draco.

donmccurdy avatar donmccurdy commented on September 18, 2024

FYI, I've cross-filed this issue on three.js: mrdoob/three.js#13648. There is some infrastructure in three.js's examples/js/* to support workers. But currently I don't think anyone is actively working on adding worker support to THREE.DRACOLoader.

from draco.

FrankGalligan avatar FrankGalligan commented on September 18, 2024

three.js added web worker support. That can be used as an example.

from draco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.