diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index e54cbed06..ea9bf389c 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -35,7 +35,7 @@ 01.Levels\01.Logo - 01.Levels\01.Logo\02.GamePlay + 01.Levels\02.GamePlay 03.InfoInstance @@ -848,6 +848,9 @@ {e68261eb-a581-4bf5-b48d-b47cc81f7406} + + {7e641382-9dfa-4da7-a8c8-a3ee06360e7a} + {c02bfd67-091b-4636-a45f-34a3603ffbd8} @@ -887,7 +890,7 @@ 01.Levels\01.Logo - 01.Levels\01.Logo\02.GamePlay + 01.Levels\02.GamePlay 03.InfoInstance diff --git a/Jusin154_Team3D/Client/Private/Decendo.cpp b/Jusin154_Team3D/Client/Private/Decendo.cpp index f5445947a..406a3e61f 100644 --- a/Jusin154_Team3D/Client/Private/Decendo.cpp +++ b/Jusin154_Team3D/Client/Private/Decendo.cpp @@ -201,7 +201,7 @@ HRESULT CDecendo::Pre_Setting(CGameObject* pObject, void* pArg) CUnit* pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); if (nullptr != pTargetUnit) { - XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_WorldPostion()); + XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_LockOnPos()); XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); } diff --git a/Jusin154_Team3D/Client/Private/EffectPool.cpp b/Jusin154_Team3D/Client/Private/EffectPool.cpp index 0006b58c4..7dcecb132 100644 --- a/Jusin154_Team3D/Client/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Client/Private/EffectPool.cpp @@ -122,6 +122,7 @@ HRESULT CEffectPool::Bind_ShaderResources() HRESULT CEffectPool::Ready_Effect() { +#ifndef 기무리 if(FAILED(Create_Effect(SKILL_TYPE::JAP, 10, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CNomalJap* pEffect = nullptr; @@ -130,7 +131,6 @@ HRESULT CEffectPool::Ready_Effect() return pEffect;} ))) return E_FAIL; -#ifndef 기무리 if (FAILED(Create_Effect(SKILL_TYPE::BOMBARDA, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index cedaacd81..a940e626d 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -172,6 +172,17 @@ HRESULT CGoblin::Render() return S_OK; } +_vector CGoblin::Get_LockOnPos() +{ + if (nullptr != m_pCharacter_Controller && true == m_pCharacter_Controller->IsActive()) { + return m_pCharacter_Controller->Get_Position(); + } + else if (nullptr != m_pRigidBody) { + return m_pRigidBody->Get_Position(); + } + return Get_WorldPostion(); +} + void CGoblin::OnCollision(CGameObject* pOther, void* pDesc) { ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 4771134e1..79f95116b 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -1298,16 +1298,19 @@ HRESULT CLoader::Loading_For_GamePlay() #pragma region ACTOR if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Npc_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){ return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){ return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Troll/Troll.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/SubTroll/troll.fbx", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){ return E_FAIL; + } #pragma endregion @@ -1433,327 +1436,6 @@ HRESULT CLoader::Loading_For_GamePlay() }); -//#pragma region MAP_MODELS -// vector> jobFutures; -// -// _uint iLoadCount = 46; -// vector*> Contents(iLoadCount); -//{ -// { /* Terrain */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Terrain", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Terrain", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// -// { /* Ollivanders*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// -// { /* Gatehouse*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Gatehouse/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// -// { /* TScrolls */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Collisions", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* 3BroomStick*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes/3Broom_Kit", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// -// -// { /* BLDG_QuidditchShop */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_HogsheadInn */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Honeydukes */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_OwlPost */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_TeaShop */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Zonkos */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_DB_GR */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Potions */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Collisions", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Salon */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* Hengist_Tree */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Vegetation/Hengist_Tree", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Vegetation", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN A*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN B*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN C*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN E*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN F*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN G*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN H*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN J*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -//} -// -// -// for (auto& jobFuture : jobFutures) -// { -// jobFuture.get(); -// } -// -// for (_uint i = 0; i < Contents.size(); ++i) { -// for (_uint j = 0; j < (Contents[i])->size(); ++j) { -// FOLDER_LOAD* pContents = (*Contents[i])[j]; -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { -// return E_FAIL; -// } -// -// for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { -// return E_FAIL; -// } -// } -// -// } -// } -// -// for (_uint i = 0; i < Contents.size(); ++i) { -// for (_uint j = 0; j < (Contents[i])->size(); ++j) { -// Safe_Delete((*Contents[i])[j]); -// } -// Safe_Delete(Contents[i]); -// } -//#pragma endregion -// - - m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다."); /* For.Prototype_GameObject_UI_Manager*/ @@ -2175,30 +1857,30 @@ HRESULT CLoader::Loading_For_GamePlay() } -//#pragma region RECEIVE_THREAD -// { // MapModels -// _uint iIndex = 0; -// for (auto& JobMapModels : jobMapModels) -// { -// vector* pOut = JobMapModels.get(); -// for (_uint i = 0; i < pOut->size(); ++i) { -// FOLDER_LOAD* pContents = (*pOut)[i]; -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { -// return E_FAIL; -// } -// -// for (_uint j = 0; j < pContents->pRigidBodyTags.size(); ++j) { -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[j], pContents->LoadedRigidBody[j]))) { -// return E_FAIL; -// } -// } -// Safe_Delete(pContents); -// } -// iIndex++; -// Safe_Delete(pOut); -// } -// } -//#pragma endregion +#pragma region RECEIVE_THREAD + //{ // MapModels + // _uint iIndex = 0; + // for (auto& JobMapModels : jobMapModels) + // { + // vector* pOut = JobMapModels.get(); + // for (_uint i = 0; i < pOut->size(); ++i) { + // FOLDER_LOAD* pContents = (*pOut)[i]; + // if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { + // return E_FAIL; + // } + + // for (_uint j = 0; j < pContents->pRigidBodyTags.size(); ++j) { + // if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[j], pContents->LoadedRigidBody[j]))) { + // return E_FAIL; + // } + // } + // Safe_Delete(pContents); + // } + // iIndex++; + // Safe_Delete(pOut); + // } + //} +#pragma endregion m_strMessage = TEXT("정보를 불러오는 중입니다."); m_strMessage = TEXT("로딩이 완료되었습니다.."); diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp index 5e364efd2..150f467bf 100644 --- a/Jusin154_Team3D/Client/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp @@ -68,8 +68,9 @@ void CNomalJap::Priority_Update(_float fTimeDelta) void CNomalJap::Update(_float fTimeDelta) { - if (m_bVisible == false) + if (m_bVisible == false){ return; + } __super::Update(fTimeDelta); @@ -215,12 +216,11 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject, void* pArg) CUnit* pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); if (nullptr != pTargetUnit) { + XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_LockOnPos()); - XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_WorldPostion()); - - if(XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))) >= 35.f) //거리가 일정 이상이라면 그냥 정면으로 발사 + if (XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))) >= 35.f) { //거리가 일정 이상이라면 그냥 정면으로 발사 XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f); - + } XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index 9d1ba543b..688561087 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -188,6 +188,17 @@ HRESULT CTroll::Render() return S_OK; } +_vector CTroll::Get_LockOnPos() +{ + if (nullptr != m_pCharacter_Controller && true == m_pCharacter_Controller->IsActive()) { + return m_pCharacter_Controller->Get_Position(); + } + else if (nullptr != m_pRigidBody) { + return m_pRigidBody->Get_Position(); + } + return Get_WorldPostion(); +} + void CTroll::OnCollision(CGameObject* pOther, void* pDesc) { ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); diff --git a/Jusin154_Team3D/Client/Public/Goblin.h b/Jusin154_Team3D/Client/Public/Goblin.h index 61aff89a6..e70a6b496 100644 --- a/Jusin154_Team3D/Client/Public/Goblin.h +++ b/Jusin154_Team3D/Client/Public/Goblin.h @@ -26,6 +26,7 @@ class CGoblin final : public CMonster virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; + virtual _vector Get_LockOnPos() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override; virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override; diff --git a/Jusin154_Team3D/Client/Public/Troll.h b/Jusin154_Team3D/Client/Public/Troll.h index 3af05aa9c..a1dc4e9bf 100644 --- a/Jusin154_Team3D/Client/Public/Troll.h +++ b/Jusin154_Team3D/Client/Public/Troll.h @@ -29,6 +29,7 @@ class CTroll final : public CMonster virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; + virtual _vector Get_LockOnPos() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override; virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/BaseFlattenNormalMap.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/BaseFlattenNormalMap.dds deleted file mode 100644 index 3e734c79d..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/BaseFlattenNormalMap.dds and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/BaseFlattenNormalMap.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/BaseFlattenNormalMap.png new file mode 100644 index 000000000..d8e1fd944 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/BaseFlattenNormalMap.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/SK_Troll_ArmoredTroll_CMB_Master.psk b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/SK_Troll_ArmoredTroll_CMB_Master.psk deleted file mode 100644 index 72def4abe..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/SK_Troll_ArmoredTroll_CMB_Master.psk and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/T_Troll_CMB_Mountain1_N.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/T_Troll_CMB_Mountain1_N.dds new file mode 100644 index 000000000..2971ab538 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/T_Troll_CMB_Mountain1_N.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/troll.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/troll.bin deleted file mode 100644 index c07d2edd2..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/troll.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:54e1234838ed0c62bbbdba5b52fdf4254a2c7e05638d2b9fbf5e50dbbf8d4471 -size 5161199 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/troll.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/troll.fbx index 11203c581..4ed5bba04 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/troll.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/troll.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:19bf2069e6472c5980e65d607226690b32272a6d71afcf1e5498961c88d5e223 -size 2285276 +oid sha256:33783d796335f0fdefff1f06f34cec423975b05d8147e4316902ac73d9dcf200 +size 135867852 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/troll.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/troll.xml new file mode 100644 index 000000000..6d1d8c574 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/troll.xml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Constants.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Constants.hlsli index 372ecfae5..f46cc1fc0 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Constants.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Constants.hlsli @@ -40,8 +40,8 @@ static const float AI_TEXTURE_TYPE_MAYA_SPECULAR = 23.f / 27.f; static const float AI_TEXTURE_TYPE_MAYA_SPECULAR_COLOR = 24.f / 27.f; static const float AI_TEXTURE_TYPE_MAYA_SPECULAR_ROUGHNESS = 25.f / 27.f; static const float AI_TEXTURE_TYPE_ANISOTROPY = 26.f / 27.f; -static const float AI_TEXTURE_TYPE_GLTF_METALLIC_ROUGHNESS = 27.f / 27.f; - +static const uint AI_TEXTURE_TYPE_GLTF_METALLIC_ROUGHNESS = 1; +static const uint AI_TEXTURE_TYPE_MAX = AI_TEXTURE_TYPE_GLTF_METALLIC_ROUGHNESS; #endif // ENGINE_SHADER_CONSTANTS_HLSLI diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index c03ca7829..f9ef153d5 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -246,6 +246,15 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) fRoughness = vSRO.g; fOcclusion = vSRO.b; } + else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_ANISOTROPY)) + { + fMetallic = 0.f; + + float4 vSRXO = g_SurfaceTexture.Sample(DefaultSampler, uv); + vF0 = vSRXO.rrr; + fRoughness = vSRXO.g; + fOcclusion = vSRXO.a; + } else // basic Lighting(phong blinn) // if you were here, you miss some assets. { Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (fAmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient)); @@ -912,7 +921,12 @@ PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In) float4 vDepthDesc = g_DepthTexture.Sample(PointSampler, uv); float fCenterViewSpaceZ = vDepthDesc.y * g_fFar; // n ~ f - + float fRatio = lerp(0.f, 1.f, (g_fFar - fCenterViewSpaceZ) / g_fFar); + if (fRatio <= 0.f) + { + Out.fOcclusion = 1.f; + return Out; + } float4 vCenterViewPosition; { vCenterViewPosition.x = uv.x * 2.f - 1.f; @@ -957,8 +971,8 @@ PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In) fIsOccluded *= fRangeCheck; fOcclusion += fIsOccluded; } - fOcclusion = (1.f - (fOcclusion / g_iKernelSize)); - Out.fOcclusion = fOcclusion; + fOcclusion = (1.f - (fOcclusion / g_iKernelSize) * fRatio); + Out.fOcclusion = fOcclusion ; return Out; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index b65b093b0..21c3264cc 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -23,8 +23,12 @@ Texture2D g_NormalTexture; Texture2D g_DAOTexture; Texture2D g_THVTexture; Texture2D g_SurfaceParamsTexture; +Texture2D g_TransmissionTexture; +Texture2D g_EmissiveTexture; +bool g_bBinded_Texture[AI_TEXTURE_TYPE_MAX * 27]; + float3 g_RootColor; float3 g_TipColor; float3 g_DyeColor; @@ -249,12 +253,19 @@ PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; - vector vMtrlDiffuse = g_DiffuseTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); - vector vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); - if (vMtrlDiffuse.a < 0.2f) - { - discard; - } + float4 vMtrlDiffuse = g_DiffuseTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + float4 vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + //if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_TRANSMISSION], true)) + //{ + // float4 vTransmission = g_TransmissionTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + // vMtrlDiffuse *= vTransmission; + //} + //if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_EMISSIVE], true)) + //{ + // float4 vEmissive = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + // vMtrlDiffuse += vEmissive; + //} + if (vMtrlDiffuse.a < 0.2f) { discard; } float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, AnisoTropy_BLUR_Sampler, In.vTexcoord); float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); @@ -269,10 +280,15 @@ PS_OUT PS_MAIN(PS_IN In) Out.vAlbedo = vMtrlDiffuse; Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); + float fSurfaceParam = g_fUsingSurfaceParams; + if (true == AlmostEqual7(g_fUsingSurfaceParams, 0.f)) + { + fSurfaceParam = 0; + } Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 깊이 ( 0~ 1) - (In.vProjPos.w / g_fFar), // 뷰 스페이스 Z - g_fUsingSurfaceParams, // 서페이스 파라미터 - 1.f); + (In.vProjPos.w / g_fFar), // 뷰 스페이스 Z + fSurfaceParam, // 서페이스 파라미터 + 1.f); Out.vColor = float4(0.f, 0.f, 0.f, 1.f); Out.vSurface = vSurface; @@ -335,7 +351,7 @@ PS_OUT_OUTLINE PS_MAIN_OUTLINE(PS_IN_OUTLINE In) Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 깊이 ( 0~ 1) (In.vProjPos.w / g_fFar), // 뷰 스페이스 Z - 0, // 서페이스 파라미터 + AI_TEXTURE_TYPE_METALNESS, // 서페이스 파라미터 1.f); return Out; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl index 1be6fa4d8..3750acda3 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl @@ -26,13 +26,19 @@ float2 g_vClipBoxSize; float2 g_vClipBoxLTPos; Texture2D g_DiffuseTexture; +Texture2D g_NormalTexture; +Texture2D g_DAOTexture; +Texture2D g_THVTexture; +Texture2D g_SurfaceParamsTexture; +Texture2D g_TransmissionTexture; +Texture2D g_EmissiveTexture; + +bool g_bBinded_Texture[AI_TEXTURE_TYPE_MAX * 27]; + Texture2D g_MaskingTexture; Texture2D g_ClippingTexture; Texture2D g_DisolveTexture; -Texture2D g_NormalTexture; Texture2D g_GlowTexture; -Texture2D g_SurfaceParamsTexture; -Texture2D g_EmissiveTexture; Texture2D g_GlassTexture; float g_fBloomStrength; @@ -226,10 +232,24 @@ PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; - vector vMtrlDiffuse = g_DiffuseTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); - vector vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); - if (vMtrlDiffuse.a < 0.2f) { discard; } - + float4 vMtrlDiffuse = g_DiffuseTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + float4 vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_TRANSMISSION], true)) + { + float4 vTransmission = g_TransmissionTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + vMtrlDiffuse *= vTransmission; + } + if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_EMISSIVE], true)) + { + float4 vEmissive = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + vMtrlDiffuse += vEmissive; + } + if (vMtrlDiffuse.a < 0.2f) + { + discard; + } + + float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, AnisoTropy_BLUR_Sampler, In.vTexcoord); float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); @@ -237,10 +257,15 @@ PS_OUT PS_MAIN(PS_IN In) Out.vAlbedo = vMtrlDiffuse; Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); + float fSurfaceParam = g_fUsingSurfaceParams; + if (true == AlmostEqual7(g_fUsingSurfaceParams, 0.f)) + { + fSurfaceParam = 0; + } Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 깊이 ( 0~ 1) - (In.vProjPos.w / g_fFar), // 뷰 스페이스 Z - g_fUsingSurfaceParams, // 서페이스 파라미터 - 1.f); + (In.vProjPos.w / g_fFar), // 뷰 스페이스 Z + fSurfaceParam, // 서페이스 파라미터 + 1.f); Out.vColor = float4(0.f, 0.f, 0.f, 1.f); Out.vSurface = vSurface; diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 99d13e345..133f11df7 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -135,6 +135,11 @@ 5.0 + + cd /d "$(SolutionDir)" +call Update_Shaders.bat + + @@ -161,6 +166,11 @@ + + cd /d "$(SolutionDir)" +call Update_Shaders.bat + + diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 58e06904d..c86d171d1 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -1672,7 +1672,7 @@ HRESULT CLoader::Loading_For_Bloom() #pragma region HAIR futures.emplace_back(Deferred_ModelLoad( - MODEL::INDEPENDENT, "../Bin/Resources/Models/Monster/SubTroll/troll.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/SubTroll/troll.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), TEXT("Prototype_Component_SubTroll_Model") )); diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Constants.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Constants.hlsli index 372ecfae5..f46cc1fc0 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Constants.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Constants.hlsli @@ -40,8 +40,8 @@ static const float AI_TEXTURE_TYPE_MAYA_SPECULAR = 23.f / 27.f; static const float AI_TEXTURE_TYPE_MAYA_SPECULAR_COLOR = 24.f / 27.f; static const float AI_TEXTURE_TYPE_MAYA_SPECULAR_ROUGHNESS = 25.f / 27.f; static const float AI_TEXTURE_TYPE_ANISOTROPY = 26.f / 27.f; -static const float AI_TEXTURE_TYPE_GLTF_METALLIC_ROUGHNESS = 27.f / 27.f; - +static const uint AI_TEXTURE_TYPE_GLTF_METALLIC_ROUGHNESS = 1; +static const uint AI_TEXTURE_TYPE_MAX = AI_TEXTURE_TYPE_GLTF_METALLIC_ROUGHNESS; #endif // ENGINE_SHADER_CONSTANTS_HLSLI diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index c03ca7829..f9ef153d5 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -246,6 +246,15 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) fRoughness = vSRO.g; fOcclusion = vSRO.b; } + else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_ANISOTROPY)) + { + fMetallic = 0.f; + + float4 vSRXO = g_SurfaceTexture.Sample(DefaultSampler, uv); + vF0 = vSRXO.rrr; + fRoughness = vSRXO.g; + fOcclusion = vSRXO.a; + } else // basic Lighting(phong blinn) // if you were here, you miss some assets. { Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (fAmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient)); @@ -912,7 +921,12 @@ PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In) float4 vDepthDesc = g_DepthTexture.Sample(PointSampler, uv); float fCenterViewSpaceZ = vDepthDesc.y * g_fFar; // n ~ f - + float fRatio = lerp(0.f, 1.f, (g_fFar - fCenterViewSpaceZ) / g_fFar); + if (fRatio <= 0.f) + { + Out.fOcclusion = 1.f; + return Out; + } float4 vCenterViewPosition; { vCenterViewPosition.x = uv.x * 2.f - 1.f; @@ -957,8 +971,8 @@ PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In) fIsOccluded *= fRangeCheck; fOcclusion += fIsOccluded; } - fOcclusion = (1.f - (fOcclusion / g_iKernelSize)); - Out.fOcclusion = fOcclusion; + fOcclusion = (1.f - (fOcclusion / g_iKernelSize) * fRatio); + Out.fOcclusion = fOcclusion ; return Out; } diff --git a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp index 17b8165fe..bfd7916d1 100644 --- a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp @@ -123,7 +123,7 @@ HRESULT CInstance_Model::Assimp_Model_Load(const _char* pModelFilePath, MODEL eT _uint iFlag = {}; iFlag = aiProcess_ConvertToLeftHanded | aiProcessPreset_TargetRealtime_Fast; - if (MODEL::NONANIM == eType || MODEL::ENVIROMENT == eType) { + if (MODEL::NONANIM == eType || MODEL::PBR_NONANIM == eType || MODEL::ENVIROMENT == eType) { iFlag |= aiProcess_PreTransformVertices; } m_iRootBoneIndex = iRootBoneIndex; diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp index 9fc9172a5..22a4b781e 100644 --- a/Jusin154_Team3D/Engine/Private/Material.cpp +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -101,36 +101,50 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, MODEL eType, const ai if ((tinyxml2::XML_SUCCESS != xmldoc.LoadFile(xmlFilePath.string().c_str()))) { return E_FAIL; } - { - tinyxml2::XMLNode* pNode = xmldoc.FirstChildElement("Material"); - if (pNode == nullptr){ - return E_FAIL; - } - tinyxml2::XMLElement* pRoot = pNode->FirstChildElement("Material"); - if (nullptr == pRoot) { - return E_FAIL; - } - _int iIndex = 0; - for (tinyxml2::XMLElement* pElement = pRoot->FirstChildElement("Container"); pElement; pElement = pElement->NextSiblingElement("Container"), ++iIndex) - { - const _char* pFileName = pElement->Attribute("Filename"); - const _char* pExtention = pElement->Attribute("Extension"); - if (nullptr == pFileName || '\0' == pFileName[0] - || nullptr == pExtention || '\0' == pExtention[0]) { - continue; - } - else { - xmlFilePath.replace_filename(pFileName); - xmlFilePath.replace_extension(pExtention); - } - pSRV = m_pGameInstance->Add_Resource(xmlFilePath.string().c_str()); - if (nullptr == pSRV) { - return E_FAIL; - } - m_SRVs[iIndex].push_back(pSRV); - m_SaveMaterial.Path[iIndex].push_back(xmlFilePath.string()); + tinyxml2::XMLElement* pRoot = xmldoc.FirstChildElement("Material"); + if (pRoot == nullptr){ + return E_FAIL; + } + + aiString aistrName = pAIMaterial->GetName(); + string xmlMaterialName = aistrName.C_Str(); + + tinyxml2::XMLElement* pElement = pRoot->FirstChildElement(xmlMaterialName.c_str()); + + if (pElement == nullptr){ + return E_FAIL; + } + + filesystem::path pathFolder = xmlFilePath.parent_path(); + + for (tinyxml2::XMLElement* typeElement = pElement->FirstChildElement(); + typeElement != nullptr; + typeElement = typeElement->NextSiblingElement()) + { + _int typeIndex = typeElement->IntAttribute("Index", -1); + if (typeIndex < 0){ + continue; } + + const _char* pFileNameAtt = typeElement->Attribute("Filename"); + const _char* pExtensionAtt = typeElement->Attribute("Extension"); + + if (pFileNameAtt == nullptr || pFileNameAtt[0] == '\0' + || pExtensionAtt == nullptr || pExtensionAtt[0] == '\0') { + continue; + } + + filesystem::path pathResourceFile = pathFolder / pFileNameAtt; + pathResourceFile.replace_extension(pExtensionAtt); + + pSRV = m_pGameInstance->Add_Resource(pathResourceFile.string().c_str()); + if (nullptr == pSRV){ + return E_FAIL; + } + + m_SRVs[typeIndex].push_back(pSRV); + m_SaveMaterial.Path[typeIndex].push_back(pathResourceFile.string()); } return S_OK; @@ -453,7 +467,6 @@ HRESULT CMaterial::Bind_SRV(CShader* pShader) // return S_OK; //} - const _char* pConstantName = ""; _float fZero = 0.f; if (FAILED(pShader->Bind_RawValue("g_fUsingSurfaceParams", &fZero, sizeof(_float)))) { return E_FAIL; @@ -461,87 +474,108 @@ HRESULT CMaterial::Bind_SRV(CShader* pShader) if (FAILED(pShader->Bind_SRV("g_SurfaceParamsTexture", nullptr))) { return E_FAIL; } - + _bool bBinded[AI_TEXTURE_TYPE_MAX] = {}; for (_uint iTextureType = 0; iTextureType < AI_TEXTURE_TYPE_MAX; ++iTextureType) { + const _char* pConstantName = ""; + bBinded[iTextureType] = true; if (m_SRVs[iTextureType].empty()) { - continue; + bBinded[iTextureType] = false; } - switch (aiTextureType(iTextureType)) - { - case aiTextureType_NONE: - break; - case aiTextureType_DIFFUSE: - pConstantName = "g_DiffuseTexture"; - break; - case aiTextureType_SPECULAR: - { - _float fUsingSurfaceParams = ((_float)iTextureType / (_float)AI_TEXTURE_TYPE_MAX); - pConstantName = "g_SurfaceParamsTexture"; - pShader->Bind_RawValue("g_fUsingSurfaceParams", &fUsingSurfaceParams, sizeof(_float)); - } break; - case aiTextureType_AMBIENT: - break; - case aiTextureType_EMISSIVE: - break; - case aiTextureType_HEIGHT: - break; - case aiTextureType_NORMALS: - pConstantName = "g_NormalTexture"; - break; - case aiTextureType_SHININESS: - break; - case aiTextureType_OPACITY: - break; - case aiTextureType_DISPLACEMENT: - break; - case aiTextureType_LIGHTMAP: - break; - case aiTextureType_REFLECTION: - break; - case aiTextureType_BASE_COLOR: - break; - case aiTextureType_NORMAL_CAMERA: - break; - case aiTextureType_EMISSION_COLOR: - break; - case aiTextureType_METALNESS: - { - _float fUsingSurfaceParams = ((_float)iTextureType / (_float)AI_TEXTURE_TYPE_MAX); - pConstantName = "g_SurfaceParamsTexture"; - pShader->Bind_RawValue("g_fUsingSurfaceParams", &fUsingSurfaceParams, sizeof(_float)); - } break; - case aiTextureType_DIFFUSE_ROUGHNESS: - break; - case aiTextureType_AMBIENT_OCCLUSION: - break; - case aiTextureType_UNKNOWN: - break; - case aiTextureType_SHEEN: - break; - case aiTextureType_CLEARCOAT: - break; - case aiTextureType_TRANSMISSION: - break; - case aiTextureType_MAYA_BASE: - break; - case aiTextureType_MAYA_SPECULAR: - break; - case aiTextureType_MAYA_SPECULAR_COLOR: - break; - case aiTextureType_MAYA_SPECULAR_ROUGHNESS: - break; - case aiTextureType_ANISOTROPY: - break; - case aiTextureType_GLTF_METALLIC_ROUGHNESS: - break; - case _aiTextureType_Force32Bit: - break; - default: - break; + else { + switch (aiTextureType(iTextureType)) + { + case aiTextureType_NONE: + break; + case aiTextureType_DIFFUSE: + pConstantName = "g_DiffuseTexture"; + break; + case aiTextureType_SPECULAR: + { + _float fUsingSurfaceParams = ((_float)iTextureType / (_float)AI_TEXTURE_TYPE_MAX); + pConstantName = "g_SurfaceParamsTexture"; + if (!m_SRVs[iTextureType].empty()) { + pShader->Bind_RawValue("g_fUsingSurfaceParams", &fUsingSurfaceParams, sizeof(_float)); + } + } break; + case aiTextureType_AMBIENT: + break; + case aiTextureType_EMISSIVE: + pConstantName = "g_EmissiveTexture"; + break; + case aiTextureType_HEIGHT: + break; + case aiTextureType_NORMALS: + pConstantName = "g_NormalTexture"; + break; + case aiTextureType_SHININESS: + break; + case aiTextureType_OPACITY: + break; + case aiTextureType_DISPLACEMENT: + break; + case aiTextureType_LIGHTMAP: + break; + case aiTextureType_REFLECTION: + break; + case aiTextureType_BASE_COLOR: + break; + case aiTextureType_NORMAL_CAMERA: + break; + case aiTextureType_EMISSION_COLOR: + break; + case aiTextureType_METALNESS: + { + _float fUsingSurfaceParams = ((_float)iTextureType / (_float)AI_TEXTURE_TYPE_MAX); + pConstantName = "g_SurfaceParamsTexture"; + if (!m_SRVs[iTextureType].empty()) { + pShader->Bind_RawValue("g_fUsingSurfaceParams", &fUsingSurfaceParams, sizeof(_float)); + } + } break; + case aiTextureType_DIFFUSE_ROUGHNESS: + break; + case aiTextureType_AMBIENT_OCCLUSION: + break; + case aiTextureType_UNKNOWN: + break; + case aiTextureType_SHEEN: + break; + case aiTextureType_CLEARCOAT: + break; + case aiTextureType_TRANSMISSION: + pConstantName = "g_TransmissionTexture"; + break; + case aiTextureType_MAYA_BASE: + break; + case aiTextureType_MAYA_SPECULAR: + break; + case aiTextureType_MAYA_SPECULAR_COLOR: + break; + case aiTextureType_MAYA_SPECULAR_ROUGHNESS: + break; + case aiTextureType_ANISOTROPY: + { + _float fUsingSurfaceParams = ((_float)iTextureType / (_float)AI_TEXTURE_TYPE_MAX); + pConstantName = "g_SurfaceParamsTexture"; + if (!m_SRVs[iTextureType].empty()) { + pShader->Bind_RawValue("g_fUsingSurfaceParams", &fUsingSurfaceParams, sizeof(_float)); + } + } break; + case _aiTextureType_Force32Bit: + break; + default: + break; + } + } + if (true == bBinded[iTextureType]) { + if (FAILED(pShader->Bind_SRV(pConstantName, m_SRVs[iTextureType][0]))) { + return S_OK; + } } - - pShader->Bind_SRV(pConstantName, m_SRVs[iTextureType][0]); } + if (FAILED(pShader->Bind_RawValue("g_bBinded_Texture", &bBinded, sizeof(bBinded)))) { + return E_FAIL; + } + return S_OK; } diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index 3b4264904..83233ea77 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -72,10 +72,25 @@ HRESULT CMesh::Initialize_Prototype(MODEL eType, vector& Bones, co #pragma region VERTEX_BUFFER - HRESULT hr = (eType == MODEL::NONANIM) ? - Ready_VertexBuffer_For_NonAnim(pAIMesh, PreTransformMatrix) : - Ready_VertexBuffer_For_Anim(Bones, pAIMesh); - + HRESULT hr = {}; + switch (eType) + { + case Engine::MODEL::NONANIM: + case Engine::MODEL::PBR_NONANIM: + hr = Ready_VertexBuffer_For_NonAnim(pAIMesh, PreTransformMatrix); + break; + case Engine::MODEL::ANIM: + case Engine::MODEL::PBR_ANIM: + hr = Ready_VertexBuffer_For_Anim(Bones, pAIMesh); + break; + case Engine::MODEL::ENVIROMENT: + break; + default: + break; + } + if (FAILED(hr)) { + return E_FAIL; + } #pragma endregion #pragma region INDEX_BUFFER @@ -183,13 +198,25 @@ HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* } #pragma region VERTEX_BUFFER - - HRESULT hr = MODEL::NONANIM == eType ? - Ready_VertexBuffer_For_NonAnim(_SaveMesh, PreTransformMatrix) : - Ready_VertexBuffer_For_Anim(pModel, _SaveMesh); - - if (FAILED(hr)) + HRESULT hr = {}; + switch (eType) + { + case Engine::MODEL::NONANIM: + case Engine::MODEL::PBR_NONANIM: + hr = Ready_VertexBuffer_For_NonAnim(_SaveMesh, PreTransformMatrix); + break; + case Engine::MODEL::ANIM: + case Engine::MODEL::PBR_ANIM: + hr = Ready_VertexBuffer_For_Anim(pModel, _SaveMesh); + break; + case Engine::MODEL::ENVIROMENT: + break; + default: + break; + } + if (FAILED(hr)){ return E_FAIL; + } #pragma endregion diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index a026f4da4..401288758 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -105,11 +105,13 @@ HRESULT CModel::Bind_BoneMatrices(_uint iMeshIndex, CShader* pShader, const _cha _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform) { - if (!m_bPlayAnim) + if (!m_bPlayAnim){ return false; + } - if (m_iCurrentAnimIndex < 0 || m_iCurrentAnimIndex >= (_int)m_iNumAnimations) + if (m_iCurrentAnimIndex < 0 || m_iCurrentAnimIndex >= (_int)m_iNumAnimations){ return false; + } if (m_iCurrSecondAnimIndex >= 0) { Play_Dual_Anim(fTimeDelta, pTransform); @@ -1168,7 +1170,7 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma _uint iFlag = {}; iFlag = aiProcess_ConvertToLeftHanded | aiProcessPreset_TargetRealtime_Fast; - if (MODEL::NONANIM == eType || MODEL::ENVIROMENT == eType) { + if (MODEL::NONANIM == eType || MODEL::PBR_NONANIM == eType || MODEL::ENVIROMENT == eType) { iFlag |= aiProcess_PreTransformVertices; } m_iRootBoneIndex = iRootBoneIndex; @@ -1202,7 +1204,7 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma return E_FAIL; } } - else if (MODEL::INDEPENDENT == eType) { + else if (MODEL::PBR_NONANIM == eType || MODEL::PBR_ANIM == eType) { if (FAILED(Ready_Materials_Independent(eType, m_pAIScene, pModelFilePath))) { return E_FAIL; } @@ -1811,7 +1813,7 @@ HRESULT CModel::Initialize(void* pArg) SAFE_ADDREF(m_pTransform); - if (m_eType == MODEL::ANIM || m_eType == MODEL::ANIM_LOCAL) + if (m_eType == MODEL::ANIM || m_eType == MODEL::PBR_ANIM || m_eType == MODEL::ANIM_LOCAL) { Initialize_RootBone(); InItialize_BoneIndex(); diff --git a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp index 6402d980a..d06d34691 100644 --- a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp +++ b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp @@ -144,6 +144,13 @@ HRESULT CRigidBody_Dynamic::ConvertToCCT(CCharacter_Controller& CCTOriginal) return E_FAIL; } +_vector CRigidBody_Dynamic::Get_Position() +{ + PSX::PxVec3 pxPos = m_pRigidBody->getGlobalPose().p; + _vector vPos = { pxPos.x, pxPos.y, pxPos.z }; + return vPos; +} + _float3 CRigidBody_Dynamic::Get_FootPosition() { PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose(); diff --git a/Jusin154_Team3D/Engine/Private/Timer_Manager.cpp b/Jusin154_Team3D/Engine/Private/Timer_Manager.cpp index 967a1e65b..bf37e5007 100644 --- a/Jusin154_Team3D/Engine/Private/Timer_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Timer_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Timer_Manager.h" #include "Timer.h" @@ -51,7 +51,7 @@ CTimer* CTimer_Manager::Find_Timer(const _wstring& strTimerTag) if (iter == m_Timers.end()) return nullptr; - + return iter->second; } diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index bb84592c1..eabe15c3d 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -29,7 +29,7 @@ enum class PXBODYSTATE { enum class MOUSEKEYSTATE { LBUTTON, RBUTTON, WBUTTON, XBUTTON }; enum class MOUSEMOVESTATE { X, Y, W }; enum class D3DTS { VIEW, PROJ, VIEW_INV, PROJ_INV, END }; -enum class MODEL { ANIM, NONANIM, INDEPENDENT, ENVIROMENT, ANIM_LOCAL}; +enum class MODEL { ANIM, NONANIM, PBR_NONANIM, PBR_ANIM, ENVIROMENT, ANIM_LOCAL}; enum class NAVI_POINT { A, B, C, END }; enum class NAVI_LINE { AB, BC, CA, END }; diff --git a/Jusin154_Team3D/Engine/Public/Mesh.h b/Jusin154_Team3D/Engine/Public/Mesh.h index 8db9cc479..58521725d 100644 --- a/Jusin154_Team3D/Engine/Public/Mesh.h +++ b/Jusin154_Team3D/Engine/Public/Mesh.h @@ -15,6 +15,7 @@ class ENGINE_DLL CMesh final : public CVIBuffer _uint Get_MaterialIndex() const { return m_iMaterialIndex; } + void SeT_MaterialIndex(_uint iMaterialIndex) { m_iMaterialIndex = iMaterialIndex; } const _char* Get_Name() const { return m_strName.c_str(); } HRESULT Bind_BoneMatrices(const vector& Bones, class CShader* pShader, const _char* pConstantName); diff --git a/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h b/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h index 9d8736c75..0f554f941 100644 --- a/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h +++ b/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h @@ -47,6 +47,7 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody _bool IsActive() const { return m_bActive; } void SetActive(_bool bCondition) { m_bActive = bCondition; } + _vector Get_Position(); _float3 Get_FootPosition(); PSX::PxTransform Get_FootPositionPxTransform(); private: diff --git a/Jusin154_Team3D/Engine/Public/Unit.h b/Jusin154_Team3D/Engine/Public/Unit.h index a5b951505..9809ca0fc 100644 --- a/Jusin154_Team3D/Engine/Public/Unit.h +++ b/Jusin154_Team3D/Engine/Public/Unit.h @@ -33,6 +33,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; _wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; } + #ifdef _DEBUG void Load_KeyFrame(); #endif // _DEBUG @@ -48,6 +49,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject void Set_LightCombo(_uint LightCombo) { m_iLightCombo = LightCombo; } _float Get_KeyFrame(_string FrameName); _bool IsCurrentKeyFrame(_string FrameName); + virtual _vector Get_LockOnPos() { return Get_WorldPostion(); } virtual void Reset_Sprint() {}; virtual void Reset_Walk() {}; @@ -58,6 +60,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject CModel* m_pModelCom = { nullptr }; CFSM* m_pFSM = { nullptr }; _wstring m_strModelPrototypeTag; + _float2 m_vHP = { 230.f, 350.f }; _bool m_bRimLight = { true }; _float m_fRimLightPower = { 3.2f }; _float m_fRimLightStrength = { 3.04f };