Mesh disappear when add animation event

I have a playground here AnimationGroup demo | Babylon.js Playground (

I tried to change the texture of the mesh during specific animation frame, when I hit play, I can see when new material added, the mesh also flashes and disappear for a second, is there any way to solve this? Thanks.

You could force the compilation of the material shaders to ensure everything is ready when you render:


Thank you @sebavan , that’s very helpful