About this mod
Mainly for myself and my poor memory, or for anyone that could find it useful.
Notes I took related to skin, face and head editing.
- Permissions and credits
Small how-to's related to skin editing:
How to change texture paths of the head mesh:
So, check your head's entity for NormalBlend node:
CEntityTemplate->CEntity->CMimicComponent->CHardAttachement->CNormalBlendComponent
and edit texture paths in it's MaterialInstance.
For example, Triss' main vanilla head mesh:
characters\models\main_npc\triss\h_01_wa__triss\h_01_wa__triss.w2mesh
Is linked to this head entity:
characters\models\main_npc\triss\h_01_wa__triss.w2ent
And is set up to use this texture set:
characters\models\main_npc\triss\model\a_01_wa__triss_a01.xbm
characters\models\main_npc\triss\model\a_01_wa__triss_b01.xbm
characters\models\main_npc\triss\model\a_01_wa__triss_d01.xbm
characters\models\main_npc\triss\model\a_01_wa__triss_n01.xbm
And it can be adjusted in her h_01_wa__triss.w2ent in NormalBlend's MaterialInstance here:
If npc's head.w2ent has no NormalBlend enabled, you should be able to change it's material by editing head's xml or cooked mesh material, as you do with any other mesh.
How to fix weird lighting/shadows on your custom head mesh (made from scratch or imported from some other game):
The most convenient way of copying it would be to use Data Transfer modifier in Blender on some vanilla head mesh a source mesh.
What defines NormalBlend's (dynamic mimicking wrinkles) areas:
1) character's head's w2ent's NormalBlend node:
characters\models\main_npc\triss\h_01_wa__triss.w2ent
2) character's head's w3fac file:
characters\models\main_npc\triss\h_01_wa__triss\h_01_wa__triss.w3fac
They seem to be set in 2d space and related to UV coordinates. You can copy them to any npc for any other npc to alter their placement a little/
How to edit/enable/disable the "pore overlay":
Faces and bodies are also using that technique, but for pores and bumps on the skin. Here are paths to vanilla textures:
characters\models\common\textures\detailmaps_pbr\detailmap_skin_01.xbm
characters\models\common\textures\detailmaps_pbr\detailmap_skin_02.xbm
You can easily edit it's placement, strength and size. I'll use Triss' main head as an example.
> Placement:
pbr_skin material is using Ambient texture's Red channel as a map for DetailNormal's placement, where white=maximum influence and black=no influence, grey values are decreasing the strength of DetailNormal the closer to black they are.
Triss' Ambient texture's Red channel:
As you can see, DetailNormal's influence is the strongest on her cheeks and forehead, while on ears, nose, lips, chin and eye areas it's influence's is weakened. Painting areas closer to the edge of UV island darker is also a good idea since the tiling doesn't always correspond between them (example);
If you want to disable pore overlay, you can paint this whole channel black and that would do the trick.
>Strength & size:
as explained previously, for Triss, her head's material is set up in her head's entity file, and these are settings related to DetailNormal:
characters\models\main_npc\triss\h_01_wa__triss.w2ent
DetailAlbedoPower - ? yet unknown
DetailNormal - path to a tileable normal texture to be used as an overlay.
DetailPower - strength multiplier of that texture.
DetailRange - distance in in-game meters- from which that texture is visible.
DetailTile - UV projected tiling of that texture. Increase the numbers to tile it smaller, decrease to make them bigger.
For bodies, they are also using pbr_skin Material, and so, are, too, having DetailNormal texture in Ambient's Red channel.
To edit Material properties, you should edit body mesh' Material.
List of most used base skin materials:
pbr_skin_decal - an exact copy of pbr_skin, but with an addition of possible color overlay. Mainly used for tattoos, but also can be used for blemishes, wounds, or warpaints.
Has some tricky bits.
pbr_skin_normalblend - for mimicking wrinkles overlay.
pbr_skin_simple - used for lod meshes. Not useful.
pbr_skin_morph - for rare occasions when npc is changing face meshes on the fly. Like Regis or Dettlaff.
List of skin materials' shader settings:
Diffuse - Diffuse texture path (name_d.xbm in vanilla)
Normal - Normal texture path (name_n.xbm in vanilla)
Decal - exclusive to pbr_skin_decal materials; Decal overlay texture path
Decal_contrast - exclusive to pbr_skin_decal materials; seems to control the strength/opacity of Decal overlay
DetailNormal - Detailmap texture path (many of those textures are in characters\models\common\textures\detailmaps_pbr folder);
DetailAlbedoPower - ?
DetailPower - strength/opacity of detailmap texture
DetailRange - distance from which detailmap becomes visible
DetailTile - tiling/size of detailmap
SpecularColor, SpecularColor2 - rgb=color, a=opacity; self-explanatory; in vanilla, SpecularColor is less strong, while SpecularColor2 has blue tint to it and is most noticeable in shadows or dim lighting.
RSpecBase, RSpecBase2 - base amount of SpecularColor that is present at all times
RSpecScale, RSpecScale2 - maximum amount of SpecularColor
SpecularPower2 - only available for 2nd set;
RoughnessBias, RoughnessBias2 - ? presumably, basic roughness amount applied at all times
SSAOImpact - controls the strength of SSAO that could be applied;
ReflectionGainScale - ?
VarianceColor - rgb=color, a=opacity; coloring that affects the whole mesh
VarianceOffset - strength of said coloring;
TranslucencyFresnel - ?
TranslucencyFresnelGain - ?
AntiLightbleedScale - ?
AntiLightbleedUpOffFront - ?
AntiLightbleedUpOffRound - ?
DiffuseBumpinessAngleExp - ?
DiffuseBumpinessSteepLight - ?
DiffuseBumpinessStraightLight - ?
EnbProbeBumpiness - ?
SSS_CoarseColor - ?
SSS_CoarseColorInvRange - ?
SSS_CoarseWrapBase - ?
SSS_CoarseWrapScale - ?
SSS_DetailColorBleed - ?
SSS_DIffuseDistribpow - ?
SSS_DiffuseScale - ? bigger numbers make the mesh glow lmao
Texture maps:
Normal - rgb
NormalBlend - rgb - normalmap for mimicking wrinkles; their strength and placement are defined by "NormalBlend areas" parameter; it doesn't seem to be easily editable, but overall it seems to be tied to UV coordinates on textures;
some npcs are reusing others' NormalBlend textures (for example, Cerys is using characters\models\main_npc\triss\h_01_wa__triss\h_01_wa__triss_b01.xbm);
a - ? presumably AO
Ambient - 3 maps combined into one file for compression purposes, most likely;
r - DetailNormal and Decal distribution; white=enabled, black=disabled;
(DetailNormal texture for skin is usually a "pore overlay" (characters\models\common\textures\detailmaps_pbr\detailmap_skin_01), and you can change it's size and strength in material settings; the Red channel map only defines where they are present or not present;
g - presumably Glossiness (?); white=less, black=more;
(Glossiness tends to be less visible on pure black areas of Specular map)
b - presumably Specular(?); black=less, white=more;
(in some lighting/weather conditions, specifically in shadows or in other scenarios when there is no direct light, Specular influence is the most noticeable.
Most vanilla maps tend to paint "shadows" in, so that some areas always appear shadowed compared to lightened parts; like scalp, jawline, or eye sockets. Vanilla maps also darken the areas that are supposed to be black or overall dark.
Brighter areas can appear to have a rather metallic? grey-ish shine to them, so make sure to balance it)
example of overdone lightness of this map on the lips:
Decal - rgb - grey=disabled; any other color=enabled;
an overlay that goes over Diffuse, Normal, and Ambient channels, and adds another colored layer to it.
!important!
Ambient's red channel also affects the distribution of Decal! So if you would use vanilla Ambient map for regular body, areas like neck, nails, or nipples would not be affected by Decal texture
Important mesh features:
Vanilla head meshes have a Vertex Color layer roughly looking like this:
Lack of this coloring would result in broken shadows on the head, so make sure to copy it from vanilla mesh.
Bodies
Body meshes also have a Vertex Color layer, though it's usage is not clear. I only noticed that for pbr_skin_decal material, white areas are shaded differently from red areas:
left - Vertex Color of vanilla female body; right - vanilla female body using pbr_skin_decal material in game;
Heads entity structure:
Heads entities are composed from numerous assets with technical info on top. Problem is, some settings are duplicated, and some parts have confusing workarounds to work with, so I decided to also include it here since it's so easy to screw up.
Simplified map of content of a regular head.w2ent:
CMimicComponent -> rig.w3fac skeleton path
^ head.w2mesh path (head mesh, head material)
^ (optional) NormalBlend enabler, NormalBlend's areas of effect, NormalBlend's texture path & material applied to head.w2mesh
^ he.w2mesh path (eye, eyelashes, teeth and tongue meshes & materials)
^ (optional) hb.w2mesh path (beard, eyebrows haircards & materials)
rig.w3fac
vanilla example: characters\models\main_npc\triss\h_01_wa__triss\h_01_wa__triss.w3fac
Contains slightly adjusted bone positions compared to basic .w3fac. Most unique characters have own .w3faces or are reusing some specific ones. So simply swapping head.w2meshes between for example Triss and Yennefer with no changes to .w3fac link would end up looking horribly, as both have own unique .w3fac in vanilla.
Important!
Also has an instance of NormalBlend's areas of effect settings.
head.w2mesh
vanilla example: characters\models\main_npc\triss\h_01_wa__triss\h_01_wa__triss.w2mesh
Though it has material settings and it could even be numerous materials applied, NormalBlend's material from head.w2ent _will always overwrite them_. Every mesh you import as a head.w2mesh would use material settings from head.w2ent (presumably) on top of their own OR (possibly) instead of own. Needs more info.
If you ever tried using other texture path than in vanilla and game then reverted it back on test, know that it was NormalBlend's settings in head.w2ent screwing your work :/
he.w2mesh
vanilla example: characters\models\main_npc\triss\h_01_wa__triss\he_01_wa__triss.w2mesh
Applies materials for each part independently:
eyes
eyes' shadow overlay
teeth
caruncle
eyelashes
Has different set of bones compared to head.w2mesh. Some vanilla meshes have corrupted armature on export, for example, Yennefer's he_ armature rotates her right eye backwards for some reason.
Can be fixed by manually rotating the bone back on place (counter clockwise) :')
hb.w2mesh
Hair cards for brows & beards in vanilla.
Uses same bones as a head mesh, and also supports any number of materials. Can be useful for adding other accessories here instead of head.w2mesh.
NormalBlend component in head.w2ent
tricky bastard caused me some grey hair RRREEEEE
anyways, is enabled in head.w2ent, sets up it's areas of effect in head.w2ent AND in .w3fac, and also has own Material settings that are overwriting ones in head.w2mesh
So make sure to keep an eye on it.
My other mods:
Elle Fanning as various characters
Prototype Yen
Bathsebah's Anna Stenger Improevements
Bathsebah's Keira Metz edits
Bathsebah's Book Jaskier
Tomira's Less Potato
Spooky Yennefer
Triss (G)Lorified
Triss (G)Lorified Wardrobe
Legacy Triss Makeover
Somewhat Ciri
My guides and resources:
Skin Editing Notes
Hair Editing Notes and Tutorial