Home Technical Talk

Optimize UVs - mobile game

Tzur_H
polycounter lvl 9
Offline / Send Message
Tzur_H polycounter lvl 9
I'm trying to optimize my UVs for an asset I'm creating for mobile game, right now the model is deleted in half so I'll mirror everything at the end of the UVing stage to save space, parts that are not deleted, are already stacked on the UVs.
my problem is, that I can't fit some of the UV shells into 0-1 space without scaling down everything pretty significantly - losing texel res :\

I just wonder what would be the best approach to this kind of issue?  because I'm facing this quite often and have no idea what to do.
split the mesh into 2x 256 maps instead of 1x 512 or just scale down and fit everything to 1x 512? :S


Replies

  • Deadly Nightshade
    Offline / Send Message
    Deadly Nightshade polycounter lvl 10
    Yes you can.
    Let me start by saying that having a uniform Texel Density isn't such a big deal - and even less so for mobile assets (same goes for distortion).

    That shell with the spire can be cut in half, mirrored and have it's halfs stacked on top of each other. You get the same quarter of the spire repeating radially, but that should be fine.

    You can do the same with the shell for the arcs: You don't need a full arc +2 half arcs - you only need one half arc of unique UV space, so stack them all together (also applies to the small bit below).

    Also, at what distance and angle is this asset viewed by the camera? I'm sure you can find some shells that doesn't need the same density as others.

    Last but not least:
    It is always a bad idea to load in several texture maps into memory when you can get by with less. For example, 4x 256 maps are more expensive to load into the graphics memory than a single 512 map (the concept of "mega textures" takes this optimization process to it's limits).
  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 12
    You can always do a single 2:1 ratio texture map at a resolution of 512x256 which should still conserve texture memory (and draw calls) compared to a 512x512.

    That being said, I agree with @Deadly Nightshade and think you can probably fit this all into a single 1:1 square effectively by mirroring more of your mesh.
  • Farfarer
    For something like this, I'd use a couple of tiling textures rather than one massive one. You can use a second texture/lightmap texture to add large scale variation.
  • Tzur_H
    Offline / Send Message
    Tzur_H polycounter lvl 9
    Thanks for the replies guys. You gave me some great suggestions, I'll try em out and see what I can come up with!

    The game will be in isometric view, I was thinking maybe to delete everything that the camera won't see, but I'm not sure if I should do it now, because I'm not 100% sure about the specific angle myself, also, it will effect the shadow cast by the object from light sources no? :S
    Farfarer said:
    For something like this, I'd use a couple of tiling textures rather than one massive one. You can use a second texture/lightmap texture to add large scale variation.
    What do you mean by second texture/lightmap texture to add large scale variations?
    I know the engine needs a 2nd UV channel with no overlaps in order to build proper lightmap, so I can use the same channel to also assign textures to in the shader?
    Also when creating tileable textures for mobile, what resolution is usually being used?

    Thanks again, appreciate it.
  • Farfarer
    For texture resolution, whatever works on mobile, I guess. Depends on a lot of factors, just use common sense :P

    You can use up to 3 UV channels in Unity 5 (two in Unity < 5), so you can use one for a second texture with big colours and modulate your tiling texture with that to try and remove obvious tiling and add some more visual interest. Generally the last UV set is reserved for light mapping.
Sign In or Register to comment.