Comments (8)
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.
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.
I don't really know...
from three.js.
I will try to figure it out...
from three.js.
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.
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.
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.
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)
- Fbx model not loaded as expected HOT 2
- Capsule: "lineLineMinimumPoints" function returns global temp variables, does not use Capsule fields HOT 5
- correct exports of extensionless imports HOT 3
- NodeMaterial: Material "ShaderMaterial" is not compatible. HOT 5
- Backgournd cube bug HOT 1
- Transparent objects cannot penetrate to cast shadows HOT 1
- More efficient Ray-AABB intersection test HOT 6
- Sheen from IBL isn't being affected by AO HOT 1
- Raycaster for a point on a plane sometimes returns distance distint 0 HOT 3
- GLTFLoader canβt parse ArrayBuffer with gltf and throw an error HOT 1
- CSS3DRenderer: Transforms broken depending on container size and position HOT 7
- MSAA does not always work when doing RTT. HOT 13
- Anisotropy rotation appears incorrect (clockwise) HOT 1
- isWebGL2 determination algorithm is incorrect HOT 8
- Missing typecheck for GLTFExporter HOT 3
- Raycaster is not easily extendable. Can I fix? HOT 8
- Getting warning in custom WebGL implementation running ThreeJS HOT 2
- webgpu supports vertex buffers greater than 8 HOT 4
- Inconsistent raycaster intersectObjects results. HOT 1
- [Doc] Doc CapsuleGeometry param not match
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from three.js.