|
|
|
|
|
|
{ |
|
|
|
// TODO: factor out the biased position? |
|
|
|
float3 biasedPositionWS = positionWS + bsdfData.normalWS * bsdfData.thickness; |
|
|
|
float shadow = GetDirectionalShadowAttenuation(lightLoopContext, biasedPositionWS, lightData.shadowIndex, L, posInput.unPositionSS); |
|
|
|
#ifdef SHADOWS_USE_SHADOWCTXT |
|
|
|
float shadow = GetDirectionalShadowAttenuation(lightLoopContext.shadowContext, biasedPositionWS, lightData.shadowIndex, L, posInput.unPositionSS); |
|
|
|
#else |
|
|
|
float shadow = GetDirectionalShadowAttenuation(lightLoopContext, biasedPositionWS, lightData.shadowIndex, L, posInput.unPositionSS); |
|
|
|
#endif |
|
|
|
|
|
|
|
illuminance *= shadow; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
// TODO: factor out the common biased position? |
|
|
|
float3 biasedPositionWS = positionWS + bsdfData.normalWS * bsdfData.thickness; |
|
|
|
float3 offset = float3(0.0, 0.0, 0.0); // GetShadowPosOffset(nDotL, normal); |
|
|
|
float shadow = GetPunctualShadowAttenuation(lightLoopContext, lightData.lightType, biasedPositionWS + offset, lightData.shadowIndex, L, posInput.unPositionSS); |
|
|
|
#ifdef SHADOWS_USE_SHADOWCTXT |
|
|
|
float shadow = GetPunctualShadowAttenuation(lightLoopContext.shadowContext, biasedPositionWS + offset, lightData.shadowIndex, L, posInput.unPositionSS); |
|
|
|
#else |
|
|
|
float shadow = GetPunctualShadowAttenuation(lightLoopContext, lightData.lightType, biasedPositionWS + offset, lightData.shadowIndex, L, posInput.unPositionSS); |
|
|
|
#endif |
|
|
|
shadow = lerp(1.0, shadow, lightData.shadowDimmer); |
|
|
|
|
|
|
|
illuminance *= shadow; |
|
|
|