From 58c85d8c30e9ad7119b7cf3b6008459cdf6aa9b1 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 1 Apr 2016 14:07:07 -1000 Subject: [PATCH] Depth buffer fix --- DataSpec/DNACommon/PAK.cpp | 2 ++ DataSpec/DNACommon/TXTR.cpp | 2 +- Editor/ViewManager.cpp | 1 + Runtime/Graphics/CGraphics.cpp | 6 +++--- Runtime/Graphics/CModelBoo.cpp | 2 +- hecl | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/DataSpec/DNACommon/PAK.cpp b/DataSpec/DNACommon/PAK.cpp index 9482f0b8b..d47cc337d 100644 --- a/DataSpec/DNACommon/PAK.cpp +++ b/DataSpec/DNACommon/PAK.cpp @@ -453,6 +453,7 @@ bool PAKRouter::extractResources(const BRIDGETYPE& pakBridge, bool f if (extractor.weight != w) continue; +#if 0 /* This is used to ensure parallel extracts won't collide files */ if (precedenceSharesOnly) { @@ -466,6 +467,7 @@ bool PAKRouter::extractResources(const BRIDGETYPE& pakBridge, bool f } } } +#endif std::string bestName = getBestEntryName(*item); hecl::SystemStringView bestNameView(bestName); diff --git a/DataSpec/DNACommon/TXTR.cpp b/DataSpec/DNACommon/TXTR.cpp index a238934c7..2f587abdf 100644 --- a/DataSpec/DNACommon/TXTR.cpp +++ b/DataSpec/DNACommon/TXTR.cpp @@ -738,7 +738,7 @@ bool TXTR::CookPC(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outP } /* Read and make RGBA */ - for (png_uint_32 r=0 ; r=0 ; --r) { png_read_row(pngRead, rowBuf.get(), nullptr); switch (colorType) diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index 7b56eef05..a3e29f378 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -59,6 +59,7 @@ void ViewManager::ParticleView::resized(const boo::SWindowRect& root, const boo: void ViewManager::ParticleView::draw(boo::IGraphicsCommandQueue *gfxQ) { + gfxQ->clearTarget(false, true); if (m_vm.m_modelTest.IsLoaded()) { CModelFlags flags; diff --git a/Runtime/Graphics/CGraphics.cpp b/Runtime/Graphics/CGraphics.cpp index 7820a45ab..8cc43e537 100644 --- a/Runtime/Graphics/CGraphics.cpp +++ b/Runtime/Graphics/CGraphics.cpp @@ -119,6 +119,7 @@ void CGraphics::SetViewMatrix() /* Load position matrix */ /* Inverse-transpose */ g_GXModelViewInvXpose = g_GXModelView.inverse(); + g_GXModelViewInvXpose.m_origin.zeroOut(); g_GXModelViewInvXpose.m_basis.transpose(); /* Load normal matrix */ } @@ -156,16 +157,15 @@ zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect, zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix() { - CProjectionState& ref = g_Proj; float rml = g_Proj.x8_right - g_Proj.x4_left; float rpl = g_Proj.x8_right + g_Proj.x4_left; float tmb = g_Proj.xc_top - g_Proj.x10_bottom; float tpb = g_Proj.xc_top + g_Proj.x10_bottom; - float fmn = g_Proj.x18_far - g_Proj.x14_near; + float nmf = g_Proj.x14_near - g_Proj.x18_far; float fpn = g_Proj.x18_far + g_Proj.x14_near; return zeus::CMatrix4f(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f, 0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f, - 0.f, 0.f, -fpn / fmn, -2.f * g_Proj.x18_far * g_Proj.x14_near / fmn, + 0.f, 0.f, fpn / nmf, 2.f * g_Proj.x18_far * g_Proj.x14_near / nmf, 0.f, 0.f, -1.f, 0.f); } diff --git a/Runtime/Graphics/CModelBoo.cpp b/Runtime/Graphics/CModelBoo.cpp index 4ecb46258..8dfbd98e1 100644 --- a/Runtime/Graphics/CModelBoo.cpp +++ b/Runtime/Graphics/CModelBoo.cpp @@ -376,7 +376,7 @@ CModel::CModel(std::unique_ptr&& in, u32 dataLen, IObjectStore* store) { hecl::Runtime::ShaderTag tag(mat.heclIr, hmdlMeta.colorCount, hmdlMeta.uvCount, hmdlMeta.weightCount, - 0, mat.uvAnims.size(), false, false, true); + 0, mat.uvAnims.size(), true, true, true); matSet.m_shaders.push_back(CGraphics::g_ShaderCacheMgr->buildShader(tag, mat.heclIr, "CMDL", ctx)); } } diff --git a/hecl b/hecl index 26f586dbc..35db2400e 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 26f586dbc2a7a614abe0fb5b86bb2bc32c43b5f9 +Subproject commit 35db2400e471e01014808e51730c091562055035