mojira.dev
MC-246230

Elements in models that contain start and/or end positions outside the 0-16 range have auto-uv mapping that bleeds the texture atlas

The bug

When a model contains an element that exists outside of the 0-16 bounds (-16-32 is valid) the default UV mapping will not be capped at 0-16, causing texture atlas bleeding. The problem in this report is specifically the auto-UV mapping, for UV provided out of range, see MC-236285.

How to reproduce:

  1. Replace the minecraft:block/cobblestone model in a resource pack with the following:

    {
    	"parent": "minecraft:block/block",
    	"textures": {
    		"all": "minecraft:block/cobblestone"
    	},
    	"elements": [
    		{
    			"from": [ -16, -16, -16 ],
    			"to": [ 32, 32, 32 ],
    			"faces": {
    				"up": { "texture": "#all" },
    				"down": { "texture": "#all" },
    				"north": { "texture": "#all" },
    				"south": { "texture": "#all" },
    				"west": { "texture": "#all" },
    				"east": { "texture": "#all" }
    			}
    		}
    	]
    }

    Notice that no UV mapping is provided, so it used auto-mapping.

  2. Load the resource pack

  3. Place a cobblestone block in a world

  4. Notice how the 9 textures are shown with cobblestone in the center

    [media]

The fix

Either one of the following:

  • Deploy the second fix option for MC-236285. (Preferred fix)

  • Make auto-uv mapping get the size of the face, and offset, like it does now, but then clamp it between 0 and 16 (offset into the area before cutting the size down so that elements fully outside the 0-16 range do not get a 0 wide/tall UV).

Linked issues

Attachments

Comments 7

migrated

I think this actually duplicates MC-236285. How is it different?

SPGoding

I believe MC-236285 is that you can set a UV outside of the normal range, while this ticket is about the default UV for larger models.

migrated

Can confirm.

muzikbike

Isn't this a duplicate of MC-156088?

migrated

No, this is about default uv; that report specifically sets uv mapping.
That said, that report appears to be very similar to MC-236285.

migrated

Still in 1.20.1.

I'd like to request ownership of this report; @unknown has not done anything on MoJIRA since may of last year. (Over a year of no activity.)

Dhranios

Still in 1.21.4.

migrated

(Unassigned)

Community Consensus

Platform

Low

Resource Packs

1.18.1, 1.20.1, 1.20.2, 23w43b, 1.21.4

Retrieved