Hi, I am trying to implement stable cascaded shadow maps but I am still getting shadow shimmering.
Here is my code for non-stable CSM (the part where you calculate all the lightviewprojection matrices):
//this function calculates projection frustums for every split and later uses it to get frustum in world space
std::array<DirectX::XMFLOAT4X4, MAX_CASCADES_NUM> projectionMatrices = RecalculateProjectionMatrices(camera);
std::array<DirectX::XMMATRIX, MAX_CASCADES_NUM> lightViewProjectionMatrices;
for (UINT i = 0; i < MAX_CASCADES_NUM; ++i)
{
///frustum in world space
BoundingFrustum frustum(DirectX::XMLoadFloat4x4(&projectionMatrices[i]));
frustum.Transform(frustum, DirectX::XMMatrixInverse(nullptr, camera.View()));
///get frustum corners
std::array<DirectX::XMFLOAT3, frustum.CORNER_COUNT> corners;
frustum …