int cascadeCount;
int shadowSplitIndex = EvalShadow_GetSplitIndex(lightLoopContext.shadowContext, lightData.shadowIndex, positionWS, payloadOffset, fade, cascadeCount);
// we have a fade caclulation for each cascade but we must lerp with shadow mask only for the last one
fade = ((shadowSplitIndex + 1) == cascadeCount || shadowSplitIndex == -1.0) ? fade : 0.0;
// if shadowSplitIndex is -1 it mean we are outside cascade and should return 1.0 to use shadowmask: saturate(-shadowSplitIndex) return 0 for >= 0 and 1 for -1
fade = ((shadowSplitIndex + 1) == cascadeCount) ? fade : saturate(-shadowSplitIndex);
// See comment in EvaluateBSDF_Punctual
shadow = lightData.nonLightmappedOnly ? min(shadowMask, shadow) : shadow;
// See comment in EvaluateBSDF_Punctual
shadow = lightData.nonLightmappedOnly ? min(shadowMask, shadow) : shadow;
// Note: There is no shadowDimmer when there is no shadow mask
#endif