Dynamic shadows artifacts

It is not the fact that unrolled loops are faster, that surprises. It is half the render time difference that is uncommon. I don’t recall seeing a measurable gain outside of 20% in recent years, even with fetch-heavy loops. Not sure why the loop was not unrolled by compiler either, to be fair.

But yeah, considering that UE4 uses quality presets, that define loop iteration count at compile time, there is absolutely no reason not to unroll. As to code chunk, I think the inflation of the shader size and compile time is incomparable to speed gains in shadow filtering, so can’t be even regarded as a downside.