Walkthrough of a Weapon Import - Silvris/wiki-page-making GitHub Wiki
This page will walk through the entire process of porting a pre-existing weapon model into Monster Hunter: World. This guide does not go through the processes of creating a model or creating textures, only utilizing pre-existing assets to import into Monster Hunter: World.
For this example, I will be importing Zenobia's Greataxe from Xenoblade Chronicles 2. Credits go to kurokairaku for extracting the model and textures from the game.
Importing and Exporting the Model
Begin by downloading Blender 2.79 and AsteriskAmpersand's Mod3 Importer/Exporter.
Additionally, downloading AsteriskAmpersand's Mod3 Toolbox can ease certain aspects of the process.
Import a MHW .mod3 by clicking the File button in the top left, then hovering over Import, and then selecting MHW MOD3.
Once you have the MHW model imported, import your own model and adjust it to match the proportions of the model you are replacing (quick Blender shortcuts-- G to translate/move the model, R to rotate the model, S to scale the model, pressing any of them then pressing X, Y, or Z will lock that transformation to the aforementioned axis).
Select the original MHW mesh, go into Edit Mode (by either pressing Tab with default keybinds, or by pressing the bar at the bottom of the 3D view), select all vertices (press the A key using default keybinds), and delete them. Select your imported mesh, then hold shift and select the mesh you just deleted the vertices of, then press Ctrl-J to join them. This is important, as it transfers the custom properties from the MHW mesh to your new mesh, and they are needed for the model to appear in-game.
Do this for as many meshes as your original model has. Any extra meshes can be deleted at this point.
Now, you will need to give the model weights. Aside from Switch Axe and Charge Blade, weapon weighting is rather simple, as it is weighted only to one bone. To quickly weight a model, go into Weight Painting mode, select Weight Gradient from the menu on the left side of the screen, and then just begin a gradient in the direction away from your model. This will give the whole model the maximum value for your weight as it is set on the side menu (defaults to 1.0). At this point, the model is ready for exporting, but before finishing this section, I'm going to detail the most important custom properties. These can be found in the same tab as the vertex groups/weights, and can have multiple effects on the model.
- Material - the name of the material in the mrl3 that the model should use. Having different materials is how you make models that use more than one set of textures.
- Shadow Cast - not too much important with this one, other than setting it to a value of 0 will cause the model to not render at all, and setting it to a value of 1 will make it not cast a shadow. Best to stick with defaults.
- Visible Condition - determines when the model should be rendered. 0 will have it always render, while on weapons, 1 and 2 are unsheathed and sheathed respectively.
- Weight Dynamics - not too important for weapons (as they have simple weights), but for models with more complex weights, a higher number will make the weights be interpreted "smoother".
FAQ:
- The exporter won't export my model! - Open the console by clicking on Window->Toggle System Console. The exporter will have output an error message detailing what you need to do to fix the issue it has with your model.
Setting up the Textures
I will be using Photoshop for this guide, but it should not be too hard to follow along using the Paint.net guide.
You will need to save your textures in .dds format, either through Paint.net, Photoshop, or Gimp. Additionally, Photoshop users will need to install a plugin to be able to open and save .dds textures.
Monster Hunter: World uses many different types of textures, but there are three main textures that almost every model has: BML, NM, and RMT.
BML textures are your standard diffuse textures. They define the color of the model, as well as transparency. This is the diffuse of the model I am importing. Most BML are saved as BC7 textures, as they have the widest range of transparency among the compression types.
NM textures are your normal maps. They describe the surface of the model, in a way that doesn't require editing the model itself. One thing to note about Monster Hunter: World's normal maps is that they are saved using BC5 compression, meaning they lack the blue channel commonly seen in other normal maps.
RMT textures are effectively four textures in one.
The red channel controls the roughness of the model, like whether it should be shiny or matte. The higher the value is in the roughness map, the more matte the section becomes.
The green channel controls the metallicness of the model. Higher values = more metallic. It should be noted that models with high metallic will often darken in color, and that full 255 metallic will cause issues with the game's rendering engine, a range around 190 to 220 is recommended.
The blue channel controls translucency of the model. Higher values will allow light to pass through the model, while lower values will block light.
The alpha channel of an RMT texture controls subsurface scattering, the effect where light enters a translucent (though not required for MHW) substance (most often skin) and exits the substance at a different point than it entered. Using it gives a soft tone to where light passes through the model, unlike translucency.
RMT textures are often saved as DXT1, although textures using subsurface scattering will need to save with BC7 compression.
Aside from these three main textures, there are several other types of textures:
- EM, or emission maps - these show where (and occasionally, how) a model should emit light. Saved with DXT1
- CMM, or color mask maps - these are used for a variety of functions, but for weapons, show where a Gunlance should emit while on Wyvernfire cooldown, show the indicator for a Charge Blade's current phial charge on the model, and where to emit light based on the Kinsect type on an Insect Glaive. On these three models, CMM will often also act as an emission map on RGB, and the CMM control will be in the alpha channel. Often saved with either DXT1 or BC7, depending on need of transparency.
- FM, or fur maps - these are used by the rendering engine to create a fur-like appearance in-game. The blue channel is the intensity of the fur effect on the area, while red and green are directional-controls.
- XM - a similar map to RMT, this texture is effectively three in one. The red channel controls the application of specular film, which changes how light hits that portion of the model. The green channel controls the application of cube and panorama maps. The blue channel controls wave emission, with darker portions of the texture emitting first then gradually growing up to the white portions of the texture when wave emission is enabled.
Once you have your textures saved, download Jodo's Texture Converter and drop all of your textures into it. There should now be an equivalent .tex for each .dds you selected.
Materials and Folder Setup
We're going to go ahead and set up our folders before working on the material, as there are some specifics that will save you some headache later. First, navigate to your installation of Monster Hunter: World. Then, should it not already be present, make a new folder named "nativePC". Inside that folder, make another folder named "wp". From there, you will need to make three more folders. First, one for the weapon type (in my case, "ham"). Inside that one, you need to make a folder for the specific weapon you are replacing ("ham031"), and then finally a "mod" folder within it.
Now, go back to the weapon type folder. You'll want to make another folder. The name for this folder should relate to your mod (in my case, "ZenobiaGreataxe"). This is the folder that is going to house your textures, for reasons I'll discuss later.
Copy your .mod3 into the "mod" folder you made earlier, and then copy your textures into your new texture folder. Then make a copy of the .mrl3 present in the original weapon's files and move it into the "mod" folder.
Download AsteriskAmpersand's Cras-T Material Editor and drag the .mrl3 into it. You will be met with a similar screen to this.
The first thing to talk about is the middle box. These are the actual materials present on the mrl3. The Library to the far left makes copies of materials within mrl3 that are added to it. You can then open one of these mrl3 and drag a material to your opened one to add it into your mrl3 (which I will be doing, since I will be using this weapon for another guide).
The box to the left of the materials are the resources. They are the paths to the texture files that the mrl3 should load. This is why I recommended you make a separate folder for textures. By moving them out of the weapon folder, weapon mods can be easily moved from one weapon model to another. You can double-click on a resource to rename it, right-click to delete it or add new resources, and you can use the Global Replace to replace all instances of a line of text ("wp/ham/ham031/ham031_") with your own ("wp/ham/ZenobiaGreatAxe/ZenobiaGreataxe"). Right-clicking also gives you the option to repoint a resource, which gets into the next subject.
The box to the right of the materials are the resource bindings. They define what texture should be used for what purpose. If you do not want a binding to be used, just bind it to a null texture (normally null_black, but certain bindings require special ones, such as null_RMT and null_NM).
It is very important you do not mess with the sampler bindings. Doing so will often lead to the entire file being broken, requiring you to restart the process.
The final major thing to talk about are the material parameters. There are two sets of parameters, the unknown parameters (on top) and the material parameters (on bottom).
The unknown parameters are not relevant very often, however they are capable of interesting things. The most notable use for them is the fifth parameter from the left on the top row. It controls the ability to use transparency from textures, set it to 7 for best results.
The material parameters often directly influence the bindings in some way. Notable ones:
- fEmissiveMapFactor_uiColor - controls both emission brightness and emission color (use ratios to figure out exact colors if needed)
- fMetallic, fRoughness, fSpecular, fSubSurfaceBlend, fTranslucency - controls whether to apply the aforementioned effects. Normally, keep the first 3 at 1 and the latter 2 at 0
- fAnimEmitMin, fAnimEmitSpeed - the minimum value for animated emission (set to 1 by default, disabling it) and the speed of animated emission
- fAnimEmitWave, bUseWaveEmit - the latter enables wave emission, which reads the blue channel of the XM to make a "moving" emission effect, fAnimEmitWave is a count of how many waves should be sent in one cycle
- fFurParam_uiUNorm - a set of four parameters that affect the application of fur based on the FurMap and FurVelocityMap bindings
- fFilmThickness, fFilmIOR - the former applies the specular film to the areas specified by the red channel of the XM, while the latter determines the index of reflection for the film, changing how it reflects light (normally represented by a change of color in that section).
- fRefraction_uiSNorm - applies refraction to the model based on the green channel of the XM map and the Panorama map
After you have made all of the changes you need, you are ready to save the mrl3. Press on the File button in the top left corner, and then hit Save. You are now ready to test your model in-game.