Search Unity

Texture Atlasing with hand drawn textures

Discussion in 'General Graphics' started by BravePenguin1, Apr 22, 2021.

  1. BravePenguin1

    BravePenguin1

    Joined:
    Jan 10, 2016
    Posts:
    11
    Hi there,

    I've started a project, aimed at the oculus platform, and I've been looking at ways to optimize performance, due to the mobile hardware. I've seen a lot of stuff around texture atlases, however they usually involve just unwrapping onto a pre made texture of some kind. I plan to hand draw my textures (after unwrapping), rather than just using the generic, square texture images.

    Does anyone have any advise around a decent workflow for this. I've thought of creating all of the relevant models first, then unwrapping them all onto the same blank texture image (which I would then paint after), however this makes it harder to add new models to it afterwards.

    Is this just a drawback of using the hand painted textures, or is there a good workaround?

    Also, am I right in thinking that anything using the same shader/material etc, will be automatically batched in some way?

    Thanks in advance for any advice.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    The short version is unwrap each object to a square / rectangular UV area like you normally would, but then scale that down into a smaller part of the total atlas. And no, it's not easier if you aren't using hand painted textures. In some ways it's even harder since you can't easily use repeating textures across surfaces when using a texture atlas. You have to slice up the geometry to emulate repeating textures.

    Focus on objects you know won't be moving, as atlasing is most useful for static environment meshes vs anything dynamic. Try to atlas based on which objects are likely to be used together, like all objects within one area of a level in one or two atlases, all objects that are likely to be reused into another, etc. Technically you could say atlasing textures for characters is useful as well, but in that case it's more about making sure skinned meshes use a single material per sub mesh as they can't be batched anyway.

    There are also tools out there to help atlas them after the fact. So you can put them all into the game without atlasing them, then use the tool to combine the textures and adjust the textures.

    Anything marked static can be, if it's using the same material. Dynamic meshes with less than 300 vertices or 900 attributes (position, normal, UVs, etc) total can be batched if you have dynamic batching turned on, but only if they're mesh renderer components, not skinned.
     
  3. BravePenguin1

    BravePenguin1

    Joined:
    Jan 10, 2016
    Posts:
    11
    You know what? Now you've explained it like that, I can't believe how much my head over complicated it In terms of total atlas size for mobile platforms, is 512x512 a safe bet? Or could I afford to go higher? Obviously less textures would mean less draws, but I'm not certain if the cost vs higher quality images.

    Thanks for the info BTW
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    We used multiple 2048x2048 atlases for Falcon Age.
     
  5. BravePenguin1

    BravePenguin1

    Joined:
    Jan 10, 2016
    Posts:
    11
    Oh wow! Much Bigger than I thought.
    Thankyou so much for the help (and falcon age is awesome BTW).