Open brianchirls opened 9 years ago
I am worried about the performance implecation of purge and restore methods, are they supposed to be called in realtime ?
No, they're supposed to be called outside of "hot" render cycles, when you're shutting down or spinning up sections of a composition. On Feb 10, 2015 3:57 PM, "Abhishek Hingnikar" notifications@github.com wrote:
I am worried about the performance implecation of purge and restore methods, are they supposed to be called in realtime ?
— Reply to this email directly or view it on GitHub https://github.com/brianchirls/Seriously.js/issues/81#issuecomment-73781963 .
Ah then they definitely make sense. :D
Sometimes large compositions with multiple scenes can cause problems running on devices without great GPU resources, like a mobile phone/tablet. For example, when running this piece on a MacBook Air, WebGL crashes (lost context) when switching between scenes.
I propose to add
.purge()
and.restore()
methods to all node types and to theSeriously
composition object for releasing all GPU resources (shaders, textures, frame buffers, etc.). All the resources will be rebuilt when.restore()
is called or automatically when any purged nodes need to be rendered.