HOME | DD

#guide #mmd #mikumikudance #mikumikueffect
Published: 2019-12-21 09:51:43 +0000 UTC; Views: 1910; Favourites: 7; Downloads: 3
Redirect to original
Description
Take these surveys!
docs.google.com/forms/d/e/1FAI…
docs.google.com/forms/d/e/1FAI…
Before I start, I should say there are a lot of things I don't know. I've looked a little at Raycast-MMD, but MMD says it doesn't work on my hardware and when I bypassed hardware validation, MMD didn't crash but the result looked weird. So I know it has material settings like roughness but I don't know how they're used. I also know nothing about non-MMD rendering, like the competitions that Nvidia or Intel run to see who can simulate the best cloth or whatever. There are countless academic papers on the subject that I have never heard of.
I also had the wrong understanding when I wrote that first paragraph. I did lots of testing and looked at the code to be able to draw accurate graphs.
With 'toon' lighting used by pmd/pmx models, shadow is calculated by multiplying a number, the 'toon' color, by the lighting from MMD's main light.
With diffuse lighting used by accessories, the brightness of direct illumination is calculated by adding a number, the material's Diffuse Color, to the lighting from MMD's main light, and then restricting the total.
These models act differently. With 'toon', shadow is always a specific proportion of direct light, while with diffuse, shadow becomes a greater and greater proportion of direct light until it saturates at full brightness and shadows are just as bright as direct light. Due to a bug, when using MMD's default self-shadow shader, shadows can actually become BRIGHTER than direct light!
A material's ambient and emissive color are also used in the calculations, but they don't change how these models work. They are why models in MMD usually have half brightness when main light is at 0 and why brightness doesn't change above 128 light. (And LightAmbient for accessories is 0.3 lower than for pmd/pmx models for the same main light setting, so it can go negative.)
Specular is the exception. It doesn't match either light model, because it starts at 0 when light is 0 and keeps increasing after other sources of color have stopped increasing. Some models use specular, but even when Specular Color is set, a high Specular Power may decrease the width of reflections so they're unnoticeable. A good Specular Power for skin seems to be around 5, but some of these materials have a much higher exponent.
A good shader would use the same light model for everything, so all parts of the scene increase in brightness when you change the main light, not just some parts. This is about the limitations of a single shader.
Stage tk grid floor and askyY seiga.nicovideo.jp/seiga/im415…
Sand from www.nepr.net/post/it-takes-500… , it says "Petr Kratochvil / Creative Commons"
Mirror by 비비델, instagram.com/nn_yun_s 43148258_248229992524743_710199679434865916_n.jpg
Water reflection from an account on Instagram, I just opened the image. Cropped.
A shader tries to simulate difference surfaces and objects using data provided by the model. With the specular model used in MMD, a very sharp reflection is done with a high power, which narrows the reflection area, but this isn't great as lights are typically not actually point sources. The sun is half a degree in width, which is why leaves can cast crescent-shaped shadows during an eclipse. Electrical lights are often frosted, or at least have a reflecting enclosure which blurs shadows.
It works best with an irregular, uneven surface, like Surface 2 here, but even this is not perfect. Reflections get spread out vertically more than they do horizontally on real surfaces, such as the water in the photo, but the specular model does not do this.
In other cases, it's hard to think of parameters that a model could use to simulate a surface's properties. Surfaces 3, 4, and 5 all have the same reflection characteristics for light that comes from above, but they are different for light coming at a low angle. The spikes or pyramids in surfaces 4 and 5 prevent some or all of the light from reaching the flat areas in between the pyramids when light is at a low angle. Rotating the surface around the normal, the line perpendicular to the surface, also produces different results.
Surface 5 is, I think, similar to satin. As far as I can tell, the weave of satin causes offset rows that prevent light from falling in the 'gaps'. The reflecting shapes are more like cylinders instead of pyramids, though, so the reflected light goes in different directions than in Surface 5.
It gets even more complicated if you want to be able to zoom in on a surface. If you could see individual pyramids, you would just treat each of their faces as a smooth surface, and using the math that describes the aggregate behaviour would be inappropriate.
Specular is the most complicated to model because light output direction varies the most. I think diffuse lighting, as in 'anything that isn't specular' and not the specific math used for accessories in MMD, may also be worth modifying; maybe cloth is brighter when viewed from the direction of light, because fibers don't shadow each other, or something. But it isn't as noticeable as specular reflections are.
So a single shader won't simulate all surfaces. It can get a bit better, but you still need different shaders that use different math for unusual materials.
The example data structure shows how you might try to model different materials using data. But it's only for one dimension, and specifying how light varies from side to side adds an extra layer of complication.
Specular direction is why using the default specular reflection for hair, which Hatsune Miku on the left does, isn't appropriate. I think reflection for fibers like hair or satin is in a cone, not in all directions. Shader used in this image is a modified AdultShader and can be downloaded here: www.deviantart.com/taemojitsu/…