Skip to content

Comments

ensure scaled auto uvs stay static when vertex positions are moved#335

Merged
karl- merged 13 commits intomasterfrom
uv/keep-scaled-faces-static
Sep 23, 2020
Merged

ensure scaled auto uvs stay static when vertex positions are moved#335
karl- merged 13 commits intomasterfrom
uv/keep-scaled-faces-static

Conversation

@karl-
Copy link
Contributor

@karl- karl- commented Aug 21, 2020

Purpose of this PR

Scaled auto UVs now stay static when moving adjacent faces. A new mesh format version is added for the purpose of updating legacy auto uvs to account for this change.

Links

https://forum.unity.com/threads/probuilder-bug-textures-dont-align-properly.955797/
https://forum.unity.com/threads/texture-alignment-bug.713618/

uv-before
uv-after

@lopezt-unity
Copy link
Collaborator

LGTM,
However, I wonder if that should also apply to this case (top face):
uvunwrapping-test

@karl- karl- marked this pull request as ready for review August 24, 2020 13:34
internal static void Unwrap(ProBuilderMesh mesh, Face face, Vector3 projection = default)
{
Projection.PlanarProject(mesh, face, projection != Vector3.zero? projection : Vector3.zero);
Projection.PlanarProject(mesh, face, projection != Vector3.zero ? projection : Vector3.zero);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a special reason to check (projection != 0 ? projection : 0) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's looks suspicious. I don't know why that is there, I will investigate

Copy link
Contributor

@JoelFortin JoelFortin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a quick pass on my side. LGTM.
Had already did a pass while peer reviewing with Karl.

@karl- karl- merged commit 2fa82a3 into master Sep 23, 2020
@karl- karl- deleted the uv/keep-scaled-faces-static branch September 23, 2020 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants