Home Technical Talk

Calculating space used by uv's

Is there a way to select the area your uv's occupy in photoshop (I know how to do that bit) and calculate how much of the image it occupies as pixels/percent? Just interested how efficiently I may have packed my uv's sometimes thats all.

Replies

  • Ghostscape
    Options
    Offline / Send Message
    Ghostscape polycounter lvl 13
    fill layer with black, load UV selection, fill that area with white, filter->blur->average, eyedropper the color.

    edit: I thought it was obvious that when you eyedropper the color you simply check the B% in the color picker's HSB numbers to see your percentage, sorry :)
  • Quokimbo
    Options
    Offline / Send Message
    Ghostscape wrote: »
    fill layer with black, load UV selection, fill that area with white, filter->blur->average, eyedropper the color.

    Why would you do this?
  • monster
    Options
    Offline / Send Message
    monster polycounter
    http://www.juantwo.com/scripts/Martinez_Macro_TextureArea.zip

    If you are using 3D Max you can use my script to calculate the area used by your UVs. It gives the output as a percent. For example, a box that has 6 sides planar mapped will be using 600% of the texture space.

    Copy it to the UI/MacroScripts folder. Restart max and look in the "monsterBlues" category to bind it to a hotkey or quad menu.
  • killingpeople
    Options
    Offline / Send Message
    killingpeople polycounter lvl 18
    Quokimbo,
    Ghostscape is saying you could base the value of the gray off how efficient your uvs were. the lighter the gray, the more efficient your uv's were, the darker, the more space you've wasted.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    if you've filled your background black and UV areas white, you can also use the Histogram to get a percentage of black / white pixels.
  • scourgewarper
    Options
    Offline / Send Message
    Cheers monster might have to give that a whirl as its right in max but I think MoP's method sounds quickest whilst in ps cheers :)
  • Mark Dygert
    Options
    Offline / Send Message
    Renderhjs, has a feature in textools that analyzes your UV layout in 3dsmax and gives you some stats, kind of helpful for when you're in 3dsmax. MoP's method is the one I've used in the past when I was supper annal about that stuff, now I just eye ball it and kick my own ass when there's wasted space.

    Also be careful not to pack them so tight that you loose out on any and all padding. That can be really important if your textures get mip-mapped.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Yeah, I don't think i've ever actually calculated percentage of space used by UVs, personally... I just remember that histogram trick from a similar thread on polycount about 3 years ago.

    You could be using 99% of your image's space for UV layout and still have a crappy layout, similarly you could have a layout that uses only 80% of available space that is actually really good (eg. fast for painting and producing quality normal bakes) :)
  • scourgewarper
    Options
    Offline / Send Message
    Hehe fair enough :) it was just a passing thought and in reality it doesn't reflect on how well you've used your UV space at all, the padding issue is a prime example of what to remain aware of, I guess I found myself looking at my UV's and thinking although they were laid out right maybe I could use a bit more of that space but you could spend forever trying to claw back a few pixels.

    As long as you've minimized stretching/number of seams etc that's all that matters cheers for indulging my query tho!
  • ArYeS
    Options
    Offline / Send Message
    ArYeS polycounter lvl 8
    I agree that this data is irrelevant, but there is also program ImageJ for measurments like that.
  • Ghostscape
    Options
    Offline / Send Message
    Ghostscape polycounter lvl 13
    Area used is a poor metric for judging an unwrap (things like ease of painting, stretching, texel density consistency, etc, matter more) but that doesn't mean maximizing your area used isn't one of the goals of an unwrap. Additionally tracking this over the course of many assets will give you a better idea of whether you are improving your unwrapping skills.

    You can't compare area used between two different meshes (IE, a shotgun that uses 87% isn't objectively better than a rifle that uses 72%) and judge one to be more efficient than the other. The only time you can compare this stat objectively is when you're talking about the same mesh with the same UV island breakup, and in which case it will be obvious which one is more efficient because you will have scaled up your more efficient unwrap. Am I being clear here?
  • Mark Dygert
    Options
    Offline / Send Message
    I agree with per, yes even with text. It might be readable at 4x the size but ultra sharp text stands out worse when it doesn't match density. Of course there are exceptions to this, but most of the time, its not worth the time and effort put into it (or taking it back out).
  • Cordell Felix
    Options
    Offline / Send Message
    Cordell Felix polycounter lvl 9
    @monster
    thanks for the link, works like a charm
  • Treidge
    Options
    Offline / Send Message
    Treidge polycounter lvl 11
    If anyone is particularly curious about their UV space usage, I can recommend checking the IPackThat tool. It shows the space usage of actual UV shells and as a second metric shows UV space usage including the padding (margin size), which is not necessarily a wasted space (you should have some padding, anyway). Free demo version of IPackThat can do this just fine  ;)
  • musashidan
    Options
    Offline / Send Message
    musashidan high dynamic range
    Polyunwrapper plug for Max and also Headus calculate used space as a %.
Sign In or Register to comment.