question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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, …)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
aardgoosecommented, Nov 1, 2016

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??

0reactions
oguzeroglucommented, Feb 22, 2018

In this demo using the modification in the PR, 6 random vertices are picked in every 3 seconds and only they are updated: https://oguzeroglu.com/update_ranges.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the three.BufferAttribute function in three - Snyk
BufferAttribute function in three. To help you get started, we've selected a few three examples, based on popular ways it is used in...
Read more >
Three.js BufferGeometry Vertices Not Updating - Stack Overflow
I am looking to connect plane buffer geometry grid tiles which have real elevation data from IndexedDB. My issue is the ...
Read more >
BufferAttribute#updateRange – three.js docs
A callback function that is executed after the Renderer has transferred the attribute array data to the GPU. # .updateRange : Object. Object...
Read more >
What's New | Babylon.js Documentation
Added public version of AbstractMesh function _getPositionData. ... So, if you are directly updating the inputTexture property with a render target texture ...
Read more >
sys — System-specific parameters and functions — Python ...
This module provides access to some variables used or maintained by the ... not be handled and the process should be terminated as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found