Home Technical Talk

Best alternative to 3ds Flatten Mapping

polycounter lvl 10
Offline / Send Message
bac9-flcl polycounter lvl 10
I'm looking for a good alternative to 3ds Max Unwrap UVW modifier Flatten Mapping option, for purposes of producing UV2 layouts I can use for lightmapping. Unfortunately, authoring them manually is out of the question on the project I'm currently working on due to sheer volume of content I have to go through.

Flatten Mapping seems to deal poorly with hardsurface shapes I'm throwing at it, producing huge number of seams in undesirable areas and at times breaking 20-sided cylinders into more than a dozen of islands.

Are there any plugins, alternative workflows I'm not aware of (for example, maybe there is a way to make flatten mapping auto-seams attracted to smoothing group borders) or standalone software I can use to get a better non-overlapping auto-unwrap for lightmapping?

P.S.: To provide an example of geometry I'm auto-unwrapping, here are some screenshots:

lgUG50B.jpg
3Czrl3w.jpg

Replies

  • instg8r
    Options
    Offline / Send Message
    instg8r polycounter lvl 8
    I don't use any external programs for unwrapping, but I do use peel A LOT. It's a manual process, but I put the seams exactly where I want them. I'm able to save breaking things up into a lot of small islands this way and the results are usually really good even on crazy things. I might have to break something up a little more depending on if I get distortion/stretching, but overall I'm able to keep things the way I want them. I also use TexTools for smoothing based on my islands.
  • Eric Chadwick
    Options
    Offline / Send Message
    Are you adjusting the Flatten angle at all? For lightmap UVs I usually set the angle to 60 or so, to make the islands larger and more contiguous.

    UVLayout from Headus is a lot better at packing UVs than Max, but it's not free. However many people love it for unwrapping. Worth a look.
  • bac9-flcl
    Options
    Offline / Send Message
    bac9-flcl polycounter lvl 10
    @Eric Chadwick

    Sorry for the late reply: I do own UVLayout, can you elaborate on the automated workflow it enables? I have always used it for manual unwrapping of delicate hardsurface and organic objects (fancy manual pelts and all that), but I'm not aware of any way to generate full layouts there automatically.
  • Eric Chadwick
    Options
    Offline / Send Message
    I'm not a Headus user, so I don't know if it allows batching or not.

    What software do you need the lightmaps to work in? I've been doing some modeling and scenes for Unity, and found a great screen-space ambient occlusion tool which doesn't require lightmap UVs at all.

    If you are using Unity, and you need lightmapping, you could use auto-lightmap-UVs on import, then use the built-in lightmapper. It's scriptable too. IIRC Unreal has something similar.
  • Eric Chadwick
    Options
    Offline / Send Message
    Found the link, it's SSAO Pro
    https://www.assetstore.unity3d.com/en/#!/content/22369

    With it, I've produced very nice high-quality realtime AO in Unity. Very configurable.
  • Eric Chadwick
    Options
    Offline / Send Message
    Another tip. Some people really like the new app IPackThat, and it has batching.
  • bac9-flcl
    Options
    Offline / Send Message
    bac9-flcl polycounter lvl 10
    @Eric Chadwick

    Yeah, I'm using Unity. Unfortunately, screen space AO is not an option for me.

    Some of my apps have to run on mobile, and screen space effects, especially relatively heavy ones like SSAO, are completely out of the question for most mobile GPUs.

    And in PC-targeted projects where I don't have any issues with hardware performance, SSAO still isn't fit to be used as anything but a subtle complimentary effect for a few reasons:
    • Very low radius
    • Complete dependence on frame content - whether you have an enormous window, a huge lightsource, or a pitch black wall occluding all ambient behind your camera, screen space AO will behave exactly the same
    • Lack of any dependence on light direction, you just get uniform depth-based black noodles over the corners, not proper shifts in intensity depending on where ambient light in the scene comes from.

    Here is a basic comparison, SSAO above, baked AO below.

    CLdJzJC.jpg
    9Tk7hDJ.gif

    As I have to light scenes like those, with ambient occlusion/GI across hundreds of meters required, I can't rely on screen space effects:

    bzJKBfg.jpg

    ________________

    Unfortunately, I can't rely on the Enlighten lightmapping system integrated into Unity 5 either - it's results, just like it's predecessor from Unity 4, Beast, are tightly integrated into the level system and can't be reused across multiple levels. I need lightmaps to be standalone per-object maps I can attach to custom shaders just like any other map.

    Which is a shame because UV2 generation in Beast and Enlighten is slightly better than 3ds Flatten mapping - it actively welds islands into huge continuous chunks, working especially well with stuff like curved pipes where 3ds just throws hundreds of islands all over the layout.

    The only workaround I have found so far is this:
    • Write a custom OBJ exporter as a Component class in Unity, apply it to GameObject with a mesh, and use it to steal uv2 texture coordinates present in the mesh from Beast/Enlighten on-import lightmap UV generation
    • Import the resulting mesh to an external baking environment (3ds, Knald, xNormal, etc.) and bake the lightmap
    • Apply the lightmap to the material using a custom shader

    As you can imagine, it's a very slow and awkward workflow that scales really poorly for production, so I'd prefer to find a way to generate decent layouts in 3ds, right when I handle the assets there before sending them over to Unity. Boxy stuff with hard edges is handled by Flatten mapping in an acceptable way, but not everything is boxy. Consider this worst case scenario and you'll see why I'd love to know some alternatives to Unwrap UVW Flatten mapping:

    EAR4lVb.png

    It's fairly obvious why 3ds Flatten mapping results are so bad - as you crank up the angle to huge values like 120, you start seeing that Unwrap UVW modifier is not performing any flattening/relaxing at all, just slicing the mesh into chunks with set tolerances and planar mapping those chunks from average normal. Beast/Enlighten, of course, do flattening/relaxing, so they can get those pipes textured with just a few huge and noodly islands. I find it hard to believe no comparable tool exists for 3ds. :)
  • Eric Chadwick
    Options
    Offline / Send Message
    Maybe you could try copying UV1 into UV2 then pack that?
  • bac9-flcl
    Options
    Offline / Send Message
    bac9-flcl polycounter lvl 10
    Maybe you could try copying UV1 into UV2 then pack that?
    You mean with UVLayout? I don't really have an issue with authoring lightmap layouts manually in general and yes, you can get UVL layouts into Unity UV2 by moving results of UVLayout work into the second channel before exporting the final file.

    But the question of the thread is whether there exists an automated way to get the layouts. Manual unwrapping works for one or two or a dozen of meshes, but I have projects with e.g. 200 architectural models, and it's impossible to do UV2 manually in cases like those within a reasonable time.
  • Eric Chadwick
    Options
    Offline / Send Message
    No, I meant if there's a UV already in UV channel 1, perhaps you could simply auto-arrange it for UV2. But it sounds like your models aren't UVd in the first place.

    It seems like you need a batch lightmapping tool.
  • bac9-flcl
    Options
    Offline / Send Message
    bac9-flcl polycounter lvl 10
    No, I meant if there's a UV already in UV channel 1, perhaps you could simply auto-arrange it for UV2. But it sounds like your models aren't UVd in the first place.

    It seems like you need a batch lightmapping tool.
    My meshes do have existing UVs on the main channel, but those have nothing do with lightmapping and can't help there - it's just basic strip texturing with lots of overlaps, exploitation of tiling and so on. So yep, that's the question of the thread. At the moment the only way to batch-unwrap a huge set of meshes known to me is Flatten Mapping, it gives very subpar results and I'm looking for something that gives you better results.
  • Eric Chadwick
    Options
    Offline / Send Message
    If UV1 is already created, and the coverage is good, could you copy this to UV2 and pack it? I bet someone could script this without much difficulty. Something like: copy UV1 to 2, export to IPackThat, batch-pack UV2 with no overlaps, import back to 3ds Max, bake the lightmaps, etc.
  • bac9-flcl
    Options
    Offline / Send Message
    bac9-flcl polycounter lvl 10
    Oh, that's an interesting idea. Strip texturing might have some undesirable seams where lightmap UVs shouldn't, but islands from it should be a lot better than ones generated by Flatten mapping (wrapping around objects and such), so packing them might give a nice result.

    This is the first time I'm hearing that IPackThat has batch capabilities, it's not mentioned in the feature list. You're saying it's possible to run it through import-packing-export-exit from start to finish using a command line? Specifically, I guess you're referring to using Maxscript External Commands, specifically a DOSCommand or ShellLaunch pointing to e.g. a .bat file with arguments for IPackThat?

    Edit: Oh wow, I have just discovered that UVLayout has the plugin interface! That might very well be the way to go, as I already own UVL.
  • Eric Chadwick
    Options
    Offline / Send Message
    I know Maxscript can connect externally. I think to DotNET and Python? Kind of out of my area. But yeah IPackThat does seem to have batching built in.
    http://gst.piranha-bytes.com/IPackThat_BatchFile.pdf
  • Thane-
    Options
    Offline / Send Message
    Thane- polycounter lvl 3
    Please tell me this is from Metro 2035 in production. :) Or some badass upcomming VR experience ill get to discover and wander around in! I assume that is massively large and im not seeing it wrong. Anyway, lovely design! That is going in my inspiration folder.

    bzJKBfg.jpg
Sign In or Register to comment.