Skip to content

CTM into Texture Metadata

tterrag edited this page Dec 8, 2018 · 6 revisions

See Vanilla's tag structure for Metadata files. We use the same metadata file and everything you do in there should be fully compatible with CTM, including animations.

We add some extra parsing to read additional data in Vanilla's tag structure. Below see the JSON tree.

The root tag
└─ ctm : Contains data for CTM to use.
   ├─ ctm_version : Set this to 1. Just version checking.
   ├─ proxy : A texture to use instead of this one. Used for resourcepacks/mods that want to use an entirely different texture when CTM is present. 
   │	      If this is defined, nothing else (aside from ctm_version) can be defined.
   ├─ type : Sets the render type. See below for a list of possible render types.
   ├─ layer : Sets rendering layer for texture. Can be: SOLID, CUTOUT, CUTOUT_MIPPED, or TRANSLUCENT.
   ├─ textures : This is for extra textures needed by the render type. 
   │  └─ An array of extra textures used.
   └─ extra : Used for any additional information the render, or specific render type, may require.

For more information on the "extra" tag, see the wiki page for it.

Example file - filled with defaults

{
  "ctm": {
    "ctm_version": 1,
    "type": "normal",
    "layer": "SOLID",
    "textures": [],
    "extra": {
      "light": 0
    }
  }
}

Another example file:

{
  "ctm": {
    "ctm_version": 1,
    "type": "normal",
    "layer": "SOLID",
    "textures": [],
    "extra": {
      "light": {
        "block": 0,
        "sky": 0
      },
    }
  }
}

Example - Used

{
    "animation": { "frametime": 2 },
    "ctm": {
        "ctm_version": 1,
        "layer": "TRANSLUCENT",
        "type": "edges",
        "textures": [
            "blocks/obsidian_halo_ctm",
            "blocks/obsidian_halo_ob"
        ],
        "extra": {
            "connect_to": [
                { "block": "lava" },
                { "block": "flowing_lava" }
            ],
            "light": 12
        }
    }
}

Render Types

A render type is a definition of what advanced texture logic to apply to a texture. Mods can register their own render types. Below is a list of the render types CTM provides by default. Here is the directory that they are located at in CTM.

  • normal: Default. Plain texture without any special logic. This is assumed if type is not defined in the metadata file. Doesn't use anything in the textures array.
  • ctm: Connective Textures Map. Regular Connected Textures logic. Uses the first texture in the textures array as its CTM complement.
  • ctm_horizontal: Horizontal-only CTM. Doesn't use anything in the textures array.
  • pillar: State-less pillar logic. The texture will attempt to connect above/below it, or horizontally to form a pillar. Uses the first texture in the textures array as map for the 4 orientations of a pillar.
  • random: Randomized textures. Declare the size in the extra compound to define the diameter of the texture. Doesn't use anything in the textures array.
  • pattern: A multiblock texture. Declare the size in the extra compound to define the diameter of the texture. Doesn't use anything in the textures array.
  • edges: A special case of CTM, to be used when a block "changes" based on its surroundings. Requires two extra textures in the textures array; a 2x2 of textures forming a CTM map, and one extra texture for a fully obscured face (1x1 array of textures).
  • edges_full: For the same use as edges, however it uses a full block texture for each variant. This can be used for more gradual transition, but is a bit more limited in the number of combinations that can be displayed. Requires one extra texture in the textures array.
  • eldritch: A strange type which is used for Chisel's "temple" blocks. Splits the texture into quadrants and perturbs the center vertex randomly, to warp each face slightly. Doesn't use anything in the textures array.

Additional Chisel Render Types

Here's a few more texture types that Chisel registers.

  • AR: Stands for Alternating Random. Uses a 2x2 of textures, in a checkerboard. The checkerboard alternates between odds and evens. Numbers between 0 and 3 are decided on the spot.
  • SCTM: Simple Connective Texture Map. Uses a 2x2 of textures, in a simplistic CTM formation. Imitates the connection logic for AE Controllers.