Atlases

  • Views Views: 7,562
  • Last updated Last updated:

Resource Pack Guide

Atlases

  • Information​

    In snapchat 22w46a, a new directory atlases has been introduced for resource packs. Atlases stitch all your textures into one large sprite sheet to help with pack stability, load times, and performance.

    Atlas Adder​

    Atlas Adder is a neat automation tool that will create an atlas configuration for a specific resource pack; click here to download.

    Python is required to run the script, download can be found on their official website here.

    To use, simply place the downloaded Python script into your /.minecraft/resourcepacks/ folder (or just make sure the script and resource pack are in the same folder) and double click to run it (if that doesn't work, try to right-click, "Open with," and select Python).

    Fundamentals​

    If multiple directories include the same file, they will be merged by their order within the pack.

    The order of your atlas configuration is the order it will run in, during pack load, which will add or or remove new files to the texture list, which will then later be used by your models, paintings, particles, etc.

    Valid Entries​

    blocksTextures used by block and item models.
    banner_patterns, beds, chests, shield_patterns, shulker_boxes, signsUsed to render special-case models.
    mob_effectsTextures used for effect icons in the UI.
    paintingsTextures used for paintings.
    particlesTextures used for particles.

    For most resource packs with minimal additional assets, the blocks entry will cover a majority of your pack.

    Types of Sources​

    directory:
    • source - directory in the pack (relative to /textures/)
    • prefix - string added to the sprite name when loaded
    Adds all files in a directory and its subdirectories (across all namespaces).
    single:
    • resource - location of a resource (relative to /textures/)
    • sprite - sprite name (optional; if not supplied, it will default to resource)
    Adds a single file.
    filter:
    • namespace, path - patterns (regular expressions) of IDs to be removed
    Removes sprites matching the given pattern.
    unstitch:
    • resource - location of a resource (relative to /textures/; .png implied)
    • divisor_x, divisor_y - determines the units used by regions
    • regions - list of regions to copy from the source image
      • sprite - sprite name (optional; if not supplied, it will default to resource)
      • x, y - coords of the top-left corner of the region
      • width, height - size of the region
    Copies rectangular regions from other images.

    Creating an Atlas Configuration​

    Step 1. Creating a New Directory​

    Navigate within your resource pack to /assets/minecraft/ and create a new directory named atlases. Now your resource pack, if used in versions 1.19.3 or above, will be able to use and read any atlas configurations placed within this directory.

    Step 2. Adding a Directory​

    For the most part, a block atlas entry will cover a majority of the resource pack's textures. If you encounter other issues, or know that you'll need to setup another entry, refer to the entries table above. Create a new file named blocks.json within the new directory you just made.

    Inside of our blocks.json, add the following code:
    JSON:
    {
    "sources": [
    { "type": "single",
    "source": "custom/swords/",
    "sprite": "ruby-sword"
    }
    ]
    }

    This would add all the textures within your custom directories (in any namespace, i.e. /assets/minecraft/custom/) and keep them with the same prefix "custom." A sapphire sword within /assets/minecraft/textures/custom/sapphire-sword.png would be available as minecraft:custom/sapphire-sword.

    Example: If a pack had a ruby sword file /assets/jeqo/textures/custom/ruby-sword.png, you could add a directory type with the source set to "custom" and the prefix set to "custom" and the texture would now be available as jeqo:custom/ruby-sword

    Step 3. Adding Singles (Optional)​

    To add a single file, add the following code to your atlas:

    JSON:
    {
    "sources": [
    { "type": "single",
    "source": "custom/swords/",
    "sprite": "ruby-sword"
    }
    ]
    }
    Adds a single texture from a specific given path.

    Step 4. Filtering (Optional)​

    To filter, or remove, a certain directory or single, add the following code to your atlas:

    Code:
    {
    "sources": [
    { "namespace": "custom"
    }
    ]
    }
    Filters out the entire custom namespace and all the textures within every subdirectory.

    Code:
    {
    "sources": [
    { "path": "custom/swords/dungeon/gem/ruby-sword.png"
    }
    ]
    }
    Filters out the ruby sword located deep within our custom namespace.

    Step 5. Unstitching (Optional)​

    Not too much is known about this yet... tune back in soon.

    Example Atlas Configurations​

    Multiple Entries​

    Code:
    {
    "sources": [
    { "type": "directory",
    "source": "entity",
    "prefix": "entity/"
    },
    { "type": "directory",
    "source": "custom",
    "prefix": "custom/"
    },
    { "type": "single",
    "source": "custom/swords/",
    "sprite": "ruby-sword"
    }
    ]
    }
    When adding multiple entries, you'll need to add a trailing comma except for the last entry.

    ModelEngine​

    Code:
    {
    "sources": [
    { "type": "directory",
    "source": "entity",
    "prefix": "entity/"
    }
    ]
    }

    Need More Brain Fuel?

    Check out these other neat guides!