SLIM Unwrapping algorithm #48036
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
17 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#48036
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In the course of my bachelor thesis I get to implement a new parametrization algorithm into Blender. The Algorithm is described in this paper:
http://igl.ethz.ch/projects/slim/slim-techreport-2016.pdf
Compared to the current LSCM algorithm it works by minimizing a different energy which results in considerably less stretching. It works in several iterations, which allows for early termination if good enough (Can potentially be done similarly to the current "minimize stretch" GUI interaction), see UV sample:
https://drive.google.com/folderview?id=0B8tVvh1f2GtPemVKNFY1Si0zS2M&usp=sharing
Two things need to be figured out:
I'm developing on MAC OSX with XCode. The Algorithm has already been (relatively cleanly from what I've seen so far) implemented but it requires C++11. I've therefore run into compilation issues on OSX.
After i get an initial implementation working, I will try to improve some parts. I will try different solvers in the local stage of the algorithm. Namely, we try to switch from a direct to a iterative approach, hoping for a considerable speed up. After that we will try to use momentum functions to improve the local stage.
The Algorithm uses two libraries apart from EIGEN. One is from IGL (Interactive Geometry Lab ETH). It uses a GPL License. The other one is Pardiso. It contains a apparently vastly superior solver. The algorithm works just fine with just EIGEN, but it is considerably slower. However, pardiso uses a commercial license i think and is only free for students or educational institutions. We'll probably have to do without it. It's not that big of a deal though unless you unwrap geometry whichs number of polygons is in the millions.
Timeline:
The Thesis ends on the 21. of September.
I would like to get an initial raw implementation working soon, preferably within the next week. A more refined implementation with decent GUI interaction I plan to have implemented until the end of April. After that come the already mentioned improvements.
I am grateful for any help and inputs!
** The following is the diff of the code i have so far:
crashesRelease.diff
Changed status to: 'Open'
Added subscriber: @brecht
Added subscriber: @ErickNyanduKabongo
Added subscriber: @nudelZ
Pardiso can't be included in Blender, it doesn't seem to be available under an open source license compatible with the GPL. So it looks like Eigen will have to be used, which seems fine since we prefer not to add extra library dependencies whenever possible.
Regarding IGL, we'll have to evaluate if it's worth adding this entirely library as a new Blender dependency or not. Is this the code that you will integrate?
https://github.com/MichaelRabinovich/Scalable-Locally-Injective-Mappings
From what I can tell the mesh is represented by sparse Eigen matrices, and most of the IGL functions used seem to be pretty stand-alone. I didn't look at it in detail, but perhaps an option would be to just copy the code of a couple of IGL functions. If it turns out we only need 1K or 2K lines of code from IGL, it's not really worth adding the entire thing as an external dependency.
For LSCM / ABF we close all holes except the biggest one, which is simply based on the total length of the edges along the boundaries. Probably something smarter is possible, but I've never heard any user complain about the current method.
Where did you integrate the code? It might be a good idea to hook into the current UV unwrap code in uvedit_parametrizer.c, since it does seam splitting, hole filling, triangulation, and basically all the work necessary to ensure you have disk topologies.
It depends on performance. Most of the time UV unwrap is used on manually modelled or retopologized meshes, which aren't as big as the ones in the paper, and ideally the algorithm is fast enough for those that the tool can use some reasonable default threshold that users almost never need to modify. The tool could then integrate with functionality like live unwrap and pinning, where the UV unwrap is automatically recomputed as you set seams or move pinned UVs.
For handling bigger meshes, or if the algorithm is slow also for smaller meshes, it's probably worth making the tool also interactive. Perhaps it's reasonable to make it automatically stop at some threshold, while also allowing the user to stop it earlier manually.
Copying just the required functions makes sense.
Hooking into the current code is what i had in mind as well.
I guess we can decide on that only when we see how exactly it behaves once a basic implementation within blender works.
Now i still have issues with compilation on mac:
As you told me, blender can't be compiled with c++11 on mac just yet. Is it the same for Windows and MSVC? Does it only work on linux?
I thought about rewriting the SLIM code to be pre-c++11 compliant, by including tr1 from boost. The problem is, that so far I've failed at creating the appropriate cmakefiles to even use tr1. Are there any good tutorials on that? I've looked around, but most only cover the basics. Blender has a pretty complicated cmake setup, at least to my beginnerish understanding.
Thank you for your help!
Compiling with C++11 on Windows and Linux should be easier. For Windows there isn't anything to turn on, all the C++11 features are there by default. On Linux enabling C++11 is probably easy as well but I haven't tested it recently.
What does seem to work on Mac is enabling C++11 for a single module and linking against both
P347: (An Untitled Masterwork)
This works because the iksolver module I tested this with doesn't link with any other C++ modules or libraries, which I guess is the case for SLIM as well. It might not be acceptable for merging into master, but it could be helpful to get things compiling now.
Thanks! This actually works ;) Didn't think i'd get it to run on mac!
Hey, It's been quite around here, but now I'm back at it. I tried to create a first primitive implementation. I did this without discussing any architectural details here, simply because i had to get used to working with c++ and all these cmake files and stuff. I'll of course gladly listen to any advice/critique you may have and follow it, knowing that this version will probably be overthrown completely.
My problem now is, that although the implementation works, it crashes in the release build. I don't know how to approach this kind of problem, it seems quite tricky.
How can i best upload a .diff s.t. it appears in this thread? For now, i just added it to the description.
Also, the repo that holds our SLIM code is here:
https://gitlab.com/AurelGruber/SLIM_code
Thanks
CMAKE_BUILD_TYPE
set toRelWithDebInfo
can be used for debugging release builds. If it still doesn't crash then, I guess you will have to doprintf
debugging to narrow it down, or use a tool like valgrind or clang address sanitizer to find errors.You can upload patches if they are ready to be reviewed or tested here:
https://developer.blender.org/differential/diff/create/
Regarding the patch, I would suggest to implement this inside
param_lscm_begin
,param_lscm_solve
,param_lscm_end
, and perhaps rename them toparam_unwrap_*
or something like that. That way it will work with live unwrap too. Other than that I the integration code required looks quite minimal. I don't have much to comment on that, the code style could be made to match the other code in that file, but that's not important at this stage.The gitlab link gives me a 404.
We now have C++11 libraries for OS X, so no special hacks should be needed anymore. You can set
WITH_CXX11=ON
and checkout these precompileddarwin
libraries instead ofdarwin-9.x.universal
:https://svn.blender.org/svnroot/bf-blender/trunk/lib/darwin
Added subscriber: @T.R.O.Nunes
Added subscriber: @Jabokoe
Hey guys, It's been a while. Had to sort out some technical stuff. I now have an implementation that is robust and reliable.
I assume the next steps would be to
1: upload a patch based on he current HEAD of the blender repo for review
2: implement feedback, back and forth until satisfactory
3: upload a build to graphicall for testing
4: opening a thread in a forum for feedback from users
5: gathering feedback here, bugtracker and forum
Is that correct? If not, how does this usually work?
Thanks for your support
Aurel
Great!
Those steps are entirely the right way to do it.
Added subscriber: @sasa42
Added subscriber: @Sergey
Hey guys
So I linked the diffs of two branches
D2530 is just the slim implementation with all the features
D2531 is D2530 plus the implementation of symmetric-dirichlet energy minimisation with ceres. It looks fun, but not very promising imho.
D2530: It can be used as follows: unwrap a model as usual. You can then set #SLIM-iteration, relative-scale w.r.t. pins, weight-influence, weight-maps ...
Using SLIM as a relaxation algorithm can be done by hitting ctrl. + M. I tried to get it into the UI like minimize stretch, but it refuses to show up ^^. Btw, I recently noticed that I so far forgot to implement relaxation of just a selected subset of vertices. So it still always relaxes all islands.
D2531: Same as D2530, but the #iterations parameter works differently when unwrapping regularly (not relaxation):
iterations % 10 => #SLIM-Iterations
floor(#iterations / 10) * 10 => #ceres-iterations (CGNR / Iterative Schur seem to work well.)
Essentially, given #iterations = 1010 means 10 SLIM- and 100 ceres-iterations
@brecht / @Sergey Do you guys maybe have time to take a look at it?
Also, in order to build it it must be done WITH_CXX11 and the darwin libraries (not darwin-9.x... ). I usually build it without CYCLES and LLVM because that tends to not work - but I guess that's just some issue on my side and unrelated to the code changes.
Also, I added many files (~100) in extern/Eigen3/unsupported and intern/SLIM/ext/libigl_extract that my code needs.
Thank you
Added subscriber: @dr.sybren
Added subscriber: @ChameleonScales
Hi Aurel and Brecht, I finally learn how to write your name LOL,
Here is a short video i wanted to demonstrate the different https://youtu.be/IKzra5Gjh5E
I didn't test the uv pinning feature nor live unwrap. If there is some feature need to be tested please let me know :)
Thanks to both of you, can't wait to see it in master and start to use it as default
Added subscriber: @nxrighthere
Added subscriber: @nokipaike
any chance for this in blender 2.81?
Added subscriber: @BeckersC
Added subscriber: @Jaydead
Added subscriber: @Dangry
Added subscriber: @Doowah
Added subscriber: @Chris_Blackbourn
I am not a developer but I thought SLIM UV is pretty important for UV Unwrapping. So I am posting this archived development progress in case it was forgotten where it had left.
https://archive.blender.org/developer/differential/0015/0015195/index.html