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)
- Enhance target type for SpotLight and DirectionalLight HOT 1
- Build a grid through custom coordinates HOT 1
- `.equals` in class `Spherical` HOT 6
- FBXLoader loads default Unreal model with wrong rotation HOT 4
- Editor can't import glTF with .ktx2 textures HOT 1
- MRT needs a filter if there are several objects with different shader counts in the scene HOT 3
- File Export Whole Scene feature was removed 😨 HOT 2
- RectAreaLight passes through material HOT 6
- Editor: drop event in UIOutliner of ui.three.js not being call HOT 9
- Editor: Export GLB and GLTF fails to fetch HOT 2
- MeshToonMaterial support for WebGPU
- why my scene can not showed fully, after wheel scale and drag? who can help me? thanks HOT 1
- Black/gray outline shows around transparent textures when mipmaps are used. HOT 4
- MeshPhysicalMaterial: Wrong blending with nested transmissive objects. HOT 11
- Add StorageBufferAttribute to current version of Three.js HOT 1
- Stencil params getting out of sync. HOT 6
- GLTFLoader does not load external ktx2 textures HOT 5
- Material copy function issue HOT 1
- Clipping is not correct when material enables transparent and spot-light casts shadow [WebGPU] HOT 1
- WebGLRenderer: Calling "copyTextureToTexture" on an unused WebGLRenderTarget does nothing HOT 6
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.