Do lots of textures eventually create lag, and how many would it take to get to that point?

Hi!

I’m working on a game that was initially very part heavy, but I cut down on it a lot by using textures where I would have used a lot of parts in order to optimise the game. For example, I cut down on wood panelling that was previously several hundred parts to each building, to maybe 8 with custom textures.

You can see what I mean here:

I did the same thing with the roof as well.

But since the game I’m working on is so large (Kingdom Life II), you can probably imagine the amount of textures add up really quickly! I have 4-6 textures on a lot of the parts, and hundreds and hundreds of parts with textures. Would this contribute to lag at all? If this is the case, how many textures in total would it take before it contributes to lag? Would it have any kind of contribution to lag on mobile devices, in particular?

8 Likes

It depends on what is the resolution of your texture. If it’s relatively low, you’ll probably be fine; however, if you’re going to use very high resolution textures (2K), that’s going to cause some lag.

As for the amount, it also depends on the above. You can get away with around 25-ish low quality textures and get no lag, but cranking it up with high quality textures, you probably get away with 10-ish textures. (numbers were from my head so I can’t guarantee them)

1 Like

Do you mean 10-ish high quality textures in the entire place, or in a single part? I have genuinely hundreds of textures in this game.

1 Like

Roblox rescales textures higher than 1024 x 1024 anyway so using 2K textures would be near impossible in a single texture. You’d only accomplish this by using a sliced image.

Furthermore, geometry has a lot more strain on performance than textures do. You also need to bear in mind the difference between using 25 different images (so, different asset ID’s that need to be reloaded) and using duplicates of the same image.

Using a lot of textures has a similar impact as using meshes; If you use the same mesh ID a bunch of times, it will only need to cache one single mesh file. (Instancing is a blessing :pray:) This of course leaves out the fact that using multiple meshes with the same geometry has a higher impact on rendering, but that’s a whole different topic.

The point is basically: You’ll be fine with using a buttload of textures if they all share the same ID, meaning only one needs to technically be loaded. It won’t have a large impact on performance at all. You can always stress-test this by opening a new place and creating up to 2000 parts with the texture you use, and see if you have any issues running it.

12 Likes

I’m aware that textures work in a similar way to meshes in that they have a level of detail that compresses when you’re far away, and this is extended on mobile devices. This is why I’m interested in the extent of this, and how it transfers to mobile devices in particular. I want to understand the specific limit of textures, so I can better optimise the game.

3 Likes

There isn’t really much of a ‘limit’, just a lowest amount of textures needed before performance is impacted. You can’t really measure this too accurately as you’d need to have the worst device to test on. You could potentially take a potato from the fridge and attach a mouse and keyboard to it to see if it has any issues running the textures.

I’d say don’t worry too much about it, as the method you use for textures is in no way harmful for performance. I’m talking about thousands and thousands of image textures, here.

3 Likes

This is why I asked. Are you saying the limit is in the thousands in terms of before it would affect performance? Or is it more like this?

2 Likes

If you’re really concerned, open up the console while in game, and see how much memory is being committed to textures.

I’m willing to bet it’s smaller than you think.

2 Likes

Precisely. It will take thousands of different textures being right up in the camera’s face before you see any significant performance impact. (Keeping image LoD in mind here)

Yes, literally thousands. At the end of the day, you’re not rendering 3D geometry, just images.

2 Likes

@DevBuckette @Aotrou

I decided to put a couple hundred of my optimised houses that mainly utilise textures into a studio place and measure the fps and memory. As you predicted, it was a very low cost and the fps is a solid 60.

Edit: The memory usage for the textures was 47.5 MB. Without any parts or textures, this is only 25 MB and considering a game without any parts is probably 280, that’s really optimised.

Thanks for your help.

3 Likes