You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To allow higher control of optimization by Threejs users, a new .updateRanges property could be an array of update ranges, and in WebGLAttributes it call loop on those and call gl.buffSubData for each range.
Alternatives
n/a
Additional context
This may allow multiple sets of instances to be updated per frame.
For example, if someone has 1 million instances, maybe they only want to update 10 through 20, 1_000 through 1_100, and 500_000 through 500_005. For this they can define three update ranges, and avoid having to, at minimum, define a single range from 10 through 500_005. The array will allow uploading data for 115 instances instead of (at least) 499_995 instances.
The text was updated successfully, but these errors were encountered:
Yeah that's the idea. Yeah, creating and replacing arrays every frame is not gonna be ideal. We'd need to re-use objects if we'll be adding/removing them.
Another idea is instead of an array of objects, it could be a Map<number, number> or Record<number, number> (pairs of start,count), then iterating the key-value pairs.
With an array of objects, or with a map, an updateRangeCount would make it easy to specify how many update ranges to iterate over (default to all).
For back compat, updateRange could stay the same, and a new updateRanges (plural) could have multiple ranges.
Description
It looks like only a single
updateRange
is supported, andgl.bufferSubData
gets called only once for that range.Solution
To allow higher control of optimization by Threejs users, a new
.updateRanges
property could be an array of update ranges, and inWebGLAttributes
it call loop on those and callgl.buffSubData
for each range.Alternatives
n/a
Additional context
This may allow multiple sets of instances to be updated per frame.
For example, if someone has 1 million instances, maybe they only want to update 10 through 20, 1_000 through 1_100, and 500_000 through 500_005. For this they can define three update ranges, and avoid having to, at minimum, define a single range from 10 through 500_005. The array will allow uploading data for 115 instances instead of (at least) 499_995 instances.
The text was updated successfully, but these errors were encountered: