# Material properties

## Summary

**Last documented update:** Apr 20 2024 by [mana vortex](https://app.gitbook.com/u/NfZBoxGegfUqB33J9HXuCs6PVaC3 "mention")

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.

* If you want to see a list of materials grouped by class, check [cheat-sheet-materials](https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/references-lists-and-overviews/cheat-sheet-materials "mention")
* If you want to learn how material assignments work on the object, check [https://github.com/CDPR-Modding-Documentation/Cyberpunk-Modding-Docs/blob/main/for-mod-creators-theory/files-and-what-they-do/file-formats/3d-objects-.mesh-files](https://github.com/CDPR-Modding-Documentation/Cyberpunk-Modding-Docs/blob/main/for-mod-creators-theory/files-and-what-they-do/file-formats/3d-objects-.mesh-files "mention")
* If you want to understand reusable material templates, please check [re-using-materials-.mi](https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/files-and-what-they-do/file-formats/materials/re-using-materials-.mi "mention")
* The **Modding Guides** section has multiple guides on editing materials, e.g. [changing-materials-colors-and-textures](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/items-equipment/editing-existing-items/changing-materials-colors-and-textures "mention") or [textured-items-and-cyberpunk-materials](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/textures-and-luts/textured-items-and-cyberpunk-materials "mention")

## 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](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/items-equipment/custompathing-assets).
{% endhint %}

## Checking material properties

{% hint style="success" %}
You can find a wiki page with an overview of shaders under [shader-docs](https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/materials/shaders/shader-docs "mention"), 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](https://app.gitbook.com/s/-MP_ozZVx2gRZUPXkd4r/wolvenkit-app/usage/wolvenkit-search-finding-files) (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.

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-3992f325d360d097d15b1dc66592026e6089935a%2Fmaterial_properties.png?alt=media" alt=""><figcaption></figcaption></figure>

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:

<table><thead><tr><th width="261">Type: CMaterialParameter…</th><th width="137">CKeyValue</th><th>explanation</th></tr></thead><tbody><tr><td><code>Vector</code></td><td>Vector4</td><td>A vector with X, Y, Z, W (coordinates and space). This is also used for colour values (Wolvenkit usually supports those).</td></tr><tr><td><code>Texture</code></td><td>RRef:Texture</td><td>A texture (.xbm) via DepotPath</td></tr><tr><td><code>Color</code></td><td>Color</td><td>A color (RGB/color picker)</td></tr><tr><td><code>MultilayerMask</code></td><td>RRef:MultilayerMask</td><td>a <a href="../multilayered#what-is-the-mlmask">multilayerMask</a> (<code>.mlmask</code>) via depotPath</td></tr><tr><td><code>MultilayerSetup</code></td><td>RRef:MultilayerSetup</td><td>a <a href="../multilayered#what-is-the-mlsetup">multilayerSetup</a> (<code>.mlsetup</code>) via depotPath</td></tr><tr><td><code>Scalar</code></td><td>CFloat/CDouble</td><td>a numeric value with decimals. Float has 7 decimals, Double has 15</td></tr><tr><td><code>TextureArray</code></td><td>???</td><td>a texarray via depotPath</td></tr><tr><td><code>StructBuffer</code></td><td>???</td><td></td></tr><tr><td><code>HairProfile</code></td><td>RRef:<code>.hp</code></td><td>A hair profile (<a href="../../modding-tools/wolvenkit-blender-io-suite/wkit-blender-plugin-import-export#hair-profiles-.hp">.hp</a>) via depotPath</td></tr></tbody></table>

## Material layering

A material's relative "z-index" is determined by the `materialPriority` property in the shader. Here is how it works:

If a material inherits properties from `base\materials\mesh_decal.mt` and has the enableMask checkbox enabled, it renders on top of materials without that option.

If EMP\_front is enabled, that material renders on top of those with enableMask.

If both enableMask and EMP\_front are enabled, the material covers everything.

If materials have identical settings, they start flickering when overlapping. However, this only seems to happen if one of them is opaque (possibly).

Submesh order in a mesh also matters. With identical material settings, whichever submesh gets loaded last will be on top, which means the higher the submesh number, the more on top it will be.

## 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](#shared-properties "mention")).

## 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](https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/materials/configuring-materials/emissive-material-properties "mention").

## 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](#checking-material-properties) if you're not certain.
{% endhint %}

<table><thead><tr><th width="236">Property name(s)</th><th>Explanation</th></tr></thead><tbody><tr><td>LayerTile<br>LayerScale</td><td>Material scaling (zoom on surface)<br>> 1 zooms in, >1 zooms out</td></tr><tr><td>Roughness<br>Rough</td><td>Whether a surface is rough or smooth. <strong>White</strong>: full, <strong>Black</strong>: none</td></tr><tr><td>Metalness<br>Metallic</td><td>Whether a surface is metallic or not. <strong>White</strong>: full, <strong>Black</strong>: none</td></tr><tr><td>Normal<br>GlobalNormal</td><td>A material's <a href="../../modding-guides/textures-and-luts/self-made-normal-maps">bump map</a>. Yellow normal maps are called <em>swizzled</em>.</td></tr><tr><td>BaseColor<br>Diffuse<br>Albedo</td><td>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 <a href="https://github.com/WolvenKit/WolvenKit/issues">write a ticket</a> (and use the <a href="https://github.com/CDPR-Modding-Documentation/Cyberpunk-Modding-Docs/blob/main/_resources_and_assets/blender/xyz_color_picker_for_cyberpunk.zip">color picker .blend</a>)</td></tr><tr><td>AlphaThreshold</td><td>Clamps transparency. (TODO: how exactly?)</td></tr><tr><td>EnableMask</td><td>Should the material enable masking? (will use the diffuse texture's alpha channel)</td></tr><tr><td>Mask</td><td>A mask (transparency) texture (like a layer mask in Photoshop)</td></tr></tbody></table>

## Roughness/Metalness

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-61b79059fb1ae40419b58df879836cf680cd73df%2Froughness_metalness.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2Fgit-blob-4650e9b5be439fddbfebca9a2df50ecd5d6c10d9%2Fmaterials_roughness_metalness.png?alt=media" alt=""><figcaption><p>A roughness/metalness preview. Yes, it's not a sphere.</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/materials/configuring-materials.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
