Material / Texture path Basics
This guide aims to explain how material and texture pathing works. Without covering the more complicated topic of creating meshes, materials, and textures.
At a general level, most physical items in the game will have a model mdl
, some materials mtrl
and some textures tex
. For the sake simplicity, the below is referring to gear items, as other items may operate slightly different.
General Pathing
The game knows to link these files based on the following diagram. The model specified is materials, and the materials specify their textures. Because of this you can typically rename the material or textures as needed as long as the files that reference them are also updated.
Viera Ears
After testing more with viera ears. I was not able to get as much flexibilty with the names for the ear materials. Only specific names for the material files worked for me.
For example when putting a new material in the folder for Viera Ear 2. I originally named it the following which works fine.
chara/human/c1801/obj/zear/z0002/material/mt_c1801z0002_c.mtrl
But this name did not work.
chara/human/c1801/obj/zear/z0002/material/foo.mtrl
Oddly enough names poiting to the wrong race worked as I was able to get this to work.
chara/human/c1801/obj/zear/z0002/material/mt_c0801z0002_c.mtrl
I have not figured out why this works for gear items but not ears.
Example
As an example of how this works and how you can change the material and texture names around, lets look at the "Fingerless Gajaskin Gloves of Striking" item 591-5
.
The model for this item is located here:chara/equipment/e0591/model/c0201e0591_glv.mdl
.
Since this is variation 5
. Any new materials we may want to add will need to be in that variations folder:chara/equipment/e0591/material/v0005/
And the textures will all live in the gear items main texture folder:chara/equipment/e0591/texture/
Since materials reference textures by full path, the textures may not need to be put in this folder if you are adding new materials for a model. But it will keep things less confusing to just put them there for now.
If you are only overwriting the base textures and material, then you will most likely not need to change anything here. But say we want to add some new materials with their own textures.
Referencing New Materials
Here is a picture of a mod that takes the hand and cuts it up into three parts with different styles. We are going to use 3 materials for this mod. The first is the base bibo+ skin for the upper arm, the second is a material for the black band, and the third is a material for the transparent hand.
(This document is not going to go into the creation of this for simplicity, but this mod is essentially the bibo+ hand cut up into three parts to style differently with different materials, then imported into a glove item in game)
We are going to add 2 new materials and 5 new textures to accomplish this. Here is what our penumbra imports look like. The first item is our update model, then we have materials / textures for the band and the hand (ice). Notice the mod paths in green vs the game import paths in white. The text in the green paths does not matter to the game, where as the text in the white paths is very important for the game to find the files correctly. (Your mod file structure does not need to mimic the games file structure. For example the chara
folder could be named anything)
Now we need to tell our model about these new materials. Since we are updating variation 5, the model will look in the path chara/equipment/e0591/material/v0005/
for its materials. In the previous step we put our materials in this folder. The game will look in that folder for the materials based on the names we provide on this panel. So all we need to do is specify their names in the "Materials" section of this tab, then in the "Meshes" section we update the material for each mesh with the corresponding material we want to use. Mesh #1
is typically the body mesh, so it should be using the skin material for whatever body the mod is for. (In this example this gear mod will only work for the bibo body)
For the last step we need to go update the materials to point to the right texture files. Materials typically reference textures by their full path. Just use the white text file paths we created in the "File Redirections" tab to point to the right texture for each of Diffuse/Normal/Specular.
That's it, you should be able to redraw and see your new materials at this point.
No Comments