Skip to content

Fix a few mesh template UV bugs - #3732

Open
ewanhowell5195 wants to merge 7 commits into
JannisX11:nextfrom
ewanhowell5195:fix-template-uv-rounding
Open

ewanhowell5195 wants to merge 7 commits into
JannisX11:nextfrom
ewanhowell5195:fix-template-uv-rounding

Conversation

@ewanhowell5195

@ewanhowell5195 ewanhowell5195 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #1052.

Rounding only ran on islands made of a single quad, so anything combine_polys merged from two or more faces never got snapped to the pixel grid. It now runs for every quad in an island. Seams between two faces are left alone, snapping those just stretches one face and squashes the other.

Before:
uv_rounding_before
After:
uv_rounding_after

I also fixed two other things I ran into while testing this.

Islands were aligned flush to one side, so a symmetric face came out with a lopsided staircase. They are now centred on any axis they are symmetrical about.

Before:
uv_centring_before
After:
uv_centring_after

The rect used to work out which pixels a face covers was inclusive at its low corner but exclusive at its high one, so an edge sitting exactly on a pixel boundary painted the pixel past it.

Before:
uv_bleed_before
After:
uv_bleed_after

@netlify

netlify Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploy Preview for blockbench-dev ready!

Name Link
🔨 Latest commit f13bfca
🔍 Latest deploy log https://app.netlify.com/projects/blockbench-dev/deploys/6a9ca84af3e5a6000811b93f
😎 Deploy Preview https://deploy-preview-3732--blockbench-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@JannisX11

Copy link
Copy Markdown
Owner

Snapping to pixel intentionally doesn't happen on complex UV islands. For example, try to create a "Tube" shape mesh with default settings and generate a template. You'll see that at the ends of the tube the UV on some faces are wonky and pixels are no longer square.

I like the alignment change on symmetrical faces, and the fix of the extra pixel row.

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.

2 participants