MMD Fill Lights Part 2 – (Ray-MMD)

MMD Fill Lights Ray-MMD... Raycast/Ray-MMD is an awesome tool!

MMD Fill Lights Part 2 – (Ray-MMD)

Welcome back if you’ve read Part 1 of this series. But if you did not, no matter as this part will deal specifically with the application of fill lights in a Ray-MMD environment. I will be using some terminology and concepts introduced in the last part but this article can otherwise be read on it own.

Choosing the right models to use with Ray-MMD

Many models, especially the older ones like the default models do not look nice when you try to render them with Ray-MMD. However, the TDA style models, of which there are probably hundreds of variants, generally do work well. If you are new to MMD but want to use Ray-MMD, stick with the TDA style models until you have a better understanding on how the system works and its limitations.

Also, many models may need some editing work done on them to make them accept material specifications properly. TDA style models, generally are made from many separate parts so in general do not have these issues as individual materials can be easily isolated.

Also as a general rule, MMD models that uses texture maps to define their materials works best.

So let’s choose a model for our project…

Since it is summer and I have a weakness for Japanese anime girls in traditional costumes (if you haven’t figured that out already), I’m going with this one:

Tda MEIKO Yukata (edit by Murabito124)... a beautiful model!

Tda MEIKO Yukata (edit by Murabito124)

An important consideration about presenting your models

There is an important consideration that is applicable to most MMD applications, but arguably more so when you’re using it with Ray-MMD.

When you are working with still imagery there are no distractive elements such as the model doing a song and dance routine. People are going to be looking hard at your presentation. And when they do, if there are any flaws they’re going to pick up on it.

Yukata’s are special in Japan. There are considerations on how these dresses are worn, how they drape over the body and how they are presented. So, before I even posed Meiko, I did some research on the Internet to understand how real Japanese women wear and move in them. It is a light attire, but still a constrictive one so that mandates that the wearer moves in certain ways. So the pose Meiko uses is authentic because it is based on a stance adopted by a real woman wearing a yukata.

Why else is this important?

Ray-MMD is “photo-realistic“. So if something looks off, it will really look off. If you add fill lights into the equation, it only gets worse. So the best strategy when doing your poses is to do your research and pose the whole body. Doing this ensures that the model’s posture is correct regardless of how you crop your shots.

Models and resources you will need if you want to work along with the step-by-step tutorial

This will be one of the more complex Ray-MMD tutorials since to fully explain how to use fill lights using this system is necessarily lengthy. It is not hard, just that there is a lot of factors that you need to put together correctly to make these work well. So if you’ve never done this before it is worth working along with this tutorial. Once you “get it“, you’ll find that the process is actually really very easy.

You will need the following models:

  1. Either the Meiko model above or some other anime girl in a Japanese type costume.
  2. Specifically the Kyoto stage by Anonymous User(?)

If you want the pose used above you can get it here; but you can always make your own if you prefer.

With both models it is highly recommended that you use the PMXeditor to ensure that at least their materials list reads in English. If you do not know how to do this, I believe the method has been covered in another tutorial here on LearnMMD. If not, use Google to find one. This is not mandatory, it will just make things a lot easier.

You’re going to need the following software and effects:

  1. MMD
  2. Ray-MMD
  3. Either Diffusion7 or one of the equivalent Gaussian effects (optional)

Enable Bokeh Depth Of Field

(This next part is optional but highly recommended; my set up uses this option enabled)

You will need to edit one line of your ray.conf file so that Bokeh Depth Of Field is enabled. Use a text editor like Notepad or Notepad++ to do this edit. Simply change the last line to read as shown below.

Adding Fill Lights to your Ray-MMD renders

This tutorial will be assuming that you know at least the basic steps on how to use MMD and Ray-MMD. If not please read some of the beginner tutorials first.

The following are techniques that you will not easily find published elsewhere so load up MMD and add the following models. Preferably in this order but if not, sort out the model draw order so that it follows the order presented in the list below:

  1. Time of day.pmx
  2. The Kyoto stage (清水風固定影なし.pmx)
  3. Your yukari attired model

VERY IMPORTANT NOTE: The Kyoto stage comes in two versions. One with faux shadows and one without. Use the version without faux shadows. This one is labeled: 清水風固定影なし.pmx

With everything loaded you should see something like this on your MMD screen:

MMD Fill Lights Ray-MMD... This scene is so flat... wait until you see what Ray-MMD can do!

Setting up the scene

We’re going to turn the stage 180 degrees to get another view for our scene. You can do this either manually or by entering the requisite value into the y-axis field.

Next add or make a pose for your model. This version of Meiko has a slider that allows you to change the texture map of her yukata (浴衣) and obi (帯) as well as one that changes the texture map of the water balloon so she can have a matching set. Choose whichever you like, but the technique discussed here will be assuming a light colored ensemble.

Your scene should now look something like this. You can also turn off the axis display. Also you must turn off MMD’s default ground shadow.

Be sure to turn off MMD's ground Shadow. ... what a beautiful pose!

Setting up Ray-MMD

  1. Load the ray_controller and ray.x.
  2. Add main.fx to both Meiko and the stage under the MME panel Main tab
  3. Add Time of lighting.fx to the skybox under the EnvLightMap tab
  4. Add material_skybox.fx to the skybox under the MaterialMap tab

You should now see something like this:

Fixing the sky

The Kyoto stage comes with it’s own skybox which we will need to knock out. This is easy to do. Simply identify the materials for the sky and the clouds under both the Main and MaterialMap tabs in the MME panel. Un-check the check boxes under both tabs and they will not display; this will reveal the Time of day skybox. These steps are mandatory.

My material list for the Kyoto stage may look different from yours, but that is because I took the extra step to translate the materials list using the PMXe Editor. But if you did not bother to do this, just reference the number next to the label to identify the relevant materials. (#11 / #12)

Go over to the Time of day controls and set both Cloud+ and CloudTurbidity+ to their maximum value so that the clouds will be visible. At the end of these steps, your scene should look something like the image below.

The background is blurred due to the Bokeh DOF effect, but this can be easily adjusted at a later stage in this project.

Setting up the Key light

We will be using the Sun as the Key light since this is an outdoor scene. What we be doing is to adjust the position of the Sun and you will do this using MMD’s own light controls (the sliders at the bottom of the light manipulation panel).

To accomplish the next step you may want to change your view, so do whatever is comfortable.

There are some trees at the top of the path that Meiko is walking on, and this is the main reason why we turned this stage around. What we want to do now is to angle the sun so that it is shining through the trees and throwing their shadow on to Meiko’s yukata. Be careful that you don’t cast the shadows from the buildings on to her as well.

What you want to achieve is something like what is shown below. It should look absolutely gorgeous even without the other tweaks that we will be doing.

Note: holding the CTRL key while using the mouse on the lighting controls allows for more precise control.

The play of the shadows on the yukata makes it looks so soft and light. MMD Ray-MMD Raycast adds so much "reality"!

Isn’t that lovely? The play of the shadows on the yukata makes it looks so soft and light. You can almost feel a gentle breeze under the shade of those trees.

But we’re not done by a long shot…

Fixing the color temperature

At the moment, using the default values, there is too much blue in the light spectrum. Since this is a summer day, we want will want to raise the color temperature. While we are doing that we will fix some other issues as well such as correcting the depth of the shadows and the color saturation.

The values I am using are subjective. They are not a rule, so feel free to do otherwise if you prefer a different feel to your project. In all cases, when you make adjustments, make sure that the SELECT button is OFF and the TRACK button is ON. This will allow you to see your changes dynamically as you make them.

These were the values I used, just regard them as guidelines so feel free to experiment:

Time of day values

  • RayleighColorV-: 0.15
  • RayleighHeight+: 0.55
  • EnvDiffLight+: 0.30
  • EnvSpecLight+: 0.50

Ray_controller values

  • SunLight+: 0.25
  • SunShadowV-: 0.35
  • Exposure-: 0.15
  • Contrast+: 0.20
  • Saturation+: 0.25
  • Gamma-: 0.05
  • Temperature+: 0.25

Your scene should now look similar to the one shown below. The colors are warmer and richer; the play of shadow and light is much more pronounced. This is how to create a Kodachrome look using Ray-MMD. (Kodachrome was a professional film that’s no longer manufactured but it used to be an industry standard; it was noted for its ability to retain rich colors).

Don’t worry about the harsh shadows on Meiko’s face; we will get to those in due course. Note that to help better illustrate the process, I am using screen captures that focuses on Meiko, but in reality I am actually working towards a full screen (1920 x 1080) high definition end result.

Add your materials to the models

This is a good point to add material specifications to your model; do whatever you want here with the Meiko model. The standard materials will work fine, but I will be using some materials by AONS. However, some materials on the model you might want to hide such as possibly the high-lights as they can look fake. But you will definitely want to hide the faux hair shadow which does not look right when using Ray-MMD. To hide a material just un-check it in the MaterialsMap tab.

Be careful with your choice of materials for the Yukata and Obi. These use either soft cotton or silk fabric which are both very fine. You do want some bumping but it should be subtle. Just using the default materials for these would be fine also as the texture maps already suggest the type of fabric used. The advantage of using the bump maps is that kills off some of the shine which would more accurately reflect the real material.

Note that I hide anything that won’t be seen. This saves the computer from having to do unnecessary work.

As for the stage model, if you want to take the time to find or make materials for it, have at it. I’m too lazy to bother but one thing you should do is to kill some of the shine coming off the stone walls and paving. There is a simple trick to this and that is to add material_skin_melanoderm.fx to them. Apply this to material subset #0, #1 and #9.

With these settings done the results should look something like the image below. The next step is to eliminate those harsh shadows on Meiko’s face which is where the use of fill lights come in.

Ray-MMD fill lights

In the Lighting folder there are several types of user configurable emissive lights that you can add to the Ray-MMD environment. For our purposes we are only interested in two types:

  • PointLightIES.pmx
  • SpotLightIES.pmx

These work similarly in that you load them, point them and then configure them. You can experiment with the other types on your own but in my own experience some of the other types can be problematic.

The main difference between the two lights we are going to use is that you can focus SpotLightIES. This makes the application of this light situational but incredibly useful in the correct application. We will have need for one here.

Basic application method

  1. Load the light
  2. Each light has two important bones (ignore the others), a root bone and a IK-directional bone
  3. To point the light, simply drag the directional bone in the desired direction

However, there is a simpler way. Simply OP attach the directional bone to one of the bones on the target model. This way it makes it much easier to point the light and it will always follow the model. Most usefully you will normally want to:

  1. Attach to the head bone if the light is shining from above
  2. Otherwise attach it to the neck bone

These lights do not cast extra shadows by default, but if you want shadows, you can specify them and specifically how heavy a shadow you want. All this will make much more sense once we do an actual set up. However, the light widget itself does cast a shadow and this should be disabled.

Fill Light Strategy

The strategy described here applies to this scene; other scene will require different strategies.

Our issue here is:

  1. Too much shadow on Meiko’s face
  2. We want to retain the shadows on her yukata

So basically, we have opposing requirements, but no problem…

We will use a single PointLightIES to be the primary fill light and this will be located to her right. We will then add a single SpotLightIES to her left side to augment and make up for the short falls of the key light.

Whenever you use fill lights, in general you want to be as subtle as possible. If it looks fake it will look bad. There is both a science and art to adding these lights but mostly this comes with experience. If you have any photographic background, these concepts will be second nature.

Adding PointLightIES

  1. Load a single instance of PointLightIES.pmx
  2. Attach it’s direction bone to Meiko’s neck bone using the OP function.
  3. Set the RGB colors to all to read 0.50 which gives us a neutral gray light color.
  4. Set the axis to GLOBAL mode and then move it to her front and right so that it has a 45 degree angle of attack, approximate is fine.
  5. Under the LightMap tab in the MME panel, swap out the default with IES_lighting_with_shadow_medium.fx
  6. The quality of the light is set using:
    1. Intensity-: 0.20
    2. BulbAttenuation-: 0.15
    3. MultiLight-: 0.30 (this setting is on the ray_controller panel)
  7. Hide the light by un-checking it’s display check boxes in the MME panel (using the same method to hide the stage’s skybox) and hide it’s shadow by deselecting the shadow button on the model manipulation panel.

Note 1: 6.3 controls the shadow specified in step 5. If you don’t change this value, you won’t see any difference.
Note 2: The position of the light source can be adjusted to “get it just right“, so feel free to move it. Just remember that moving it might require that you make additional tweaks to the settings.

If I haven’t completely confused you, then your scene should now look something like the image shown above. Additionally, if you didn’t tell anyone, no one should have guessed that a fill light was used. This is exactly what you want.

Add SpotLightIES

Adding the this light uses an identical procedure.

  1. Load one instance of SpotLightIES.pmx
  2. Attach it’s direction bone to Meiko’s neck bone.
  3. Set the RGB colors to 0.50
  4. Move the light into a position to her left and front. Aim for her lower jaw, which is where the shadows are harshest.
  5. Under the LightMap tab in the MME panel, swap out the default with IES_lighting_with_shadow_high.fx
  6. This light has a “beam” which can be focused using the angle+/- variable so the settings I used were:
    1. angle-: 0.15
    2. intensity+: 0.30
    3. AttenuationBulb-: 0.15

The values you use will largely be determined by where you placed your SpotLightIES. But because now we have two fill lights in the equation we need to revisit the settings in the Ray_controller panel to fine tune the settings to get things to look right.

  1. MultiLight-: 0.50
  2. SSAO+: 0.40
  3. Gamma-: 0.20
  4. Temperature+: 0.40

Once the adjustments were all made, the light was hidden using the method described previously. The images below shows the end results.

A closer view of Meiko’s face and upper torso, shows how the harsh shadows are now all gone giving her face a much more gentle play of shadow and light. We also managed to retain the natural shadows from the branches of the tree and her hair. Note that I triggered her faux eye highlight to show again to give some sparkle to her eyes.

The Finishing Touches

Now that we have all the lighting elements in place and correctly set up, we can now add the final flourishes to our project. Most of these steps are optional so, just use them as suggestions.

  1. Add Diffusion7 to soften the scene making it feel more gentle. This effect will saturate the colors. If you don’t want this you can either adjust the saturation levels using the ray_controller. Alternatively, use an equivalent effect like o_diffusion which by default does not change the color depth.
  2. In all cases, due to our other adjustments, the shadows around the buildings are probably too dark and we have lost a lost definition in these areas. To compensate for this, using the ray_controller, set these values: SunShadowR+/B+/G+: 0.20
  3. If the transparencies used by the background trees are giving you issues, try temporarily changing the view to force MMD to redraw the scene. But if it remains unstable, try adding: o_disAlphaBlend
  4. Once all these are done set up your final view and lock it. Note that you should also set the View angle of your MMD camera at this time. By default it is set to 30, bringing it down will make the view “telephoto“. This works really nicely as it reinforces the perception of 3D space which you really want here due to the depth of the stage.
  5. With this done, go back into the ray_controller panel to set up the depth of field settings. I am not going to explain these settings in any detail. Just play with them and it will be pretty obvious what each control does.
  6. The final settings used were:
    1. View angle: 18 (camera panel)
    2. Exposure-: 0.35
    3. Temperature+: 0.40
    4. AttenuationBulb-: 0.35 (SpotLightIES)
    5. Fstop-: 0.50
    6. FocalLength-: 0.70


Nothing written here is set in stone. The settings used in the tutorial are merely sufficient to illustrate the method. After I wrote the main segments I went back to rework the settings basically to show that by being willing to make adjustments after-the-fact, you can get very different and possibly better results.

The following two images are thumbnails for 1920 x 1080 high resolution renders. Just click on them to see the original full screen renders. Ray-MMD is really flexible so it does pay to play around with settings to try to get the best results possible.

Note also that the final positions of the fill lights are different here with these two shots. Moving these lights around can have a dramatic difference on the final outcome.




Meiko: Murabito124 (
Kyoto Stage (清水風ステージ): Anonymous User (

MMD 9.32

Ray-MMD 1.5.2
Diffusion 7
Materials by AONS



Visit the Homepage! Plenty of Mikumikudance instruction and info!