Half-Lambert Shader Point-Source Lighting Effects
This morning I was trying to work my way through Trackdancer’s MMD FILL LIGHTS Part 1 (Half-Lambert Shader) tutorial and I discovered that I needed more basic instruction on using that Half-Lambert Shader. I found a download source for the effect: Deviant Art’s Wampa842. He offers his “Enhanced” Half-Lambert Shader for download. (Just click the download symbol under the right-edge of the main picture, there.)
I wanted to use this Shader because it offers point-source lights that actually “shine” upon your model. I have only seen that done with Raycast/Ray-MMD and I am glad to find this more-simple method.
Wampa842’s package includes the original files and his enhanced versions. If you read his README, he discusses how he has added a feature that you access using the Tr transparency values. … he says the original effect tended to flood-light a scene with objects close to the light-source being too bright. Now we can use the Tr value in his enhanced effect to soften that burn-out issue.
SO… LET’S DO IT!
I started-out trying several models for this tutorial… Although it “works” better on more exotic models, I decided to use the Luka_Megurine v1-1 model included with the MMD download so that we’d all have the same model to work with.
Turn down the brightness of the Main Lights to about 60, or so… and, using Effect Mapping, add Cook-Torrance (enhanced) to the Luka model.
Everything is going dark…
I started by loading a DummyBone that I will use to maneuver the new lights.
As an accessory, I loaded the Pointlight0.x and attached it to Dummybone 1. I maneuvered that bone so that it is behind Luka… and to the left, a little, of our scene. I rotated that bone so as to “shine” onto the back of luka.
The “light” shows-up as a dot and there is no light. You need to set the light value by adjusting that accessory’ s Rx, Ry, and Rz values…
Front-Light… Main Light…
Following along with Trackdancer’s tutorial, I next added a front light by loading “PointLight1.x” and attaching it to Dummybone 2.
I maneuvered that bone so as to be in front of the model… and above and to the right of the scene. I rotated that bone so that it points into Luka’s face.
I set those Rx, Ry, Rz rotations to a value of 24…
I also “played with” the Tr Transparency value which, in the case of Wampa842’s enhanced version, adjusts the “distance” of the light to the face to prevent the “burn-out”. You will find that you want to strike a balance between your Tr value and the brightness of the light (the Rx,Ry,Rz values).
Now we add the FILL LIGHT…
In photography and cinematography, a “fill light” is use to add light to shadowed areas. That fill light will probably be dim so as not to overpower the main light. For my tutorial, I set-up the light on Dummybone 3 and slid it out front of the model at about knee-high and rolled it to point up towards the face…
I tried several light values and decided to go for a value of 11 all the way across and then a TR of .3
And… There you HAVE it!
Those pointlights are seen as little dots in your scene. If you increase the Si Size of the dots, they get bigger but the light gets no brighter. You can UNCHECK the Display box to make them go invisible… the lights will still be “ON”. To “turn OFF” the lights, you set the Rx,Ry,Rz values to zero.
|EDITOR’S NOTE: There’s another step that you need in case you want to use Half-Lambert to illuminate not only .pmd models but also .x accessories (for example, stages). For every item you apply the effect to, shadows must be turned on. All newly loaded .pmd models have shadows turned on by default; accessories do not, though. If you applied the effect to a stage and wonder why does it not work, check its shadow option in AMP.|
TDA Models? When I started the tutorial, I found that the TDA model I was using “lost its face” and looked terrible under this shader. … somehow, by the time I was finished with my experimentation, I found another TDA that looked OK… so, I have no answer… maybe some “TDA” are not really TDA??
RAYCAST-like lighting without using Raycast/Ray-MMD!
See Trackdancer’s MMD FILL LIGHTS Part 1 (Half-Lambert Shader) tutorial. He STARTS with what I have shown you, here, and then he adds more MMEs to create an awesome scene! … He has a DOWNLOAD LINK, there for his beautiful model.
Have fun with MikuMikuDance!
– SEE BELOW for MORE MMD TUTORIALS…