Mojira Archive
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

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).

Unresolved

user-f2760

ErrorCraft

2021-12-24, 03:27 PM

2025-01-02, 12:07 PM

4

3

Community Consensus

Low

Platform

Resource Packs

1.18.1 - 1.21.41.18.1, 1.20.1, 1.20.2, 23w43b, 1.21.4

-