fogFactorAndVertexLightの計算を修正

This commit is contained in:
notargs 2023-04-25 14:26:31 +09:00
parent cc691f24bc
commit 9c7e357f50

View File

@ -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 <UnityCG.cginc>
#include <AutoLight.cginc>
@ -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;
}