Skip to content
Learn MikuMikuDance – MMD Tutorials – Free 3D Animation Software

Learn MikuMikuDance – MMD Tutorials – Free 3D Animation Software

Download Free Animation Software – Let's Learn How to Do Everything!

  • Step-by-Step MMD instructions
  • DOWNLOADS
  • Troubleshoot, Fix MMD
  • Site Contents
  • Reggie Replies Q&A
  • Homework!
  • What IS MMD?
    • Download MikuMikuDance Newest Latest Version of MMD
  • “HOW TO”
    • Raycast RAY-MMD Effect Tutorials
  • BONUS PAGES
    • Why convert PMD models to PMX?
  • HALL of CHAMPIONS
  • Tutorial Categories
  • About
    • Privacy Policy
  • Toggle search form
  • MMD Cell Phone Screen Video
    MMD Cell Phone Screen Video Creation… just for that vertical screen! Cell-Phone Video
  • Copy and Paste for Repetitive Motion in MikuMikuDance Functions-Copy-Paste-Expand
  • MMPlus has many safeguards that will save you time as you work with MMD.
    MMPlus, a New MMD Plugin! Animation Resource
  • Starting-out Using MMD starts you on a learning path.
    Starting-out Using MMD Reader discovers missing elements. MMD Basics
  • Multiply of Facial Expression command in MMD Animation Shortcuts
  • Use PMDE to Switch On the MME AutoLuminous effect in MMD AutoLuminous MME / PMDE
  • MMD EVERGLOW – Adios【Motion by Ureshiiiiii】- Free Download Motion and WAV "the making of" my video
  • Download these 1052C-Re0710 MMD Models and enjoy!
    Download Early Miku 1052C-Re0710 MMD Models from 2010! Downloading New Models
Raycast Ray-MMD Toon Shader

Ray-MMD Toon Shading Basics

Posted on January 28, 2020June 13, 2020 By MuffinMo 22 Comments on Ray-MMD Toon Shading Basics

How can I set up Raycast/Ray-MMD toon-shading? How can I use toon-shading with Raycast? What is one method of toon shading?

Ray-MMD Toon Shading Basics

Ray-MMD Toon Shading Basics - Finished image

Hi, folks! I’m MuffinMo, and this is my first article, so please treat me kindly. Today, I’m going to teach you how to do toon shading with Raycast-MMD. This is the technique that I used in my Ai Kotoba III video, and it can look very good if used correctly.

Please be warned though, I’m only going over how to set up the code for Raycast toon-shading. I will happily answer any questions you might have about my settings and/or personal techniques.

Quick side note: toon shading is only available in ray-mmd-1.5.0 and later.

My “Ai Kotoba III” featuring Ray-MMD Toon Shading…

–

First Step: get Notepad++ to edit text files

You’ll need a source code editor. I recommend Notepad++. It’s free, and works really well. You can get it here:

https://notepad-plus-plus.org/

Configuring the Start

Before you open MMD, you’ll need to open the Raycast configuration file. I’m using the master version of Raycast. Once you go into the ray.conf file, scroll down to where it says “Toon-shading material.” You’ll need to set the value below it to 2.

The Raycast Configuration File as viewed in Notepad++.

You’ll also need to scroll down to “Screen Space Subsurface Scattering” and set that value to 0.

Screen Space Subsurface Scattering config as viewed in Notepad++.

You can turn on the outlines, but that’s optional.

Basic Set Up

Now you can open MMD. Go ahead and set up your video or picture.

Screenshot of the basic MMD setup.

Don’t set up your lighting just yet, though. You’ll want to do that later.

Once you’ve set up your video/picture, load in a skybox of your choice. I’ve loaded Time of Night.

MMD scene with the Time of Night skybox added.

Now load in ray.x, and apply main.fx to your stage and model. If you’re using time of day or time of night, you’ll have to apply material_skybox.fx to the skybox under the MaterialMap tab manually, same thing with the EnvLight tab. Instead of adding the lighting effect inside the individual folder, add the one titled “skylighting_none.fx” inside the skybox folder. This will get rid of any weird spots on the model. Also be sure to disable MMD’s anti-aliasing, ground shadow, and the coordinate axis.

Editing the Material

At first, things aren’t going to look so great.

(I’ve had to adjust my lighting due to the nature of the stage I’m using, but usually I wait until I’m finished material mapping to adjust the lighting.)

This is where things are going to get a bit more complicated.

Go ahead and open up material_2.0.fx in Notepad++. Scroll down to the CustomA and CustomB slots. Make a copy of the file before you proceed.

Now set the “CUSTOM_ENABLE” value to 8 and copy the following settings:

 

“#define CUSTOM_A_MAP_FROM 0

#define CUSTOM_A_MAP_UV_FLIP 0

#define CUSTOM_A_MAP_COLOR_FLIP 0

#define CUSTOM_A_MAP_SWIZZLE 0

#define CUSTOM_A_MAP_APPLY_SCALE 0

#define CUSTOM_A_MAP_FILE “custom.png”

const float customA = 0.62;

const float customAMapLoopNum = 1.0;

#define CUSTOM_B_MAP_FROM 0

#define CUSTOM_B_MAP_UV_FLIP 0

#define CUSTOM_B_MAP_COLOR_FLIP 0

#define CUSTOM_B_MAP_APPLY_SCALE 0

#define CUSTOM_B_MAP_FILE “custom.png”

const float3 customB = float3(0.61, 0.55, 0.548);

const float2 customBMapLoopNum = 1.0;”

 

Save the file, and your screen should look like this:

Congratulations! You’ve officially created a toon shader!

Final Words…

These settings are not set in stone; feel free to experiment! Try playing with different colors, try normal mapping, try all sorts of things! Like I said before, any questions that you have, feel free to ask! I will do my very best to get back to you in a timely manner.

Thanks for reading, and remember to take care of yourself!

Credits

TDA Miku by Xoriu

Unknown Mother Goose Motion by ゲッツ

Facials by しのざき

Lip motion by kaz

Hand motion by すぱにぃ

IK motion by kemo

Camera by 鷹羽はるひ

椛暗式-遇见_暮ver1.0 by 椛暗/bananasteamedstuffs

Raycast by rui

Have fun with Ray-MMD and MikuMikuDance!


– SEE BELOW for MORE MMD TUTORIALS…


— — —


– _ — –


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

More MMD Tutorials...

Enjoy the "camera Angles WEIRD in Anime" meme...

Enjoy the "camera Angles WEIRD in Anime" meme... This image is from The Slayers - NEXT, ...read more

Reader asks how to create MMD artwork... stuff like posing, camerawork?

A reader asks... Is there a tutorial on how to create MMD artwork, like those you ...read more

Learn MikuMikuDance in Small Steps! New LearnMMD Video Series

Learn MikuMikuDance in Small Steps. Where can I find easy-to-follow MMD instructions on YouTube? How ...read more

Apply Multiple Effects on an Entire MMD Model Using M4Layer Effect

How can I apply multiple effects to an MMD model? Can I use more than ...read more

MMD Plugin Manager... I Found a Treasure!

What sorts of MMD Plugins are there? MMD Plugin Manager? MMD Plugins. Plugin MMD. More ...read more

2025: Hatsune Miku is 18... but she is designed to be always 16 Years old, by design and in reality!

Finally, in 2023, Hatsune Miku is 16 years old! but in August of 2025, she ...read more

MMD Tutorials, MuffinMo, Raycast Ray-MMD, Toon Shader

Post navigation

Previous Post: Modified MME Effects Files yield NEW Effects for MMD!
Next Post: Gotta SING… Gotta DANCE! LearnMMD’s Video Dojo Expo-3!

Related Posts

  • Written Credits aid YouTube MMDer search results Keep the Faith-MMD Credits/Sharing
  • Creating an animation using MMD, MikuMikuDance! "the making of" my video
  • Search LearnMMD.com
    SEARCH LearnMMD.com… it’s Easy! MMD Tutorials
  • RAY-MMD: A method to get great results fast and easy!
    RAY-MMD: A method to get great results fast and easy! MMD Tutorials
  • Adjusting the Physical Operation Tab settings in MMD 9.10 Functions-Copy-Paste-Expand
  • Shading China Dresses
    Shading China Dresses Using Advanced Shader Techniques Advanced Shader Technique

More Related Articles

askY Dramatic Anime Style Sky Domes for MMD created by Meme "the making of" my video
MMD CameraSmoother Tool smooths camera motions! CameraSmoother Tool
ShapeMosaic effect distorts naughty bits and faces. MME ShapeMosaic effect counters Wardrobe-malfunctions and more! MMD Tutorials
Win 7 Virtual Machine Runs MMD on MAC and Linux Kazuki Matsuoka
Different MMEffects for different feelings Give MMD Pictures Different MMEffects For Different Feelings BigPerryman
How to Use The VelocityMap Effect for MikuMikuDance. ARIZONA

Comments (22) on “Ray-MMD Toon Shading Basics”

  1. CrackedCratin says:
    April 2, 2022 at 4:23 am

    with the Ai Kotoba III Video, how did you get the backlighting type thing? I’ve tried and i cannot get it to do that.

    Reply
    1. Reggie_Dentmore says:
      April 2, 2022 at 4:05 pm

      There’s like, over 300 of those MMD Ai Kotoba III vidoes… which one has your attentiopn?

      Reply
      1. CrackedCratin says:
        April 17, 2022 at 3:50 am

        sorry for the late reply. I mean the video that is on this tutorial page (sorry i’m bad at explaining things)

        Reply
        1. MuffinMo says:
          April 30, 2023 at 6:51 pm

          Sorry for the late answer! What specifically are you having trouble with? The main light source that I used was the MMD lighting direction, and I used essentially the technique shown here, with some color adjustments to the toon shadows.

          Reply
  2. Ruki says:
    August 25, 2021 at 10:33 am

    Hey! Thank you so much for this tutorial! Everything worked really well but when I turned the outline on(code: #define OUTLINE_QUALITY 1), it gives me the error “failed to open file ./outline/fixed colour/outline.fx(parameter: OutlineMap). Is there any way I can fix it? Thank you!

    Reply
    1. Reggie_Dentmore says:
      August 25, 2021 at 1:12 pm

      Sorry… I don’t know the answer… In all of our years, you are the first to mention that issue. … ?
      Sorry!– Reggie

      Reply
      1. Ruki says:
        August 26, 2021 at 2:14 am

        Thank you for the reply! It’s a really weird issue :”( But maybe it’s because I’m using Ray 1.5.0? I’ll have to experiment around to see what the issue is.

        Reply
  3. John says:
    October 8, 2020 at 5:38 pm

    Hi everybody. Thanks for this tutorial. I have finally read it and I realize this is the legendary technique every super-mmder has been using! You really need to watch this mmd video, it’s also using Toon shader!
    https://www.youtube.com/watch?v=wsxGVsKT4J8

    Reply
  4. non says:
    September 1, 2020 at 12:52 am

    the character model became black and everything looks so bright and white

    Reply
    1. UndeadLuciel says:
      September 3, 2020 at 4:54 am

      Make sure to edit the model draw order in the edit tab so that the Skybox is above the model! The order should be Skybox>Stage>Model>ray controller

      Reply
  5. chipa says:
    July 1, 2020 at 7:59 pm

    is there any way to do this but instead of using ray use ik polishader? i’ve seen some motions that don’t hold ray : /

    Reply
    1. Reggie_Dentmore says:
      July 1, 2020 at 8:53 pm

      It’s all up to you. The wonderful thing about MikuMikuDance is that it’s so “personal”… each of us “digs in” in our own way… following our own mind-set. If you’d like to come up with these results by traveling a different route, Go for it! … If something works for you, let us know.
      … If you make a discovery you’d like to share with LearnMMD, you can leave a comment, or send me an email: ReggieDentmore@aol.com … or you can join us and become an author on LearnMMD.com and write your OWN articles on LearnMMD: see the link at the foot of this page to sign-up.
      — Reggie

      Reply
      1. chipa says:
        July 2, 2020 at 11:04 am

        hmm i see… i’m gonna try, thank you!

        Reply
  6. Coon Productions says:
    May 20, 2020 at 10:10 pm

    Oof I know I’m a few months late but I’m using 1.30

    Reply
    1. MuffinMo says:
      June 11, 2020 at 5:47 pm

      i just checked; you can’t enable the toon shading with 1.3.0. i recommend downloading either the master version or any version after 1.5.0.

      Reply
      1. Reggie_Dentmore says:
        June 11, 2020 at 9:46 pm

        Okay… do we need to amend that tutorial? I can “unpublish” it and set it as a Draft so you can edit it, if you wish to.
        — Reggie

        Reply
        1. MuffinMo says:
          June 12, 2020 at 10:05 am

          probably, just so this issue can be avoided for future users.

          Reply
  7. Jonah Snyder says:
    February 20, 2020 at 3:04 pm

    Nice! Where can I download the TDA Miku?

    Reply
    1. Reggie_Dentmore says:
      February 20, 2020 at 6:30 pm

      That’s part of the game with MMD… you need to get good at searching and finding… Google: download TDA Miku mmd

      Reply
  8. Coon Productions says:
    February 7, 2020 at 12:57 pm

    I can’t find where it says “Toon shading material”, either I’m using an outdated version or it’s really gone :/

    Reply
    1. MuffinMo says:
      February 8, 2020 at 8:22 am

      Which version are you using? The latest is 1.5.2.

      Reply
    2. Goose Gas says:
      April 8, 2021 at 4:50 pm

      The person mentioned a master version. IDK what that means…

      Reply

Leave a Reply Cancel reply

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

Download the latest version of MikuMikuDance!
See the MMD Step-by-Step instructions page!
Learn how to make your own MMD motions!
LearnMMD.com
  • Rotate stage to allow ground shadows MMD MikuMikuDance Accessory Manipulation/Adjust
  • Customize the MMD interface: Change the colors of the GUI Fia Phoenix
  • Painted Table Accessory Download Available Now Downloading New Models
  • Fixed version of the PluginManager featured image. Well, slightly fixed.
    MMD Plugin Manager… I Found a Treasure! MMD Tutorials
  • Animation Fade helps MMD scene transitions Animation Shortcuts
  • Announcing The Momi Cup 4! ARIZONA
  • Background AVI Files require a Baseleine AVI setting.
    MMD Background AVI Files converted using CloudConvert Background AVI
  • Beautiful CyberMiku Black ver1.5 has wings!
    Download MMD CyberMiku Black ver1.5 with Glowing Wings and an attitude! "the making of" my video

Copyright © 2022 Learn MikuMikuDance – MMD Tutorials – Free 3D Animation Software and Instructions..

Powered by PressBook Premium theme

Go to mobile version