Description
Description
I am writing a game where i regulary update geometry buffers. Not every frame, from none, some and many buffers in the size of multiple thousand vertices.
To keep my update smooth I already update the attribute buffers until a maximum amount of time has passed and defer further updates to the next frame.
That works well up what I have not directly on my control is bufferData() calls for all dirty attributes in the buffer geometry. Threejs updates all dirty buffers, which can be so slow that I have regular spikes. It would be great if you can somehow control this from the outside to limit the buffer uploads per frame.
Solution
I see two options:
- Add a parameter to renderer.render(scene, camera) where I can pass a threshold in ms or buffer count. That limit tells to stop updating geometry uploads.
- Add a general parameter property to the renderer considered in all render calls.
Alternatives
I could also as a workaround only mark a maximum amount of my buffer instances with needsUpdate, but the measuring is much more accurate and a general framework task.
Additional context
As its an additional optimization parameter, it does not affect existing code and should have no impact on performance.