Multiple Textures VS One Texture (for Use In-Engine)

Multiple Textures VS One Texture (for Use In-Engine)

Anonymous
Not applicable
2,229 Views
2 Replies
Message 1 of 3

Multiple Textures VS One Texture (for Use In-Engine)

Anonymous
Not applicable

I working on a gun model intended to be used for an FPS in the Unity Engine. The model is done and the UV unwrapping is complete, leaving me to simply get the layout right and make the texture. Upon adjusting the layout to fit in one texture, everything is very small, cramped, and even stacked atop each other.

 

An easy fix sure, but now I'm wondering, would it be better to break it up into maybe 3-4 textures instead of squishing it all into one? The pros and cons seem obvious (less data being used vs a nicer looking model), so I'm wondering what the best call would be for the sake of performance assuming there would be multiple instances of this gun in-game?

 

Thanks in advance!

Accepted solutions (2)
2,230 Views
2 Replies
Replies (2)
Message 2 of 3

Christoph_Schaedl
Mentor
Mentor
Accepted solution

Guns ins games does have onyl one texture set.

 

----------------------------------------------------------------
https://linktr.ee/cg_oglu
Message 3 of 3

osidedan
Advocate
Advocate
Accepted solution

Hello! I know this has been solved, but I wanted to add a few things to consider when it comes to performance on a broader scope.

first and foremost, your target platform(s) will always be your limiting factor. If you are aiming for mobile, your content will be optimized in a much different way than if you are developing for current gen consoles/PCs.
So just to clarify, everything I mention below is only for frame rate performance, and assumes you are developing for semi current consoles and PCs.

As far as GPU instructions, the extra texture lookups for having a few more materials on an object will be almost unnoticeable. However, if every object in your scene has tons of separate materials, then it will definitely add up. (kinda like how an avalanche is made up of just single snowflakes. get enough of them, and you'll definitely notice it).

That said, you mentioned this is a weapon for first person shooter, and I'm guessing it's probably a pickup as well. One trick you can use is to have 2 versions of your model. One that is placed around the world/used by NPCs that is heavily optimized (has LODs, uses mip maps on the textures, uses basic shaders, fewer or even just one material, etc.). Then you have a second version that is the "hero gun" that is only seen up close by the player when they equip it. This model will most likely take up almost 20% of the screen,  so you want it to look good. Make sure the textures and UV sizes are appropriate for the texel density on screen, and use extra materials when you need to. 

Hope that helps, and let me know if you have any questions on any of that!


Side note:
Sometimes having one material can actually be more expensive than multiple materials. For example, let's you have a sci-fi gun that has a glass tube of glowing plasma, and the rest of the gun is just a flat plastic or metal. The plasma tube would require a more costly shader that supports transparency and glow. If the entire gun uses the same material, then it will cost more per frame to render the entire gun with that expensive shader, than if you split it out into separate materials that used different shaders. Again, performance is a tricky thing, and varies from engine to engine, and platform to platform, so don't use these recommendations as hard fast rules, just things to consider. Hope that helps!