Skip to content

2 MSF Files

ItsSpyce edited this page Sep 12, 2025 · 2 revisions

Material JSON files

Material JSON files are global. Think of them as a texture set record but with way more in them. Anything can use them, no matter what. These have a couple rules:

  1. They must live in Data/Materials. Materials will not be searched for anywhere else.
  2. They must be valid JSON. The format will be below but if it is not valid, the material won't be loaded.
  3. All fields are optional but that doesn't make them unruley. Follow the types below.

Types

  • color: an array of 0..1 of either RGB or RGBA
  • map: a path string relative to Data/textures
  • material: a path string relative to Data/materials

Fields

Name Type Description
shaderType number Necessary for BGSM/BGEM conversions, otherwise optional
diffuseMap string Diffuse texture path
normalMap string Normal texture path
envMap string Environment map path
glowMap string Glow map path
specularMap string Specular map path
rimLighting boolean Enables rim lighting
rimPower number Rim lighting power
backLightPower number Back light power
specularEnabled boolean Enables specular
specularColor array (number) Specular color (RGB)
specularMult number Specular multiplier
emittanceColor array (number) Emittance color (RGBA)
emittanceMult number Emittance multiplier
receiveShadows boolean Receives shadows
castShadows boolean Casts shadows
glowMapEnabled boolean Enables glowmap
environmentMappingEye boolean Enables environment mapping for eyes
hair boolean Enables hair shader
hairTintColor array (number) Hair tint color (RGB)
facegen boolean Enables FaceGen shader
skinTint boolean Enables skin tint
grayscaleToPaletteScale number Grayscale to palette scale
skewSpecularAlpha boolean Skews specular alpha
pbr boolean Enables PBR shading
uvOffset array (number) UV offset (U, V)
uvScale array (number) UV scale (U, V)
transparency number Transparency value
alphaTest boolean Enables alpha testing
zBufferWrite boolean Enables Z-buffer writing
zBufferTest boolean Enables Z-buffer testing
decal boolean Enables decal
twoSided boolean Enables two-sided rendering
decalNoFade boolean Decal does not fade
envMapEnabled boolean Enables environment mapping
envMapScale number Environment mapping mask scale
grayscaleToPaletteColor boolean Enables grayscale to palette color
alphaBlendMode string Alpha blend mode

Material configuration files

Material configuration files are per-mod. These are used by MSF to determine what material combinations can be applied to a NIF.

Configuration files live in Data/SKSE/Plugins/MaterialSwapperFramework/{PLUGIN_NAME}/{index}.json

  • {PLUGIN_NAME} is the name of the plugin with the extension. Skyrim.esm will turn into MaterialSwapperFramework/Skyrim.esm/
  • {index} is a generic index. These have no meanings for the moment but in the future will be used for conflict resolution. Much like Open Animation Replacer's priority system, you can have as many of these as you like.
{
  /*
    The key can be one of three kinds:
    - PLUGIN_NAME|RELATIVE_FORM_ID
    - ABSOLUTE_FORM_ID
    - FORM_EDITOR_ID
  */
  "Skyrim.esm|123456": [
    {
      "name": "My New Material",
      "isHidden": false,
      "modifyName": true,
      "layer": 0,
      "applies": {
        "my_shape": "path/to/material.json"
      }
    }
  ]
}

Fields

Name Type Description
name string The name of the material
isHidden boolean Whether or not the material is hidden in the UI; useful for materials applied programatically
modifyname boolean Whether or not to apply material name to the record name. Not implemented.
layer number The layer the material applies to. Same layer materials will be replaced.
applies Map<string, string> A map of SHAPE_NAME:MATERIAL_FILE

Application

  • To apply a default material, set the BSLightingShaderProperty name to the JSON path relative to Data/materials.
  • To change materials, press F10 to open the UI and browse from equipped items.

Additional notes

There shouldn't be any issues between body types. MSF works on a shape-name based system so as long as the shape is named the same between variations, it'll work as expected. This has been tested extensively between UBE and 3BA, two very different body types.

Clone this wiki locally