Changing materials, colors and textures
Changing how an item looks in-game
Summary
Created by @manavortex Published November 05 2022
This guide will teach you how to change an item's appearance by editing its MultilayerSetup (*.mlsetup file), how to rename materials, and how add your own mlsetups (custompathing).
For a step-by-step walkthrough for a recolour of the Netrunner suit, check R&R: Colour Editing
It uses the following versions:
MLSetupBuilder >= 1.6.7 (get the latest release)
Most items in Cyberpunk are not textured, but use a procedurally generated material consisting out of an mlmask (a list of alpha masks) and an mlsetup (a list of material paths and -colours). There is a section on the exceptions below.
If you want to learn how mesh material assignment works in general, you can check the corresponding page.
For an overview of base materials and example files, you can check here.
If your changes do not become active, you will want to install Material and Texture Override from Nexus.
Video guide
Please keep in mind that video guides might be outdated, as they are much more difficult to update than a wiki page. Refer to the written guide below if you run into any troubles!
Step 1: Finding your item
This tutorial assumes that you already know which mesh and appearance you want to change. If you don't know that, you need to find the correct game file. If you only have a cheat code, see Spawn Codes instead.
We will use the female variant of the puffy vest (as I've already mapped and documented it):
Add the item to your project and open it in WolvenKit. You want the original to look up material names, even if you overwrite it with your own mesh.
Step 2: Finding the correct appearance
We will change the appearance bwstripes
, which is used by Vest_17_basic_01
:
chunkMaterials
corresponds to the chunkMasks
: For submesh_00, the material at array position 0 will be used, for submesh_01 the material at position 1, and so on.
This vest has only one chunkMask, so there's only one material.
Remember its name (ml_t2_002_ma_vest__puffy_bwstripes
) and find the corresponding material definition:
Most meshes have their materials under localMaterialBuffer/materials
. However, some of them (especially those with physics) use preloadLocalMaterialInstances
instead.
You will (hopefully) see a material with three entries in values
(order doesn't matter):
Key | Value (DepotPath) |
---|---|
MultilayerSetup |
|
MultilayerMask |
|
GlobalNormal |
|
For the purpose of this guide, all that matters is the mlsetup, which determines all the individual material assignments in this CMaterial. For an explanation of the shader, check here.
If you have your own mlsetup file, this is where you need to set tohe path. See custompathing for further details.
Most materials in Cyberpunk use the engine\materials\multilayered.mt
material and assign colours via an .mlsetup file. If you're used to textures, you are probably going to hate this. As somebody who has been where you are: the mlsetup system is cool. Genuinely. Give it a chance!
multilayered material
If you would rather use a textured material, check here.
A multilayered material consists of multiple layers of materials, projected on the mesh through the mlmask: white parts get affected, black parts are blocked out. (Again, for a full explanation, check here).
You can turn any multilayered material into its cyberspace variant by changing the material from engine\materials\multilayered.mt
to base\characters\common\cyberspace\silverhand_overlay_cyberspace_mml.mi
Exporting the .mlsetup
We're going to edit the mlsetup file and then import it back, causing a global change in the appearances of every item which uses this particular material file. (If you don't want that, see Custompathing below).
We do that by editing the MultilayerSetup. Check the MLSetupBuilder wiki page for how to do that.
Add it to your Wolvenkit project.
Step 3: Editing the .mlsetup file
For a documentation of multilayer properties, see here. For a list of reference images, check Multilayered: Previews
Export the file, overwriting the original
.mlsetup.json
Switch back to Wolvenkit
Right-click on the
.mlsetup.json
and import it from json.
This is already working. You can pack the project and see it in action!
Since you haven't changed anything in the mesh itself, you can (and should) delete it from your mod. Only keep it if you want to do the steps below.
Step 4 (optional): Custompathing
If you want to put up your own .mlsetup, rather than overwriting the original one, you can do that. All you have to do is changing the DepotPaths to the relative path of your mlsetup.
Keep your folder and file names unique! If you have two mods adding a file at the same location, the second one will be unable to overwrite it and will use the first mod's file. That is, unless your mods are in REDmod format, which will be loaded even later and in order of their folder names.
Understood? No? That's fine. Just keep it unique. :D
Step 5 (optional): Renaming materials
You can rename a material by changing the "name" property inside the CMeshMaterialEntry
in the materials
array:
Inside the appearances block, the material assignment to the individual submeshes happens by name, so don't forget to change the chunkMaterial
names!
Step 6 (optional): adding new materials
To add a new material to a mesh, you need to create two entries. The first of those needs to be in the materialEntries array:
Now, add an entry in the localMaterialBuffer.
If your mesh doesn#t have entries under localMaterialBuffer
, use preloadLocalMaterialInstances
instead.
You can now use your new material just like the regular, old materials.
Last updated