Giter Site home page Giter Site logo

Comments (8)

mrdoob avatar mrdoob commented on May 5, 2024

The matrices get calculated per object whether they change or not... you can try doing mesh.autoUpdateMatrix = false; and updateMatrix() whenever you need them to update and see if that speeds up things...

There are a few other optimisations that could be done right in the Renderer now you mention...

from three.js.

 avatar commented on May 5, 2024

It does make a 30% difference or so. When I have 900 objects, the fps rises from 7 to 10. When I have 10.000 objects, the fps stays below 1 ;-)

Is it really impossible to not send any information to the GPU when the object has not changed at all?

from three.js.

mrdoob avatar mrdoob commented on May 5, 2024

I don't really know...

from three.js.

 avatar commented on May 5, 2024

I will try to figure it out...

from three.js.

supereggbert avatar supereggbert commented on May 5, 2024

I've found the bottle neck to be the setUniform, you're pushing at least 10.000 16 float transform matrices to the card every frame and it's quite slow with JS at the moment, making state sorting that much more important, unfortunately not much use in this case :-( You could try creating a new material for each cube so the uniforms only have to be set when they're updated but that would probably be a huge memory drain and it would take ages to compile that many shaders. There are a few other options but they get progressively more complicated to implement.

from three.js.

 avatar commented on May 5, 2024

Hmm, that's a pity.

The thing is that I thought/hoped that it would be possible to not push all those matrices to the GPU, because they didn't change. In other words: why can't the GPU just keep rendering all its buffered objects until they change?

from three.js.

supereggbert avatar supereggbert commented on May 5, 2024

It is possible on modern hardware but webgl doesn't support it yet. There was talk a while ago about including in webgl v1.0 (even some early demos using it) but I believe it was decided to leave it out for now. I'd suspect it's going to be among the first extensions so might be here in the next few months, at least in the nightlies, fingers crossed ;-)

from three.js.

 avatar commented on May 5, 2024

Kinda hard typing with all my fingers crossed, but if that is what it takes to get it implemented ;-)
Seriously though, I really hope that it gets implemented! I see why it was postponed though, because it is only an issue when there are thousands of objects to be streamed to the GPU.
Anyways, let's just wait for this feature, or for faster streaming! :-)

from three.js.

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.