VRM4U
VRM4U copied to clipboard
MToon Lit shader not working with Ultra Dynamic Sky (UDS) night lighting
Describe the bug
MToon Lit works perfectly with Ultra Dynamic Sky (UDS), when the UDS lighting is set to day time. (see UDS Time Of Day
variable)
But the shader isn't lighting up my character properly, when the UDS lighting is set to night time.
Check my VRoid character at the left, in the following screenshots.
Screenshots
Unreal Engine Version: UE 5.3.2
Additional context I'm using VRM4U_5_3_20231126 (latest release)
UDS's night light is actually a DirectionalLight
with a very low Intensity
value (e.g.: 0.12 lux).
It seems my main issue is that MToon Lit doesn't like it when the Intensity value is that low.
I eventually found this page on the VRM4U documentation, and it led me to the parameters I needed to adjust: https://ruyo-github-io.translate.goog/VRM4U/02_envlight/?_x_tr_sl=ja&_x_tr_tl=en&_x_tr_hl=ja
After changing certain MaterialSystem
parameters (Saturate
, Base Pow
, Light Scale Pre
, Light Scale Post
), I managed to get the night lighting effect I was aiming for:
And here's a test with colored point lights, to ensure the model is being correctly lit:
Now, I want to make a blueprint to automatically change between "shader value profiles", depending on the directional light's current Intensity (or UDS' Time of Day value). So the values are automatically swapped when required, to ensure the lighting always looks good on both day and night.
I plan to share that blueprint here, for anyone interested. 😄
Hi. MToonLit uses Emissive and cannot adapt to extremely dark/bright scenes. In order to compensate for them, the MaterialSystem parameter is provided, so your use of it is correct. If you want to apply dynamic lights strictly, please use the materials in the SSSProfile.