I am facing an issue with a large mesh containing over 5 million triangles. I utilized BufferGeometry
with attributes such as position
, color
, normal
, and index
. However, there comes a point where I need to remove certain indices
from the index
attribute.
Upon exploration, I realized that there is no direct method to eliminate elements from the existing index
buffer. The only solution seems to be creating a new BufferAttribute
and replacing it as the index
buffer of the geometry. Unfortunately, I have not been able to find a way to delete the previous index
buffer that has already been uploaded to the GPU. This continuous accumulation is causing a GPU memory leak, and I am reluctant to dispose of the previous geometry and start anew.
Therefore, my inquiry is - does anyone know of a way to remove the previous index
buffer without disposing of the BufferGeometry
altogether?