Cascade Shadow Map Pixel Shader,
Members - Reputation: 787
Posted 29 November 2012 - 02:05 PM
So, I have CSM working. Looks great. In order for it to work properly, I need to figure out the cascade index in the pixel shader and then do the multiply with it's 1 of 4 matrices (one for each map) again in the pixel shader. I'd rather do this in the vertex shader, but then I get shadows with lines across it (shadow, no shadow, shadow, no shadow, etc.).
Is this possible to do in the vertex shader? If so, any ideas how?
Maybe I can't do this because of the nature of the shadow, it really does need to be a pixel operation. It just sucks I have to pass all 4 matrices into my pixel shader for the operation.
Members - Reputation: 780
Posted 29 November 2012 - 05:23 PM
Typically for orthographic projected cascades you only need to do a single vector by matrix transform. Each cascade can then be done via a bias and scale operation which is a single MAD operation per cascade check.
Moderators - Reputation: 17730
Posted 30 November 2012 - 01:07 AM