Skip to content

Latest commit

 

History

History
94 lines (60 loc) · 7.69 KB

File metadata and controls

94 lines (60 loc) · 7.69 KB
description
Substance Designer 2077: How it works and why it's actually super

Multilayered: Cyberpunk's supershader

Why can't they use textures?

Everyone asks this question in the beginning, but you're only a single epiphany away from a change of mind. The multilayered shader can pack up to 20 layers of texture into a single file! Read on to find out how it works.

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.

{% hint style="info" %} While the multilayered supershader is very common, there are hundreds of other non Substance-style shaders, some with traditional baked PBR textures. {% endhint %}

{% hint style="success" %} For a list of shader properties in multilayered.mt, see multilayered-material-properties-1.md

This wiki contains multiple guides about editing multilayered materials, such as:

Composition

The multilayered shader is composed of three distinct parts:

  1. Layer Masks | Mask textures that control where each surface is visible
    .mlmask files
  2. Layer Definitions | Controls procedural effects such as tiling or color for each layer
    .mlsetup files
  3. Layer Surfaces | Links PBR textures to create numerous pre-defined visual surfaces
    .mltemplate files

{% hint style="info" %} For editing mlsetup files, you'll want to use the MlSetupBuilder (download) {% endhint %}

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 will apply to a separate material layer.

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.

To edit .mlsetup files, it's recommended that you use the mlsetup-builder software.

{% hint style="info" %} For a definition of the properties, see multilayered-material-properties-1.md.

For a guide on how to edit one, check r-and-r-colour-editing.md. {% endhint %}

File structure of mlsetup viewed with WolvenKit

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.

File structure of mltemplate viewed with WolvenKit

A sample preview of some materials created by mltemplate files

An example how colour and roughness affect the material in-game

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 ChannelsRedGreenBlueAlpha
GlobalNormalNormal RNormal G??
MaskAtlas????
NameDescription
MultilayerMaskSee mlmask
MultilayerSetupSee mlsetup
GlobalNormalIntensitySets visual intensity of normal map texture
GlobalNormalUVScale?
GlobalNormalUVBias?
MaskAtlas?
MaskTiles?
Layers?
LayersStartIndex?
SurfaceTexAspectRatioSets number of mlmask layers to be used
MaskToTileScale?
MaskTileSize?
MaskAtlasDims?
MaskBaseResolution?
SetupLayerMask?
NormalsTextureDDXYMultiplier?
MicroblendsTextureDDXYMultiplier?