From ef4a07e96388edf09a01da30331039c6999df1c3 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 21 Nov 2017 12:18:52 -1000 Subject: [PATCH] Frustum culling fix --- Runtime/CStateManager.cpp | 4 ++-- Runtime/Graphics/CBooRenderer.cpp | 4 ++-- hecl | 2 +- specter | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index db554ecae..0395bb407 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -576,7 +576,7 @@ void CStateManager::DrawAdditionalFilters() const zeus::CFrustum CStateManager::SetupViewForDraw(const SViewport& vp) const { - const CGameCamera* cam = static_cast(x870_cameraManager->GetCurrentCamera(*this)); + const CGameCamera* cam = x870_cameraManager->GetCurrentCamera(*this); zeus::CTransform camXf = x870_cameraManager->GetCurrentCameraTransform(*this); g_Renderer->SetWorldViewpoint(camXf); CBooModel::SetNewPlayerPositionAndTime(x84c_player->GetTranslation()); @@ -594,7 +594,7 @@ zeus::CFrustum CStateManager::SetupViewForDraw(const SViewport& vp) const zeus::CFrustum frustum; zeus::CProjection proj; proj.setPersp(zeus::SProjPersp{fov, width / height, cam->GetNearClipDistance(), cam->GetFarClipDistance()}); - frustum.updatePlanes(camXf, proj); + frustum.updatePlanes(CGraphics::g_GXModelView, proj); g_Renderer->SetClippingPlanes(frustum); //g_Renderer->PrimColor(zeus::CColor::skWhite); CGraphics::SetModelMatrix(zeus::CTransform::Identity()); diff --git a/Runtime/Graphics/CBooRenderer.cpp b/Runtime/Graphics/CBooRenderer.cpp index a8123c96c..9f94490bd 100644 --- a/Runtime/Graphics/CBooRenderer.cpp +++ b/Runtime/Graphics/CBooRenderer.cpp @@ -920,8 +920,8 @@ void CBooRenderer::DrawUnsortedGeometry(int areaIdx, int mask, int targetMask) if (!x44_frustumPlanes.aabbFrustumTest(model->x20_aabb)) { - //model->x40_25_modelVisible = false; - //continue; + model->x40_25_modelVisible = false; + continue; } if (x318_25_drawWireframe) diff --git a/hecl b/hecl index 8873d5245..2bfe803bf 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 8873d5245636361079db04a5cc031f775b3ca0cf +Subproject commit 2bfe803bf63aa17af34adac7c7b317dc8c646467 diff --git a/specter b/specter index 883a7498e..155d45537 160000 --- a/specter +++ b/specter @@ -1 +1 @@ -Subproject commit 883a7498e1124c12fe65040f76d4079591d7ad60 +Subproject commit 155d4553794a7428090c453c30dd15e17d0961f0