Home Technical Talk

Your Opinion: Wasted UV Space

polycounter lvl 11
Offline / Send Message
jocose polycounter lvl 11
Obviously you want to make sure that you use as much of your textures as possible, but at some point you have to draw the line and you will never be able to use all of it unless your texturing a square.

I was reacently texturing a prop that used all but 1/4 of a 512x512 texture. Because of its shape and the fact I didn't want to hack it in half with another edge I wasn't able to get a layout that would result in anything better than 1/4 of the texture going unused (even using a non-square).

I think if I had spent more time on it and maybe hacked it up I could have made it use most of the texture, but then it would have been harder to paint and also would have taken more time.

I'm just curious in your opinion, how much unused texture space is acceptable? I know it's not an easy question to answer but I'm just interested to see peoples thought process on this.

Edit: I suppose what I'm asking specifically is how much wasted space is TOO much wasted space. Where would you draw the line and say you need to go back and do something to utilize more of that space?

Replies

  • ImSlightlyBored
    Options
    Offline / Send Message
    ImSlightlyBored polycounter lvl 13
    dont claim it to be wasted just call it contingecy (sp) for later revisions and additions

    depends on the forms being use though tbh and as long as you can get the most texel density for the forms, with the space you end up using, I wouldn't call it a bad thing.

    pixels aint nothin but a number.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    I would probably try shoving something else on that prop texture. Maybe a similar, smaller prop that will be used a lot in the same areas. Or if you have alpha available, use the remaining 1/4 as a space for decals or texture swaps to do a variant of the prop.

    1/4 of a 512x512 is quite a lot of space to just waste on nothing at all, IMHO... there's lots you could do with it without having to change your existing prop UVs or texture at all.
  • Tumerboy
    Options
    Offline / Send Message
    Tumerboy polycounter lvl 17
    ^^keep in mind 1/4 of 512 is a full 256x256.^^
  • jocose
    Options
    Offline / Send Message
    jocose polycounter lvl 11
    Yeah I'm aware it's a lot of space, but the object is really simple so I only have a couple of big pieces that fit into this square. I suppose my only option would have been to hack the object in half and get some pieces that were more closely resembles a square so they would pack better.

    I have see this before in HL2 props on street lights for example. They take the very long vertical cylinder and hack it in half so it can fit more easily into the square texture space.

    It can just be mind bending to figure out which is going to be the best route to take sometimes. Because adding more verts is not the best thing, but then again neither is wasting texture space.

    I don't want to get into the semantics of performance questions because, as we are all aware, its highly dependent on your engine/hardware, but in general do you think its better to add say 20 more verts or waste a 256x256 texture?

    Seams like it would just be better to add the extra verts, but then again this also makes things harder to paint.

    It sounds like everyone agrees that 1/4 of a texture exceeds the threshold for acceptable waste under any circumstance.
  • DEElekgolo
    Options
    Offline / Send Message
    DEElekgolo interpolator
    When ever I uv map, people always complain that I waste uv space and that I should go play tetris...
    But wasted UV space is wasted memory. If your texture requires such needs then try changing the texture side so that it may fit. Things like a 512x1024 texture and see how it goes.
  • jocose
    Options
    Offline / Send Message
    jocose polycounter lvl 11
    Yeah I tried this shape with a non-square 512x1024 but it was only slightly improved, and our engine doesn't handle non-sqaure textures very well. I have to manually crunch the UVs when I go to export. This particular model was just annoying usually this issue is fixed by going to a non-square layout.

    I actually just pulled up the model and thought about it some more and I think the issue could have been resolved if I had not mirrored part of it. Which would have resulted in a larger piece that would have filled the gap.

    Point being I am very sure there is a way to unwrap every model so that you don't waste 1/4 of your texture space. One way or another you can do it. It's just a question of time/skill.

    I was just wondering how much was too much. Seams like 1/4 is beyond the threshold so in the future i'll opt to spend more time figuring it out.


    Thanks for the replies everyone :)
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    yeah i would definitely never waste as much as 1/4 of a texture space. even 1/8 seems like a waste to me, but i've always been a sucker for maximum optimisation :)
  • Ghostscape
    Options
    Offline / Send Message
    Ghostscape polycounter lvl 13
    I'd try to find a way to fix it. A couple of extra verts is almost always worth the memory savings of not wasting the space, if you can get it down to a 512x256
  • Sage
    Options
    Offline / Send Message
    Sage polycounter lvl 19
    I remember from editing quake 3 content that they say that a 256 x 512 was just as expensive as a 512 x512... Is this true for all games or was it just true for their game
  • EarthQuake
    Options
    Offline / Send Message
    I would like to hear the reason for that, probably some terrible old hardware problem or something. Definitely not the case today.
  • Mark Dygert
    Options
    Offline / Send Message
    I think it has to do with loading textures in and out of memory? If all textures are the same size its easier to just overwrite one that is not being uses as opposed to looking up the sizes and swapping one that matches. So a 256x512 slides itself into a 512x512 slot in memory so it can be overwritten by another 512x512 easily.

    There are probably more efficient ways to handle it all now.
  • Frump
    Options
    Offline / Send Message
    Frump polycounter lvl 12
    I don't consider it "wasted space" I consider it, "extra space". If I've gotten everything UV'ed proportionally and laid out as well as I can get it, usually I'll be under my polygon budget too so I go ahead and make extra stuff to fill both. :)

    I generally don't waste much space due to filling all the little gaps with other stuff, but doing characters I think you still end up with a lot of unused space between shells because of the funky organic shapes. Not always the case though.
  • Acid.
    Options
    Offline / Send Message
    I would probably try to take up at least 80%-95% at least, if not just add some text in there for info detail lol. If its absolutely impossible to avoid splitting it up and causing a nasty seam that will ruin the textre then just leave it.
  • Ghostscape
    Options
    Offline / Send Message
    Ghostscape polycounter lvl 13
    Sage wrote: »
    I remember from editing quake 3 content that they say that a 256 x 512 was just as expensive as a 512 x512... Is this true for all games or was it just true for their game

    I'd imagine that this had something to do with their memory management system - IE if a character was supposed to use one 512x512, that it would budget 512x512 for them even if you were using a smaller map.

    There are half the pixels in a 256x512 and so they typically take about half the memory.
  • Vrav
    Options
    Offline / Send Message
    Vrav polycounter lvl 11
    perna wrote: »
    Then again it's very rare that you'd be working on the kind of objects that would result in a lot of unused UV space. I don't know what it is about UV's but every time you have an open space you tend to find a UV island that fits it perfectly. I don't know how that works. Must be magic.
    Yes. And UV fairies.
  • metalliandy
    Options
    Offline / Send Message
    metalliandy interpolator
    I would just make sure you fill the space with something if you can, as the texture is going to be in memory, you might as well use it rather than having it empty.
  • Blaizer
    Options
    Offline / Send Message
    Blaizer interpolator
    and you can't change the UV? 1/4 is too much!
  • El Burritoh
    Options
    Offline / Send Message
    I tend to agree with those who aren't too worried about this.

    If the asset looks good in the engine and you've got 25% unused UV space, it's not necessarily a problem.

    If you're running dangerously close to a memory limit, then I doubt that will be fixed by managing to use the remaining 25% of your UV space, and I'd look for a solution elsewhere.

    Alternatively, if you're brave... in case there are repeated areas that have the exact same texture, you could make a portion of your 512x512 texture tileable and assign several overlapped polys to that part of the texture. That might let you squeeze more out of the rest of the real estate.
  • Japhir
    Options
    Offline / Send Message
    Japhir polycounter lvl 16
    now your gonna have to post an image of the thing your talking about, so we can see if the UV fairies are working for you. What Per said really is a reckognisable situation, somehow it always works out perfectly. So image please! Or we could turn it into a stupid mini challenge and upload the obj :). (or is it all NDA :S)
  • jocose
    Options
    Offline / Send Message
    jocose polycounter lvl 11
    Japhir wrote: »
    now your gonna have to post an image of the thing your talking about, so we can see if the UV fairies are working for you. What Per said really is a reckognisable situation, somehow it always works out perfectly. So image please! Or we could turn it into a stupid mini challenge and upload the obj :). (or is it all NDA :S)

    It's just a simple aircraft freight container which is shaped like the inside of the fuselage of an aircraft. It was close to being a square but not quite. I mirrored part of it which left this gap. The fact that I chose to mirror it was really what left the gap and didn't occur to me at the time.

    So I was left trying to fill this gap with 4 separate pieces and all of them were either too big or too small and I kept on being left with about 1/4 of my space being unused.

    With the exception of very organic stuff you can almost always unwrap something so that it uses almost all of your texture space, and after going to back to this I was able to do it. The problem was that I had to get the entire thing done in about an hour and a half at the end of the day and didn't want to have to take it home to work on it. It was just a simple little side prop, the kind of thing you really don't want to waste time on.

    So really the question was just about time vs wasted space. Sometimes everything clicks and you don't waste space but other times it becomes more of a chore and you have to spend extra time working on something when you could have just moved on and already be working on something else.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    you should have made it unique then, like you say :D
  • jocose
    Options
    Offline / Send Message
    jocose polycounter lvl 11
    Yeah I know it was a dumb mistake, but it least it spawned the question and I posted here. I feel like this thread has given a nice overview on the issue of time vs UV space usage. So it wasn't a complete waste :)
  • Daaark
    Options
    Offline / Send Message
    Daaark polycounter lvl 17
    Vig wrote: »
    There are probably more efficient ways to handle it all now.
    Not really, and it's not just a texture thing, it's can be done with game data on the machine too. It's called pooling.

    If you need at max 500 of something, you just allocate all 500 in one continuous block of memory, and mark them as used or unused. When you need a new object, you just re-use an old one that was marked as dead.

    Same with textures. If they all share the same pixel format (RGBA), then you can over write one with another. Trying to allocate a new 512x512 texture in free memory where an old 256x512 was just de-allocated will just cause the 512x512 texture to be fragmented in memory. You'll get the first 256x512 in there, and then the rest will be allocated in other free chunks of memory until you get the whole thing stored finally. (Wash/rinse/repeat that story with an entire game worth of textures being allocated and de-allocated, and you can imagine the mess your texture memory will become).

    But that all depends on how the tech you are using handles that stuff. The video card will do whatever the engine/framework tells it to. It can make a mess with random allocations, it can be pooled, or you might have all your textured being atlased into chunks that are as big as the GPU will allow.

    Don't worry about not using 1/4th of a texture. If all your objects are sampling from a 512x512 texture, than so be it. It doesn't matter to the renderer if you are using up all of 1 of the pixels. They only thing you are wasting is a chance to have more texels worth of detail in your model.

    As for the 256x512 being the same as a 512x512, it could have been that that engine was padding it to fit into a pooling scheme. Data is often padded to fit it into power of 2 numbers for ease of seeking, and addressing. Even vertices, which are often stored as X,Y,Z, and an unused w coordinate.
  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    with env based stuff, you get issues like this all the time esp with large but fairly simple component shapes, i try to put some little bits or extra objects in the gaps but you hav o be carfull doing this because if that small object gets used elsewhere it will load the entire texture
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    thats why john carmack invented the mega texture :)

    but serious I think being a little bit extra strict with UV efficiency is always a benefit. Not to long ago I was creating one big texture combining almost previous 8 different texture sheets into one- because they were all kind of messy and not bandwidth and RAM effecient.
    It really was worth the effort at the end because the texture could be more crispy and use less file size as the separate files before. The UV was thus very tight and it took some time packing it all in a efficient way - but worth the effort.
    After that I used some RRT scripts to transfer the textures from the former UV's and materials to the new merged one.

    oh and back on id tech 5 or mega texture:
    there is a new paper btw. on the id tech 5 engine from Siggraph 2009, explpaining some of their technology:
    http://s09.idav.ucdavis.edu/talks/05-JP_id_Tech_5_Challenges.pdf
    from a technology point of view- its my most anticipated title to come
  • 00Zero
    Options
    Offline / Send Message
    I remember from editing quake 3 content that they say that a 256 x 512 was just as expensive as a 512 x512... Is this true for all games or was it just true for their game

    i was reading some documents for the x360 avatars and it said that a 64 x 64 uses the same memory as a 64 x 128. is this true?
  • Daaark
    Options
    Offline / Send Message
    Daaark polycounter lvl 17
    00Zero wrote: »
    i was reading some documents for the x360 avatars and it said that a 64 x 64 uses the same memory as a 64 x 128. is this true?
    Read the last paragraph of my post.
  • OBlastradiusO
    Options
    Offline / Send Message
    OBlastradiusO polycounter lvl 11
    I just unwrapped a trash can, but they're is some empty space left. That's no real big deal right?

    sampic10.jpg
  • DEElekgolo
    Options
    Offline / Send Message
    DEElekgolo interpolator
    You can fill the holes in it with uv elements as well.
  • OBlastradiusO
    Options
    Offline / Send Message
    OBlastradiusO polycounter lvl 11
    DEElekgolo wrote: »
    You can fill the holes in it with uv elements as well.

    uv elements? Can you elaborate on that?
  • Daaark
    Options
    Offline / Send Message
    Daaark polycounter lvl 17
    I just unwrapped a trash can, but they're is some empty space left. That's no real big deal right?
    Not sure if you are being sarcastic or not.

    Artistically, if it looks good in the final render, it's fine.
    Technically, it's no different than using every pixel. The rasterizer doesn't give a shit.

    However, you aren't using the full potential of the surface space you have. You can organize it better, and get more out of your texture, with a better texel density on all surfaces overall.
  • OBlastradiusO
    Options
    Offline / Send Message
    OBlastradiusO polycounter lvl 11
    Daaark wrote: »
    Not sure if you are being sarcastic or not.

    Artistically, if it looks good in the final render, it's fine.
    Technically, it's no different than using every pixel. The rasterizer doesn't give a shit.

    However, you aren't using the full potential of the surface space you have. You can organize it better, and get more out of your texture, with a better texel density on all surfaces overall.

    Yeah but if I scale it up some the pixels wont match up to my other props. Is that a problem?
  • Daaark
    Options
    Offline / Send Message
    Daaark polycounter lvl 17
    Yeah but if I scale it up some the pixels wont match up to my other props. Is that a problem?
    Are you talking about having an even pixel density between all objects? It's only a problem if you are dead set on having a set pixel density. If that's the case, put other objects on your sheet.

    Not many games I've played have had even pixel densities. It's often prioritized by object importance, or screen real-estate. Texel Densities with shadows are more important.
  • OBlastradiusO
    Options
    Offline / Send Message
    OBlastradiusO polycounter lvl 11
    Ah so if I want a set pixel density put them all on one sheet. Also prioritized by object importance. I got it. I was a little confused there.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    I don't think 110% pixel density compared to other props is going to make any visual difference. Make the UVs fill the square if you want to texture this uniquely. Currently it's a horribly wasteful UV layout for no good reason.
  • Tumerboy
    Options
    Offline / Send Message
    Tumerboy polycounter lvl 17
    It's good to maintain a rough pixel density, but you can fudge a little in between. You just don't want to texture 2 10' objects, one with a 128, and one with a 512. A little discrepancy is fine, and you'd be better off filling up that sheet.
  • OBlastradiusO
    Options
    Offline / Send Message
    OBlastradiusO polycounter lvl 11
    Is this more satisfactory. I scaled things a bit bigger and filled it up the best I could. Sry if I sound newbie on this but I want to understand UV pixel density more.

    sampic10a.jpg
  • Farfarer
    Options
    Offline / Send Message
    I'd move all the circular areas to the top (one either side of the top of the bin) and do a bit of alignment with the hole's UVs and try and push that in at the top somewhere, too. That should let you scale everything out much further and claim more space in total.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Yep, definitely detach those circular bits from the main sides of the bin - then you can scale the main bin UVs wide enough to fill the square, push them right down to the bottom too, and you should have enough space left at the top of the UV square to put all the remaining pieces.
  • OBlastradiusO
    Options
    Offline / Send Message
    OBlastradiusO polycounter lvl 11
    Hows this a bit better?

    sampic10b.jpg
  • Daaark
    Options
    Offline / Send Message
    Daaark polycounter lvl 17
    Better. But it looks like you have a bit of warping in the test pattern. It's not too bad though.
  • Acumen
    Options
    Offline / Send Message
    Acumen polycounter lvl 18
    maybe you could even consider doing the cylinder caps the way it is shown in renderhjs-video:

    [ame]http://www.youtube.com/watch?v=N_NfdU5dIMM&feature=channel_page[/ame]

    his toolset:
    http://www.renderhjs.net/textools/

    edit: but reconsidering, i don't know if that would change much, since the inner part takes up it's desired place, anyways :/
    so, um, just leave it be :D
  • Tumerboy
    Options
    Offline / Send Message
    Tumerboy polycounter lvl 17
    Blas, much better. But the UV bits on the top right, those are the insides of the garbage hole right? I would give less priority to those, scale them down just enough so you can expand the main body to the full width of your image.

    I'm also a little confused as to what's what in the circles. It looks like there's a big open hole in the middle of the middle one? Can you shrink down the bottom (right one?) and shove it inside there, since the bottom isn't going to be seen as much?
Sign In or Register to comment.