VRM4U icon indicating copy to clipboard operation
VRM4U copied to clipboard

MToon Lit shader not working with Ultra Dynamic Sky (UDS) night lighting

Open andreiagmu opened this issue 1 year ago • 4 comments

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

capture_20240102_182457_001

capture_20240102_182511_002

Unreal Engine Version: UE 5.3.2

Additional context I'm using VRM4U_5_3_20231126 (latest release)

andreiagmu avatar Jan 02 '24 21:01 andreiagmu

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.

andreiagmu avatar Jan 02 '24 22:01 andreiagmu

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:

capture_20240104_163723_003

And here's a test with colored point lights, to ensure the model is being correctly lit:

capture_20240104_164442_004

andreiagmu avatar Jan 04 '24 19:01 andreiagmu

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. 😄

andreiagmu avatar Jan 04 '24 19:01 andreiagmu

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.

ruyo avatar Jan 11 '24 14:01 ruyo