Well it's something ig

This commit is contained in:
2025-01-15 03:40:39 +01:00
parent 9805c7a2c1
commit 8a3bf57d7e
15 changed files with 295 additions and 46 deletions

View File

@@ -20,16 +20,22 @@ bool ShadowMapBuffer::Initialize() {
// Create ShaderResourceView for the depth buffer
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
srvDesc.Format = DXGI_FORMAT_R32_FLOAT;
srvDesc.Format = DXGI_FORMAT_R32_FLOAT; // Shader-readable format
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srvDesc.Texture2D.MipLevels = 1;
srvDesc.Texture2D.MostDetailedMip = 0;
HRESULT hr = m_device->CreateShaderResourceView(m_depthBuffer.GetDepthBuffer(), &srvDesc, &m_shaderResourceView);
if (FAILED(hr)) {
if (FAILED(hr))
{
OutputDebugStringA("Failed to create ShaderResourceView for ShadowMapBuffer.\n");
return false;
}
return true;
}
void ShadowMapBuffer::SetRenderTarget(ID3D11DeviceContext *deviceContext) {
deviceContext->OMSetRenderTargets(0, nullptr, m_depthBuffer.GetDepthStencilView());
}