Hello
I have followed the this guide http://www.two-kings.de/tutorials/dxgraphics/dxgraphics16.html to render to a texture.
I have no trouble rendering to the backbuffer. But when I swap out the backbuffer with a surface from a texture the z buffer does not work. I keep everything else the same except the render target. I can draw the colors, view/perspective just fine, but there are no depth test going on even though all states are the same.
The clear function returns with no errors and every draw is within a begin() and end(), just like with the backbuffer as target.
device->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(255, 255, 255), 1.0f, 0);
device->CreateTexture(512, 512,
1, D3DUSAGE_RENDERTARGET, D3DFMT_X8R8G8B8, //D3DFMT_R32F
D3DPOOL_DEFAULT, &pShadowMapTexture, NULL);
What could cause this?