Dynamic Textures - ThreeTAG/Palladium GitHub Wiki

Dynamic Textures a great way to make animated content in render layers, icons, and more. To create one, simple put a file at
assets/<namespace>/palladium/dynamic_textures/<texture_id>.json

{
  "base": "namespace:textures/models/example_texture"
}

This one would simply just look for the texture, and not do anything special with it. To make it more dynamic, read the following chapters.
If you plan to use this somewhere in your pack, you start your texture path with a #. For my example here, you would use #<namespace>:<texture_id> (without the brackets)

Texture Variables

The base setting is the texture we'll always start with when the game starts to produce this texture. There are those things called "texture variables". They allow you to get input from the entity and use it in your texture path. Let's use Palladium's variable for crouching:

{
    "base": "namespace:textures/models/example_texture_#CROUCHING.png",
    "variables": {
        "CROUCHING": {
            "type": "palladium:crouching"
        }
    }
}

Now we get the data from the entity whether it's crouching or not. The CROUCHING key I used there is the one you can use in the texture path starting with a #. Depending on the entity, the game will now look for namespace:textures/models/example_texture_true.png or namespace:textures/models/example_texture_false.png. If you don't want to add that true/false-suffix, the palladium:crouching variable has extra settings which allow you to specify what the suffixes both cases would be. So this:

{
    "base": "namespace:textures/models/example_texture#CROUCHING.png",
    "variables": {
        "CROUCHING": {
            "type": "palladium:crouching",
            "true_value": "_crouching",
            "false_value": ""
        }
    }
}

...will look for namespace:textures/models/example_texture.png (since I gave false_value an empty string) and namespace:textures/models/example_texture_crouching.png.

All texture variables can be found in the mods/documentation/palladium/dynamic_textures/texture_variables.html file in your minecraft folder.

Texture Transformers

There are also ways to let the game modify your texture. Those are called "texture transformers". So let's add an overlay on top of our current texture:

{
    "base": "namespace:textures/models/example_texture#CROUCHING.png",
    "variables": {
        "CROUCHING": {
            "type": "palladium:crouching",
            "true_value": "_crouching",
            "false_value": ""
        }
    },
    "transformers": [
      {
        "type": "palladium:overlay",
        "overlay": "namespace:textures/models/example_overlay.png"
      }
    ],
    "output": "namespace:textures/models/example_texture#CROUCHING_overlayed.png"
}

Now this will put the texture specified in overlay on top of our base texture. BUT once you apply transformers to your texture, you will need to add a output path. This will be the path the game will save the modified texture under. You actually won't find any modified texture file anywhere, this will just be the key it will be saved under in the memory while the game is active. You can see how I used the texture variable #CROUCHING in there. This is necessary, otherwise it will save all modified textures under the same key, which basically means that there will only be one texture in the end. And just as you can use texture variables in output, you can also use them in the transformers:

{
    "base": "namespace:textures/models/example_texture#CROUCHING.png",
    "variables": {
        "CROUCHING": {
            "type": "palladium:crouching",
            "true_value": "_crouching",
            "false_value": ""
        }
    },
    "transformers": [
      {
        "type": "palladium:overlay",
        "overlay": "namespace:textures/models/example_overlay#CROUCHING.png"
      }
    ],
    "output": "namespace:textures/models/example_texture#CROUCHING_overlayed.png"
}

This change would make the game look for different overlays to put on your base texture, depending on if your entity is crouching or not.

All texture transformers can be found here: coming soon

You can add as many variables and transformers as you want. In the case of transformers, the order is important for the result. It will go through each from the start to the end and modify the texture in that order.

All that might seem complicated at first, but once you understand how it works you should be able to get pretty complex with this. Feel free to suggest any texture transformers and texture variables on issue tracker here if you need any for your dynamic render layer texture.

⚠️ **GitHub.com Fallback** ⚠️