When we launch and run PlayCanvas which is under iFrame, it irregularly lost webgl context.
The size of glb file is little bigger than 50mb and the issue occurs most likely on iPad or iOS device.
Sometimes, it occurs on a low performance device. Especially, it occurs when the browser comes back from background mode to foreground
The problem is this issue occurs intermittently and randomly.
I just wonder what causes this issue and how I can prevent it.
Also, I wonders if it’s possible to restore webgl context and reload or rerender the scene.
The context is typically lost when the device goes to sleep and similar, and in most cases that recovers fine.
If you use the prefiltered cubemap for lighting, we have an issue with recovering it, and you should switch to a new type, which uses a 2D texture, which does not have this problem.
In the cubemap prefiltering dialog, delete the data first, and prefilter again, just don’t click on the "Generate legacy cubemap’.
Hey, it seems we are getting a similar issue when rendering a dynamic cubemap and extracting an environmental map on the fly. Basically very similar to this example:
What exactly is the problem @Leonidas ? Missing ambient (image) lighting when the device is lost?
If as you say this is stored in dynamically generated texture, you need to re-generate it when the context is restored. The device fires this, which should tell you to update your render targets that are not updated every frame: this.fire('devicerestored');
We don’t use readPixels inside generateAtlas functionality. By looking at the code, only shFromCubemap functions uses it, which we don’t internally call at all.
No idea about that error message at all, really strange. No other errors before this, nor the code stopped i n the debugger is similar I assume?