Q: How to synthesize the final scene-shadows in the pixel shader?
A: Theoretically, multiple shadow maps require extra rendering passes in this step because we need to sample all split shadow maps for each rasterized fragment. This burden depends on the number of texture stages supported by the hardware. In order to avoid multiple passes for the final scene-shadows rendering, we have utilized the so called pixel shader functionality available on programmable GPUs. The usage of this hardware feature totally avoids the extra burden, only a single rendering pass is required to synthesize shadow effects for all pixels.
Like standard shadow mapping, each pixel should be transformed into the light space when determining if the pixel is shadowed or not. The differences here are: 1) we should select the correct shadow map Ti, and 2) the pixel should be transformed into Wi rather W. In Direct 3D, the procedure is explained as the following:
1. Compute Ciclip in the clip space transformed from Ci in the view space.

2. For current rasterized fragment Pclip (xclip,yclip,zclip), Tindex should be selected if and only if
Here we should notice that the coordinates of every pixel in the fragment buffer are measured in the clip space!
3. During depth comparison, each pixel P in the object space should be transformed into the sub-space Wi (not W!). As we know, the concatenation of matrices (i.e. texture matrix T) required in standard shadow mapping is

Where M is the model matrix (not the modelview matrix in OpenGL!), L is the view matrix for the light, and W is the projection matrix for the light. The final matrix given performs the scale and bias to map the s, t, and r components of the texture coordinate to the [0,1] range. On the other hand, W should be replaced by Wi in PSSMs.