Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. 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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.18.1, 1.20.1, 1.20.2, 23w43b
    • None
    • Community Consensus
    • Resource Packs
    • Low
    • Platform

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

        1. bigger cobblestone model.png
          653 kB
          ErrorCraft
        2. cobblestone model.png
          624 kB
          ErrorCraft

            Unassigned Unassigned
            jirauser71590 user-f2760 (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: