When I changed InstancedBufferGeometry.instanceCount, I found that the _maxInstanceCount not changed. This will cause the InstancedBufferGeometry to display incorrectly.
@sanddyl Can you please provide a simple, live demo to show exactly what you did to cause the issue?
@sanddyl Can you please provide a simple, live demo to show exactly what you did to cause the issue?
You are resizing the attribute buffer. That is not supported.
See https://threejs.org/docs/#manual/en/introduction/How-to-update-things.
/ping @Mugen87 for confirmation.
You are resizing the attribute buffer. That is not supported.
See https://threejs.org/docs/#manual/en/introduction/How-to-update-things.
/ping @Mugen87 for confirmation.
I quite agree,but when I need to modify maxInstanceCount, instanceCount can not achieve my purpose, even if this is rare. I mean, the instanceCount in version 117 is not equal to the maxInstancedCount in the previous version.
You are resizing the attribute buffer. That is not supported.
See https://threejs.org/docs/#manual/en/introduction/How-to-update-things.
/ping @Mugen87 for confirmation.
Maybe both maxInstancedCount and instanceCount are required.
Yes, buffers can't be resized. The idea is to create a sufficiently sized buffer and then control via drawRange
or instanceCount
(when using InstancedBufferGeometry
) the rendering. This approach is demonstrated by webgl_buffergeometry_instancing.
Maybe both maxInstancedCount and instanceCount are required.
Nope. It does work by just using instanceCount
. Check out how the updated fiddle controls the amount of rendered instances.
Thanks a lot ! I will avoid such problems in the future.
Most helpful comment
Thanks a lot ! I will avoid such problems in the future.