description |
---|
How to edit images and preserve transparency |
{% hint style="success" %} Rache Bartmoss once said: the first step to importing a texture is exporting a texture. {% endhint %}
{% hint style="info" %} For documentation on the Wolvenkit Import/Export tool, see here. {% endhint %}
- Add the texture you want to overwrite to your Wolvenkit project.
- If necessary, move and rename it. You should stick to the game's naming convention.
- Find the Export Tool (Tools -> Export Tool) and export the texture.
- You can now find a png file in your project's
raw
folder.
Editing textures is straightforward: just change them in your image editor of choice. The only hitch for reimport is the transparency.
{% hint style="info" %}
Wolvenkit supports the .dds file format, but since that is more complex, we won't talk about it here and stick to the .png
format.
&#xNAN;If you're using .dds files, you probably know what you're doing anyway :)
{% endhint %}
Paint.NET is a free image editing software for Windows. It supports PNG transparency out-of-the-box.
Use 32-Bit to get the highest available image quality.
To export with transparency in Photoshop, you need an alpha channel. Fortunately, creating one is simple. (For the initiated: The alpha channel is just a layer mask over the entire image.)
Find the Channels palette at the bottom right of your Workspace and add a new channel:
You now have an alpha channel.
Your image will turn black now, because the selected alpha channel will not have transparency yet.
{% hint style="info" %} To get your image back, select "RGB" on the Channels palette — but we'll stay on the Alpha channel for now. {% endhint %}
In the layers palette, use your image as selection by ctrl+clicking on the layer's icon:
Layer to selection
With the alpha channel selected, fill your selection with white to mark the transparent parts.
{% hint style="info" %} The fastest way to do that is to press d, x, delete {% endhint %}
You can now save your image as a PNG with transparency. If you have exported a texture in the first section, you should overwrite that file.
- Find the Import Tool (Tools -> Import Tool) and select your texture.
- If you have stuck to the game's naming convention, Wolvenkit will select the right preset for you. Otherwise, you need to select the right preset:
TexG_Generic_Color
for a diffuse/albedoTexG_Generic_Normal
for a normal mapTexG_Generic_UI
for anything that you want to use in .inkatlas files- … etc
- If your texture is upside-down, uncheck the box for
VFlip
. - Click the "import" button. Your
.png
will now be imported Into the.xbm
file.
Check #editing-a-texture and make sure that your texture even has transparency, then make sure that you have the corresponding box checked in the import settings.
Change Compression
to TCM_None
, then reimport
Your texture must be a square, and its size must be a power of two (512x512, 1024x1024, and so on).
If you want to know more about the theory behind this, you can read this external tutorial. Otherwise: just make it a square!
If you are importing a .masklist
, all images for the resulting .mlmask
must be the same size. Cyberpunk will crash otherwise.
Some textures need to be in a certain colour space (theory on wikipedia). For certain types of textures, the game requires certain colour spaces. Here's a list:
File type | required colour space |
---|---|
.mlmask / .masklist | Black and White / Non-Color |
{% hint style="info" %}
If you don't know how to achieve that, google something like
<name of your editor> color space <color space>
e.g. Photoshop color space black and white
{% endhint %}
Maybe your .mlmask
has gotten corrupted or is simply incompatible. Replace it with any mlmask from the game files and try a reimport.