Trying to implement this. I've been fiddling with Z buffer issue for hours now. Shadow Map is 512x512, I render to it fine but it seems like Z buffer is disabled, even though I enabled it and clear it properly. After I render to Shadow Map, I set the Back Buffer back, clear it and everything renders as normal. I draw the shadow map texture as a sprite ontop just to verify.
What could be the issue? Do I have to make a special zbuffer aswell? -.-
d3ddev->CreateTexture(512, 512,
1, D3DUSAGE_RENDERTARGET, D3DFMT_X8R8G8B8, //D3DFMT_R32F
D3DPOOL_DEFAULT, &pShadowMapTexture, NULL);