LPDIRECT3DSURFACE9 pDestSurface_New2;
D3DLOCKED_RECT lrect_New2;
D3DSURFACE_DESC Desc2;
m_pShadowMap_QVSM_Surf_EyeDepth->GetDesc(&Desc2);
V(m_pd3dDevice->CreateOffscreenPlainSurface(Desc2.Width,Desc2.Height,Desc2.Format,D3DPOOL_SYSTEMMEM,&pDestSurface_New2,NULL));//Must be D3DPOOL_SYSTEMMEM for MSDN
V(m_pd3dDevice->GetRenderTargetData(m_pShadowMap_QVSM_Surf_EyeDepth,pDestSurface_New2));
hr=pDestSurface_New2->LockRect(&lrect_New2,NULL,D3DLOCK_NO_DIRTY_UPDATE|D3DLOCK_READONLY );
for (LONG y=0;y<(LONG)Desc.Height;y++)
{
for (LONG x=0;x<(LONG)Desc.Width;x++)
{
float depthFromEye0 = ((float*)lrect_New2.pBits)[y*(lrect_New2.Pitch/(8*sizeof(float)))+x+0];
float depthFromEye1 = ((float*)lrect_New2.pBits)[y*(lrect_New2.Pitch/(8*sizeof(float)))+x+1];
float depthFromEye2 = ((float*)lrect_New2.pBits)[y*(lrect_New2.Pitch/(8*sizeof(float)))+x+2];
float depthFromEye3 = ((float*)lrect_New2.pBits)[y*(lrect_New2.Pitch/(8*sizeof(float)))+x+3];