Answer the question
In order to leave comments, you need to log in
What is the loss of webgl context and what is it eaten with?
I'm trying to create a drawing tool on webgl2
Support for a large number of layers (> 10) at 128 bits / pix is desirable. I read the format
on the Internet, it turns out that such a terrible thing as the loss of webgl context can happen to everyone.
In this regard, several questions have matured
1: Should the handling of context loss in webgl and webgl2 be somehow different?
2: Here I lost the context, which means that all the programs and shaders of the current context just crashed and the context variable itself (usually gl
) remained available and I have to somehow restore all the data in it
or I need to get a completely new context by callinggl = canvas.getContext("webgl2");
, and only then restore it? Then the old context will be automatically deleted or will it hang in oblivion?
3: The most important question, what happens to the data when the context is lost? If I store the layers as 2d textures, will they all be destroyed? How can I save them then? Duplicate them also in RAM? Isn't it too fat? Then, when changing (and this will often happen), the textures will have to be copied through gl.readPixels
? Wouldn't this hurt performance too much? How can I continue to live?
4: Maybe even score on this loss of context? How often does it happen? Once in a million? What if I don't need mobile phone support?
Thanks and sorry for the copied question.
Answer the question
In order to leave comments, you need to log in
I'm trying to create a drawing tool on webgl2
What happens to the data when the context is lost? ...then restore it? ... will the old context be automatically deleted or will it hang in oblivion?
Can generally score on this loss of context? How often does it happen? Once in a million?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question