// this is a question for beginners, they do not have much experience with WebGL
I am trying to optimize memory usage (mainly to use our site with mobile devices).
Our grids use BufferGeometry with several instances of BufferAttribute (vertices, normals, colors, etc.), and, as I see in IE DevTools, each BufferAttribute contains two main fields for storing memory:
- array - data for the given attribute of the buffer.
- buffer - WebGLBuffer, which contains the copied data from the array field .
As I understand it, in some situations, the buffer is restored , and at this point the data array will be reused. But if all the geometry is read-only, it would be safe to clear the arrayto save memory? Or are there other situations where the WebGL buffer needs to be recreated (say, the user switched to another tab in the browser, and all WebGL materials must be recreated when they return)?
source
share