-
Visit LearnMMD.com on Facebook!.
Keep the Faith-MMD... Learn to be a responsible MMDer! .
.

Subtex slot for MMD models in PMXE


What is subtexture?  What is subtex?  How do I use subtex for MMD models?  How do I use addUV with MMD models?  What can I do with subtexture?

 

What the hecks is subtex?

Subtex is good for lots!

If you’ve played around with making MMD models, maybe you’ve noticed that you have three choices for sphere textures. Add spheres (.spa for Sphere Add) are great for making environment maps. Mult spheres (.spm for Sphere Multiply) are good for iridescence effects. But what is subtexture, and what is it good for? Just playing around with models won’t tell you much, because to be useful, subtexture relies on a infrequently used feature of MMD models.

At its most basic, subtexture is just an extra texture that gets accessed using UV coordinates and multiplied into your base texture.  (To contrast with a multiply sphere, which doesn’t use UV coordinates at all.)  You could do that in an image editing program like GIMP and save your sphere slot for something else, right? Sure. But if you have AddUV defined for your model, subtexture will use that different UV. That’s where subtexture starts to get useful.

In fact, subtexture’s interaction with UV is so important that if you’re not comfortable with UV mapping and how it works, you’re probably not going to get anything out of the use of subtexture.  If you need to review UV mapping, check out UV Unwrapping MMD Models in Blender and/or Everything You Never Wanted to Know about Textures.

Unethical uses of the subtex slot

Detail texture is subtexture

No matter how much memory your video card has, there always comes a point when you have zoomed in too far and your pixels start to look blurry. One technique to get around this is to use tiling textures. By repeating the same texture in multiple places, you can get more texture resolution than if you made a new image for every part of your model.

But what if you have some elements that repeat, but some elements that don’t? Or elements that tile in different ways? That’s what detail textures are for. They combine two different textures, one usually at a much higher scale than the other.

subtexture for detail textures
Here I’m using one UV map– my base UV map– to write the letters, which are tiled in one way, but I’m using my subtexture UV map, which is highly scaled, to add close detail to those letters.  If you want, you can download this chalkboard model to get a closer look at the textures and UV coordinates used.

Light maps are subtextures

Light maps are really just a kind of detail texture, but they’re common enough that they’re worth mentioning. In games going back twenty years or more, artists have combined high resolution, tiling texture images with lower resolution, non-tiling images representing lighting information in order to create convincing game levels.

Teto after hours

Here, this tunnel is getting tiling panel textures, but it’s being lit by a light map I baked from Blender onto add UV.  It might help if you compare the two textures being used and the UV maps using them:

 

Lightmaps and Lightmap UV

On the left, my wall texture is being tiled over many faces with overlapping UV.  But there’s no tiling on the lightmap UV on the right.  MMD combines the textures it reads from two different places, multiplying them in order to tile the wall but leave the lightmap untiled.

You can do this with a subtexture slot. Just remember that MMD’s single sun light will get affected by your lightmap too, which isn’t really appropriate. To disable MMD’s lighting, give your lightmapped material a 1.0 white ambient and a 0.0 black diffuse and specular.

PMXE no lighting

A note about MME

There is a long-standing bug in MME where MME doesn’t actually know whether to use add blending or multiply blending for subtexture– and so it uses whatever it used last for a sphere map! That means that if you use subtexture, you need to be careful to reset your sphere mode to multiply on the material immediately preceding the material with the subtexture. You could just use a throwaway plane to do this if you need to.  Notice how I made an extra material for my tunnel model above, set up to render before any of the other materials (but with its vertices well out of sight!)

Potentially, you could use this to create an add-blend subtexture, but it would only work for people using MME.  Subtexture is rarely enough used that many effects don’t bother supporting it.

UV Morphs with subtextures

One of the coolest things about subtexture is the potential for unusual UV morphs. Use of subtexture means you can morph two different textures in two different ways. You can use this to create transparency sliders that respect your original textures.

Idea rejected.

Because subtexture works by multiplying textures, and multiplication is commutative, it really doesn’t matter which is your main texture and which is your subtexture. So you can just exchange your texture with your subtexture and your UV with your AddUV to use a regular UV morph. But you can also create morphs that specifically target your AddUV. Make a morph as normal, then select AddUV2 from the drop-down and hit the >> button to Make It So. You could even combine an AddUV morph with an AddUV morph in a Group morph to get more complicated effects.AddUV for PMXE UV morphs

If Teto thinks her skirt is short enough already, we can use a UV1 morph with subtexture to slide our writing across a simple opaque-to-transparent texture, without sliding the actual letters.  Won’t Teto be excited!

Subtexture UV transparency morph

How do I get AddUV for my subtexture?

All of that is fine and well, but how do you get AddUV coordinates on your PMX model?

It’s possible in PMXE alone. Start by adding an AddUV channel to your model by selecting the number of add UV channels (at least 1 if you want to use subtexture) on the info tab.

Adding UV to PMX models with PMXE

Then you need to actually put some add UV coordinates on your vertices. You could enter those manually on the vertex tab, if you don’t have a lot of them. You can also copy from one UV map to another using edit->vertex->copy UV from the 3D window. And once you have some UV coordinates and morphs for them, you can write them using the transform window.

Copying add UV in PMXE

MMD Tools for Blender also supports add UV now, so you can also just create multiple UV maps in Blender. They’ll be exported to your PMX model in the order you create them.

AddUV for MMD in Blender

 

Self-promotion

 

Keep the Faith and credit your sources!  But if you can’t do that, share your models with the world!  You can download my Teto model if you want!


– SEE BELOW for MORE MMD TUTORIALS…




Visit the LearnMMD.com Homepage! Plenty of Mikumikudance instruction and info!

 

2 Comments

  1. July 23, 2018    

    I didn’t even know subtexture existed! Thank you for this great tutorial. You appear to have accidentally said Teto instead of Miss April.

    • July 23, 2018    

      Teto is Miss April! 0401, April Fool’s.

Leave a Reply

Your email address will not be published. Required fields are marked *

Download the latest version of MMD MikuMikuDance! Step-by-step instructions to help you make an MMD Music Video! bo-beep-bo-beep! LearnMMD's Step-by-Step MMD instructions for MikuMikuDance!

MMD Tutorials:


Really Learn MMD as you face the 15-second Animation Challenge!

Visit LearnMMD.com on Facebook!