Advanced UV Packing algorithm

Dear Blender community,

do you know if:
-there’s a UV packing algorithm that doesnt use the standard “bounding box” approach ?
-there’s already something more advanced in the works somewhere ? or somewhere hidden in the roadmap to 2.8 ?

I searched quite a while, but couldnt find anything, only some hints in an old 2.6 entry, where it says:

done
Better packing algorithms.

https://wiki.blender.org/index.php/Dev:Source/Textures/UV/Unwrapping
What does this improvement do specifically ?

Basically, for gamedevelopement you want something like “IPackThat” has.
If you dont know this tool, here is a quick demonstration:

It uses an advanced packing algorithm that can save alot of texture space.
It produces even better results than any user, if you let it run long enough :wink:

Something in that “general direction” would be awesome to have in Blender !
So any thoughts / findings you might want to share on this topic ?

thanks !

Last year’s GSOC got us close to an improved set of UV tools, including packing. I’ve got no idea how close or far away it is from being merged into master. You can monitor the BA thread if you want more info on its momentum.

thank you Derek !

Thats exactly what I was looking for, hopefully it will make it into a future blender build !

This is another promising approach: https://blenderartists.org/forum/showthread.php?409162-UV-autoseams-and-UV-Gravity-packer-addons

IPackThat is about as cutting edge as you’ll find for UV packing in the production-ready area.

iPackThat give decent results but is terribly slow… The new UV packing in Maya 2017 does in 10 seconds what iPackThat does in one night of trials…

@LoboTommy, That gravity packer is pretty hysterical. I’m going to use it at work just to freak some people out.

I have IPackThat. It seems abandonware and bait and switch at this point. The demo works much better than the actual producet. I hope I’m wrong but that’s the previous impression I got.

Thx, mentioned IPackThat in my post though !

Something integrated into Blender would be nice.
Mayas UV Packer looks great, chafouin ! Thats exactly what we need in Blender :wink:

I dont know where or when, but I definately will use the Gravity Packer as naively as possible infront of coworkers,
just to upset them. :smiley:

  • The ugliest ColorTheme for Blender I can find. That will be hilarious.

Sucks to hear :confused:
IPackThat was developed by only one person as far as I know.
Unfortunately it seems that he’s deeply involved in a project right know.
So maybe IPackThat will be updated again once that project is finished.
That would be my hope for IPackThat users, at least.
Still not very comforting I guess…

I hope they fix this for 2.79 I have to jump to another application to finish my UVs now.

Which
one do you recommend

I do a lot of UV mapping,
and if there’s a more efficient way to do it,
I wanna hear it.

I did some proof of concepting. Simple shotgun approach on packing UV islands give ~20% improvement with some final adjusting on the UV layer. http://pastebin.com/s4hZF7hs

I can’t install this in blende 2-78c

It’s not an addon. You just copy & paste it into the text editor and run it from there, while having a model selected that has UVs. The script is just a proof of concept that there are some low hanging fruits when it comes to UV packing in Blender.

Thank you for your efforts ambi !

I just did a test on an cubesphere with 3 iterations of randomized transfom on every vertex.
Every edge was marked as a seam, therefore alot of islands.

I think uv_shotgun did a slightly tighter pack in this special case,
but it also was going over the UV boundaries.
As a proof of concept its a good effort. Thx ambi !

Lets hope SaphireS will get his UV Packer into master !

I made some improvements and made the script into an addon. It’s kind of slow and completely unoptimized so I do not recommend using it for more than 10k edges at the moment.

Attachments


packer.zip (5.12 KB)

It crushed blender)

ambi,

nicely done. Will have a look at the script.

Is the ‘amount used’ calculated with the border pixels counted as used or unused?

@LetterRip: Amount used is the used UV polygon area. The algorithm as it stands is quite simple. It just scans from the corners towards the center and tries to place the largest available polygon (by bounding box) in random orientation. If it can’t it just tries again in a farther point until it reaches the center. Then it scales back the entire set to fit the polygon. The collision detection is crude, and should be rewritten to use smarter algorithm. Proper generation of margin is missing.

@brothermechanic: You can cancel the calculation with esc or right mouse button. Also opening the Python console will give you more information.