Skip to content

Commit

Permalink
update portfolio component.
Browse files Browse the repository at this point in the history
  • Loading branch information
SungJJinKang committed Feb 9, 2023
1 parent 17dd479 commit 118ca9b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 79 deletions.
9 changes: 4 additions & 5 deletions Doom3/Source/GameLogic/Benchmark.inl
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ void dooms::GameLogicStartPoint::StartGameLogic()
entity1Camera->SetClippingPlaneNear(1.0f);
entity1Camera->SetClippingPlaneFar(6500.0f);
entity1->AddComponent<Move_WASD>();
entity1->AddComponent<DeferredRenderingDebuggerController>();
entity1->AddComponent<PortfolioComponent>();
portfolioComponent = entity1->AddComponent<PortfolioComponent>();
/*
PathFollower* pathFollower = entity1->AddComponent<PathFollower>();
pathFollower->mTargetWayPointIndex = 1;
Expand Down Expand Up @@ -513,7 +512,7 @@ void dooms::GameLogicStartPoint::StartGameLogic()
auto meshRenderer = entity->AddComponent<MeshRenderer>();
meshRenderer->SetMesh(mesh);
meshRenderer->SetMaterial(materialList[Random::RandomUIntNumber(0, materialList.size() - 1)]);
//portfolioComponent->PlanesRenderers.push_back(meshRenderer);
portfolioComponent->PlanesRenderers.push_back(meshRenderer);

WanderComponent* wanderComp = entity->AddComponent<WanderComponent>();
wanderComp->mPoint1 = { Random::RandomFloatNumber(-1500.0f, 1500.0f) , y , Random::RandomFloatNumber(-1500.0f, 1500.0f) };
Expand Down Expand Up @@ -682,7 +681,7 @@ void dooms::GameLogicStartPoint::StartGameLogic()
auto meshRenderer = entity->AddComponent<MeshRenderer>();
meshRenderer->SetMesh(mesh);
meshRenderer->SetMaterial(material1);
//portfolioComponent->RockRenderers.push_back(meshRenderer);
portfolioComponent->RockRenderers.push_back(meshRenderer);

WanderComponent* wanderComp = entity->AddComponent<WanderComponent>();
wanderComp->mPoint1 = { Random::RandomFloatNumber(-3500.0f, 3500.0f) , Random::RandomFloatNumber(-3500.0f, 3500.0f) , Random::RandomFloatNumber(-3500.0f, 3500.0f) };
Expand All @@ -709,7 +708,7 @@ void dooms::GameLogicStartPoint::StartGameLogic()
auto meshRenderer = entity->AddComponent<MeshRenderer>();
meshRenderer->SetMesh(mesh);
meshRenderer->SetMaterial(material1);
//portfolioComponent->RockRenderers.push_back(meshRenderer);
portfolioComponent->RockRenderers.push_back(meshRenderer);

WanderComponent* wanderComp = entity->AddComponent<WanderComponent>();
wanderComp->mPoint1 = { Random::RandomFloatNumber(-3500.0f, 3500.0f) , Random::RandomFloatNumber(-3500.0f, 3500.0f) , Random::RandomFloatNumber(-3500.0f, 3500.0f) };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,25 @@ void dooms::PortfolioComponent::OnChangedByGUI(const dooms::reflection::DField&

UpdateGUI();

if(field_of_changed_field.CompareWithFieldName("AllRocksDesiredMaxDrawDistance"))
if(field_of_changed_field.CompareWithFieldName("AllRocksDesiredDrawDistance"))
{
for(auto renderer : RockRenderers)
{
renderer->SetDesiredMaxDrawDistance(AllRocksDesiredMaxDrawDistance);
renderer->SetDesiredMaxDrawDistance(AllRocksDesiredDrawDistance);
}
}

if (field_of_changed_field.CompareWithFieldName("AllPlanesDesiredMaxDrawDistance"))
if (field_of_changed_field.CompareWithFieldName("AllAirPlanesMaxDrawDistance"))
{
for (auto renderer : PlanesRenderers)
{
renderer->SetDesiredMaxDrawDistance(AllPlanesDesiredMaxDrawDistance);
renderer->SetDesiredMaxDrawDistance(AllAirPlanesMaxDrawDistance);
}
}
}

void dooms::PortfolioComponent::UpdateGUI()
{
dooms::graphics::graphicsSetting::IsSortObjectFrontToBack = Enabled_MultiThread_SortingFrontToBack;
//dooms::graphics::graphicsSetting::IsOverDrawVisualizationEnabled = OverdrawDebugger;

if (DeferredRenderingDebuggerController* component = GetOwnerEntity()->GetComponent<DeferredRenderingDebuggerController>())
{
component->SetPIPVisible(Enabled_DeferredRenderingDebugger);

}

dooms::physics::Physics_Setting::SetIsPhysicsOn(Is_Enabled_CollisionDebugging);
dooms::physics::Physics_Setting::IS_RENDER_PHYSICS_RAYCASTING_DEBUGGER = Is_Enabled_CollisionDebugging;

dooms::graphics::graphicsSetting::IsDrawMaskedOcclusionCullingBinTriangleStageDebugger = See_MaskedSWOcclusionCulling_Occluder;
dooms::graphics::graphicsSetting::IsDrawMaskedOcclusionCullingTileCoverageMaskDebugger = Is_Enabled_MaskedSWOcclusionCullingTileCoverageMaskDebugging;
dooms::graphics::graphicsSetting::IsDrawMaskedOcclusionCullingTileL0MaxDepthValueDebugger = See_MaskedSWOcclusionCulling_DepthBuffer;
Expand All @@ -55,7 +43,7 @@ void dooms::PortfolioComponent::UpdateGUI()
defaultGraphicsPipeLine->mRenderingCullingManager.mCullingSystem->SetEnabledCullingModule(culling::EveryCulling::CullingModuleType::_ViewFrustumCulling, Enable_Multithread_SW_ViewFrustumCulling);
defaultGraphicsPipeLine->mRenderingCullingManager.mCullingSystem->SetEnabledCullingModule(culling::EveryCulling::CullingModuleType::_MaskedSWOcclusionCulling, Enable_MaskedSWOccslusionCulling);
defaultGraphicsPipeLine->mRenderingCullingManager.mCullingSystem->SetEnabledCullingModule(culling::EveryCulling::CullingModuleType::_DistanceCulling, Enable_DistanceCulling);
defaultGraphicsPipeLine->mRenderingCullingManager.mCullingSystem->SetEnabledCullingModule(culling::EveryCulling::CullingModuleType::_PreCulling, Enable_PreCulling);
defaultGraphicsPipeLine->mRenderingCullingManager.mCullingSystem->SetEnabledCullingModule(culling::EveryCulling::CullingModuleType::_PreCulling, true);
}
}

Expand All @@ -64,26 +52,10 @@ void dooms::PortfolioComponent::InitComponent()

Base::InitComponent();

Enabled_MultiThread_SortingFrontToBack = true;
dooms::graphics::graphicsSetting::IsSortObjectFrontToBack = true;
dooms::graphics::graphicsSetting::IsDrawMaskedOcclusionCullingBinTriangleStageDebugger = See_MaskedSWOcclusionCulling_Occluder;
dooms::graphics::graphicsSetting::IsDrawMaskedOcclusionCullingTileCoverageMaskDebugger = Is_Enabled_MaskedSWOcclusionCullingTileCoverageMaskDebugging;
dooms::graphics::graphicsSetting::IsDrawMaskedOcclusionCullingTileL0MaxDepthValueDebugger = See_MaskedSWOcclusionCulling_DepthBuffer;

//OverdrawDebugger = false;
//dooms::graphics::graphicsSetting::IsOverDrawVisualizationEnabled = OverdrawDebugger;

Enabled_DeferredRenderingDebugger = false;
if (DeferredRenderingDebuggerController* component = GetOwnerEntity()->GetComponent<DeferredRenderingDebuggerController>())
{
component->SetPIPVisible(Enabled_DeferredRenderingDebugger);

}

Is_Enabled_CollisionDebugging = false;
dooms::physics::Physics_Setting::SetIsPhysicsOn(Is_Enabled_CollisionDebugging);
dooms::physics::Physics_Setting::IS_RENDER_PHYSICS_RAYCASTING_DEBUGGER = Is_Enabled_CollisionDebugging;

UpdateGUI();
}

Expand All @@ -105,23 +77,3 @@ void dooms::PortfolioComponent::OnEndOfFrame_Component()
{

}

void dooms::PortfolioComponent::SetBoxsStatic()
{
graphics::BatchRenderingManager::GetSingleton()->SetPauseBakeBatchMesh(true);
for(Entity* entity : StaticMobilitySetter)
{
entity->SetEntityMobility(eEntityMobility::Static);
}
graphics::BatchRenderingManager::GetSingleton()->SetPauseBakeBatchMesh(false);
}

void dooms::PortfolioComponent::SetBoxsDynamic()
{
graphics::BatchRenderingManager::GetSingleton()->SetPauseBakeBatchMesh(true);
for (Entity* entity : StaticMobilitySetter)
{
entity->SetEntityMobility(eEntityMobility::Dynamic);
}
graphics::BatchRenderingManager::GetSingleton()->SetPauseBakeBatchMesh(false);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,11 @@ class DOOM_API D_CLASS PortfolioComponent : public Component

private:

D_PROPERTY(TOOLTIP="Enable DeferredRendering Debugger")
bool Enabled_DeferredRenderingDebugger = false;

D_PROPERTY(TOOLTIP="Enable MultiThread Sorting Front to Back")
bool Enabled_MultiThread_SortingFrontToBack = false;

/*
D_PROPERTY(TOOLTIP="Enable Overdraw Debugger")
bool OverdrawDebugger = false;
*/

D_PROPERTY(INVISIBLE)
bool Is_Enabled_CollisionDebugging = false;

D_PROPERTY(TOOLTIP="See Selected Occluders of Masked SW Occlusion Culling")
bool See_MaskedSWOcclusionCulling_Occluder = false;

Expand All @@ -46,7 +37,6 @@ class DOOM_API D_CLASS PortfolioComponent : public Component
D_PROPERTY(TOOLTIP="See DepthBuffer of Masked SW Occlusion Culling")
bool See_MaskedSWOcclusionCulling_DepthBuffer = false;


D_PROPERTY(TOOLTIP = "Enable Multithreaded CPU View Frustum Culling")
bool Enable_Multithread_SW_ViewFrustumCulling = true;

Expand All @@ -56,13 +46,10 @@ class DOOM_API D_CLASS PortfolioComponent : public Component
D_PROPERTY(TOOLTIP = "Enable Distance Culling")
bool Enable_DistanceCulling = true;

D_PROPERTY(INVISIBLE, TOOLTIP = "Enable PreCulling Culling")
bool Enable_PreCulling = true;

D_PROPERTY(MIN=0.0, TOOLTIP ="Set DesiredMaxDrawDistance to All Rocks's Renderer ( Test )")
float AllRocksDesiredMaxDrawDistance = 8000.0f;
D_PROPERTY(MIN=0.0, TOOLTIP = "Set DesiredMaxDrawDistance to All Planes's Renderer ( Test )")
float AllPlanesDesiredMaxDrawDistance = 8000.0f;
float AllRocksDesiredDrawDistance = 8000.0f;
D_PROPERTY(MIN=0.0, TOOLTIP = "Set DesiredMaxDrawDistance to All Air Planes's Renderer ( Test )")
float AllAirPlanesMaxDrawDistance = 8000.0f;

void OnChangedByGUI(const dooms::reflection::DField& dFieldOfChangedField) override;

Expand All @@ -79,10 +66,5 @@ class DOOM_API D_CLASS PortfolioComponent : public Component
void UpdateComponent() override;
void OnEndOfFrame_Component() override;

D_FUNCTION()
void SetBoxsStatic();
D_FUNCTION()
void SetBoxsDynamic();

};
}

0 comments on commit 118ca9b

Please sign in to comment.