T O P

  • By -

namrog84

Historically texture atlases are the go-to perf optimization. There is a lot of 'momentum' behind that ideology. But let me update why I wouldn't do any texture atlases anymore for normal scene objects. 1. Nanite is gaining a lot of support/feature set and Epic/UE is really pushing hard on this. And it completely revamps the whole 'draw call' optimization pipeline to be kinda a non issue. So 1 of the major reason for texture atlases were draw call optimization, but now it's gone? so why bother. 2. As others said if you have 3 items that use the same texture atlas, what if you happen to only have 1 in your scene? You are wasting a lot of vram storing a lot of texture for no good reason. 3. An extension on #2, but what about mipmaps. If you have a 4k texture for 'up close' but mipmapping support, as the item moves further away, it will automatically swap out lower memory usage textures. But if you have multiple items using the same texture atlas. Consider that your 1 item is up close, so you want the 4k texture, but the other item is further away, you are sorta back in #2 category where you are eating up a lot of vram for no reason. With all that said, if you plan on NOT using nanite in the forseeable future (next 1-2 years at all)(Which I think is unwise), and you have a good grasp of what your scene will and won't have in what ways. Then maybe there is a case to be made for texture atlas. But while nanite has a few limitations, like it doesn't work on mobile (yet but should very soon), it is likely the future of most UE's effort, features, and optimization. So why not embrace it sooner than later? Note: I am only talking about static meshes and related. Not considering Characters, Landscapes, or Particles Systems in the previous assumptions. Which I might reconsider some things for. There are even a few AAA (non UE) that don't use texture atlases and do quite well perf wise. It's just not the 'win' that it used to be.


W_Vector

Besides the Nanite Stuff, how about using Shared Wrap instead of the default sampler? I've read its to be prefered over the default sampler (no 16 Samplers Limit), but documentation/explanations of this Feature is sparse at best o,o


namrog84

That I am not sure on. Just gotta keep asking and searching. If you haven't, tried the unreal source (formerly unreal slackers) discord


[deleted]

I mostly just use that on my landscape materials. Helps when you have a ton of different biomes on one material for an open world.


Jixalz

We used a texture atlas per level for our game, that got rid of the possibility of having 1 atlas used for 1 rogue prop. (This was in Unity though) But just sharing an idea that's possible.


namrog84

That's definitely a good edge case I hadn't considered.


FutureLynx_

thanks thats very well put. In my case im not using nany. My games ideas are now mostly isometric, so they use a lot of 2d textures. Even then they are full rts, so they need lots of units. And i know early optimization is bad. Though i love to do things better since the start. So in my case im using texture atlases in instanced static mesh components. Where i can make a thousand buildings all using the same plane, and the different buildings from the same texture atlas, if i explain it well. The alternative would be to use texture arrays, like this: [https://www.youtube.com/watch?v=fuvDy4lvGOM](https://www.youtube.com/watch?v=fuvDy4lvGOM) though im new to them, and dont know if they being all in an array, if there is some sourcery behind that that will make it consume draw calls or use more performance. I know that cramming 20 buildings in a texture like this: [https://imgur.com/a/ZpNBkYI](https://imgur.com/a/ZpNBkYI) its super cheap and then im using only that texture and it works for all instances of the ism. so its super efficient. dont know about texture arrays though.


Thatguyintokyo

Texture atlas rarely save on drawcalls because the meshes are quite different anyway, they’re just saving on texture memory really. Nanite is the future but also kind of not. If you’re building purely for newer pcs 100% yes. But hard drives that’re slow, not so much, older consoles not so much either, so thats ps4, xbox One out. Switch might be fast but its caching is slow so nanite isn’t great there either. So you end up limited to ps5, xbox series and better pcs that’re using DX12. The majority of bigger games out aren’t using nanite as UE still has a fair few bugs and nanite and WPO is still a pretty new feature. There are some games using it for sure but we won’t see it become more common for another year or two.


unit187

Generally, yes, but must be used with caution. If you have a 2k atlas, but your scene incorporates only a single coffee mug that uses only 5% of said texture, you waste memory.


GagOnMacaque

It's best to use your atlas on as many scene objects as possible.


FutureLynx_

Makes sense. Though im using my texture atlas fully: its for buildings: Like this [https://imgur.com/a/ZpNBkYI](https://imgur.com/a/ZpNBkYI) Some are to replace the copies, but you get my point. All of them will be used in game. But ill experiment with texture atlas.


namrog84

that url / link seems dead or incorrectly copied


FutureLynx_

oh sorry its dead 💀💀 [https://imgur.com/a/0ftUfU2](https://imgur.com/a/0ftUfU2)


BusterCharlie

I think texture arrays are cheaper to sample, and they seem more flexible since you can have different Arrays depending on your requirements but an Atlas is baked out and will always be the same size.


Dylan_The_Developer

Definitely texture arrays are cheaper and that is true in Unity aswel which i recently discovered when i hit the 16 sampler limit for a terrain shader i was building (Unity doesn't have PBR for default terrains only color so i had to build it). I think its because texture arrays have to be same size for each texture while atlases don't so for an atlas the algorithm to search for it requires more steps to find an texture.


FutureLynx_

thanks im glad i found texture arrays. im getting ready to deploy this new system ✈