Solid Particle System: Handle Context Restored

YO @Deltakosh or @sebavan … How do i properly handle rebuild a solid particle system after the WebGL context has been lost and then successfully restored. I see the asset container has code like this for restoring regular particle systems

this._onContextRestoredObserver = scene.getEngine().onContextRestoredObservable.add(() => {
     ...

            for (const system of this.particleSystems) {
                system.rebuild();
            }

     ...
});

But the solid particle system does not have a rebuild function.

So basically what the best thing to rebuild the particle system after a lost context.

A bit of context.
I have an app that sometimes looses its context when the user does multiple instances. And i have a few solid particle system in play.

without rebuilding the SPS , when the WebGL context is successfully restores the app crashes with this error

It really should not even execute that line because of the line above that say if:

 (!this._texture) return

but basically some renderToTarget texture is reporting as null when calling this._texture.generateMipMaps after successfully restoring the context.

Weird

Any Thoughts ???

Do you mind creating a repro for me in the PG?

Hi @MackeyK24 ! Just checking in, were you able to solve your problem? If not, can you provide us with a repro in PG so we can look at it further? :slightly_smiling_face:

I think i can detect and restore lost context… the problem i am seeing now that all my texture are loaded via GLTF which makes BLOBS. When the context has been restored all the BLOBS that contain textures are NULL and i get the BLUE screen :frowning:

cc @bghgary as this should probably not happen.

Is there a repro?