Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

Stable Cascaded Shadow Maps

$
0
0

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(&amp;projectionMatrices[i]));
		frustum.Transform(frustum, DirectX::XMMatrixInverse(nullptr, camera.View()));

		///get frustum corners
		std::array<DirectX::XMFLOAT3, frustum.CORNER_COUNT> corners;
		frustum …

Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>