pixiv / three-vrm

Use VRM on Three.js
MIT License
1.3k stars 110 forks source link

fix: Add new shadowIntensity value to mtoon shader #1431

Closed ashconnell closed 4 months ago

ashconnell commented 4 months ago

Three 166 introduces a new light.shadowIntensity value (https://github.com/mrdoob/three.js/pull/28588) which breaks three-vrm as the shader won't compile.

This PR updates the MToon fragment shader to use the new value.

0b5vr commented 4 months ago

@ashconnell Thank you for the contribution!

We usually provide broader compatibility against past Three.js versions, so compat codes are mandatory in MToon shader codes. Would you add a compat code following the code example below? You would probably use the expression THREE_VRM_THREE_VERSION >= 166.

https://github.com/pixiv/three-vrm/blob/9e16c3855a5b441cca0f11480c4003de25d2943c/packages/three-vrm-materials-mtoon/src/shaders/mtoon.frag#L653-L660

After changing the code, please make sure that the code is working correctly on both r165 and r166.

0b5vr commented 4 months ago

@ashconnell Hello, could you make the change I mentioned above?

0b5vr commented 4 months ago

Superseded by #1441