Inactive textures still loading

I’m trying to figure out how to optimise loading, but I fail to get the most basic test possible to work.
I’ve created an empty project with one single sprite in it. Even if I uncheck Preload on both the sprite and the texture atlas, and turn off the sprite in the hierarchy, the texture atlas still loads as soon as I run the scene. It’s not supposed to do that right?

The assets may be cached in your browser. Have you tried disabling cache in Devtools?

Can you post a link to the project please?

Thanks for getting back to me

The texture loads even if I publish a build and run it in a browser for the first time.

Here’s a published version. Turn on devtools and look for “BG Atlas.png”. It’s the only object in the scene (not even a camera) and it’s turned off.

Here’s the project
https://playcanvas.com/editor/scene/952641

Thanks!

Right, I can reproduce this with your sample project. The texture atlas shouldn’t load since it isn’t requested anywhere, but still loads.

@MrOliv, can you submit an issue about it in the engine repo?

Not 100% sure this is a bug as the asset is being referenced in the scene so it would make sense for it to be loaded when the entity is created (even if it’s disabled).

Note that the atlas will be loaded after the preload screen.

I think for material and model assets, they get loaded only after any entity referencing them gets enabled. If it’s added in the hierarchy but it’s disabled the referenced assets won’t load.

I imagine the textureatlas is kind of a special case, since it isn’t directly referenced by any entity, only by other sprite assets.

1 Like

Ah, I see it now… Definitely report an issue for that

The sprite component is like to be issue as the sprite asset references the atlas.

1 Like