Hi, I'm trying to figure out how to perform a custom z-prepass in directx, but I'm not sure how to do it. I set my depth buffer as usual:
deviceContext->OMSetRenderTargets(5, m_pRenderViews, m_depthStencilView);
deviceContext->RSSetViewports(5, m_viewports);but now how do I write data to ‘m_depthStencilView’? do I have to use the SV_DEPTH semantic in the pixel shader output? Similarly, how do I write data to the stencil buffer? I am not aware of a HLSL semantic that refers to the stencil buffer.
Since I am not doing a custom z-prepass as of now, does directx do this automatically? If so, at which point is it performed? Thanks.