diff --git a/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_lighting_unity.hlsl b/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_lighting_unity.hlsl index acf7e7953..2967bd4e3 100644 --- a/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_lighting_unity.hlsl +++ b/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_lighting_unity.hlsl @@ -22,13 +22,8 @@ UnityLighting GetUnityLighting(const Varyings input, const half3 normalWS) if (MToon_IsForwardBasePass()) { UnityLighting output; -#ifdef MTOON_URP - output.indirectLight = SampleSH(normalWS); - output.indirectLightEqualized = (SampleSH(half3(0, 1, 0)) + SampleSH(half3(0, -1, 0))) * 0.5; -#else - output.indirectLight = ShadeSH9(half4(normalWS, 1)); - output.indirectLightEqualized = (ShadeSH9(half4(0, 1, 0, 1)) + ShadeSH9(half4(0, -1, 0, 1))) * 0.5; -#endif + output.indirectLight = MToon_SampleSH(half3(normalWS)); + output.indirectLightEqualized = (MToon_SampleSH(half3(0, 1, 0)) + MToon_SampleSH(half3(0, -1, 0))) * 0.5; output.directLightColor = lightColor; output.directLightDirection = lightDir; output.directLightAttenuation = atten; diff --git a/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_render_pipeline.hlsl b/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_render_pipeline.hlsl index 97f38d328..663da3528 100644 --- a/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_render_pipeline.hlsl +++ b/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_render_pipeline.hlsl @@ -75,6 +75,16 @@ #endif +// SampleSH +inline half3 MToon_SampleSH(half3 normalWS) +{ + #ifdef MTOON_URP + return SampleSH(normalWS); + #else + return ShadeSH9(half4(normalWS, 1)); + #endif +} + // Transform inline float3 MToon_TransformObjectToWorldNormal(float3 normalOS) {