I’m currently developing a weapons kit. I was curious if its better to have small individual textures for each weapon or if its better to atlas numerous weapons on to larger maps. Since the player would only have one two or three maximum equipped at one time.
Reducing the number of materials and objects will reduce the number of draw calls and improve performance
Hi Darth, So my concern here is when the engine performs a draw call. Does the texture size matter? or the pixels space on that texture. For instance If I put 5 weapons on one material and just a single weapon is called from that 1024 texture. Is that a bigger hit to performance then if that same mesh called a 512 texture.
The texture is typically loaded onto the card ahead of time.
The draw call instructs the gpu to process a batch of primitives.
When the primitives are being rendered, the texture is accessed - e.g. a texel is looked up based on the relevant uv coordintates.
So the size of the texture consumes more graphics memory but does not necessarily take more time in regards to processing a draw call.
The difference in processing a 1024 texture vs. a 512 isn’t as big of an impact as how much it would save in performance in reduced draw calls. It’s kind of a balance in how much memory you use vs. how many objects, but usually it’s worth it to take a memory hit.
Memory isn’t an issue until you run out of it. (Or too much memory bandwidth is being used streaming things in and out).
For a weapons kit, I would not use a texture atlas, people may only want to use a few guns out of the kit. And generally you want high resolution textures for FPS views of the weapons (2048x2048 for an FPS weapon is not uncommon).
BUT if there’s attachments that are reused on multiple guns, an atlas is not a bad idea.
Its actually for RPG style weapons Swords shields ect… But my guess is that simliar principles apply. unless seen from 3rd person camera…