Difference between revisions of "Material Modding"
Line 14: | Line 14: | ||
* Base texture, which is a texture that can be colored by the player. This should be grayscale most of the time, as the player chosen color will be applied directly by multiplying it, except as noted for the Extra texture. | * Base texture, which is a texture that can be colored by the player. This should be grayscale most of the time, as the player chosen color will be applied directly by multiplying it, except as noted for the Extra texture. | ||
* Bump texture, which is the normal map. These are usually purple, signifying a direction pointing along the normal of the surface. | * Bump texture, which is the normal map. These are usually purple, signifying a direction pointing along the normal of the surface. | ||
− | * Extra texture. The material uses the 3 color channels of the extra texture to modify the material. The red channel controls occlusion, i.e. how dark a material appears, even in direct light, to simulate crevices | + | * Extra texture. The material uses the 3 color channels of the extra texture to modify the material. |
+ | ** The red channel controls occlusion, i.e. how dark a material appears, even in direct light, to simulate crevices. | ||
+ | ** The green channel controls smoothness/specularity | ||
+ | ** The blue channel controls color masking, where 100% blue means the player's color will be 100% multiplied with the base texture color and 0% means the material will only use the base texture color. An example of using the blue channel of the Extra texture would be to add gold adornments to a wall that the player can't change the color of. | ||
= XML example = | = XML example = |
Revision as of 14:17, 1 March 2018
Material mod structure
Main structure
You can add your own materials to the game by creating a new folder inside the Materials folder in the root of the game.
Inside your new folder you should add a "materials.xml" file. The root tag of the xml file should be named after the name of your material pack, each child node is a new material.
Materials
Each material will be named as its tag. The player will never see this name, but the game uses it for serialization purposes, so you should make the name as unique as possible to avoid overlap. If a material is named the same as another one, it will replace it, which you can use to replace in-game materials.
Each material should have sub tags defining its Category, either Floor, Interior or Exterior, optional paths to its "Base", "Bump" and "Extra" textures and optionally a Skirting tag which you can use to remove skirtings on interior wall materials using <Skirting>False</Skirting>.
Material textures
Materials consist of:
- Base texture, which is a texture that can be colored by the player. This should be grayscale most of the time, as the player chosen color will be applied directly by multiplying it, except as noted for the Extra texture.
- Bump texture, which is the normal map. These are usually purple, signifying a direction pointing along the normal of the surface.
- Extra texture. The material uses the 3 color channels of the extra texture to modify the material.
- The red channel controls occlusion, i.e. how dark a material appears, even in direct light, to simulate crevices.
- The green channel controls smoothness/specularity
- The blue channel controls color masking, where 100% blue means the player's color will be 100% multiplied with the base texture color and 0% means the material will only use the base texture color. An example of using the blue channel of the Extra texture would be to add gold adornments to a wall that the player can't change the color of.
XML example
<CoolPack> <CoredumpingBestWall> <Category>Interior</Category> <Base>base.png</Base> <Bump>bump.png</Bump> <Extra>extra.png</Extra> <Skirting>False</Skirting> </CoredumpingBestWall> </CoolPack>