Jump to content
probiner

Packing sorted by an attribute?

Recommended Posts

Given weighted (colored red:x, green:y) polygon islands if I use the UV Layout SOP, the colors will have somewhat random distribution:

image.png.5f5d8d83c32b48e678c231c106e662e0.png 

Now, what I'm wondering is if there's an already established way to have the packing respect an attribute (vector2 or 2 floats) to sort the uv islands according to one or both values in the respective axis. Here's a mock-up:
image.png.34c04ac871e4f42857f6d5c5acc5056e.png

Even if I don't use UVs and do some simulation, it's not sure how I would go about to have the, let's say cylinders, fill a space and respect sorting.

Scene: PRB_WeightedPacking.hiplc

Cheers
prb

Edited by probiner

Share this post


Link to post
Share on other sites

Yes, UV layout is a complex operation to build from scratch , if you are interested, you could learn more about the theory there by looking for this  paper

Least squares conformal maps for automatic texture atlas generation" by levy et al, https://members.loria.fr/Bruno.Levy/papers/LSCM_SIGGRAPH_2002.pdf

 

I agree with Konstantin Solution, looks like a solution to me. Matt delete a random piece, but you could establish rule and  as copy on the UV 0.1 space

 

 

 

Share this post


Link to post
Share on other sites
On 12/24/2021 at 10:03 AM, konstantin magnus said:

Matt published a perhaps suitable packing method called "Pack fattest to thinnest boxes":
https://www.tokeru.com/cgwiki/index.php?title=ForLoops

Thanks, but can't use this dart throwing method in my case, since I have a fixed set of islands to pack, so I can't just delete part of them for not fitting. It's a useful method, just not for my case.

 

On 12/26/2021 at 2:41 PM, vinyvince said:

Yes, UV layout is a complex operation to build from scratch , if you are interested, you could learn more about the theory there by looking for this  paper

Least squares conformal maps for automatic texture atlas generation" by levy et al, https://members.loria.fr/Bruno.Levy/papers/LSCM_SIGGRAPH_2002.pdf

 

I agree with Konstantin Solution, looks like a solution to me. Matt delete a random piece, but you could establish rule and  as copy on the UV 0.1 space

 

 

 

As mentioned above, deletion method won't do for me. Thanks for the link about LSCM, I'll see if it inspires me to get something functional going. But let's see if some ready made approach surfaces :)


Cheers
prb

Edited by probiner

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×