Closed w0rm closed 5 years ago
A list of possible use cases for updating a mesh on GPU:
In the meantime I updated the docs to not generate mesh in view.
Should be fixed by https://github.com/elm-explorations/webgl/pull/9
According to https://stackoverflow.com/questions/31250052/are-webgltextures-garbage-collected this is not fully fixed. This approach should be fine for occasional changes but not for constantly creating new meshes/textures on every frame.
This was discovered in the https://github.com/francisdb/glmorph demo by @francisdb. The current implementation caches the attributes for each mesh. This means that every newly created mesh will be added to the cache, and if this is done in
AnimationFrame
subscription, the cache may grow pretty fast.This is the smallest example to reproduce this issue:
The heap snapshot shows the growing amount of
WebGLBuffer
objects: