Skip to content

Materials System

TheKillerey edited this page Apr 13, 2026 · 1 revision

Materials System

The addon provides a full material pipeline: import League .materials.bin files, edit materials in Blender's UI, and export back to binary format.

Location: League Tools tab → Material Editor


Overview

League materials are stored as StaticMaterialDef entries inside .materials.bin files (PROP format). Each material contains:

  • Shader link — which shader program to use
  • Samplers — texture references with addressing modes
  • Parameters — vec4 shader constants (colours, speeds, etc.)
  • Switches — boolean feature toggles
  • Shader Macros — compile-time constants
  • Techniques — rendering pass definitions with blend states

Material Import

From Project Manager

When loading a map variant, materials are imported automatically from the associated .materials.bin.

Manual Import

  1. Open Material Editor → Import Materials.
  2. Select a .materials.bin file.
  3. Materials are created in Blender with:
    • Shader node graph (approximating the League shader)
    • All metadata stored as custom properties
    • Texture images loaded from configured asset paths

Texture Resolution Order

The addon searches for textures in this priority (configurable):

  1. Custom Assets Folder (if "Prioritize Custom Assets" is enabled)
  2. Original Assets Folder (Riot's extracted ASSETS/)
  3. Levels Folder (map-level textures)
  4. Project directory (local overrides)

Supported texture formats: .dds, .tex (Riot TEX), .png, .tga


Material Editor UI

Materials List

The top section shows all loaded materials. Select one to edit.

Samplers (Textures)

Each material can have multiple texture samplers:

Sampler Usage
DiffuseTexture Main colour texture (most common)
Mask_Texture Alpha/mask channel
Noise_Texture Procedural noise
Emission_Tex Emissive/glow map
Normal_Map Normal mapping
Distortion_Texture UV distortion
FlowMap Water flow direction
Gradient_Texture Colour gradients
GlitterBlendingTexture Sparkle effects
VertexDeformationMask WPO/vertex animation

Editing a sampler:

  1. Select the sampler in the list.
  2. Click Browse Texture to pick a new texture file.
  3. Set address modes (Wrap, Clamp, Mirror).
  4. Changes reflect in the Blender material node graph.

Sampler address modes:

addressU: 0=Clamp, 1=Wrap
addressV: 0=Clamp, 1=Wrap
addressW: 0=Clamp, 1=Wrap

Operations:

  • Add Sampler — create a new texture slot
  • Remove Sampler — delete a texture slot
  • Convert DDS to TEX — convert a DDS file to Riot's TEX format

Parameters

Shader parameters are stored as vec4 (4 floats):

Parameter Example Values Description
Color (1.0, 0.5, 0.2, 1.0) RGBA colour
Transition_Speed_Factor (2.0, 0, 0, 0) Animation speed
AlphaTestValue (0.5, 0, 0, 0) Alpha threshold
DeformWaveController (1, 0.5, 2, 0) Wave animation params
BPM (120, 0, 0, 0) Beats per minute

Operations:

  • Add Parameter — create a new parameter
  • Edit Parameter — modify the vec4 values
  • Remove Parameter — delete a parameter

Switches

Boolean toggles that enable/disable shader features:

Switch Effect
ENV_TRANSITION Environment transition effect
USE_WS_MASK World-space masking
DISABLE_FIRE_FX Disable fire effects
DISABLE_SHADOWS Skip shadow rendering
PREMULTIPLIED_ALPHA Premultiplied alpha blending
DEBUG_VIEW_MASK Debug visualisation

Operations:

  • Add Switch — create a new switch
  • Toggle Switch — enable/disable

Shader Macros

Compile-time constants that control shader compilation:

Macro Usage Count Description
NO_BAKED_LIGHTING 1,142 Disable baked lighting
DISABLE_DEPTH_FOG common Disable depth-based fog
PREMULTIPLIED_ALPHA common Premultiplied alpha mode
DISABLE_SHADOWS common Skip shadow rendering
ENV_TRANSITION common Enable environment transition

Techniques

Rendering technique definitions:

techniques[0] = MaterialTechnique {
    name: "normal"
    passes[0] = MaterialPass {
        shader: "Shaders/StaticMesh/Default_Earth"
        blendEnable: false
        cullEnable: true
        srcColorBlendFactor: 1    # ONE
        dstColorBlendFactor: 0    # ZERO
        writeMask: 15             # RGBA
    }
}

Each technique contains one or more passes with blend state configuration.


Material Export

Export Materials

  1. Material Editor → Export Materials to write a standalone .materials.bin.
  2. Or use Export Materials (Merge) to merge with an existing file:
    • Updates existing material entries in-place.
    • Preserves all non-material entries (VFX, particles, controllers, etc.).

Export via Project Manager

Export Materials in Project Manager writes directly to the project's materials path, automatically using merge mode.


Shader Templates

Create materials from predefined shader templates:

  1. Click Create from Shader Template.
  2. Browse the StaticMesh shader list.
  3. Select a shader (e.g. Default_Earth, Water_River, SRX_Blend_Rocks).
  4. A new material is created with the correct samplers, parameters, and macros.

Available shader categories:

  • Default_* — Standard terrain and props
  • SRX_Blend_* — Seasonal (SRX) shaders
  • Infernal_* — Infernal rift theme
  • Water_* — Water surfaces
  • Hologram_* — Holographic effects
  • Glass_* — Glass/transparent

Shader Preview System

The Material Editor can build Blender shader node graphs that approximate League's rendering:

  • PBR mode — default for most materials
  • Water mode — flow maps, distortion, transparency
  • Glass mode — refraction and transparency
  • Hologram mode — scan-line and glow effects

Preview textures are loaded from configured asset paths and applied to image nodes automatically.


Code Examples

Parse a materials.bin in Python

from MapgeoAddon import propertybin_parser

data = propertybin_parser.parse_bin("sodapop_srs.materials.bin")
print(f"Format: {data['magic']} v{data['version']}")
print(f"Entries: {data['entry_count']}")

for entry in data['entries']:
    type_hash = entry.get('type_hash', '0x0')
    path_hash = entry.get('path_hash', '')
    print(f"  {path_hash} (type: {type_hash})")

Material entry structure (JSON representation)

{
  "path_hash": "0xa1b2c3d4",
  "type_hash": "0xff9d3409",
  "fields": [
    {
      "name_hash": "0x8d39bde6",
      "type": 16,
      "value": "Maps/KitPieces/SRX/Materials/Default/Earth_River_DM"
    },
    {
      "name_hash": "0x175e6924",
      "type": 129,
      "values": [
        {
          "class_hash": "0x2a41c4c2",
          "fields": [
            {"name_hash": "0x8d39bde6", "type": 16, "value": "DiffuseTexture"},
            {"name_hash": "0xd23b3438", "type": 16, "value": "ASSETS/Maps/Textures/earth_river.dds"}
          ]
        }
      ]
    }
  ]
}

Statistics

From research across all official League maps:

  • 9,509 total materials
  • 195 material files
  • 282.95 MB of material data
  • 627 unique parameters documented
  • 71 unique texture samplers identified
  • Common shaders: Default_Earth, SRX_Blend_Earth_Rocks, Water_River

Clone this wiki locally