Textures Load and Memory Management

Good afternoon guys, me again!


I have a 3D Tour application and am experiencing a problem.
When it starts, all the textures of the skyboxes load from the internet and stand ready (stored in an object) so that the user can walk the property.

When you click a blue circle, the texture is allocated to an object and is visible to the user.
Now the problem starts, as you move from one skybox to the other, the former continues to occupy system memory, but if I give the unload command in the texture, I need to reload it from the internet if I need to display it.

Note that by clicking the first time on any skybox, the upload is immediate, but if you need to revisit some, it takes time to load.

You need to unload the asset using the relevant method, not the texture object directly. And make sure a material rendered doesn’t use it.

The asset will be reloaded to VRAM as soon as it is requested (e.g. by a material) or you can reload it manually by using the load method on the assets manager:

this.app.assets.load( myTextureAsset );

I couldn’t understand a way to solve my problem. Let me explain further:

  1. I call app.assets.loadFromUrl() to load all the skyboxes textures as assets and store it to javascript objects;
  2. When i click on a blue circle, it respective texture is assigned to its material;
  3. When i go to another point, i call the textureAsset.unload()

At the first step, all my skyboxes textures are loaded and not consuming the whole browser memory. As i click and navigate to another point (step 2) the texture start to consume the browser memory. Now how to get back to the state in which the textures are in step 1 (loaded to cache - i guess -, ready to be showed, but not consuming memory and without need to re-download the file)?