diff --git a/libs/cauldron b/libs/cauldron index 3e4a021..b92d559 160000 --- a/libs/cauldron +++ b/libs/cauldron @@ -1 +1 @@ -Subproject commit 3e4a021fc0d3e0372347126771a5155016810a11 +Subproject commit b92d559bd083f44df9f8f42a6ad149c1584ae94c diff --git a/src/DX12/GLTFSample.cpp b/src/DX12/GLTFSample.cpp index 8d148e7..221fd85 100644 --- a/src/DX12/GLTFSample.cpp +++ b/src/DX12/GLTFSample.cpp @@ -267,7 +267,7 @@ void GLTFSample::LoadScene(int sceneIndex) if (m_pGltfLoader->m_lights.size() == 0) { tfNode n; - n.m_tranform.LookAt(PolarToVector(AMD_PI_OVER_2, 0.58f) * 3.5f, math::Vector4(0, 0, 0, 0)); + n.m_transform.LookAt(PolarToVector(AMD_PI_OVER_2, 0.58f) * 3.5f, math::Vector4(0, 0, 0, 0)); tfLight l; l.m_type = tfLight::LIGHT_SPOTLIGHT; @@ -414,7 +414,7 @@ void GLTFSample::OnRender() // Do any start of frame necessities BeginFrame(); - ImGUI_UpdateIO(); + ImGUI_UpdateIO(m_Width,m_Height); ImGui::NewFrame(); if (m_loadingScene) diff --git a/src/DX12/Renderer.cpp b/src/DX12/Renderer.cpp index 2ddd308..2ab8d95 100644 --- a/src/DX12/Renderer.cpp +++ b/src/DX12/Renderer.cpp @@ -88,8 +88,20 @@ void Renderer::OnCreate(Device* pDevice, SwapChain *pSwapChain, float FontSize) m_ResourceViewHeaps.AllocCBV_SRV_UAVDescriptor(1, &m_ShadowMaskSRV); #endif - m_SkyDome.OnCreate(pDevice, &m_UploadHeap, &m_ResourceViewHeaps, &m_ConstantBufferRing, &m_VidMemBufferPool, "..\\media\\cauldron-media\\envmaps\\papermill\\diffuse.dds", "..\\media\\cauldron-media\\envmaps\\papermill\\specular.dds", DXGI_FORMAT_R16G16B16A16_FLOAT, 4); - m_SkyDomeProc.OnCreate(pDevice, &m_ResourceViewHeaps, &m_ConstantBufferRing, &m_VidMemBufferPool, DXGI_FORMAT_R16G16B16A16_FLOAT, 1); + constexpr bool bInvertedDepth = false; + m_SkyDome.OnCreate( + pDevice, + &m_UploadHeap, + &m_ResourceViewHeaps, + &m_ConstantBufferRing, + &m_VidMemBufferPool, + "..\\media\\cauldron-media\\envmaps\\papermill\\diffuse.dds", + "..\\media\\cauldron-media\\envmaps\\papermill\\specular.dds", + DXGI_FORMAT_R16G16B16A16_FLOAT, + 4, + bInvertedDepth + ); + m_SkyDomeProc.OnCreate(pDevice, &m_ResourceViewHeaps, &m_ConstantBufferRing, &m_VidMemBufferPool, DXGI_FORMAT_R16G16B16A16_FLOAT, 1, bInvertedDepth); m_Wireframe.OnCreate(pDevice, &m_ResourceViewHeaps, &m_ConstantBufferRing, &m_VidMemBufferPool, DXGI_FORMAT_R16G16B16A16_FLOAT, 1); m_WireframeBox.OnCreate(pDevice, &m_ResourceViewHeaps, &m_ConstantBufferRing, &m_VidMemBufferPool); m_DownSample.OnCreate(pDevice, &m_ResourceViewHeaps, &m_ConstantBufferRing, &m_VidMemBufferPool, DXGI_FORMAT_R16G16B16A16_FLOAT); @@ -403,7 +415,13 @@ void Renderer::AllocateShadowMaps(GLTFCommon* pGLTFCommon) std::vector::iterator CurrentShadow = m_shadowMapPool.begin(); for( uint32_t i = 0; CurrentShadow < m_shadowMapPool.end(); ++i, ++CurrentShadow) { - CurrentShadow->ShadowMap.InitDepthStencil(m_pDevice, "m_pShadowMap", &CD3DX12_RESOURCE_DESC::Tex2D(DXGI_FORMAT_D32_FLOAT, CurrentShadow->ShadowResolution, CurrentShadow->ShadowResolution, 1, 1, 1, 0, D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL)); + constexpr float fClearValue = 1.0f; + CurrentShadow->ShadowMap.InitDepthStencil( + m_pDevice, + "m_pShadowMap", + &CD3DX12_RESOURCE_DESC::Tex2D(DXGI_FORMAT_D32_FLOAT, CurrentShadow->ShadowResolution, CurrentShadow->ShadowResolution, 1, 1, 1, 0, D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL), + fClearValue + ); CurrentShadow->ShadowMap.CreateDSV(CurrentShadow->ShadowIndex, &m_ShadowMapPoolDSV); CurrentShadow->ShadowMap.CreateSRV(CurrentShadow->ShadowIndex, &m_ShadowMapPoolSRV); } diff --git a/src/DX12/UI.cpp b/src/DX12/UI.cpp index 67e4ad5..88c42ce 100644 --- a/src/DX12/UI.cpp +++ b/src/DX12/UI.cpp @@ -139,8 +139,8 @@ void GLTFSample::BuildUI() if (ImGui::Button("Set Spot Light 0 to Camera's View")) { int idx = m_pGltfLoader->m_lightInstances[0].m_nodeIndex; - m_pGltfLoader->m_nodes[idx].m_tranform.LookAt(m_camera.GetPosition(), m_camera.GetPosition() - m_camera.GetDirection()); - m_pGltfLoader->m_animatedMats[idx] = m_pGltfLoader->m_nodes[idx].m_tranform.GetWorldMat(); + m_pGltfLoader->m_nodes[idx].m_transform.LookAt(m_camera.GetPosition(), m_camera.GetPosition() - m_camera.GetDirection()); + m_pGltfLoader->m_animatedMats[idx] = m_pGltfLoader->m_nodes[idx].m_transform.GetWorldMat(); } }