Home Technical Talk

UV Layout Why is this wrong for games?

Creo_metus
node
So I hear so many conflicting things and I'm hoping someone can help me out here. Talking specifically for games:

Are Overlapping UVs acceptable or not? Why or why not? 

Do I have to stay in the 0-1 space of a UV map or can I put some UV shells in the other available space? If so, why or why not? 

I built a simple wall and laid out the UV's in a way I believe to be completely wrong, but the result looks fine and probably better detail than what I would have gotten from smushing the UV's into the 0-1 space. Granted I know I'm not in a game engine, but I can drop this in Unity or UE4 with minimal issues I believe. Can someone please tell me why this is bad or is it acceptable to do to take advantage of tiled Textures for more detail? 

3D Model: 



UV Layout: 


TEXTURE 1024X1024:
 

I'm just trying to get a good answer since I hear it so many ways, but man it would take some of the headache out of UV'ing if I could use some space outside the 0-1 or overlap similar parts to save space and get a little more detail.

Replies

  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter
    Your goal is to make the model look as good as it can within a memory constraint and as efficiently as possible.

    So, if mirroring and overlapping parts of the models UV's means you can get the resolution you need from a smaller texture, that is more efficient, right?

    If the model needs a mix of tiling textures and some unique parts, you can use trim sheets. If it needs completely unique textures, it may be necessary to not have any overlapping shells. That's not as efficient use of space, but a lot of times it's necessary.

    Getting a little outside of my experience, but to use multiple UV channels (i.e. going beyond the o-1 space) you would need a special shader to read that. I believe that would usually be more expensive in games and isn't necessary under normal circumstances.
    Look into Lightmap UV's if you are gonna be doing enviro art for games because there is some considerations there. Somebody else can probably tell you more about that. Likely, most the info you need is on the wiki. That's a good source because it's been around awhile, has been compiled by professionals, and has plenty of links to further resources.

    As always, trust, but verify. Place no head above your own, and if information you are receiving seems conflicted, test things for yourself.


    If you browse around for some modular environment tutorials, you'll get a better sense about things. Way easier to understand by practice than with theory alone. Modular environments are all about efficiency so they'll be making use of trim sheets, mirrored UV's and such.

    one last note, Tim Simpson is the man around here for beginner friendly trim sheet and enviro lighting instruction. Search "polygon academy." He's been putting up a few tutorials recently that may help you as well.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    Not only is this acceptable, but it is an established and common technique. 0-1 UV space is simply the default tile. UV space tiles infinitely in all directions and is read like this by the engine. It wraps back onto itself. Tiling textures, trim sheets, and atlases all make use of this fact.

    Unique UVs for baking and lightmapping UVs are the exception and will stay within the 0-1(there are tools to temporarily shift the 0-1 tile to other tiles but that is a different issue and not too common)

    Overlapping UVs, again, are not only acceptable, but an important method of saving/optimising on texture space. Baking and lightmapping being the exceptions. Once maps have been baked you can overlap as usual.

    @alex javor multiple UV channels are not needed to go outside 0-1(think basic tiling texture) Multiple channels are used for alternate unwrap layouts that can be called. Going outside 0-1 is simply wrapping the texture onto the same UVs.
  • gnoop
    Offline / Send Message
    gnoop sublime tool
    Since a few renderers out there, not Blender unfortunately,  could ask you what exact UV space to bake or animate your UV  you  can pack your UV in this also kind of "unique" way  where nothing overlap each other while is not in 0-1 space.    In some specific cases unwrapping in this manner could be more efficient.  You just bake 4 UV spaces and stack it one over another in Photoshop, SD or Blender composer
     20 years ago when every pixel in games was countable  we had an in-house unwrapper that had a special mode for that.        Now even Rizom lab seems don't having it  :(  
  • Noors
    Offline / Send Message
    Noors greentooth
     UV space tiles infinitely in all directions and is read like this by the engine. It wraps back onto itself.
    Just a small precision here. Due to uv values beeing stored into limited memory (float), you'll lose precision at very high values (same goes for meshes). That's usually not an issue besides texture scrolling implementation (you dont want to offset your uv forever) or unless you unwrap at insane distance from the 0-1 square.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    I've seen precision become an issue at shockingly low uv offsets on a PS4 engine I'm not going to name so as a rule I tend to pull shells back into 0-1 space (or as close as possible)  before export. 
     An offset of 1 or 2 units shouldn't give you any trouble though. 
  • Creo_metus
    Thank you all so much for your responses. This helps me tremendously at least on modular assets. 

    @Alex Javor  Thank you for pointing me in the direction of Trim Sheets and polygon academy. A lot of times just figuring out the right question to ask google is helpful, so thank you. I very much appreciate the resources. 

    @musashidan when you talk about baking normals and the like for unique UVs. This would be more so for individual props and the like correct? Example let's say I had an item that was an important asset to my game and was unique that a player would get up close to. Would I make use of overlapping the UV's  to gain detail or would that be bad practice and distort the normals or other bakes? 

    I appreciate all your responses and I'll play around with a few more things and repost results as I experiment. Thanks again! 



  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    Yes, unique baked 0-1 normal sheets would generally be for 'hero' assets like props that you want to stand out as unique, or that simply might not be suited to trim sheets or tiling textures. This is a broad generalisation, though, and not a hard rule. Props can, of course, be entirely textured using trims or tiling. A baked asset doesn't have to be unique either, it can be duplicated around the scene/between levels. Unique bake assets should never be too large in the scene. This would break the texel density in relation to other scene textures and result in blurry/pixelated/low res textures. Also, if you are baking many small assets of similar material you should aim to lay them all out on a single texture sheet to reduce draw/calls and memory footprint.

    All of this stuff is interchangeable and it really comes down to style/design/optimisation/draw calls/reusability/modularity/etc....

    Overlapping/stacked/mirrored UVs on 0-1 bakes are there to squeeze as much texture resolution from that single tile as you can. So, for example, the asset will never be seen from front/back and left/right at the same time so you can simply stack/mirror those islands. You can offset the identical islands out of 0-1, delete geo from identical stacked islands, or clone mesh elements to make use of identical texture space. This is all done post-bake. Otherwise the ray projection will suffer from 'Z-fighting' and result in bake errors(the stacked UVs are right on top of eachother and this 'confuses' the baking rays)

    Note that if your unique bake will have text or non-symmetrical decal details then these will be flipped backwards on mirrored UVs. You can workaround this by using mesh/deferred decals.


Sign In or Register to comment.