Home Technical Talk

UVs: More Maps VS. Bigger Maps?

polycounter lvl 10
Offline / Send Message
Abidus polycounter lvl 10
Say you're working on a character model with several components to it, that you are trying to UV unwrap efficiently. In terms of maintaining good texture quality (and good performance), would you rather:

1) Stick in all on one map at a very high resolution (e.g. 4k+)
2) Divide it between a couple of medium resolution maps (e.g. 2048x2048)
3) Divide it even further between 3 or more maps at a lower resolution (e.g 1024x1024).

I guess my question boils down to this: which has the bigger performance hit, more maps or bigger maps?

Replies

  • EarthQuake
    More maps will generally be more expensive to render. Every additional texture map will require a different shader, which means more draw calls to render. How expensive draw calls are will vary depending on your engine.

    However, in some cases, like skin vs cloth, you might need multiple shaders any way, at which point, having a map for all the skin elements, and another for the non-skin elements won't make a difference vs 1 map for both. If your skin shader requires an extra map like a subdermis or translucency input, its more efficient to have all the skin content on a smaller texture separate from everything else, so you don't end up with texture that have large black wasted space for areas that do not require those effects. Sometimes these secondary effect maps can be significantly lower resolution than the base diffuse and normal maps.

    Similarly, if some elements of your texture need an alpha channel for transparncy, you should generally group all of those elements onto a separate, smaller texture. This is important for two reasons, the first of which being you don't want to run alpha blending on more polygons than you need to, secondly is texture memory/compression(see below).

    In terms of texture memory, 1x 4K is equal to 4x 2ks, 16x 1ks or 64x 512s.

    Texture compression and alpha channels are also very important. It might seem really efficient to pack your specular map into your diffuse alpha, but in reality it isnt. Compressed, a 32 bit image (RGB+A) is the same size as two full color 24 bit images.

    Now, if you want to get really efficient, what you should be doing is packing multiple textures into the channels of a 24bit image. For instance:
    R: gloss/rougness
    G: specular/metalness
    B: ao/cavity

    TL;DR: It depends on exactly what you are doing!
  • Abidus
    Offline / Send Message
    Abidus polycounter lvl 10
    Thanks for the thorough response. I found it hilarious that you could jam several textures into the channels of a single image, have to try that out some time ^^.
  • faizanali
    EarthQuake wrote: »
    Now, if you want to get really efficient, what you should be doing is packing multiple textures into the channels of a 24bit image. For instance:
    R: gloss/rougness
    G: specular/metalness
    B: ao/cavity

    TL;DR: It depends on exactly what you are doing!

    How the hell do you do that?!
  • Ashaman73
    Offline / Send Message
    Ashaman73 polycounter lvl 6
    faizanali wrote: »
    How the hell do you do that?!
    They just use custom shaders. It is quite easy as long as the engine you use support a certain degree of custom shaders.
  • EarthQuake
    Yes, your engine needs to support it.

    In Toolbag, you can load the same texture input into multiple slots and then use the channel selector to pick the right one.

    In unreal, you can link individual channels to inputs in the node editor.
  • FelixL
    Offline / Send Message
    FelixL polycounter lvl 4
    We've had better results with using multiple smaller maps instead of giant maps like 4k. Giant textures are bad for streaming and often take up more space in the pool than they should. Non-square textures (like 2048x512) are fragmenting the streaming pool and should be avoided.
    I think UDIM style texturing will be a good future direction once someone writes a good texture array implementation. Film assets are often using just 512x512 textures, just very very many of them.
  • faizanali
    Thanks Ashaman and EarthQuake for replying.

    Basically there's no workaround to get this in games that don't support this? I'm a modder and haven't really gotten into the "big thing". I was really excited when I learned about this.
  • .Wiki
    Offline / Send Message
    .Wiki polycounter lvl 8
    FelixL wrote: »
    Film assets are often using just 512x512 textures, just very very many of them.
    oO Who said this?

    We are using UDIMs in Mari too for our tv spot productions and 4k textures are our standard. For some characters or objects we use 8k UDIM tiles. It has no impact on the rendertime because arnold (and some other renderers) use mipmapped textures.
  • EarthQuake
    FelixL wrote: »
    We've had better results with using multiple smaller maps instead of giant maps like 4k. Giant textures are bad for streaming and often take up more space in the pool than they should. Non-square textures (like 2048x512) are fragmenting the streaming pool and should be avoided.

    Yeah, that's a very good point. The larger the texture is the harder it can be stream in and out of memory.
  • FelixL
    Offline / Send Message
    FelixL polycounter lvl 4
    .Wiki wrote: »
    oO Who said this?

    We are using UDIMs in Mari too for our tv spot productions and 4k textures are our standard. For some characters or objects we use 8k UDIM tiles. It has no impact on the rendertime because arnold (and some other renderers) use mipmapped textures.

    I've gotten some film assets set up like this, though they might have been scaled down for other reasons.
    I've noticed that projection speeds can be kind of slow with 4K tiles in Mari if you use heavy meshes, I'd rather go 2k or lower and have a different unwrap. But I'm not super experienced with this kind of workflow.
  • .Wiki
    Offline / Send Message
    .Wiki polycounter lvl 8
    FelixL wrote: »
    I've gotten some film assets set up like this, though they might have been scaled down for other reasons.
    I've noticed that projection speeds can be kind of slow with 4K tiles in Mari if you use heavy meshes, I'd rather go 2k or lower and have a different unwrap. But I'm not super experienced with this kind of workflow.
    If the small textures only were jpgs these could be the preview files for the tiled UDIM textures. We also create some small jpg previews that are loaded in the viewport. On rendertime the large tiled files are loaded automatically.
  • thomasp
    Offline / Send Message
    thomasp hero character
    i'd choose several smaller maps over one large one. faster to work with regardless of machine and application as soon as the complexity of your workfiles increases - 4k+ with lots of layers are no fun at all - and easier to optimize: if you can pick and choose between which texture tile can safely be downrezzed and at what ratios, you will be less screwed if you are working on a game and suddenly the texture budget for characters decreases than ifyou had to scale down your single texture to 50% or worse.
  • Ashaman73
    Offline / Send Message
    Ashaman73 polycounter lvl 6
    thomasp
    From an artist perspective it might be a good idea to work with more smaller texture, from an engine perspective this could result in more rendering calls, which is still an issue (Mantle,Dx12 might change this in the future).

    On the other hand, some game projects, regardless of the underlying engine, utilize (project specific) tools which will merge smaller texture into larger one (atlas). It really depends on the project. Without any project specification it would be a good idea to keep the number of textures down without sacrifying too much workflow or using uber-large textures.
  • FelixL
    Offline / Send Message
    FelixL polycounter lvl 4
    It depends on the asset. If you already know that there are very few instances of it in any given scene, the increase in drawcalls by using several textures will be minimal. If you are texturing something like a cockroach and you have hundreds of them on screen, yes, it's best to do it in one texture.
  • thomasp
    Offline / Send Message
    thomasp hero character
    i'd consider optimization as something that can be put as an afterthought - you could e.g. render to texture - perhaps in automated fashion - a game resolution/pixel density atlas of your character's maps to a fresh uv set in the end. my concern would be how to work with the asset, keeping the work data consistent to be able to iterate on it and how to prevent it from getting bastardized due to overwhelming complexity. ;)

    i'd also think that character's materials take comparably small resource footprints next to environments or effects in a typical game. unless your place has hired the kind of noobs that put 2k's for eye textures and zbrush everything up to 11. not really something to split hair about early on. getting them to look right seems to be the main issue.
Sign In or Register to comment.