diff --git a/src/DX12/GLTF/GltfDepthPass.cpp b/src/DX12/GLTF/GltfDepthPass.cpp index f0c914e..55f0567 100644 --- a/src/DX12/GLTF/GltfDepthPass.cpp +++ b/src/DX12/GLTF/GltfDepthPass.cpp @@ -318,7 +318,7 @@ namespace CAULDRON_DX12 descPso.RasterizerState.DepthClipEnable = false; descPso.BlendState = CD3DX12_BLEND_DESC(D3D12_DEFAULT); descPso.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC(D3D12_DEFAULT); - descPso.DepthStencilState.DepthFunc = m_bInvertedDepth ? D3D12_COMPARISON_FUNC_LESS : D3D12_COMPARISON_FUNC_GREATER; + descPso.DepthStencilState.DepthFunc = m_bInvertedDepth ? D3D12_COMPARISON_FUNC_GREATER : D3D12_COMPARISON_FUNC_LESS; descPso.SampleMask = UINT_MAX; descPso.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; descPso.DSVFormat = depthFormat; diff --git a/src/VK/GLTF/GltfDepthPass.cpp b/src/VK/GLTF/GltfDepthPass.cpp index b546dae..70e701e 100644 --- a/src/VK/GLTF/GltfDepthPass.cpp +++ b/src/VK/GLTF/GltfDepthPass.cpp @@ -419,7 +419,7 @@ namespace CAULDRON_VK ds.flags = 0; ds.depthTestEnable = true; ds.depthWriteEnable = true; - ds.depthCompareOp = m_bInvertedDepth ? VK_COMPARE_OP_LESS_OR_EQUAL : VK_COMPARE_OP_GREATER_OR_EQUAL; + ds.depthCompareOp = m_bInvertedDepth ? VK_COMPARE_OP_GREATER_OR_EQUAL : VK_COMPARE_OP_LESS_OR_EQUAL; ds.back.failOp = VK_STENCIL_OP_KEEP; ds.back.passOp = VK_STENCIL_OP_KEEP; ds.back.compareOp = VK_COMPARE_OP_ALWAYS;