Skip to content

Latest commit

 

History

History

configuring-materials

description
How materials work, and how you can configure them

Material properties

Summary

Last documented update: Apr 20 2024 by manavortex

This page gives an explanation and overview about material properties. For more detailed explanation of a specific kind of material, please check the nested pages in the wiki's file tree, or check the "next" link at the bottom of the page.

Material properties

The properties of a material (or a shader) are defined in its shader file. Those files have the extension .mt or .remt and are widely used and extended.

{% hint style="danger" %} You should never replace a .mt or .remt — this will affect every single thing using the material.
If you want to change specific surfaces, look out for the right .mi file and change that, or create one and start custompathing. {% endhint %}

Checking material properties

{% hint style="success" %} You can find a wiki page with an overview of shaders under shader-docs.md, but it needs expanding. Maybe you'd like to contribute? {% endhint %}

You can see a material's default properties by opening the .(re)mt file in WolvenKit and inspecting the parameters array.

{% hint style="info" %} To find a shader template, use the Wolvenkit Search (you can copy the query):

yourMaterialType > .remt|.mt {% endhint %}

Any properties that you don't overwrite by adding them to your CMaterialInstance or .mi file will take the default properties specified in the file.

Here, you can also see what value a shader template will use if you don't give it any properties.

What do these mean?

The interesting bit is on the right side of the arrow in the picture above, since it specifies the type of parameter:

Type: CMaterialParameter…CKeyValueexplanation
VectorVector4A vector with X, Y, Z, W (coordinates and space). This is also used for colour values (Wolvenkit usually supports those).
TextureRRef:TextureA texture (.xbm) via DepotPath
ColorColorA color (RGB/color picker)
MultilayerMaskRRef:MultilayerMaska multilayerMask (.mlmask) via depotPath
MultilayerSetupRRef:MultilayerSetupa multilayerSetup (.mlsetup) via depotPath
ScalarCFloat/CDoublea numeric value with decimals. Float has 7 decimals, Double has 15
TextureArray???a texarray via depotPath
StructBuffer???
HairProfileRRef:.hpA hair profile (.hp) via depotPath

Transparency

Whether or not a material can be transparent depends on the shader. Transparency can be switched on/off via the EnableMask property, or clamped via AlphaThreshold (see #shared-properties).

Glow / Light

Whether or not a material emits light depends on the shader, e.g. metal_base.remt supports this via the Emissive texture property.
For a documentation of this, see emissive-material-properties.md.

Shared properties

This section will list properties that are common to many materials and give a short explanation of what they do.

Not all materials use all of these properties.

{% hint style="info" %} The same parameters can be named differently across different shaders (e.g the base texture can be called BaseColor, Diffuse, or Albedo).

Properties with texture paths can end in Texture, e.g. BaseColorTexture instead of BaseColor.

As this is a horrible mess, it is easiest to look up the properties in the shader if you're not certain. {% endhint %}

Property name(s)Explanation
LayerTile
LayerScale
Material scaling (zoom on surface)
> 1 zooms in, >1 zooms out
Roughness
Rough
Whether a surface is rough or smooth. White: full, Black: none
Metalness
Metallic
Whether a surface is metallic or not. White: full, Black: none
Normal
GlobalNormal
A material's bump map. Yellow normal maps are called swizzled.
BaseColor
Diffuse
Albedo
A material's base colour value. This is usually a colour, but it can also be a vector4. Wolvenkit usually supports this, but if you don't see a colour picker, please write a ticket (and use the color picker .blend)
AlphaThresholdClamps transparency. (TODO: how exactly?)
EnableMaskShould the material enable masking? (will use the diffuse texture's alpha channel)
MaskA mask (transparency) texture (like a layer mask in Photoshop)

Roughness/Metalness

A roughness/metalness preview. Yes, it's not a sphere.