|
|
|
|
|
|
for (int lightIndex = globalLightData.x; lightIndex < globalLightData.y; ++lightIndex) |
|
|
|
{ |
|
|
|
LightInput lightInput; |
|
|
|
half NdotL; |
|
|
|
o.fogCoord.yzw += EvaluateOneLight(lightInput, diffuseAndSpecular.rgb, diffuseAndSpecular, normal, o.posWS, o.viewDir.xyz); |
|
|
|
o.fogCoord.yzw += EvaluateOneLight(lightInput, diffuseAndSpecular.rgb, diffuseAndSpecular, normal, o.posWS, o.viewDir.xyz, NdotL); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
#ifdef _SHADOWS |
|
|
|
if (lightIndex == 0) |
|
|
|
{ |
|
|
|
#if _NORMALMAP |
|
|
|
float3 vertexNormal = float3(i.tangentToWorld0.z, i.tangentToWorld1.z, i.tangentToWorld2.z); |
|
|
|
#else |
|
|
|
float3 vertexNormal = i.normal; |
|
|
|
#endif |
|
|
|
color *= ComputeShadowAttenuation(i, i.normal * bias); |
|
|
|
color *= ComputeShadowAttenuation(i, vertexNormal * bias); |
|
|
|
} |
|
|
|
#endif |
|
|
|
} |
|
|
|