Skins manages it’s skins through the concept of Skin Groups. Conceptually, a Skin Group groups together material modifications that makes sense together — this set of material modifications then form the basis for a sensible gear skin.

Apart from grouping together the different material modifications, Skin Groups are also responsible for targeting what gears the entire group would even apply to. Say I made texture modifications to a Shotgun, then I would probably want my textures to only be able to be used by the Shotgun and not with anything else, since this set of material texture replacements will likely not work with anything else (there are, of course, exceptions!).

Inside a Skin Group is a collection of what I call Material Targets. Like the name suggests, a Material Target targets a specific material. This is all conceptually rather pleasing until you want to define the material you are trying to target. Matching a specific material is hard, especially since there are some different materials in GTFO that have the exact same name (e.g. “Spear”). To solve this problem I added the option to add some additional targeting filters to Material Targets so that there is hopefully no ambiguity.

After we have targeted a Material Target with the filters, there is no limit as to what can be done. Almost anything you can think of doing with a Material object in Unity can be done here — well, that might be a bit of a stretch. The current system of Material Targets allows any of the properties on the material/shader to be modified, including the shader itself.

Since it would be pretty dumb to include data blobs for the textures inside the JSON files themselves, textures are references by path relative to the directory the current Material Target is in.

Apart from specifying a path to a texture, the schema allows additional type of expression called Texture Macros. Texture Macros allow for easy definition of common textures without having to create or ship an image texture for that texture slot at all. I initially added it for easy testing, but it has proven to me to be quite useful; for more details see the Texture Macro page.

There might be the desire to customize the model of a gun for use. You can specify a Mesh Target to replace a specific mesh in-game. The mod currently support specifying meshes via Asset Bundles since it is the native unity format.

Info

Mesh Targets are introduced in plugin version 0.7.0.


Skins follows a specific process of loading everything given multiple considerations, the details of which can be checked out here.