Epic MegaGrant - a short story

My name is Lukasz Czyz, I am the creator and lead developer of the UVPackmaster addon for Blender.

It was quite a long time ago when I encountered the Aurel Gruber’s presentation regarding his work for implementing the SLIM UV unwrapping algorithm in Blender. The presentation was from 2016 and it is still available on You Tube. I recommend you to watch it in order to learn why SLIM in Blender is a big deal:

As you can see in the comment section of the video, the perspective of having SLIM implemented in Blender was exciting for the community. Unfortunately it turned out that Aurel didn’t have resources to finish the implementation and his code was abandoned for a couple of years in the work in progress state (note he originally started implementing it for Blender 2.7).

It was 2022 when I recalled that old Aurel’s presentation. It occurred to me that it is a real shame that such a useful piece of code wasn’t  finally merged into the official Blender codebase. I also realized how exciting it would be to finish it myself – to my contribution to such an amazing project as Blender, so that every user could use the algorithm for free.

First I contacted Aurel to ask him whether he didn’t mind me finishing his original implementation, if I was able to gather funds for it. He accepted my idea as he confirmed he didn’t have time to finish the work himself.

In the next step I decided to apply for an Epic MegaGrant to receive funding for this work, knowing that Epic Games supports Blender. I sent a proposal and after a few months got the response: accepted! I could start working.

Yes, it took a while – note that in the first place I had to port the original Aurel’s code to the latest Blender 4 codebase. Then I had to pass the demanding code review process managed by Blender devs. But I can proudly announce it now: the implementation was finally merged into the Blender codebase (after 8 years!) and will be available in the next Blender release.

Read on to learn more about the SLIM algorithm.

About SLIM

SLIM is a state of the art UV unwrapping algorithm invented at the IGL institute of ETH Zurich. Thanks to its iterative nature, it is superior to all algorithms currently implemented in Blender in the following terms:

  • it can unwrap complex meshes with much less distortion (even with no seams applied).
  • the user gains control over the “unwrap quality” / “computing time” tradeoff. More iterations means less distorted UV map, but more time is required to compute it.
  • it can be used to effectively minimize stretch on meshes already unwrapped (Minimize Stretch operator).
Take a look at the pictures below to check the difference between algorithms when unwrapping a head mesh. Keep in mind that the mesh is being unwrapped without any seams, what makes the task really difficult.

Angle Based method (implemented in Blender)

First let’s take a look how the algorithms currently supported by Blender deal with unwrapping the mesh. The picture below shows a result from the Angle Based method. Note how UVs are stretched at the center and border (red color). Due to stretching the texture is unevenly laid on the mesh – compare big texture squares at the top of the head with small squares around the neck.

Conformal method (implemented in Blender)

Next picture shows a result of the second algorithm available in Blender: “Conformal”. As you can see it doesn’t do any better – there is a lot of stretching in the texture as well:

SLIM method (to be implemented in this proposal)​

Now let’s check how SLIM will deal with this task. Remember that SLIM is an iterative algorithm – more iterations means better result, but also more time required to compute it. The next pictures show SLIM results after different number of iterations:

SLIM result after 5 iterations
SLIM result after 10 iterations
SLIM result after 50 iterations

As you can see just 5 SLIM iterations is enough to achieve a less stretched UV map than the maps generated by the Blender methods. After 10 iterations, we get a map with much less distortion (the texture is laid on the mesh much more evenly). What is more 10 iterations of the algorithm can be computed in a very short time (similar to the time required for methods already implemented in Blender). When we proceed to 50 iterations, the result doesn’t change significantly, what indicates that we can stop on that number. We got a very decently unwrapped UV map with no single seam.