Home Technical Talk

UV Layout - Overlapping vs Wasted space

polycounter lvl 19
Offline / Send Message
TorQue[MoD] polycounter lvl 19
So as it pertains to game design, which is worse in a UV layout for memory issues? Or does it matter?

Reason I'm asking is because I've got a bunch of archway models that are all going to use the same texture. I'm trying to reduce the memory footprint by throwing them all on one unwrap but I'm wondering if this is actually going to make a difference in terms of memory used by the engine (specifically UDK).

Here are my two options for UVs:
uv_overlap_wasted.jpg

Or would it simply be better to give each mesh its own unwrap and simply re-use the same texture/material 11 times (per object)? I'd imagine not due to draw calls but I'm still learning the technical side of things.

Replies

  • Neox
    Offline / Send Message
    Neox godlike master sticky
    if you would straighten the uvs you would get something you can easier texturize, also it would be way easier to stack
  • TorQue[MoD]
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Good advice. Still interested in the technical limitations or benefits. I know that the Unwrap is what actually determines the tri-count of the mesh so I'm wondering if it also has drawbacks for memory if there's overlapping UVS?
  • ZacD
    Online / Send Message
    ZacD ngon master
    overlapping UVS is a very good thing, it allows you to have a higher pixel density in your textures.
  • Neox
    Offline / Send Message
    Neox godlike master sticky
    but in his case it's just random pieces beeing stacked, not elements that would share the same texture?

    so in general yeah this is a very common practice, bt only on pixes that actually share the same uvspace to use the same texture, not like it seems to be done here
  • WarrenM
    Overlapping UVs won't affect memory or vert count at all. The only real effect is that you get higher texel density - which is a good thing, usually.

    As was suggested earlier, to maximize your UV space get those islands as rectangular as possible and then play a rousing game of UV tetris.

    Remember too that you don't have to worry about having absolutely even texel density across the entire mesh - if the player will never see the back or bottom of the mesh, for example, go ahead and scale those islands down. Don't waste UV space for the sake of evenness...
  • TorQue[MoD]
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Ok. So that's good to know. These are all using the same tileable texture actually. I just threw them in a quick layout where some were overlapping to make my point.

    So "wasted space" on a texture is only "bad" in that you're not fully utilizing the entire sheet correct? As in you're already loading the 1K texture into memory so you might as well utilize the entire thing. But if its a tileable texture and you're using it all over the scene, then its not so much an issue?

    I just wanted to make sure there weren't some technical downsides that I wasn't aware of.

    So ultimately, it would be better for me to simply unwrap every one of those pieces in the above layout to fill the entire UV space and then just stack them all on top of each other. Cool!

    Thanks for the feedback guys!
  • ZacD
    Online / Send Message
    ZacD ngon master
    If it's just a tileable texture, you can have them all overlapping, the scale of the uv islands can be adjusted to be outside of the 1,1 square. You can make the islands as big as you want and the uv's overlap as much as you want.
  • TorQue[MoD]
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    So there's another question... I USED to scale the islands outside the bounds of the UV but UDK always gives me a warning that this is a bad thing. So just recently I figured out that I can adjust the U and V scale of the materials in max so that I can get them looking right and then apply the same scale to the material in UDK.

    If UDK is generating an error that charts are outside the bounds, then I'd imagine its bad for performance?
  • ZacD
    Online / Send Message
    ZacD ngon master
    I originally thought udk only warns you when the light map uv's are outside of the uv space, and it'll apply a tiling material just fine even if it's outside the uv space. But then I checked out their demo level and no meshes that us tiling materials are mapped outside of the normal uv space.
  • mAlkAv!An
    Offline / Send Message
    mAlkAv!An polycounter lvl 5
    There's not much tiling going on in the demo levels (foliage, night&day). Mostly it's meshes with unique UVs/maps and just a tiling overlay, for those they probably decided to simply adjust the tiling withing the material instead of adding an extra UV channel.
    Check out the mobile content (epic citadel), there are lots of meshes with tileable textures only and those have UVs out of bounds.

    I've never encountered such a warning apart from lightmaps and never heard of this being an issue.
  • WarrenM
    Right, just to confirm ... UVs outside the 0-1 space are fine for all channels except your lightmap channel. And that's only because it will cause errors in your lightmap.

    There is no performance consideration that I'm aware of, outside of each set of UVs requires the memory to hold it.
  • TorQue[MoD]
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Ok, it must have been for a lighting channel then. Weird though cause I always auto-generate those inside UDK.
  • JoscelinFrost
    Though I normally advocate stacking UV islands to increase texel density of your textures, if you are using tiling textures anyways it is better to lay out your UVs uniquely, that way the UV layout can be used for both your texturing and your lightmaps as well. If you are stacking your islands, an easy way to quickly generate lightmap UVs is to use the UDK lightmap tool to repack your existing UVs using the "repack only" option. That way it will take your nice clean UVs, copy them into the lightmap UV channel and repack them uniquely so they can be used for baking the lighting. Hope that helps!
  • WarrenM
    Ok, it must have been for a lighting channel then. Weird though cause I always auto-generate those inside UDK.
    That's another habit you'll want to break if you want good looking lighting. :) That function is best for temp UVs or stuff you have no source art for. Making your own lightmap UVs will ALWAYS be better quality...
  • TorQue[MoD]
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Ok thanks for the advice guys :)
Sign In or Register to comment.