Skip to main content

Material Config XML

Material Config Basics

Example XML:

<materials version="3">
    <material name="mat_name" render_template="generic:DIFFUSE_TEXTURE:NORMALMAP" version="2">
        <diffuse_texture		file="texture/file/path/my_texture_df"/>
        <bump_normal_texture	file="texture/file/path/my_texture_nm"/>
    </material>
</materials>

A full list of template variables can be found in shaders/base.render_template_database

  • <material/> contains the information of a material.
  • <diffuse_texture/> typically uses a texture with the identifier _df at the end.
  • <bump_normal_texture/> typically uses a texture with the identifier _nm at the end.
  • <material_texture/> typically uses a texture with the identifier _gsma at the end. (Gloss, Specular, Metalness, Alpha)

Special Use Cases

  • render_template="template_name" a full list of templates can be found in shaders/base.render_template_database
  • unique="true" is usually used for materials that will change per-unit. Unit contours for example.
  • src="name" will clone the values from an existing <material> to your current material.
    • cloned materials can be modified further by including variables or textures to override the source copy.
  • decal_material="id" graphic mesh faces with the material will use the decal_material variable for hit effects.
  • diffuse_color="255 255 255 255" potentially unused. (Red, Green, Blue, Alpha)
  • version="2" most if not all templates use version 2.