I'm calling this a resource not a tutorial because I'm not showing a step by step process but rather my documentation of a successful experiment. My goal was to bring the decal shield system to something other than shields. Since Rome 2 came out I was thinking there must be a way to simply increase the variations without having too many models. I though it was simple as adding a texture array to a non shield model. That doesn't work. Up until now I had no idea why.
Then came the assembly kit and that helped out a lot. As silly as this sounds, I just now got a new shield model to use the decal system. Before I just used the shield models textures and had models upon models. The shield example doesn't exactly help much because all the relevant slots are given the same generic dds names. You can use the diffuse normal, specular, gloss and level maps like usual, but then you have to add the decal mask, decal dirt map and decal dirt mask slots to it as well. I looked into the game's files to find how I needed to set those up. Essentially here's how you need to do it.
decal mask: take wherever there is an actual texture turn white and everything else black then scale the image to 128 x 128 pixels.
decal dirt map: same as above except scale it to 512 x 512 pixels or if in doubt half the size of your original texture.
decal dirt mask: everything black
So my first test was getting a new shield to work with decals. I took the pavise shield from my Medieval mod and used that as a base. Simply put I got it to work! So then I wanted to try it with a body texture. I took the base surcoat I use for my Men at Arms and other units and used the texture variations as "patterns" Here's the result of both tests.
Yeah, I got it to work,
The difference that was stopping me before the Assembly Kit was the shader that separates armor, helmets, etc from shields. Shields with decals need to use the shader "decal_dirtmap" and models with bones need to used "weighted" or "weighted_skin". I checked the shader list in the "Rigid_Materials.xml" (Found in raw_data\lighting) to see if there was a shader that basically did both and there is. "weighted_decal" is what you want to use.
So now I've been brainstorming the potential with this and also any issues this could bring. This might be great for mods like DeI where they add lots of variations to the units. It could be a way to improve performance when instead of having a crap ton of linothorax models with different textures, you could just have one model with a texture array. You could kill off the three color system by adding an array to the clothing. To a lesser extent you could do this to helmets that use the same model. Now as I was typing this I realized something to be mindful for. Make sure you only add decals to where you want to. You shouldn't do it to the whole texture because some models will need gloss and specular maps and they might not look as good if you did just took the whole piece. (I only did it in the screenshot to test the method) So yeah, I think this has potential.