Home Technical Talk

Texture size vs. quantity

polycounter lvl 18
Offline / Send Message
coldwolf polycounter lvl 18
I've searched but couldn't find a discussion on what kind of performance impact textures have. Is it better to have fewer, larger textures or many smaller ones?

It depends of course, but if that's your best answer, could you please specify what you know about the platform you're working on? e.g. I've read here that the ps2 likes lots of little textures (as in 256 and 128s). What about the 360 or ps3? Or specify a game engine and what it prefers, if you could please.

Even more specifically, for large models with a lot of parts (big complicated machinery for example, or a complex building), is it generally better to unwrap and texture each of the parts? Or put them all on one big sheet?

Thanks for your time smile.gif

Replies

  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    less textures better for "normal hardware" (read xbox1, and above, ps2 is indeed different as it has so little texture memory). some engines will generate those "big sheets" out of many textures internally automatically, as it means less state-changes in the rendering pipe, which means higher performance.
  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    More textures means more calls to load those textures, so you spend more time moving textures in and out of memory.

    However, smaller more generic textures for environments means you can share textures between lots of objects (buildings), so they get kept in memory for longer anyway.

    A street of shops example:
    Common bricks, more bricks, concrete, road, pavement, generic metal for pipes etc. These are used on many of the buildings and the street itself.

    Unique single textures per building (brick, plaster). These are probably used in other areas of the game, just not in the immediate area.

    Unique detail sheet for some buildings/shops - branding, window display, signs.
  • coldwolf
    Offline / Send Message
    coldwolf polycounter lvl 18
    Thanks!

    So it sounds like texture calls are more precious than the memory they use up. In other words, fewer and bigger is better for most modern platforms?
  • Mark Dygert
    Also remember if you use one big sheet to cover several objects and in later levels only one or two of those objects are used, it is still calling a big sheet and not using most of it. Likewise if you have an object that breaks into smaller pieces like a robot that is destroyed and its arms ad legs fly off leaving the torso sitting in the ground for the rest of the game, it might be a good move to put the arms and legs on a separate sheet so those sheets are removed from memory when it is destroyed. But then again thats more memory management going on...

    I think an important step to take is to unwrap the model so each piece gets maximum detail and is EASY to paint (very few inverted pieces or weird angles). Be it one large UV space or several smaller it doesn't matter, whatever is easiest to paint on. I call this a "Master UV layout". Later you can go in and re-arrange the UV pieces to a new UV channel and bake/render to texture the Master UV channel to the new UV layout.

    That way you're never far away from delivering what is needed and you only rearrange the pieces once. It beats the hell out of rearranging things in Max, then trying to rotate and scale everything in PhotoShop.

    This trick also works well when you're working on multi-platform titles, or just want to go from 2 sheets to 1 or vice versa.
  • warby
    Offline / Send Message
    warby polycounter lvl 18
    the size and amount of textures doesn't really effect performance.
    the amount of materials and the amount of batches/draw calls that will result out of them does ... the fewer draw calls the better !

    so try to use as few materials as you possibly can without fucking up your own work flow too much.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    but very often amount of materials is related to amount of textures. (unless the engine internally optimizes for texture atlas useage to create bigger batches).

    in a regular engine you will get an extra draw call for every new texture you use. (not as in texture combinations diffuse/spec... for a material, but say your object uses 4 diffuse textures)
  • HarlequiN
    Offline / Send Message
    HarlequiN polycounter lvl 18
    [ QUOTE ]
    Likewise if you have an object that breaks into smaller pieces like a robot that is destroyed and its arms ad legs fly off leaving the torso sitting in the ground for the rest of the game, it might be a good move to put the arms and legs on a separate sheet so those sheets are removed from memory when it is destroyed.

    [/ QUOTE ]

    Actually that probably wouldn't matter, unless there was a specific technical reason for doing so. Firstly 99.9% of games would remove the torso once you've moved away anyway, and secondly, if it's supposed to remain there, like it's the remains of a boss, then the area will hav ebeen designed with the memory footprint of the entire robot in mind anyway - you don't need to free any memory up by removing things unless there's a specific reason to do so (like right after you destroy it a team of 7 guys turn up to attack you, after being spooled into memory) - and if that's the case you're going to be informed by whoever's responsible for the more technical aspects of your work anyway.
  • Mark Dygert
    Harl you're right its basically a push in most cases. It can even tie up resources trying to figure out what textures need to be dumped, and if they need to be loaded again it can create more of an issue.

    The specific technical reasons I was thinking of where:
    - RTS's units that can be scavenged (so you can have many objects on the screen staying for extended periods of time)
    - Objects/structures that have large additions that appear/disappear when it is up/downgraded or disabled.
    - Destructible enviromental objects like a tanker fuel truck after the tanker explodes. If the truck always stays and the tanker always is reduced to an axle. Put the Axle on the truck texture, and leaving the tanker on its own.

    Like I said its all more memory management and might not gain you an advantage. But in some cases it might be one more trick you can pull out of your bag that lets the unit cap be set to 300 instead of 175.

    I think the important part of my post was to remember you can keep your UV's pretty fluid and adjust them to whatever the technical demands are. Which takes the stress out of "oh crap I unwrapped it wrong". It should only take as long as to rearrange the pieces in max and render out a new map(s). Instead of having to re-unwrap the traditional way costing you several hours if not an entire day.

    Also if you create a master UV channel that is easy to paint on you'll save yourself some time.
  • coldwolf
    Offline / Send Message
    coldwolf polycounter lvl 18
    That's a great idea Vig, but I haven't a clue how to do that. But it sounds like I put an unwrap modifier on channel 1 and that will be the "master" uv channel, then when I make changes to the layout I do so on a duplicate channel, then somehow bake it from channel 1?

    Is there a way for me to do with with some other program like HeadusUV or modo? Max is crashing a lot on my laptop, and I can't afford a new computer that would handle it yet frown.gif
  • leilei
    Offline / Send Message
    leilei polycounter lvl 14
    in an OpenGL game it's best to stick to as least textures as possible, because more means new surfaces and more gl draw calls leading to slowness
  • Black_Dog
    Offline / Send Message
    Black_Dog polycounter lvl 17
    [ QUOTE ]
    the size and amount of textures doesn't really effect performance.

    [/ QUOTE ]
    Up until the scene requests reads from a texture set that doesn't fit in vram, in which case you will fall off a performance cliff.

    Considering vram varies from 768 Mb down to 128 or lower, texture memory use is definitely an issue.
Sign In or Register to comment.