This topic is 2829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey all,

I've got a basic cascaded shadow map up and working but I'm having stability problems. My implementation is closely following the ShaderX6 article by Michal Valient. I was able to achieve perfect stability in the first and closest cascade as described in this post http://www.gamedev.n...ed-shadow-maps/. My problem is that the other 3 further cascades shimmer quite awfully now.

The 4 cascade view projection matricies are calculated as

ShadowMat = LightLookAt * OrthoProjection * RoundingMat

where the rounding mat is as mention in the previous post. (pasted here)

//--------------------------

// xShadowMatrix is the light view projection matrix

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

### D3DXMatrixTranslation(&xRounding, dx, dy, 0); [/font] //-------------------------- This gives me a perfectly stable result for the first cascade. The remaining 3 cascades are being looked-up in the shadow map atlas via an offset and scale passed to the pixel shader. float3 offset[n] = ShadowMat[0] * lookat[n].translation float scale[n] = splitRadius[0] / splitRadius[n] I'm missing something here and can't figure it out. Seems to me that even though I'm using the properly rounded shadow matrix for each cascade caster rendering, I'm disregarding it in the lookup because I'm scaling and offseting in a fractional pixel way. Is there a way to derive the scale and offset purely from the set of cascade shadow matricies? I'm probably getting it wrong by using the projection of the nth lookat's translation as it's before the rounding adjustment. Thanks in advance, ref_cracker

##### Share on other sites
Solved:

There is a way to calculate the proper scale and offset directly form your cascade shadow viewproj matricies. It's right in the article but wasn't working due to a bug in my matrix inversion code.

The way to get the scale remains

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 19
• 36
• 9
• 16
• 75