Garux / netradiant-custom

The open-source, cross-platform level editor for id Tech based games.
https://garux.github.io/NRC/
Other
299 stars 52 forks source link

UV Tool: smarter patch unwrapping algorithm #27

Open Garux opened 4 years ago

Garux commented 4 years ago

Current algorithm is technically wrong, but covers good amount of cases more or less right.
In short it is: find avg axes of patch out of its points, find longest column and row, find uv projection space out of triangle, including these col and row, placed on manipulator's plane along avg axes.
Apparently this doesn't always turn out well, examples:
unwanted skew: image skewed and sizing is odd: image is fine, when texture is placed in 'natural' style, previous was projected image odd skew and sizing ratio in the very classic case: image 'natural' may be odd too: image

Wished qualities of unwrapping are:

Current implementation fulfills 3 and 4, 1 and 2 aren't always like wished.