🔩
Mod Developer
DeveloperModder
  • 👋Welcome!
  • Support
    • Dashboard
    • 📄Dictionary
    • 📘Glossary
      • ▫️Files
        • ▫️Assets
          • ▫️Appendix
        • ▫️Red4 Shaders
          • ▫️Definitions
          • ▫️Descriptions
      • ▫️In-Game Objects
        • ▫️Building
        • ▫️Character
          • ▫️Hair
        • ▫️Clothes
          • ▫️Variants
        • ▫️Environment
        • ▫️Vehicle
          • ▫️Assests
            • ▫️Appearance Mapping
          • ▫️TweakDB
        • ▫️Weapon
    • 🐣Getting Started
      • ▫️1. Setup
      • ▫️2. Download
      • ▫️3. Configure
    • 👪Community Links
    • 🔨Troubleshooting
      • ❔FAQ
      • ❗Problems
  • Documentation
    • Dashboard
    • Generalized guidees
      • Replace a player item with an NPC item
      • Mesh editing
      • Remove an Animation (and Potentially Replace It)
      • Change Position and Rotation of an entMeshComponent
      • PagEdit Voiceover and Subtitles In a Quest
      • Recoloring items
      • Creating new items (adding to the game)
    • 🎨Graphical Editors
      • 🦮General Guides
      • 📄General References
      • ▫️Adobe Substance
      • ▫️Autodesk Maya
      • ▫️Blender
      • ▫️Gimp
      • ▫️Krita
      • ▫️Photoshop
    • 🧑‍💻Modding Tools
      • ▫️Cyberpunk Engine Tweaks
        • 🦮Guides
          • ▫️Installing
            • ▫️Troubleshooting
            • ▫️Proton
          • ▫️Usage
          • ▫️Scripts
          • VS Code
        • 📄Reference Sheets
          • ▫️Config File
          • ▫️Font & font size
          • ▫️Uninstalling
          • ▫️UI Examples
      • ▫️MLSETUP Builder
        • 🦮Guides
        • 📄Reference Sheets
      • ▫️REDmod
        • 🦮Guides
        • 📄Reference Sheets
          • ▫️Commands
            • ▫️Deploy
            • ▫️Import
          • ▫️Usage
          • ▫️Structure
      • ▫️Redscript
        • 🦮Guides
          • Get Started
            • Download
            • REDscript in 2 minutes
        • 📄Reference Sheets
          • Language Features
            • Intrinsics
            • String formatting
            • Loops
      • ▫️Red4ext
        • 🦮Guides
          • ▫️Get Started
            • Installing RED4ext
            • Installing a Plugin
            • Configuration
            • Uninstalling
          • ▫️Creating a Plugin
          • ▫️Creating a Custom Native Class
            • Adding a Native Function
        • 📄Reference Sheets
      • ▫️TweakDB
        • ▫️TweakXL
          • 📄Reference Sheets
        • ▫️ArchiveXL
          • 📄Reference Sheets
        • 🦮Guides
      • ▫️WolvenKit
        • 🦮Guides
          • ▫️Getting Started
            • ▫️Download
            • ▫️Setup
            • ▫️Install
            • ▫️Uninstall
            • ▫️Create a mod
          • ▫️Custom Photo Mode Expressions
        • 📄Reference Sheets
          • ▫️Overview
          • ▫️Editor
            • ▫️Project Explorer
            • ▫️Properties
            • ▫️Asset Browser
          • ▫️Release Notes
      • ▫️WolvenKit.CLI
        • 🦮Guides
        • 📄Reference Sheets
    • ⚙️Utilities
      • ▫️010 Editor
        • 🦮Guides
        • 📄Reference Sheets
      • ▫️3DS
        • 🦮Guides
        • 📄Reference Sheets
      • ▫️Deep Asset Discovery
        • 🦮Guides
        • 📄Reference Sheets
      • ▫️Noesis
        • 🦮Guides
        • 📄Reference Sheets
      • ▫️Notepad++
        • 🦮Guides
        • 📄Reference Sheets
      • ▫️PixelRick's Save Editor
        • 🦮Guides
        • 📄Reference Sheets
  • Collaboration
    • Dashboard
    • 🤝Get Involved
      • Needed Documentation
      • Wanted Ads
    • 📅Meetings
Powered by GitBook
On this page
  • About
  • Composition
  • What is the mlmask?
  • What is the mlsetup?
  • MLSETUP Definition
  • What is the mltemplate?
  • Technical Details
  • multilayered
  • ​
  1. Support
  2. Glossary
  3. Files
  4. Red4 Shaders

Descriptions

PreviousDefinitionsNextIn-Game Objects

Last updated 2 years ago

About

A significant portion of assets for Cyberpunk 2077 leverage the complex multilayered.mt supershader. The supershader has several different component files which are used to create masks to blend procedural textures without baking them. You can read more about this technique in this documentation by CDPR Technical Art Director Krzysztof Krzyścin: ​

While the multilayered supershader is very common, there are hundreds of other non Substance-style shaders, some with traditional baked PBR textures.

Composition

The multilayered shader is composed of three distinct parts:

  1. Layer Masks | Mask textures that control where each surface is visible ​

  2. Layer Definitions | Controls procedural effects such as tiling or color for each layer ​

  3. Layer Surfaces | Links PBR textures to create numerous pre-defined visual surfaces ​

What is the mlmask?

MLMASK files are the core element of the substance-style integration. These files contain an array of up to 20 textures which are used to control the blending between pre-defined surfaces called mltemplates. These mask textures are more-or-less 1:1 with substance-style layer masks.

Demonstration of how mlmask files are used to mask meshes. Each mask represents a separate surface.

As shown above, each mesh using the multilayer shader uses a unique mlmask file that is hand authored by CDPR artists. To take effect in game, each mask file is linked by the mlsetup file.

What is the mlsetup?

MLSETUP files are fairly self-explanatory when considering the name, multilayer setup. These files correspond with an mlmask file and are responsible for setting up parameters for each layer from the mlmask. Each layer within an mlsetup contains information very similar to materials or shaders.

MLSETUP Definition

Property

Description

colorScale

material

matTile

Tiling multiplier for the main surface texture

mbTile

Tiling multiplier for the microblend texture

metalLevelsIn

?

metalLevelsOut

Clamps metalness output levels

microblend

Procedural detail texture

microblendContrast

Controls influence of microblend texture

microblendNormalStrength

Multiplier for adjusting normalblend strength

microblendOffsetU

Shifts UV map for microblend texture

microblendOffsetV

Shifts UV map for microblend texture

normalStrength

Sets intensity of mltemplate normal map

offsetU

Moves UV in X direction

offsetV

Moves UV in Y direction

opacity

Sets layer opacity

overrides

?

roughLevelsIn

?

roughLevelsOut

Clamps roughness output levels

What is the mltemplate?

MLTEMPLATE files are the actual visible surfaces that appear on meshes using the multilayered.mt supershader. The multilayer templates include a wide variety of surfaces such as steel, iron, aluminum, plastic, nylon, linoleum, carpet, soil, grass, rubber, concreate, and everything else imaginable. Each template can use a unique color, normal, roughness, and metallic PBR texture. The mltemplate files are selected from within each layer definition of an mlsetup file. Meshes can blend up to 20 mltemplate surfaces into a single material by masking them with the mlmask.

Technical Details

Multilayered Shaders

engine\materials\multilayered.mt

base\materials\multilayered_clear_coat.mt | Adds clearcoat effect

base\materials\vehicle_destr_blendshape.mt | Adds procedural vehicle damage

base\materials\cloth_mov_multilayered.mt

base\materials\multilayered_terrain.mt

base\materials\ver_mov_multilayered.mt

multilayered

Texture Channels

Red

Green

Blue

Alpha

GlobalNormal

Normal R

Normal G

?

?

MaskAtlas

?

?

?

?

Name

Description

MultilayerMask

See mlmask

MultilayerSetup

See mlsetup

GlobalNormalIntensity

Sets visual intensity of normal map texture

GlobalNormalUVScale

?

GlobalNormalUVBias

?

MaskAtlas

?

MaskTiles

?

Layers

?

LayersStartIndex

?

SurfaceTexAspectRatio

Sets number of mlmask layers to be used

MaskToTileScale

?

MaskTileSize

?

MaskAtlasDims

?

MaskBaseResolution

?

SetupLayerMask

?

NormalsTextureDDXYMultiplier

?

MicroblendsTextureDDXYMultiplier

?

​

File structure of mlsetup viewed with WolvenKit

Sets a color from within the file

Path to file

File structure of mltemplate viewed with WolvenKit
A sample preview of some materials created by mltemplate files
📘
▫️
▫️
▫️
mltemplate
mltemplate
https://magazine.substance3d.com/cyberpunk-2077-a-world-full-of-substance/
.mlmask files
.mlsetup files
.mltemplate files