Home Technical Talk

UV Straightening and its perks on LOD generation

godlike master sticky
Offline / Send Message
Neox godlike master sticky
This is a topic that has been reoccuring lately and i thought putting the info in its own thread is a good idea.
I will be showcasing a method i have been using for way over a decade now, in 3dsmax. Which is to my knowledge the only tool that allows me to do this.
Please correct me if i am wrong, i'd love to have this functionality in maya or blender.

This is from our internal wiki/confluence. adjusted for this forum. maybe i have missed a thing or two that is very specific to how we work.

anyways lets go, shall we?

Why Do we straighten UVs?

So people have been wondering why we are so anal about straight UVs, and it basically comes down to LODs. LODs could be used for various things, the obvious is that a mesh gets lower poly over the distance that it is drawn. The further away a model is, the lower the polycount. But they will also jump into action when you have a version of your game running on lower end specs, say Fortnite running on Mobile, or spyro running on Switch. While we usually do not create the LODs ourselves, they will be created after we delivered our work.

For the Level of Detail meshes we need to keep things straight to avoid texture breaks when loops get deleted. It doesnt really matter if this is done by algorithms like Simplygon or other automatic/semi automatic solutions, or if you do it by hand. ideally we want to keep everything between majore landmarks on a model straight. On a character that would be joints. On a prop this would be defining angles. But straight doesn't mean it has to be perfectly horizontally or vertically aligned. diagonally would work too! dependent on your final texture resolution horizontal or vertical is preferred, to avoid visual stepping.

How much of this makes sense in the age of nanine? i assume it still makes sense, because any automatic lodding solution ideally is able to kill mesh detail without hurting UV seams? But i have no data to prove that.

I know from one of our projects that Nanite still worked better with clean UVs than just some UVs


lets take this thumb for example. if you keep it perfectly relaxed you will have nice soft curves. but the problem with hat is, if you kill loops for Lods, you will create more and more UV seams, the more its curved the more visible this will become.

here is an example of hand UVs that will work better with Lodding.


Straightening UVs in 3dsmax

Here is a little guide on how i use a feature inside 3dsmax to straighten parts on the Unwrap.

It might be that your version of max doesnt allow you to do it anymore. UNLESS you install one of our tools which you can find here


So my main tool of choice is welding verts that are not connected.

When asked why that feature was removed from 3dsmax, support told me, that it was never part of max and should by definition not work. If it did... it was a bug.

OH WELL...

unless you plug this script into your macroscripts folder and run it, that is

nevermind the old UI, it works in Max 2025 just as fine as in Max 2011 :)

this is the script you need to run to enable it in your version of max if it doesn't work what i am about to show you.

a normal relaxed UV layout like you would get from many apps nowadays. It's mathematical accurate. most faces are in line scale wise, there is little stretching. all cool. But this doesn't LOD well and it doesn't stack well inside the UVs puzzling phase.

My suggestion to what it should look like. Note: it doesnt have to be all rectangular. but lines should idealy be straight so when lodding you can remove loops without creating issues on the texture side.

So here is how i get there:

after running the script (its a toggle should only be needed once) set up the wel treshold to something high. be aware with the script on you can now weld the entire UV space into a single point.

I am sure with pinning and automatic live UV stuff you can get similar results nowadays

Weld all the verts on the centerline


Now relax the selection by Face Angles. The result is a pretty solid base to go on with. Note how the centerline is pretty well maintained not collapesed. not straight yet but easy to work with.

select the bottom edge and straighten it

invert the selection and relax all the other points but the just straightened line

do the same for the top line

and the sides


straighten the centerline and break it

select a row of faces alongside one side of the centerline and scale it a bit away from the center

select and relax the center point

Tadaa! you got a nice and clean UV island to work with.

There is one downside to this method. you will get a decent amount of stretching in the crotch area. But this can be ignored or worked around well enough in many cases.

You obviously can do the same for hands:

or even the face:

Common Issues with straightening

One usual issue with edge straightening is, that people tend to do it blindly. and ignore obvious stretching caused by it

This is stuff we definitely should avoid, so dont just blindly straighten everything. check your UVs on the model for stretchmarks

luckily enough usually this is simple enough to fix




Straightening UVs with UnwrapPro (plugin)

Quick guide on how to use UnwrapPro to help speed straightening things up.
We'll be using a third-party plugin for 3ds Max called UnwrapPro: https://mariussilaghi.com/products/unwrap-pro
This plugin adds a new modifier to 3ds Max, Unwrap Pro. It's almost the same as the default Unwrap UVW modifier with an added tab.

Right off the bat, we have an option called Prevent Border Overlap. This will relax the UVs in a way that will completely avoid intersections within the same island - especially useful for faces (mouth and eye holes) and other meshes with lots of curves.

The second (and perhaps the most important) is the Unwrap button. Its basically a peel + relax with an improved relaxing system that provides less distortion than usual. (iterations = number of times relax is applied to the UV) The relax method in this plugin also works with Max's native vertice pins (unlike the default relax option) so we can take advantage of that to quickly straighten UVs while maintaining them overlap free. Example below:

1. Set up the seams for your UV island like you regularly would. We then set the peel mode to LSCM so that we can pin vertices (from 3ds Max 2020 onwards)

2. Select a loop that you want to straighten, straighten it using the align horizontal/vertical tools from Max and pin the selected vertices

3. Select the whole island, make sure to have "Prevent Border Overlap" checked on the modifier, and click Unwrap and see the magic happen! 

4. Continue pinning and straightening loops, and hitting the unwrap button until you reach the desired result, knowing the UV will be relaxed while respecting pins and avoiding border overlaps at all times!

5. All done!

Sometimes you might need to click the Unwrap button a few times until it relaxes the UV completely. Spacebar is the default shortcut for this but you can set your own in the modifier's settings.
Troubleshoot: In case the UV island starts acting up when you hit Unwrap, you might need to check if you have any existing overlaps on your island, as the plugin usually doesn't like that.


You're using a different software? Maya, Blender? You name it, feel free to add your method! :)

Replies

  • odd_enough
    Offline / Send Message
    odd_enough polycounter lvl 12
    Good info! I've been doing similar straightening methods in Blender with the Zen UV addon, specifically the Reshape Island command. Using this as an example of non-quad straightening by selecting the edge or edges to maintain axis alignment and it straightens the shell while retaining volume. It can certainly do a lot of what you mentioned above, though I'd be curious to run tests with more organic shells. image
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    This is always a fun topic - and ZenUV does look good !

    Default Blender can do decent "rubbergloving" of UVs by leveraging pinned UV verts. As follows : 

    - Bringing the desired UV verts between fingers together, either by scaling them down to 0 or by pseudo-welding them (the weld tool does *not* weld them like oldschool max would, but it does bring the verts to their center location in one single input so this can be a little faster than using Scale).
    - Then, designing the desired outline of the glove shape by manipulating verts as desired.
    - Running Unwrap on that, hence relaxing things within the pinned outline.
    - Fixing anything that still needs straightening, then running Unwrap again.




    Now of course this doesn't rely on performing an initial relax on the "stitched fingers" setup. Not sure if this is a good thing or a bad thing, but I believe that the overall time involved is similar.

    I need to check if there is a way to select a bunch of verts along an edge, and have them be spaced similarly to their spacing on the mesh. This could probably shave off some time here and here, when setting up the outer borders of straightened islands.
  • ScoobyDoofus
    Offline / Send Message
    ScoobyDoofus polycounter lvl 20
    I feel validated and seen by this thread. This is, in Max/Silo, nearly identical to how I unwrap. The Unwrap Pro add-on is news though...
  • Eric Chadwick
  • Neox
    Offline / Send Message
    Neox godlike master sticky
  • Michael Knubben
    pior said:
    I need to check if there is a way to select a bunch of verts along an edge, and have them be spaced similarly to their spacing on the mesh. This could probably shave off some time here and here, when setting up the outer borders of straightened islands.

    I've been trying to figure out the exact thing, and while Magic UV (free, included) has a tool that can unwrap only on x or y, it relies on the 3d viewport, and reunwrapping an entire island vs just vertices, so it's not fit for purpose. Many other 'reunwrap in place' also suffer from the same issue, namely: only faces can be unwrapped, not edges.
    There's the built-in 'Relax' brush tool, which is useful and has a setting for referencing the mesh topology, but: it can't operate only on one axis, so there's still always a straightening step.
    What worked best for me is (again) Magic UV with its Smooth function: https://docs.blender.org/manual/en/4.1/addons/uv/magic_uv.html?utm_source=blender-4.1.1#smooth-uv
    Setting the Mesh Influence to 1 allows you it to take into account the actual distance on the mesh. This won't constrain it only to one axis, but on a straight mesh it did keep the uv's straight for me.

    If anyone finds a tool that can reunwrap a vertex/edge selection only on a single axis, that'd be really useful!

    I also use UV Toolkit and Zen UV for reliable functions to straighten a uv island to a single edge selection, warp (reshape) it to a loop, or quadify it entirely.
Sign In or Register to comment.