Any Tips / Tricks for Minimizing Performance Impact of Textures?

Hello fellow developers!

I know that textures can take up a lot of memory and resources of a device on Roblox. However, textures are essential in creating realistic environments. Some games that I have seen use a lot of textures are horror, apocalyptic, and some open-explore games.

So, I would like to know if there are ways of having a texture-based game that suppresses their malicious effects on performance. I have read a post where someone suggested texturing only the visible sides of a part. I would want to know if there are more tips and tricks like that.

Thank you all.

4 Likes

Here are a few common ways of reducing the performance impact of textures:

  • Refrain from using semi-transparent textures. If your texture contains semi-transparent pixels, Roblox will have to combine the colors of those semi-transparent pixels with the colors of objects behind them, which increases computation time! Especially multiple semi-transparent textures stacked on top of each other can kill performance quickly.
  • Reuse your textures often. A texture only has to be loaded into memory once, so textures that are reused are stored in the same ‘memory block’. So one texture that is reused 5 times will take up less memory than 5 similar though unique textures.
  • Keep your texture sizes small. The more pixels a texture contains, the more memory it takes up. As a rule of thumb you should not make your textures bigger than the space they occupy on your screen 99% of the time. So if I have a texture of a leaf, but that leaf never takes up more than 30x30 pixels screen space, you should keep your texture at that size or smaller.
  • Use your textures sparingly when possible. This is something you already mentioned, but the fewer textures you have ‘active’ (so visible on your UI or game world), the fewer textures have to be stored in memory and drawn, which will reduce memory usage and increase performance.

When done correctly, you shoud be able to create a nice looking game that doesn’t take up too much memory and is still running at a good frame rate.

23 Likes

Thank you for these ideas, I will definitely try them out! However I have a few questions:

  1. What do you mean by reusing textures? Is it simply using the same texture on a part over and over again as much as possible? Or do I have to convert it into a package?

  2. Also, if I were to “de-load” textures that are out of bounds of player visibility (like in a horror game where everything around is black), would this improve performance?

Again, thank you for these tips. They are really useful to me.

1 Like

The former; copy and paste the Texture or Decal object such that the ID in the objects are the same.

It should, yes, but it depends on Roblox’s implementation. Usually objects that are out of vision aren’t rendered at all. And if you destroy all references to an image or texture (e.g. every decal with the same ID) it should also free up that part of the memory, reducing memory usage. I do not know any details though, so there might be more to it.

2 Likes

I was researching texture performance and saw your post.

Regarding the leaf example; what would a sensible limit on leaves be? Say someone wanted to make a Minecraft clone in Roblox - each cube to be smooth plastic, but have one surface being a texture.
And then they wanted 5000 clones of that part/cube.
Or, using your own example, a tree with 5000 leaves.
As they’re all clones, would it be possible performance-wise?

2 Likes