diff --git a/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_forward_vertex.hlsl b/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_forward_vertex.hlsl index 17c2984ad..2420d9971 100644 --- a/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_forward_vertex.hlsl +++ b/Assets/VRMShaders/VRM10/MToon10/Resources/VRM10/vrmc_materials_mtoon_forward_vertex.hlsl @@ -3,6 +3,7 @@ #ifdef MTOON_URP #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #else #include #include @@ -56,8 +57,14 @@ Varyings MToonVertex(const Attributes v) // v is UnityCG macro specified name. output.tangentWS = half4(UnityObjectToWorldDir(v.tangentOS), tangentSign); #endif + #ifdef MTOON_URP + half3 vertexLight = VertexLighting(output.positionWS, output.normalWS); + half fogFactor = ComputeFogFactor(output.pos.z); + output.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #else UNITY_TRANSFER_FOG(output, output.pos); UNITY_TRANSFER_LIGHTING(output, v.texcoord1.xy); + #endif return output; }