Home› Technical Talk

[3ds max] How to pack UVs with similar direction grouping?

polycounter lvl 15
Offline / Send Message
dimwalker polycounter lvl 15

My problem is lightmaps are bleeding a lot because final lightmap atlas usually ends up at 1px/m density. Increasing padding does nothing at that point since it's barely makes and difference and if I pump it enough to actually spread UV shells apart, it will make each isle even smaller, sometimes below one pixel.

Can't make several lightmaps. Can't increase resolution. Only solution I see is grouping shells with same averaged normal so even when elements bleed on each other it would not be as jarring as neighboring fully lit and pitch black shells, but then got stuck - I still need to pack it tight and no way I would be able to do it by hand.

Played around with this idea, like detaching mesh into 4 parts (say normals of a tetrahedron faces), feeding each to packer of choice and then attaching all together moving UV shells to appropriate quadrant. yet still hit the same wall - it won't be optimal packing if shells vary in size significantly(wall of 4 story building and its windows). And with only 4 directions it would probably still catch too much of high contrast lighting elements in same "region".


Ideally I need a packer with some sort of "group shells with similar normals" checkbox, but I didn't find anything like that yet and my scripting skills are not enough to write it myself.

Or is there another way to workaround excessive bleeding in this case?

Replies

  • gnoop
    Offline / Send Message
    gnoop polycounter

    I know how to do it in Blender if it may help. Select> select similar> by normal. Pay attention to threshold slider. Then you need UVpackmaster 3 addon for $44. It has "groups" where you have unwrap each selection first, assign it to a groups and then grouped islands will always stay together. The packing will be not as tight as without grouping although.

    https://uvpackmaster.com/doc3/blender/3.1.0/20-packing-functionalities/50-lock-overlapping/#lock-groups

    or you can manually pin each selection by normal groups in UDIM tiles and in the end just re-composite that groups manually in the first tile . no need to spend $44.

    Still pack master addon is the best thing I ever bought for Blender . if you give it some time for "advanced heuristic" it packs very efficient.

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter

    max supports UV shell grouping so you could make angle based selections and group from those to get something similar to what gnoop is suggesting.

  • dimwalker
    Offline / Send Message
    dimwalker polycounter lvl 15

    Have no experience with blender. Steps seem easy enough, but since I would do most of the work in max and have to change second UV channel often it would be quite inconvenient to jump between max and blender. Will bother my blender-savvy colleague, maybe he can try it out. Thank you.


    UDIM way is doable in max, but I don't like how much space would get wasted. For example

    I think I can do A with maxscript alone, yet half of UV space is empty. B packing is what I'm after, but it requires "try to keep similar direction shells together, mixing with neighbors when necessary" understanding of grouping and that would require a lot of scary math.

    In real life scenario C could be arranged better, but it helps to illustrate what I mean. Even irregular size and shape groups would still work great.

    UPD: UVpackmaster seems to be exactly the tool for this job, but max support is discontinued apparently.

  • Eric Chadwick

    Maybe an alternative route... bake lighting into vertex color. This would avoid bleeding, but would increase vertex count on lighting seams.

    Or perhaps check out https://www.scriptspot.com/3ds-max/scripts/polyunwrapper I know the developer is very responsive to requests/feedback.

  • gnoop
    Offline / Send Message
    gnoop polycounter


    This soft can do grouping too as far as I know but I never really used it personally. Too many options, too many buttons to learn about. While Blender + uvpackmaster is usually push and forget.

  • Kanni3d
    Offline / Send Message
    Kanni3d ngon master

    ^ After using Rizom recently, it occured to me that you can align by x/y/z orientation. Probably just what you were looking for

  • dimwalker
    Offline / Send Message
    dimwalker polycounter lvl 15

    In the end concept wasn't as useful as I thought since even surfaces with same direction can and often will be shaded differently - shadows from other objects or pitch black on intersections. Also baker plays a bigger role in this - some will render neat lightmaps with less or no leaks while others end up very messy.

    Yet there is still use for UV-elements direction separation. Currently catching and downscaling everything facing downward on lightmap. And it was a nice exercise in maxscript. Made a small tool for this task:

    https://www.scriptspot.com/3ds-max/scripts/udims-by-axis


Sign In or Register to comment.