Is it possible to provide a public function to update the BufferAttribute immediately?

I have 80m+ vertices and corresponding color attribute (which is dynamic) in my buffer geometry. Sometimes i have to update two different portions of the color buffer. Since the buffer size is huge, i have to update the buffer by parts (gl.bufferSubData).

But, currently there is no way to update two different parts of a buffer in a single frame. I can update one part using updateRange but not multiple parts. I have to update the full buffer (gl.bufferData) for that.

So, what i am proposing, is it possible to provide a function to update the buffer immediately when i need to update it? How about making public function/functions in BufferAttribute to do that?

Three.js version
  • Dev
  • r82
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

1 thought on “Is it possible to provide a public function to update the BufferAttribute immediately?

  1. I don’t think that would fly, BufferAttribute doesn’t have any knowledge of the renderer backend, and I can’t imagine that being encouraged. Alternatively support passing an array of offset/length values to update, that the renderer could be made to handle??

Comments are closed.