Do contents of a blueprint array get stored in memory?

Hi all,

I have a character blueprint in my game to which I want to add a rather lengthy list of high resolution textures as a texture array variable. The idea being that I can pull from these one at a time to stamp into a render target. My question is: are all of the texture assets that the variable is pointing to going to be loaded into memory when the character spawns? Seems like this would be pretty inefficient but I wanted to check on this before proceeding.

I created a test blueprint with some tiny black textures in an array inside of it, and then switched them all over to 4k maps, and saw no difference in the profilers. Encouraging, but I guess I’m still not convinced as the profilers didn’t seem to be giving me information that made much sense (the ms weren’t changing very much when I added a bunch of characters.)

And if it DOES mean that I would need to load them all into memory, and I want to use another cheaper method to access these textures, is that possible? If I store it in another blueprint that I cast to, would that help? Or can I somehow access a particular texture (or otherwise) asset by name alone without an array?

Yes, I believe the array of textures would all be loaded when you load the character. This may be when the character first spawns, but it could also happen when the game initially starts up if e.g. your game instance/level has references to the character class.

I’d suggest learning about soft references if you haven’t tried them before. An array of soft texture references can point to textures which aren’t loaded (and doesn’t force them to load) so you could choose if/when each one gets loaded.

Okay, thank you for your answer! I will look into soft references for these textures. As I understand it that would mean loading the textures from the CPU to the GPU, which I will have to test for performance. These textures might be loaded quite rapidly at times. Otherwise, I might try storing them in a regular array to keep them on the GPU from the get-go, but using subUVs to minimize how many textures we’re dealing with.