|
|
|
|
|
|
CBUFFER_END |
|
|
|
|
|
|
|
CBUFFER_START(_LocalShadowBuffer) |
|
|
|
float4x4 _LocalWorldToShadowAtlas[4]; |
|
|
|
half _LocalShadowStrength[4]; |
|
|
|
float4x4 _LocalWorldToShadowAtlas[MAX_VISIBLE_LIGHTS]; |
|
|
|
half _LocalShadowStrength[MAX_VISIBLE_LIGHTS]; |
|
|
|
half4 _LocalShadowOffset0; |
|
|
|
half4 _LocalShadowOffset1; |
|
|
|
half4 _LocalShadowOffset2; |
|
|
|
|
|
|
float4 shadowCoord = mul(_LocalWorldToShadowAtlas[lightIndex], float4(positionWS, 1.0)); |
|
|
|
ShadowSamplingData shadowSamplingData = GetLocalLightShadowSamplingData(); |
|
|
|
half shadowStrength = GetLocalLightShadowStrenth(lightIndex); |
|
|
|
return SampleShadowmap(shadowCoord, TEXTURE2D_PARAM(_LocalShadowMapAtlas, sampler_LocalShadowMapAtlas), shadowSamplingData, shadowStrength); |
|
|
|
half attenuation = SampleShadowmap(shadowCoord, TEXTURE2D_PARAM(_LocalShadowMapAtlas, sampler_LocalShadowMapAtlas), shadowSamplingData, shadowStrength); |
|
|
|
return (shadowStrength > 0.0h) ? attenuation : 1.0h; |
|
|
|
#endif |
|
|
|
} |
|
|
|
|