Skip to content

1.) Setting up your model

Manashiku edited this page Jun 28, 2023 · 3 revisions

Before applying the shader to your model in MMD or MMM you will need to do things in PMX Editor.


Applying the textures:

Because Genshin Impact models uses different types of textures, it is important to make sure theyre put in the correct material slots.

_Diffuse textures

These are your regular color textures and should be used in the Tex slot image

_Lightmap textures

These textures are the weird multicolor semi transparent textures. These contain important shadow, specular, metallic, and material region information. These go in the Sph/Spa slot. Make sure to also change the type to Sub-Tex image If the material youre applying this to is a face material the texture will appear slightly different If it is a face material, you can set it as either "x Multi-Sphere" or "+ Add-Sphere"
As of version 1.1.6, This is no longer necessary to set specific spheremap types. sub-tex, multi, & add are all treated as if they're the same flag image

_ShadowRamp textures

These textures are the smaller, skinnier textures that have different gradients. These are what the game uses to apply different shadow colors to the models. image


Using the Plugins

Installing the plug-ins:

In order to use the plug-ins you will need to copy them to your _plugin folder inside the PMXEditor folder.
image
Inside that folder there are 4 folders: CSSscript, Launcher, System, & User. I recommend creating a folder inside of User and putting both the MMDGenshin Helper plug-in and the MMDGenshin Material Generator plug-in inside of it. That way they're together and easier to find but whatever works for you.
If the plug-ins don't work you may need to unblock the dll or the original zip archive they were in.

Using the MMDGenshin Helper plug-in

Depending on where your model came from there are some special vertex data attributes that need to be remade.

Generating Vertex Colors

Vertex color refers to the per-vertex color data that almost all 3D engines support in some capacity. MMD and MMM however do not. Because of this it is necessary to store that data somewhere that both programs can access. Thankfully the PMX format supports up to 4 additional xyzw UV coordinate sets.
AddUV2 has been delegated as where the vertex colors will be stored.
The MMDGenshin Helper plug-in can generate a basic default set for you if your model doesn't come with this data.
There are two checkbox options available currently for vertex color generation:
1.) (blue underline) overwriting preexisting vertex colors. This can be used in case there were any errors in the conversion process or if by chance the plug-in displays the error that there already exists vertex colors when there actually doesn't. If the latter is the case, make extra sure that you aren't overwriting the proper vertex colors.
2.) (red underline) Replaces the vertex color alpha/w component with MMDs edge scale values image

Create IK bone for light information

Previous versions of the shader proved to be hard to use for people whose computers didn't support japanese language characters. Because of this, the new version of the shader will instead use an IK bone attached to the head bone to not only get the correct facing direction info for the face shading but for also fixing the face shadow incase it doesn't follow the light properly.
These bones are called light_link, light_target, light_offset.
Also created is a bone called light_rotate which can be used to change the light direction for the whole model instead of just the face. image

Creating a secondary set of normals for the outline

If you aren't using this model in MMM don't worry about this option.
Genshin uses two sets of normals per model. One for the diffuse shading and one set for the outline. While it isn't currently possible to get this data out of the game for the average person, there is a method to create an approximate recreation of them. The plug-in can help with this.
The first step in this process is to click the Copy button. This will copy the current normals to AddUV4.
Then, with all the vertices selected in PMXView, you will use the built in feature to average the normals by nearest vertice. This can be found in the PMXView window in the menu Edit(E)>Normal(N)>Average Normals - Near
Finally, you will click the Swap button to move the original normals back to being the current normals while also moving the new averaged normals to the AddUV4 block.
You will know it worked if you turn on the AddUV4 visualization in PMXView and see something like this: image

Creating shader morphs


MMDGenshin now supports 3 sets of model specific control morphs.
Those being model_dark, model_bright, model_r, model_g, model_b, shadow_dark, shadow_bright, shadow_r, shadow_g, shadow_b, specular_dark, specular_bright, specular_r, specular_g, specular_b.
Just simply press the Create button and they will show up in the morph box. You may need to add them to the display box if they arent added automatically. image


Once you've gone through and made sure all this has been done to your model, you're ready to move on to the next step