[SOLVED] Reload skybox failed

Hi there,I am facing a strange problem after the engine update,I don’t know if it’s a bug.

I use " pc.app.setSkybox() " after the skybox asset is loaded and " asset.unload()" to free VRAM after I switch to a new skybox,it works fine before the latest engine update, but now it can’t work :confused:

Snipaste_2020-07-10_14-49-48 Snipaste_2020-07-10_14-51-09

The test project can be found here:

Can anyone give me some advice?

Hi @FBplus,

It seems that the second time you load the asset, in which the code still goes to line 52 and attempts to reload the asset … the cubemap faces aren’t loaded.

Are you doing anything special in your assetsManager.js script? Otherwise this seems like a bug, submit this in the engine repo. There has been work lately on skybox/cubemaps loading.

1 Like

Thanks for the reply Leonidas :smile:

That script is just a helper for me to manage the assets at runtime and should do nothing to the main logic here.I delete that script and it still not work :pensive:

I think this may be a bug, since the previous engine works fine.Thanks for your advice :smile:


Cubemap handling/loading has had a major refactor courtesy of @slimbuck


I have noticed some recent problems with skybox showing up wrong, as well.

I have a project with multiple scenes. Only the skybox assigned to the “main” scene will display. The other scenes have their own skybox/cubemap asset, but it won’t display. Only the first one loaded, it seems.

Also, note that it displays fine if I “Launch” the scene from the Editor. The issue occurs when running the build.

This project does nothing to manipulate the skybox at runtime. It’s simply set in the Scene settings. It was working recently, but now it’s not.

Hi @FBplus, @Cain_Quigley,

As Will says the cubemap handler got a rewrite. I’ll look into this ASAP, thanks so much for the repro!


Thank you, sir! I’ll keep an eye on this issue for a bug fix.

Thanks :grinning:

Created https://github.com/playcanvas/engine/issues/2271

This should now be working with engine release v1.32.0.