Unloading and Reloading materials

Good morning,

So it looks like with the latest engine release, the app no longer crashes when unloading assets on scene destroy and then reloading them on reload, but I am getting a bit of strange behavior.

Now when returning to the scene, it seems that none of my textures actually get applied to the material. The runtime lightmaps still appear to work, but none of the other maps appear to load. Looking at the console, I’m getting a warning of:

Ignoring unsupported input property to standard material: validated

for each material with a texture that gets loaded.

I made a repro of the behavior, but strangely, the warning doesn’t appear in the repro, so I could be doing something wrong in general.

Here is the repro:

and the project:

https://playcanvas.com/project/781274/overview/unload-reload-material-repro

To see the behavior, just click to go to scene 2 then scene 1 then scene 2 once more. You will see that the material unloaded from the Earth Sphere, does not get applied on reload. The moon’s textures get unloaded, but the material does not.

Also, one more observation. It appears that the same unloading and reloading material issue also applies to cubemaps that get unloaded. The app crashes and presents the error:

facetextures[0] undefined

Simply not unloading the cubemap prevents crashing even when textures are unloaded.