diff --git a/Jusin154_Team3D/Client/Private/Broom_States.cpp b/Jusin154_Team3D/Client/Private/Broom_States.cpp index 25961c62c..8d6c11cc0 100644 --- a/Jusin154_Team3D/Client/Private/Broom_States.cpp +++ b/Jusin154_Team3D/Client/Private/Broom_States.cpp @@ -158,8 +158,7 @@ void CBroom::Behavior_MoveEnter() { pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_UP_B]; } - - if (m_pGameInstance->Key_Up(DIK_LSHIFT)) + else if (m_pGameInstance->Key_Down(DIK_LSHIFT)) { pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; } @@ -201,13 +200,10 @@ HRESULT CBroom::Behavior_MoveExitCheck(_float fTimeDelta) else if (bLft) { pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_LEFT_B]; - Camera_InterpTurn(fTimeDelta); - } else if (bRht) { pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_RIGHT_B]; - Camera_InterpTurn(fTimeDelta); } else if (bDown) @@ -231,7 +227,6 @@ HRESULT CBroom::Behavior_MoveExitCheck(_float fTimeDelta) m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); } else{ - m_fTargetSpeed = m_fFlyMaxSpeed; m_fSpeed += (m_fTargetSpeed - m_fSpeed) * fTimeDelta * m_fAccel; m_pTransformCom->Go_LerpStraight(m_fSpeed, fTimeDelta); @@ -256,20 +251,16 @@ HRESULT CBroom::Behavior_MoveExitCheck(_float fTimeDelta) if (bUp) { - pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_UP_B]; m_pTransformCom->Go_LerpUp(m_fTurnSpeed, fTimeDelta); - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_fVerticalSpeed = +m_fTurnSpeed; } else { - pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_DOWN_B]; m_pTransformCom->Go_LerpDown(m_fTurnSpeed, fTimeDelta); - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - + m_fVerticalSpeed = -m_fTurnSpeed; } } - if (vInput.x < 0.f) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * 0.1f); @@ -291,30 +282,54 @@ HRESULT CBroom::Behavior_MoveExitCheck(_float fTimeDelta) pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_DOWN_B]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); } - else if (az >= ax) + else if (ax >= az) { - if (vInput.z > 0) + if (ay >= ax) { - pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - Camera_InterpTurn(fTimeDelta); + if (vInput.y > 0) + pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_UP_B]; + else + pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_DOWN_B]; } + else { + if (vInput.x < 0) + pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_LEFT_B]; + else if (vInput.x > 0) + pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_RIGHT_B]; + else { + Camera_InterpTurn(fTimeDelta); + pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; + } + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); } else { - if (vInput.x < 0) - pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_LEFT_B]; - else - pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_RIGHT_B]; + if (vInput.y > 0) + pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_UP_B]; + else if (vInput.y < 0) + pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_DOWN_B]; + else { + pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; + } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); } } else { + + m_fVerticalSpeed += (0.f - m_fVerticalSpeed) * fTimeDelta * m_fDecel; + + if (fabs(m_fVerticalSpeed) > 0.001f) + { + if (m_fVerticalSpeed > 0.f) + m_pTransformCom->Go_LerpUp(m_fVerticalSpeed, fTimeDelta); + else + m_pTransformCom->Go_LerpDown(-m_fVerticalSpeed, fTimeDelta); + } + pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); } - - } if (m_bHoverToggle && !SUCCEEDED(InputMove()) && !SUCCEEDED(InputAction())) @@ -324,7 +339,7 @@ HRESULT CBroom::Behavior_MoveExitCheck(_float fTimeDelta) m_fSpeed += (m_fTargetSpeed - m_fSpeed) * fTimeDelta * m_fDecel; m_pTransformCom->Go_LerpStraight(m_fSpeed, fTimeDelta); - + pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_STOP_B]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); if (m_pModelCom->IsFinishedAnim() && iCurrentAnimIndex == m_Animation[STATEANIM::BROOM_HOVER_STOP_B].first) @@ -371,7 +386,6 @@ void CBroom::Camera_InterpTurn(_float fTimeDelta) if (m_pGameInstance->Key_Pressing(DIK_W)) xmvInput += vCameraLook; - xmvInput = XMVector3Normalize(xmvInput); _float2 fInput2D = { XMVectorGetX(xmvInput), XMVectorGetZ(xmvInput) }; @@ -390,11 +404,11 @@ void CBroom::Camera_InterpTurn(_float fTimeDelta) if (angleDiff > Offset) { - m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta*0.3f); + m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta*0.1f); } else if (angleDiff < -Offset) { - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * 0.3f); + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * 0.1f); } } @@ -410,18 +424,24 @@ void CBroom::Add_FSM() Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc)); - } + } - { - CState_Move::STATE_MOVE_DESC Desc{}; - Desc.pOwner = this; - Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); }; - Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(fTimedelta); }; - Desc.funcExitEvent = [this]() { Behavior_MoveExit(); }; - Desc.funcPriorityUpdate = nullptr; - Desc.funcLateUpdate = nullptr; - m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); - } + { + CState_Move::STATE_MOVE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_MoveExit(); }; + Desc.funcPriorityUpdate = [this](_float fTimeDelta) { + if (m_bHoverToggle) + { + _float3 fMove = m_pGameInstance->Get_MouseMove(); + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.02f); + } + }; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); + } #pragma endregion } diff --git a/Jusin154_Team3D/Client/Private/BuildingContainer.cpp b/Jusin154_Team3D/Client/Private/BuildingContainer.cpp index 386cfd141..7f4d702b3 100644 --- a/Jusin154_Team3D/Client/Private/BuildingContainer.cpp +++ b/Jusin154_Team3D/Client/Private/BuildingContainer.cpp @@ -40,9 +40,8 @@ void CBuildingContainer::Late_Update(_float fTimeDelta) if (m_pOcclusionQueryCom->isDraw()) __super::Late_Update(fTimeDelta); } - else{ + else __super::Late_Update(fTimeDelta); - } m_pGameInstance->Add_RenderGroup(RENDER::OCCLUSION, this); @@ -50,6 +49,9 @@ void CBuildingContainer::Late_Update(_float fTimeDelta) pCollisiton->Late_Update(fTimeDelta); } } + else + m_pOcclusionQueryCom->Set_PreFrameDraw(); + } HRESULT CBuildingContainer::Render() diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 979cb6fe7..a0dda6a2f 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -133,6 +133,7 @@ HRESULT CGoblin::Render() { if (!m_bVisible) return S_OK; + if (FAILED(Bind_ShaderResources())) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp b/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp index c83e46c8d..999335218 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp @@ -58,8 +58,15 @@ void CGoblin_BattleAxe::Priority_Update(_float fTimeDelta) void CGoblin_BattleAxe::Update(_float fTimeDelta) { - - + if (m_bDisolve) { + m_fDisolveTime += fTimeDelta; + if (m_fDisolveTime >= 1.f) + { + m_fDisolveTime = 0.f; + m_bDisolve = false; + m_bVisible = false; + } + } } void CGoblin_BattleAxe::Late_Update(_float fTimeDelta) @@ -81,13 +88,18 @@ HRESULT CGoblin_BattleAxe::Render() _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + if (FAILED(Render_Disolve())) { + return E_FAIL; + } + + for (_uint i = 0; i < iNumMeshes; i++) { if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::SPECTOR_WEAPON)))) { return E_FAIL; } @@ -96,6 +108,43 @@ HRESULT CGoblin_BattleAxe::Render() } } + { + _bool bDisolve = false; + _float zero = 0.f; + m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)); + m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &zero, sizeof(_float)); + } + + return S_OK; +} + +HRESULT CGoblin_BattleAxe::Render_Disolve() +{ + if (FLT_EPSILON3 * 10 < m_fDisolveTime) + { + _bool bDisolve = true; + _float fDisolveAmount = 0.1f; + _float fDisolveEdgeWidth = 0.1f; + if (FAILED(m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &m_fDisolveTime, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveAmount", &fDisolveAmount, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveEdgeWidth", &fDisolveEdgeWidth, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_GlobalSRV(m_pShaderCom, TEXT("GLOBAL_DISOLVE_NOISE_05"), "g_DeadDisolveTexture"))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_GlobalSRV(m_pShaderCom, TEXT("GLOBAL_DISOLVE_BURN_VERTICAL"), "g_DisolveTexture"))) { + return E_FAIL; + } + } + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp index e8054bd7f..7998b2409 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp @@ -42,6 +42,9 @@ HRESULT CGoblin_Spector::Initialize(void* pArg) m_vOriginScale = m_pTransformCom->Get_Scale(); + m_pModelCom->Set_AnimationIndex(5); + m_pModelCom->Play_Animation(0, m_pTransformCom); + m_bVisible = false; return S_OK; @@ -84,6 +87,17 @@ void CGoblin_Spector::Update(_float fTimeDelta) m_pModelCom->Set_AnimationIndex(5); } + if (m_bDisolve) { + Get_PartObject()->Set_Disolve(true); + m_fDisolveTime += fTimeDelta; + if (m_fDisolveTime >= 1.f) + { + m_fDisolveTime = 0.f; + m_bDisolve = false; + m_bVisible = false; + } + } + #ifdef _DEBUG Describe_Entity(); #endif // _DEBUG @@ -107,6 +121,11 @@ HRESULT CGoblin_Spector::Render() _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); _uint iShaderPass = ENUM_CLASS(SHADER_PASS_ANIM::SPECTOR); + + if (FAILED(Render_Disolve())) { + return E_FAIL; + } + for (_uint i = 0; i < iNumMeshes; i++) { if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { @@ -126,6 +145,13 @@ HRESULT CGoblin_Spector::Render() } } + { + _bool bDisolve = false; + _float zero = 0.f; + m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)); + m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &zero, sizeof(_float)); + } + return S_OK; } @@ -196,6 +222,36 @@ HRESULT CGoblin_Spector::Bind_ShaderResources() return S_OK; } +HRESULT CGoblin_Spector::Render_Disolve() +{ + if (FLT_EPSILON3 * 10 < m_fDisolveTime) + { + _bool bDisolve = true; + _float fDisolveAmount = 0.1f; + _float fDisolveEdgeWidth = 0.1f; + if (FAILED(m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &m_fDisolveTime, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveAmount", &fDisolveAmount, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveEdgeWidth", &fDisolveEdgeWidth, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_GlobalSRV(m_pShaderCom, TEXT("GLOBAL_DISOLVE_NOISE_05"), "g_DeadDisolveTexture"))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_GlobalSRV(m_pShaderCom, TEXT("GLOBAL_DISOLVE_BURN_VERTICAL"), "g_DeadDisolveBurnTexture"))) { + return E_FAIL; + } + } + + return S_OK; +} + CGoblin_Spector* CGoblin_Spector::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CGoblin_Spector* pInstance = new CGoblin_Spector(pDevice, pContext); diff --git a/Jusin154_Team3D/Client/Private/Goblin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_States.cpp index 2f4570465..ec52ae3a8 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_States.cpp @@ -240,10 +240,14 @@ void CGoblin::Behavior_SwingEnter() m_pGoblinSpector->Set_Visible(true);}, 0.05f); + Add_Event(pairAnimInfo.first, + [this]() { + m_pGoblinSpector->Set_Disolve(true); }, + 0.28f); + Add_Event(pairAnimInfo.first, [&]() { m_bLookAt = true; m_bStep = true; - m_pGoblinSpector->Set_Visible(false); m_pFSM->Change_State(FSMSTATE::SHUFFLE); }, 0.45f); } diff --git a/Jusin154_Team3D/Client/Private/InstancedProp.cpp b/Jusin154_Team3D/Client/Private/InstancedProp.cpp index 195d5a2e6..15cb800c5 100644 --- a/Jusin154_Team3D/Client/Private/InstancedProp.cpp +++ b/Jusin154_Team3D/Client/Private/InstancedProp.cpp @@ -22,6 +22,9 @@ void CInstancedProp::Update(_float fTimeDelta) void CInstancedProp::Late_Update(_float fTimeDelta) { + if (m_isShake) + m_pVIBufferInstanceCom->Shake(fTimeDelta); + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); } @@ -86,6 +89,7 @@ HRESULT CInstancedProp::Initialize(void* pArg) if (FAILED(Ready_Components(pArg))) return E_FAIL; + m_iNumMesh = m_pVIBufferInstanceCom->Get_NumMesh(); return S_OK; @@ -107,6 +111,10 @@ HRESULT CInstancedProp::Ready_Components(void* pArg) if(FAILED(Load_InstancedProp(pDesc->strInstanceDataPath.c_str()))) return E_FAIL; + m_isShake = pDesc->isShake; + if (m_isShake) + m_pVIBufferInstanceCom->Set_Shake_Value(pDesc->vRadius, pDesc->vSpeed); + /* Com_Shader */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_INSTANCE_PROP_MODEL, reinterpret_cast(&m_pShaderCom)))) diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 8e6b7edd5..1d6969164 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -222,7 +222,7 @@ HRESULT CLevel_GamePlay::Ready_Background() if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UNIFIED))) return E_FAIL; - + CMapElement_Lake::MAPOBJECT_LAKE_DESC Lake_Desc = {}; @@ -244,10 +244,10 @@ HRESULT CLevel_GamePlay::Ready_Background() _bool isReady_Background = { false }; #ifdef gimch - isReady_Background = false; + isReady_Background = true; #endif // gimch #ifdef Bin - isReady_Background = true; + isReady_Background = false; #endif // #ifdef 진우 isReady_Background = false; @@ -281,87 +281,119 @@ HRESULT CLevel_GamePlay::Ready_Background() CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopTable"); CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopChair"); - CInstancedProp::INSTANCE_PROP_DESC Desc = {}; - - /* InstanceProp Oak_Tree*/ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OakTree_MedA.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) { + if (FAILED(Ready_IntstanceProp())) return E_FAIL; - } - - /* BearBerry */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_BearBerry_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/BearBerry_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) { - return E_FAIL; - } - - /* SM_HM_OwlPost_Window_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OwlPost_Window.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; - - ///* WA_Rectangle_Double_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Rectangle_Double_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; - - ///* WC_Retangle_Double_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Retangle_Double_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; - - ///* WA_Square_Double_C */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WA_Square_Double_C.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; - - /* Quid_Window_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Quid_Window_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; - - /* Ollivanders_Box_Window */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Ollivanders_Box.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; - - /* WC_L_DoubleS_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_L_DoubleS_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; - - /* WC_Round_Double_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Round_Double_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; - - /* SM_HM_Door1a */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door1a.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; - - /* SM_HM_Door1a */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door2b.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; - } return S_OK; } +HRESULT CLevel_GamePlay::Ready_IntstanceProp() +{ + CInstancedProp::INSTANCE_PROP_DESC Desc = {}; + + /* InstanceProp Oak_Tree*/ + Desc.isShake = true; + Desc.vRadius = _float2(0.015f, 0.04f); + Desc.vSpeed = _float2(0.3f, 1.f); + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OakTree_MedA.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) { + return E_FAIL; + } + + /* BearBerry */ + Desc.isShake = true; + Desc.vRadius = _float2(0.015f, 0.02f); + Desc.vSpeed = _float2(0.6f, 1.f); + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_BearBerry_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/BearBerry_A.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) { + return E_FAIL; + } + + /* SM_HM_OwlPost_Window_A */ + Desc.isShake = false; + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OwlPost_Window.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + + ///* WA_Rectangle_Double_A */ + Desc.isShake = false; + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Rectangle_Double_A.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + + ///* WC_Retangle_Double_A */ + Desc.isShake = false; + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Retangle_Double_A.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + + ///* WA_Square_Double_C */ + Desc.isShake = false; + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WA_Square_Double_C.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + + /* Quid_Window_A */ + Desc.isShake = false; + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Quid_Window_A.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + + /* Ollivanders_Box_Window */ + Desc.isShake = false; + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Ollivanders_Box.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + + /* WC_L_DoubleS_A */ + Desc.isShake = false; + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_L_DoubleS_A.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + + /* WC_Round_Double_A */ + Desc.isShake = false; + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Round_Double_A.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + + /* SM_HM_Door1a */ + Desc.isShake = false; + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door1a.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + + /* SM_HM_Door2b */ + Desc.isShake = false; + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door2b.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + + /* OakTree_TallA */ + Desc.isShake = true; + Desc.vRadius = _float2(0.f, 0.01f); + Desc.vSpeed = _float2(0.01f, 0.1f); + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_OakTree_TallA"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OakTree_TallA.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + + return S_OK; +} + HRESULT CLevel_GamePlay::Ready_Layer_UI(const _wstring& strLayerTag) { CInfoInstance::GetInstance()->Load_SpellInfo("../Bin/Resources/Data/UI/Spell/SpellInfo.xml"); diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 0e32e8a1d..7aca53522 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -295,10 +295,10 @@ HRESULT CLoader::Loading_For_GamePlay() _bool isLoad_Background = { false }; #ifdef gimch - isLoad_Background = false; + isLoad_Background = true; #endif // gimch #ifdef Bin - isLoad_Background = true; + isLoad_Background = false; #endif // #ifdef 진우 isLoad_Background = false; @@ -1895,6 +1895,12 @@ HRESULT CLoader::Loading_For_GamePlay() CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/InstanceProp/SM_HM_Door2b.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml")))) return E_FAIL; + + /* For.Prototype_Component_VIBuffer_Model_Instancel_OakTree_TallA*/ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_OakTree_TallA"), + CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext, + "../Bin/Resources/Models/InstanceProp/SM_OakTree_TallA.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml")))) + return E_FAIL; #pragma endregion /* For.Prototype_Component_South_Hogwart_Land_LOD1 */ diff --git a/Jusin154_Team3D/Client/Private/MapObject_Render.cpp b/Jusin154_Team3D/Client/Private/MapObject_Render.cpp index 6cf5da9f2..1857ee068 100644 --- a/Jusin154_Team3D/Client/Private/MapObject_Render.cpp +++ b/Jusin154_Team3D/Client/Private/MapObject_Render.cpp @@ -108,7 +108,7 @@ HRESULT CMapObject_Render::Render() return E_FAIL; } - for (_uint i = 0; i < m_iNumMeshe; i++) + for (_uint i = 0; i < m_iNumMeshe; ++i) { if (FAILED(m_pModelComs[0]->Bind_Material(i, m_pShaderCom))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp index b577d7a71..ac6c4b8a3 100644 --- a/Jusin154_Team3D/Client/Private/Monster.cpp +++ b/Jusin154_Team3D/Client/Private/Monster.cpp @@ -159,9 +159,9 @@ CStat* CMonster::Get_Stat() return m_pStat; } -const _float4x4* CMonster::Get_HeadMatrix() +_matrix CMonster::Get_HeadMatrix() { - return m_pModelCom->Get_BoneMatrixPtr("Head"); + return m_pModelCom->Get_BoneMatrix("Head"); } HRESULT CMonster::Ready_Components(void*pArg) diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index 0d9e1d917..f8c494dbd 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -145,6 +145,17 @@ HRESULT CPlayer::InputAim() return E_FAIL; } +HRESULT CPlayer::InputBroom() +{ + if (m_pGameInstance->Key_Pressing(DIK_LCONTROL) + || m_pGameInstance->Key_Pressing(DIK_SPACE)) + { + + return S_OK; + } + return E_FAIL; +} + void CPlayer::Behavior_IdleEnter() { m_pFSM->Enable_State(FSMSTATE::IDLE); pair<_uint, _bool> pairAnimInfo; @@ -328,6 +339,7 @@ void CPlayer::Behavior_MoveEnter() m_bSprintToggle = false; m_bWalkToggle = false; pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + m_bRatio = false; } } else { // While Moving @@ -753,7 +765,6 @@ HRESULT CPlayer::Behavior_DodgeExitCheck(_float fTimeDelta) } if (SUCCEEDED(InputMove()) && fRatio >= 0.32f) { - m_pTransformCom->AccumulateMomentum(m_pTransformCom->Get_State(STATE::LOOK)*fTimeDelta*1.3f); m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; } @@ -1283,10 +1294,17 @@ void CPlayer::Behavior_Broom_RideEnter() m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } -HRESULT CPlayer::Behavior_Broom_RideExitCheck() +HRESULT CPlayer::Behavior_Broom_RideExitCheck(_float fTimeDelta) { _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); pair<_uint, _bool> pairAnimInfo; + + _bool bFwd = m_pGameInstance->Key_Pressing(DIK_W); + _bool bLft = m_pGameInstance->Key_Pressing(DIK_A); + _bool bRht = m_pGameInstance->Key_Pressing(DIK_D); + _bool bDown = m_pGameInstance->Key_Pressing(DIK_LCONTROL); + _bool bUp = m_pGameInstance->Key_Pressing(DIK_SPACE); + if (iCurrAnimIndex == m_Animation[STATEANIM::BROOM_MOUNT].first) { if (m_pModelCom->IsFinishedAnim()) { @@ -1323,41 +1341,92 @@ HRESULT CPlayer::Behavior_Broom_RideExitCheck() } else { - if (m_pGameInstance->Key_Pressing(DIK_W)) + if (SUCCEEDED(InputBroom()) || SUCCEEDED(InputMove())) { - pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_FWD); + _float3 vInput = { 0.f, 0.f, 0.f }; + + if (bFwd) vInput.z += 1.f; + if (bLft) vInput.x -= 1.f; + if (bRht) vInput.x += 1.f; + if (bUp) vInput.y += 1.f; + if (bDown) vInput.y -= 1.f; + + _bool bHasInput = !(vInput.x == 0 && vInput.y == 0 && vInput.z == 0); + _vector vDir = XMVector3Normalize(XMLoadFloat3(&vInput)); + + if (bUp || bDown) + { + if (bUp) + { + pairAnimInfo = m_Animation[STATEANIM::BROOM_UP]; + } + else + { + pairAnimInfo = m_Animation[STATEANIM::BROOM_DOWN]; + } + } + + _float ax = fabsf(vInput.x); + _float ay = fabsf(vInput.y); + _float az = fabsf(vInput.z); + + if (ay > ax && ay > az) + { + if (vInput.y > 0) + pairAnimInfo = m_Animation[STATEANIM::BROOM_UP]; + else + pairAnimInfo = m_Animation[STATEANIM::BROOM_DOWN]; + } + else if (ax >= az) + { + if (ay >= ax) + { + if (vInput.y > 0) + pairAnimInfo = m_Animation[STATEANIM::BROOM_UP]; + else + pairAnimInfo = m_Animation[STATEANIM::BROOM_DOWN]; + } + else { + if (vInput.x < 0) + pairAnimInfo = m_Animation[STATEANIM::BROOM_LEFT]; + else if (vInput.x > 0) + pairAnimInfo = m_Animation[STATEANIM::BROOM_RIGHT]; + else { + pairAnimInfo = m_Animation[STATEANIM::BROOM_FWD]; + } + } + } + else + { + if (vInput.y > 0) + pairAnimInfo = m_Animation[STATEANIM::BROOM_UP]; + else if (vInput.y < 0) + pairAnimInfo = m_Animation[STATEANIM::BROOM_DOWN]; + else { + pairAnimInfo = m_Animation[STATEANIM::BROOM_FWD]; + } + } } - else if (m_pGameInstance->Key_Pressing(DIK_A)) - { - pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_LEFT); - } - else if (m_pGameInstance->Key_Pressing(DIK_D)) - { - pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_RIGHT); - } - else if (m_pGameInstance->Key_Pressing(DIK_LCONTROL)) - { - pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_DOWN); - } - else if (m_pGameInstance->Key_Pressing(DIK_SPACE)) - { - pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_UP); - } - else - { - pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_FWD); + else { + pairAnimInfo = m_Animation[STATEANIM::BROOM_FWD]; } } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } - - - if (m_pGameInstance->Key_Down(DIK_N)) { - pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_DISMOUNT); - m_pFSM->Enable_State(FSMSTATE::DISMOUNT); - m_pBroom->Set_Ride(false); - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + if (m_pGameInstance->Key_Pressing(DIK_N)) { + auto flags = m_pCharacter_Controller->Get_CollisionFlags(); + if (flags & PSX::PxControllerCollisionFlag::eCOLLISION_DOWN) + { + m_bOnce = false; + pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_DISMOUNT); + m_pFSM->Enable_State(FSMSTATE::DISMOUNT); + m_pBroom->Set_Ride(false); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + else { + m_pBroomTransform->Go_Down(fTimeDelta); + } } if (iCurrAnimIndex == m_Animation[STATEANIM::BROOM_DISMOUNT].first) @@ -1465,7 +1534,6 @@ void CPlayer::Add_FSM() _float3 fMove = m_pGameInstance->Get_MouseMove(); m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.03f); } - } } }; @@ -1518,37 +1586,39 @@ void CPlayer::Add_FSM() Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(fTimeDelta); }; Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); }; Desc.funcPriorityUpdate = [this](_float fTimeDelta) { - - _vector xmvInputDir = XMVectorZero(); - - _vector xmvCamLook = XMVector4Normalize(XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f)); - _vector xmvCamRight = XMVector4Normalize(XMVectorSet(m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z, 0.f)); - - if (m_pGameInstance->Key_Pressing(DIK_W)) - xmvInputDir += xmvCamLook; - if (m_pGameInstance->Key_Pressing(DIK_S)) - xmvInputDir -= xmvCamLook; - if (m_pGameInstance->Key_Pressing(DIK_A)) - xmvInputDir -= xmvCamRight; - if (m_pGameInstance->Key_Pressing(DIK_D)) - xmvInputDir += xmvCamRight; - - xmvInputDir = XMVector3Normalize(xmvInputDir); - - _float2 vInputDir = { XMVectorGetX(xmvInputDir),XMVectorGetZ(xmvInputDir) }; - _vector xmvCurLook = XMVector4Normalize( - XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); - _float2 vCurLook = { XMVectorGetX(xmvCurLook),XMVectorGetZ(xmvCurLook) }; - - _float vDir = CMyTools::Get_Direction2D(vCurLook, vInputDir); - _float absDir = fabsf(vDir); - _float cross = vCurLook.x * vInputDir.y - vCurLook.y * vInputDir.x; - if (cross > 0.f) + if (SUCCEEDED(InputMove())) { - m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); - } - else { - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + _vector xmvInputDir = XMVectorZero(); + + _vector xmvCamLook = XMVector4Normalize(XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f)); + _vector xmvCamRight = XMVector4Normalize(XMVectorSet(m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z, 0.f)); + + if (m_pGameInstance->Key_Pressing(DIK_W)) + xmvInputDir += xmvCamLook; + if (m_pGameInstance->Key_Pressing(DIK_S)) + xmvInputDir -= xmvCamLook; + if (m_pGameInstance->Key_Pressing(DIK_A)) + xmvInputDir -= xmvCamRight; + if (m_pGameInstance->Key_Pressing(DIK_D)) + xmvInputDir += xmvCamRight; + + xmvInputDir = XMVector3Normalize(xmvInputDir); + + _float2 vInputDir = { XMVectorGetX(xmvInputDir),XMVectorGetZ(xmvInputDir) }; + _vector xmvCurLook = XMVector4Normalize( + XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); + _float2 vCurLook = { XMVectorGetX(xmvCurLook),XMVectorGetZ(xmvCurLook) }; + + _float vDir = CMyTools::Get_Direction2D(vCurLook, vInputDir); + _float absDir = fabsf(vDir); + _float cross = vCurLook.x * vInputDir.y - vCurLook.y * vInputDir.x; + if (cross > 0.f) + { + m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + } + else { + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + } } }; Desc.funcLateUpdate = nullptr; @@ -1609,22 +1679,22 @@ void CPlayer::Add_FSM() #pragma region Behavior_Broom_Ride { - CState_Broom_Ride::STATE_BROOM_RIDE_DESC Desc{}; Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_Broom_RideEnter(); }; - Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_Broom_RideExitCheck(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_Broom_RideExitCheck(fTimedelta); }; Desc.funcExitEvent = [this]() { Behavior_Broom_RideExit(); }; Desc.funcPriorityUpdate = [this](_float fTimeDelta) { _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); if (m_pFSM->IsEnable(FSMSTATE::DISMOUNT)) return; - if (m_bHoverToggle) - { - _float3 fMove = m_pGameInstance->Get_MouseMove(); - m_pBroomTransform->Turn(m_pBroomTransform->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.02f); + _vector OffsetY = XMVectorSet(0.f, 1.f, 0.f, 0.f); + if (!m_bOnce) { + m_pBroomTransform->Set_State(STATE::POSITION, Get_WorldPostion()+ OffsetY); + m_bOnce = true; } + _matrix BroomWorld = XMLoadFloat4x4(m_pBroomTransform->Get_WorldMatrixPtr()); _matrix BoneLocal = XMLoadFloat4x4(m_pBroomModel->Get_BoneMatrixPtr("broomSocket")); diff --git a/Jusin154_Team3D/Client/Public/Broom.h b/Jusin154_Team3D/Client/Public/Broom.h index 6fec3bcc7..bde68fce4 100644 --- a/Jusin154_Team3D/Client/Public/Broom.h +++ b/Jusin154_Team3D/Client/Public/Broom.h @@ -39,6 +39,11 @@ class CBroom final : public CUnit _float m_fDecel = 1.f; _float m_fTurnDecel = 0.3f; + + _float m_fVerticalSpeed = 0.f; + + + _float3 m_vCameraLookDir = { 0.f, 0.f, 1.f, }; _float3 m_vCameraRightDir = { 1.f, 0.f, 0.f }; private: diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 1c463aac6..4e7ee02cd 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -7,7 +7,7 @@ namespace Client enum class MAPOBJECT_RENDER_TYPE { NORMAL, DECAL, GLASS }; enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, HAIR, EYELASH, OUTLINE_WRITE, OUTLINE_READ,SPECTOR, END }; - enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, OUTLINE_WRITE, OUTLINE_READ, BLOOM, WATER, LAND, NONMRO, END }; + enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, OUTLINE_WRITE, OUTLINE_READ, BLOOM, WATER, LAND, NONMRO,SPECTOR_WEAPON, END }; enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, ENV_TERRAIN_ANISO, SHADOW, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLEND, TRAILWB_FOR_BLEND, TRAIL_BLUR, TRAIL_BLOOM, END }; diff --git a/Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h b/Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h index 5f2edcb42..19adbf2f7 100644 --- a/Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h +++ b/Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h @@ -24,12 +24,17 @@ class CGoblin_BattleAxe final : public CPartObject virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; + HRESULT Render_Disolve(); + void Set_Disolve(_bool bDisolve) { m_bDisolve = bDisolve; } public: private: const _float4x4* m_pSocketMatrices = { }; CShader* m_pShaderCom = { nullptr }; CModel* m_pModelCom = { nullptr }; + _bool m_bDisolve = { false }; + _float m_fDisolveTime = { 0.f }; + private: HRESULT Ready_Components(); diff --git a/Jusin154_Team3D/Client/Public/Goblin_Spector.h b/Jusin154_Team3D/Client/Public/Goblin_Spector.h index dc83d6452..d687fa74b 100644 --- a/Jusin154_Team3D/Client/Public/Goblin_Spector.h +++ b/Jusin154_Team3D/Client/Public/Goblin_Spector.h @@ -30,6 +30,7 @@ class CGoblin_Spector final : public CMonster virtual HRESULT Render() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override; virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override; + void Set_Disolve(_bool bDisolve) { m_bDisolve = bDisolve; } private: @@ -39,6 +40,8 @@ class CGoblin_Spector final : public CMonster _float3 m_Offset = {}; _float3 m_vOriginScale = {}; _float3 m_vScale = { 1.f, 1.f, 1.f }; + _bool m_bDisolve = { false }; + _float m_fDisolveTime = {0.f}; @@ -52,6 +55,7 @@ class CGoblin_Spector final : public CMonster HRESULT Ready_Components(); HRESULT Ready_Parts(); HRESULT Bind_ShaderResources(); + virtual HRESULT Render_Disolve(); public: static CGoblin_Spector* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/InstancedProp.h b/Jusin154_Team3D/Client/Public/InstancedProp.h index accf7104a..77a2af368 100644 --- a/Jusin154_Team3D/Client/Public/InstancedProp.h +++ b/Jusin154_Team3D/Client/Public/InstancedProp.h @@ -16,8 +16,11 @@ class CInstancedProp final : public CGameObject public: typedef struct tagInstancedPropDesc { - _wstring strPrototypeTag; - _string strInstanceDataPath; + _bool isShake; + _float2 vRadius; + _float2 vSpeed; + _wstring strPrototypeTag; + _string strInstanceDataPath; }INSTANCE_PROP_DESC; private: CInstancedProp(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -32,7 +35,9 @@ class CInstancedProp final : public CGameObject virtual HRESULT Render_Shadow()override; private: + _bool m_isShake = {}; _uint m_iNumMesh = {}; + CVIBuffer_Model_Instance* m_pVIBufferInstanceCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Level_GamePlay.h b/Jusin154_Team3D/Client/Public/Level_GamePlay.h index ed2a0b758..cddda5fc3 100644 --- a/Jusin154_Team3D/Client/Public/Level_GamePlay.h +++ b/Jusin154_Team3D/Client/Public/Level_GamePlay.h @@ -24,6 +24,7 @@ class CLevel_GamePlay final : public CLevel HRESULT Initialize(void* pArg); HRESULT Ready_Lights(); HRESULT Ready_Background(); + HRESULT Ready_IntstanceProp(); HRESULT Ready_Markers(); HRESULT Ready_Layer_UI(const _wstring& strLayerTag); HRESULT Ready_Layer_Camera(); diff --git a/Jusin154_Team3D/Client/Public/Monster.h b/Jusin154_Team3D/Client/Public/Monster.h index ac255766e..6de57a325 100644 --- a/Jusin154_Team3D/Client/Public/Monster.h +++ b/Jusin154_Team3D/Client/Public/Monster.h @@ -23,7 +23,7 @@ class CMonster abstract : public CUnit virtual _bool Get_Damage(_float fDamage); virtual _float2 Get_Hp(); virtual CStat* Get_Stat(); - const _float4x4* Get_HeadMatrix(); + _matrix Get_HeadMatrix(); protected: CInfoInstance* m_pInfoInstance = { nullptr }; CUnit* m_pTarget = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index c8ef49abd..0876c49d6 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -109,12 +109,14 @@ class CPlayer final : public CUnit _bool m_bRatio = { false }; _bool m_bAim = { false }; _float m_fAnimSpeed = {}; + _bool m_bOnce = { }; HRESULT InputAction(); HRESULT InputMove(); HRESULT InputKeyUpMove(); HRESULT InputSpell(); HRESULT InputAim(); + HRESULT InputBroom(); void Behavior_IdleEnter(); HRESULT Behavior_IdleExitCheck(_float fTimeDelta); @@ -153,7 +155,7 @@ class CPlayer final : public CUnit void Behavior_HitExit(); void Behavior_Broom_RideEnter(); - HRESULT Behavior_Broom_RideExitCheck(); + HRESULT Behavior_Broom_RideExitCheck(_float fTimeDelta); void Behavior_Broom_RideExit(); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogwart_AlphaMap.dds b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogwart_AlphaMap.dds index 95887abf3..5db06d3ea 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogwart_AlphaMap.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogwart_AlphaMap.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/InstanceMaterial.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/InstanceMaterial.xml index 08b8328ce..af60495b3 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/InstanceMaterial.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/InstanceMaterial.xml @@ -136,4 +136,18 @@ MRO + + + T_Oak_Leaves02_D + T_Oak_Leaves02_N + T_Oak_Leaves02_SRO + SRO + + + T_BogTree_Oak_BarkA_D + T_BogTree_Oak_BarkA_N + T_BogTree_Oak_BarkA_SROH + SRO + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/OakTree_TallA.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/OakTree_TallA.bin new file mode 100644 index 000000000..05fd5fd99 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/OakTree_TallA.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:56bb0f2cc0bb682a1017983b88c73e61b67ccda90a40bbe9b8cb51c224bf308c +size 5188 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SM_OakTree_TallA.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SM_OakTree_TallA.bin new file mode 100644 index 000000000..5a05b3452 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SM_OakTree_TallA.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07141211ac5b0b0a9acaa3ead9701bc92e2c63171528dc4afe891cbe47c07652 +size 906880 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SM_OakTree_TallA.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SM_OakTree_TallA.fbx new file mode 100644 index 000000000..8a304f13a --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SM_OakTree_TallA.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fa2cef30105cd4517a7c2f2338d5d6db2b8d7cd983965c1030d4e0ce9c943eb +size 381084 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_Oak_Leaves_D.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_Oak_Leaves_D.dds new file mode 100644 index 000000000..f871a0c40 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_Oak_Leaves_D.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_Oak_Leaves_N.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_Oak_Leaves_N.dds new file mode 100644 index 000000000..b918894e3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_Oak_Leaves_N.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_Oak_Leaves_SRO.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_Oak_Leaves_SRO.dds new file mode 100644 index 000000000..a014e6dd0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_Oak_Leaves_SRO.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Instance_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Instance_Compute.hlsl new file mode 100644 index 000000000..b8af76bd4 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Instance_Compute.hlsl @@ -0,0 +1,66 @@ +#include "Engine_Shader_Functions.hlsli" +#include "Engine_Shader_Defines.hlsli" + +struct Instance +{ + float4 vRight; + float4 vUp; + float4 vLook; + float4 vTranslation; +}; + +struct InstanceValue +{ + float fSpeed; + float fMaxRadian; +}; + + +StructuredBuffer g_InstanceBufferInput : register(t0); +StructuredBuffer g_InstanceValueBufferInput : register(t1); + +RWStructuredBuffer g_InstanceOutput : register(u0); + +cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐이더 바인딩할때 인덱스가 동일해야함 +{ + float fTimeDelta; + float fPading1; + float fPading2; + float fPading3; +} + +//내가 몇개의 스레드를 사용할 것인지 지정하는데 +//GPU 칩의 개수를 X * Y * Z의 개수 만큼 사용하겠다는 의미이다. +[numthreads(256, 1, 1)] +void CS_MAIN( + uint3 DispatchThreadID : SV_DispatchThreadID) +{ + int iIndex = DispatchThreadID.x; // 배열 인덱스 + + Instance particle = g_InstanceBufferInput[iIndex]; + InstanceValue particleValue = g_InstanceValueBufferInput[iIndex]; + + float fRadian = sin(particleValue.fSpeed * fTimeDelta) * particleValue.fMaxRadian; + + // 3. 임의의 축 회전 행렬 생성 + + // 4. 최종 월드 행렬 (CurMat) 생성 + + float4x4 CurMatrix = + { + particle.vRight, + particle.vUp, + particle.vLook, + particle.vTranslation + }; + + CurMatrix = mul(RotateAxis(particle.vLook, fRadian), CurMatrix); + + particle.vRight = CurMatrix[0].xyzw; + particle.vUp = CurMatrix[1].xyzw; + particle.vLook = CurMatrix[2].xyzw; + particle.vTranslation = CurMatrix[3].xyzw; + + //아웃풋 대입 + g_InstanceOutput[iIndex] = particle; +} diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index d8b4aca96..0fed6234a 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -486,6 +486,11 @@ PS_OUT PS_SPECTOR_MAIN(PS_IN In) float4 vMtrlDiffuse = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); float4 vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vMtrlDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vMtrlDiffuse, In.vTexcoord); + } if (vMtrlDiffuse.a < 0.2f) { discard; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl index d82af3096..79b9b8820 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl @@ -26,6 +26,9 @@ float g_fUsingSurfaceParams; float2 g_vClipBoxSize; float2 g_vClipBoxLTPos; +float g_fDisolveAmount; +float g_fDisolveEdgeWidth; + Texture2D g_DiffuseTexture; Texture2D g_NormalTexture; Texture2D g_DAOTexture; @@ -621,6 +624,47 @@ PS_OUT PS_NONMRO(PS_IN In) return Out; } +PS_OUT PS_SPECTOR_WEAPON_MAIN(PS_IN In) +{ + PS_OUT Out; + + float4 vMtrlDiffuse = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + float4 vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + + if (true == g_bDisolve) + { + float4 vBurnColor = g_DisolveTexture.Sample(DefaultSampler, In.vTexcoord); + vMtrlDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vMtrlDiffuse, In.vTexcoord); + } + + 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); + + float3 vNormal = normalize(mul(vNormalDecoded, WorldMatrix)); + + 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 + fSurfaceParam, // 서페이스 파라미터 + 1.f); + Out.vColor = float4(0.f, 0.f, 0.f, 1.f); + Out.vSurface = vSurface; + + return Out; +} + technique11 MeshTechnique11 { pass MeshPass // 0 @@ -808,4 +852,14 @@ technique11 MeshTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_NONMRO(); } + + pass SpectorWeaponPass // 19 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_SPECTOR_WEAPON_MAIN(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl index e3980199a..7a5cdb835 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl @@ -87,7 +87,7 @@ PS_OUT PS_MAIN(PS_IN In) vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - if (vMtrlDiffuse.a < 0.1f) + if (vMtrlDiffuse.a < 0.4f) discard; vector vMtrlNormal = g_NormalTexture.Sample(DefaultSampler, In.vTexcoord); @@ -101,7 +101,7 @@ PS_OUT PS_MAIN(PS_IN In) Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f); Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, g_fUsingSurfaceParams, 0.0f); Out.vColor = float4(0.f, 0.f, 0.f, 1.f); - Out.vSurface = g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord); + Out.vSurface = float4(g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord).xy, 1.f, 1.f); return Out; } diff --git a/Jusin154_Team3D/Editor/Private/Camera_Debug.cpp b/Jusin154_Team3D/Editor/Private/Camera_Debug.cpp index 66e018e39..e1092e701 100644 --- a/Jusin154_Team3D/Editor/Private/Camera_Debug.cpp +++ b/Jusin154_Team3D/Editor/Private/Camera_Debug.cpp @@ -29,9 +29,18 @@ void CCamera_Debug::Update(_float fTimeDelta) if (m_pGameInstance->Key_Up(DIK_GRAVE)) { m_bMovable = !m_bMovable; } +#ifdef 진우 if (m_pGameInstance->Mouse_Down(DIM_MBUTTON)) { m_pGameInstance->Toggle_MouseCenter(); } +#endif +#ifndef 진우 + if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)) { + m_pGameInstance->Toggle_MouseCenter(); + } +#endif // gimch + + if (m_bMovable) { #pragma region Position _float fSpeed = 5.f; diff --git a/Jusin154_Team3D/Editor/Private/InstancedProp.cpp b/Jusin154_Team3D/Editor/Private/InstancedProp.cpp index 8931c57c0..1e816d2c0 100644 --- a/Jusin154_Team3D/Editor/Private/InstancedProp.cpp +++ b/Jusin154_Team3D/Editor/Private/InstancedProp.cpp @@ -14,6 +14,7 @@ CInstancedProp::CInstancedProp(const CInstancedProp& rhs) void CInstancedProp::Priority_Update(_float fTimeDelta) { + } void CInstancedProp::Update(_float fTimeDelta) @@ -28,7 +29,9 @@ void CInstancedProp::Update(_float fTimeDelta) m_pVIBufferInstanceCom->Add_Instance(m_pTransformCom->Get_XMWorldMatrix()); m_pVIBufferInstanceCom->Update_Instance(); - //m_vRotation.y = m_pGameInstance->Random_Float(0.f, 360.f); + + m_vRotation.y = m_pGameInstance->Random_Float(0.f, 360.f); + m_vScale.y = m_pGameInstance->Random_Float(0.8f, 1.2f); _float3 vPosition = {}; if (m_pGameInstance->isPicking(&vPosition)) @@ -45,6 +48,11 @@ void CInstancedProp::Update(_float fTimeDelta) void CInstancedProp::Late_Update(_float fTimeDelta) { + if(true == m_isShake) + { + m_pVIBufferInstanceCom->Shake(fTimeDelta); + } + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); } @@ -82,15 +90,20 @@ HRESULT CInstancedProp::Initialize(void* pArg) return E_FAIL; m_bEditMode = pDesc->bEditMode; + m_isShake = pDesc->isShake; m_strPrototypeTag = pDesc->strPrototypeTag; if (FAILED(Ready_Components(pArg))) return E_FAIL; + if(m_isShake) + m_pVIBufferInstanceCom->Set_Shake_Value(pDesc->vRadius, pDesc->vSpeed); + m_vPosition = _float4(0.f, 0.f, 0.f, 1.f); m_vRotation = _float3(0.f, 0.f, 0.f); m_vScale = _float3(1.f, 1.f, 1.f); + XMStoreFloat4x4(&m_WorldMatrixIdentity, XMMatrixIdentity()); if(!m_bEditMode) @@ -114,6 +127,8 @@ HRESULT CInstancedProp::Ready_Components(void* pArg) reinterpret_cast(&m_pVIBufferInstanceCom)))) return E_FAIL; + + /* Com_Shader */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_INSTANCE_PROP_MODEL, reinterpret_cast(&m_pShaderCom)))) @@ -354,7 +369,7 @@ void CInstancedProp::Describe_Entity() m_pTransformCom->Set_Scale(m_vScale); //m_pTransformCom->Set_State(STATE::POSITION, XMLoadFloat4(&m_vPosition)); - m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); + //m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); m_pVIBufferInstanceCom->Fix_Instance(m_pTransformCom->Get_XMWorldMatrix()); if (GUI::Button("Delete", ImVec2(150.f, 30.f))) diff --git a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp index 10d022917..4480a3a5b 100644 --- a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp @@ -52,13 +52,13 @@ HRESULT CLevel_MapViewer::Initialize() return E_FAIL; } - /*if (FAILED(Ready_Layer_InstanceProp(TEXT("Layer_InstanceProp")))) { + if (FAILED(Ready_Layer_InstanceProp(TEXT("Layer_InstanceProp")))) { return E_FAIL; } - if (FAILED(Ready_Layer_BuildingContainer(TEXT("Layer_Building")))) { - return E_FAIL; - }*/ + //if (FAILED(Ready_Layer_BuildingContainer(TEXT("Layer_Building")))) { + // return E_FAIL; + //} if (FAILED(Ready_Layer_Unified(TEXT("Layer_Unified")))) { return E_FAIL; @@ -120,16 +120,16 @@ HRESULT CLevel_MapViewer::Ready_Layer_Terrain(const _wstring& strLayerTag) CTerrain::TERRAIN_DESC Desc = {}; /* Hogsmeade */ - //Desc.isEdit = false; - //Desc.iAlphaSizeX = 2048; - //Desc.iAlphaSizeY = 2048; - //Desc.vPosition = _float3(-194, 18.5f, -153.f); - //Desc.strBufferTag = TEXT("Prototype_Component_VIBuffer_Terrain_Hogsmeade"); - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) - // return E_FAIL; + Desc.isEdit = false; + Desc.iAlphaSizeX = 2048; + Desc.iAlphaSizeY = 2048; + Desc.vPosition = _float3(-194, 18.5f, -153.f); + Desc.strBufferTag = TEXT("Prototype_Component_VIBuffer_Terrain_Hogsmeade"); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) + return E_FAIL; /* Hogwart */ - Desc.isEdit = true; + Desc.isEdit = false; Desc.iAlphaSizeX = 2048; Desc.iAlphaSizeY = 2560; Desc.vPosition = _float3(-451.f, 18.5f, -791.f); @@ -227,16 +227,22 @@ HRESULT CLevel_MapViewer::Ready_Layer_Land(const _wstring& strLayerTag) HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) { CInstancedProp::INSTANCE_PROP_DESC Desc = {}; - Desc.bEditMode = false; - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OakTree_MedA.bin"; /* Oak_Tree */ + Desc.bEditMode = false; + Desc.isShake = true; + Desc.vRadius = _float2(0.015f, 0.04f); + Desc.vSpeed = _float2(0.3f, 1.f); + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OakTree_MedA.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) return E_FAIL; /* BearBerry */ Desc.bEditMode = false; + Desc.isShake = true; + Desc.vRadius = _float2(0.015f, 0.02f); + Desc.vSpeed = _float2(0.6f, 1.f); Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_BearBerry_A"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/BearBerry_A.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) @@ -244,6 +250,7 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) /* SM_HM_OwlPost_Window_A */ Desc.bEditMode = false; + Desc.isShake = false; Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OwlPost_Window.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) @@ -251,6 +258,7 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) ///* WA_Rectangle_Double_A */ Desc.bEditMode = false; + Desc.isShake = false; Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Rectangle_Double_A.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) @@ -258,6 +266,7 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) ///* WC_Retangle_Double_A */ Desc.bEditMode = false; + Desc.isShake = false; Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Retangle_Double_A.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) @@ -265,6 +274,7 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) ///* WA_Square_Double_C */ Desc.bEditMode = false; + Desc.isShake = false; Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WA_Square_Double_C.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) @@ -272,6 +282,7 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) /* Quid_Window_A */ Desc.bEditMode = false; + Desc.isShake = false; Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Quid_Window_A.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) @@ -279,6 +290,7 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) /* Ollivanders_Box_Window */ Desc.bEditMode = false; + Desc.isShake = false; Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Ollivanders_Box.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) @@ -286,6 +298,7 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) /* WC_L_DoubleS_A */ Desc.bEditMode = false; + Desc.isShake = false; Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_L_DoubleS_A.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) @@ -293,6 +306,7 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) /* WC_Round_Double_A */ Desc.bEditMode = false; + Desc.isShake = false; Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Round_Double_A.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) @@ -300,6 +314,7 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) /* SM_HM_Door1a */ Desc.bEditMode = false; + Desc.isShake = false; Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door1a.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) @@ -307,11 +322,22 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) /* SM_HM_Door1a */ Desc.bEditMode = false; + Desc.isShake = false; Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door2b.bin"; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) return E_FAIL; + /* OakTree_TallA */ + Desc.bEditMode = false; + Desc.isShake = true; + Desc.vRadius = _float2(0.f, 0.01f); + Desc.vSpeed = _float2(0.01f, 0.1f); + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_OakTree_TallA"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OakTree_TallA.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) + return E_FAIL; + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 2ad97b8fd..e1ef58464 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -2713,43 +2713,43 @@ HRESULT CLoader::Loading_For_MapViewer() // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - ///* Light */ - //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\LightPosts", - // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - // return E_FAIL; + /* Light */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\LightPosts", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; - ///* Doors */ - //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Doors", - // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - // return E_FAIL; + /* Doors */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Doors", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; - ///* Step */ - //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\GroundSurfaces", - // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - // return E_FAIL; - //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\GroundSurfaces", - // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - // return E_FAIL; + /* Step */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\GroundSurfaces", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\GroundSurfaces", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; - ///* Barrel */ - //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Meshes", - // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - // return E_FAIL; + /* Barrel */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Meshes", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; - ///* Box */ - //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\MiscProps", - // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - // return E_FAIL; + /* Box */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\MiscProps", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; - ///* TeaShop Table */ - //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Tables", - // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - // return E_FAIL; + /* TeaShop Table */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Tables", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; - ///* TeaShop Chair*/ - //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Chairs", - // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - // return E_FAIL; + /* TeaShop Chair*/ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Chairs", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; /* Hogwart LOD */ if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogwarts\\HogwartsLOD", @@ -2764,292 +2764,296 @@ 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) + +_bool isLoad_Map = { true }; +if(isLoad_Map) +{ + { /* 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()] + )); + } +} + +if(isLoad_Map) +{ + for (auto& jobFuture : jobFutures) { jobFuture.get(); } @@ -3073,7 +3077,8 @@ vector*> Contents(iLoadCount); } } - }*/ + } +} m_strMessage = TEXT("쉐이더를(을) 로딩 중 입니다."); @@ -3160,7 +3165,7 @@ vector*> Contents(iLoadCount); #pragma region INSTANCE_MODEL CVIBuffer_Model_Instance::INSTANCE_DESC InstanceDesc = {}; - InstanceDesc.iNum = 20; + InstanceDesc.iNum = 100; ///* For.Prototype_Component_VIBuffer_Model_Instancel */ //if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel"), @@ -3239,6 +3244,12 @@ vector*> Contents(iLoadCount); CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/InstanceProp/SM_HM_Door2b.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml")))) return E_FAIL; + + /* For.Prototype_Component_VIBuffer_Model_Instancel_OakTree_TallA*/ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_OakTree_TallA"), + CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,&InstanceDesc, + "../Bin/Resources/Models/InstanceProp/SM_OakTree_TallA.fbx", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml")))) + return E_FAIL; #pragma endregion // INSTANCE_MODEL /* For.Prototype_Component_VIBuffer_Box */ @@ -3312,12 +3323,15 @@ vector*> Contents(iLoadCount); m_isFinished = true; - //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]); - //} + if(isLoad_Map) + { + 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]); + } + } #endif return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/MapElement_Lake.cpp b/Jusin154_Team3D/Editor/Private/MapElement_Lake.cpp index c09ac0614..6be50f795 100644 --- a/Jusin154_Team3D/Editor/Private/MapElement_Lake.cpp +++ b/Jusin154_Team3D/Editor/Private/MapElement_Lake.cpp @@ -66,16 +66,12 @@ void CMapElement_Lake::Priority_Update(_float fTimeDelta) void CMapElement_Lake::Update(_float fTimeDelta) { m_fTimeAcc += fTimeDelta * m_fUVValue; - Describe_Entity(); + //Describe_Entity(); } void CMapElement_Lake::Late_Update(_float fTimeDelta) { #ifdef _DEBUG - - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); - m_pTransformCom->Set_Scale(m_vScale); - m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); #endif m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp index 8925d8561..cae2b5389 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp @@ -58,27 +58,23 @@ HRESULT CMapObject_Manager::Initialize(void* pArg) m_iContainerObjectIndex = 99; //m_pContainer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Building"))->Get_Object(); - /*if (FAILED(Load_MapData("Map1205"))) + if (FAILED(Load_MapData("Map1205"))) return E_FAIL; - if (FAILED(Load_LightObject("LightElement"))) - return E_FAIL; - - if (FAILED(Load_InteractObject("E_INTER_Barrel"))) - return E_FAIL; - if (FAILED(Load_InteractObject("E_INTER_PostPackage_B"))) - return E_FAIL; - if (FAILED(Load_InteractObject("E_INTER_PostPackage_F"))) - return E_FAIL; - if (FAILED(Load_InteractObject("E_INTER_TeaShopTable"))) - return E_FAIL; - if (FAILED(Load_InteractObject("E_INTER_TeaShopChair"))) - return E_FAIL;*/ - - /*if (FAILED(Load_LightObject("LightElement"))) - return E_FAIL; - */ + return E_FAIL;*/ + // + //if (FAILED(Load_InteractObject("E_INTER_Barrel"))) + // return E_FAIL; + //if (FAILED(Load_InteractObject("E_INTER_PostPackage_B"))) + // return E_FAIL; + //if (FAILED(Load_InteractObject("E_INTER_PostPackage_F"))) + // return E_FAIL; + //if (FAILED(Load_InteractObject("E_INTER_TeaShopTable"))) + // return E_FAIL; + //if (FAILED(Load_InteractObject("E_INTER_TeaShopChair"))) + // return E_FAIL; + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Public/InstancedProp.h b/Jusin154_Team3D/Editor/Public/InstancedProp.h index 3dca3f32a..30722e8e4 100644 --- a/Jusin154_Team3D/Editor/Public/InstancedProp.h +++ b/Jusin154_Team3D/Editor/Public/InstancedProp.h @@ -17,6 +17,9 @@ class CInstancedProp final : public CGameObject typedef struct tagInstancedPropDesc { _bool bEditMode{}; + _bool isShake; + _float2 vRadius; + _float2 vSpeed; _wstring strPrototypeTag; string strInstanceDataPath; }INSTANCE_PROP_DESC; @@ -33,6 +36,7 @@ class CInstancedProp final : public CGameObject private: _bool m_bEditMode = {}; + _bool m_isShake = {}; CVIBuffer_Model_Instance* m_pVIBufferInstanceCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; @@ -45,7 +49,6 @@ class CInstancedProp final : public CGameObject _float3 m_vScale = {}; #ifdef _DEBUG _char m_szFileName[MAX_PATH] = {}; - #endif // _DEBUG diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Instance_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Instance_Compute.hlsl new file mode 100644 index 000000000..b8af76bd4 --- /dev/null +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Instance_Compute.hlsl @@ -0,0 +1,66 @@ +#include "Engine_Shader_Functions.hlsli" +#include "Engine_Shader_Defines.hlsli" + +struct Instance +{ + float4 vRight; + float4 vUp; + float4 vLook; + float4 vTranslation; +}; + +struct InstanceValue +{ + float fSpeed; + float fMaxRadian; +}; + + +StructuredBuffer g_InstanceBufferInput : register(t0); +StructuredBuffer g_InstanceValueBufferInput : register(t1); + +RWStructuredBuffer g_InstanceOutput : register(u0); + +cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐이더 바인딩할때 인덱스가 동일해야함 +{ + float fTimeDelta; + float fPading1; + float fPading2; + float fPading3; +} + +//내가 몇개의 스레드를 사용할 것인지 지정하는데 +//GPU 칩의 개수를 X * Y * Z의 개수 만큼 사용하겠다는 의미이다. +[numthreads(256, 1, 1)] +void CS_MAIN( + uint3 DispatchThreadID : SV_DispatchThreadID) +{ + int iIndex = DispatchThreadID.x; // 배열 인덱스 + + Instance particle = g_InstanceBufferInput[iIndex]; + InstanceValue particleValue = g_InstanceValueBufferInput[iIndex]; + + float fRadian = sin(particleValue.fSpeed * fTimeDelta) * particleValue.fMaxRadian; + + // 3. 임의의 축 회전 행렬 생성 + + // 4. 최종 월드 행렬 (CurMat) 생성 + + float4x4 CurMatrix = + { + particle.vRight, + particle.vUp, + particle.vLook, + particle.vTranslation + }; + + CurMatrix = mul(RotateAxis(particle.vLook, fRadian), CurMatrix); + + particle.vRight = CurMatrix[0].xyzw; + particle.vUp = CurMatrix[1].xyzw; + particle.vLook = CurMatrix[2].xyzw; + particle.vTranslation = CurMatrix[3].xyzw; + + //아웃풋 대입 + g_InstanceOutput[iIndex] = particle; +} diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index 95e1f38f6..389a14646 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -641,6 +641,7 @@ call Update_Lib.bat + Effect 5.0 diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index 67cb0c16c..d9f41ede5 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -1320,5 +1320,8 @@ 99.Define\01.SHADER\Inc + + 99.Define\01.SHADER + \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Private/Light_Manager.cpp b/Jusin154_Team3D/Engine/Private/Light_Manager.cpp index 4c89fe94d..7103da91e 100644 --- a/Jusin154_Team3D/Engine/Private/Light_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Light_Manager.cpp @@ -49,7 +49,7 @@ void CLight_Manager::Delete_Light(_uint _iCurrentLevel, CLight* _pLight) SAFE_RELEASE(_pLight); iter = m_Lights[_iCurrentLevel].erase(iter); - + return; } else { diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 2a35e0f05..d45e1367b 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -516,6 +516,21 @@ const _float4x4* CModel::Get_BoneMatrixPtr(const _char* pBoneName) const return (*iter)->Get_CombinedTransformationMatrixPtr(); + +} + +_matrix CModel::Get_BoneMatrix(const _char* pBoneName) const +{ + vector::const_iterator iter = find_if(m_Bones.begin(), m_Bones.end(), [&](CBone* pBone)->_bool + { + if (true == pBone->Compare_Name(pBoneName)) + return true; + + return false; + }); + + + return (*iter)->Get_CombinedTransformationMatrix(); } const _char* CModel::Get_MeshName(_uint iIndex) diff --git a/Jusin154_Team3D/Engine/Private/OcclusionQuery.cpp b/Jusin154_Team3D/Engine/Private/OcclusionQuery.cpp index 44742260c..62c1608a8 100644 --- a/Jusin154_Team3D/Engine/Private/OcclusionQuery.cpp +++ b/Jusin154_Team3D/Engine/Private/OcclusionQuery.cpp @@ -18,6 +18,12 @@ void COcclusionQuery::Begin_Query() _bool COcclusionQuery::isDraw() { + if (false == m_bCurFrameDraw) + { + m_bPreFrameDraw = m_bCurFrameDraw = true; + return true; + } + bool bVisible = m_bPreFrameDraw; _uint iIndex = (m_iCheckFrame + 3) % 5; @@ -71,8 +77,8 @@ HRESULT COcclusionQuery::Initialize(void* pArg) return E_FAIL; } } - - m_bPreFrameDraw = m_bThisFrameDraw = true; + m_bCurFrameDraw = false; + m_bPreFrameDraw = true; m_iNumCullFrame = 0; return S_OK; diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp index 21575c4a5..d916afa88 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp @@ -7,6 +7,7 @@ #include "Model.h" #include "Transform.h" #include "Shader.h" +#include "ComputeShader.h" CVIBuffer_Model_Instance::CVIBuffer_Model_Instance(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CVIBuffer_Instance(pDevice, pContext) @@ -55,9 +56,20 @@ HRESULT CVIBuffer_Model_Instance::Initialize_Prototype(const _char* pModelFilePa HRESULT CVIBuffer_Model_Instance::Initialize(void* pArg) { + m_fTimeAcc = 0.f; + + if (FAILED(Create_ConstantBuffer())) + return E_FAIL; + + if (FAILED(Create_Instance_Value_Buffer())) + return E_FAIL; + if (FAILED(Reay_Instance_Buffer())) return E_FAIL; + if (FAILED(Create_ComputeShader())) + return E_FAIL; + return S_OK; } @@ -70,6 +82,68 @@ HRESULT CVIBuffer_Model_Instance::Render(_uint iMeshIndex) return S_OK; } +void CVIBuffer_Model_Instance::Shake(_float fTimeDelta) +{ + m_fTimeAcc += fTimeDelta; + + if (3600.0f < m_fTimeAcc) + m_fTimeAcc = 0.f; + + D3D11_MAPPED_SUBRESOURCE ConstantSubResource = {}; + + if (SUCCEEDED(m_pContext->Map(m_pConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &ConstantSubResource))) + { + CS_MODEL_INSTANCE_CONSTANT_DESC* pDesc = static_cast(ConstantSubResource.pData); + + pDesc->fTimeDelta = m_fTimeAcc; + pDesc->fPading1 = 0.f; + pDesc->fPading2 = 0.f; + pDesc->fPading3 = 0.f; + m_pContext->Unmap(m_pConstantBuffer, 0); + } + + if (m_pComputeShader == nullptr) + return; + + _uint iGroupCountX = (m_iNumInstance + 255) / 256; + + ID3D11Buffer* CSBuffers[] = { + m_pVBInstance, + m_pParticleValueBuffer + }; + + m_pComputeShader->Dispatch(0, 0, _float3((_float)iGroupCountX, 1.f, 1.f), CSBuffers, m_pConstantBuffer); + + return; +} + +HRESULT CVIBuffer_Model_Instance::Set_Shake_Value(_float2 vRadius, _float2 vSpeed) +{ + D3D11_MAPPED_SUBRESOURCE InstanceValueResource = {}; + + if (SUCCEEDED(m_pContext->Map(m_pParticleValueBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &InstanceValueResource))) + { + CS_MODEL_INSTANCE_DESC* pDesc = static_cast(InstanceValueResource.pData); + + for (_uint i = 0; i < m_iNumInstance; ++i) + { + pDesc[i].fMaxRadian = m_pGameInstance->Real_Random_Float(vRadius.x, vRadius.y); + pDesc[i].fSpeed = m_pGameInstance->Real_Random_Float(vSpeed.x, vSpeed.y); + } + + m_pContext->Unmap(m_pParticleValueBuffer, 0); + } + + return S_OK; +} + +HRESULT CVIBuffer_Model_Instance::Bind_OutPut_SRV_VS(_uint Index, _uint iBufferIndex) +{ + m_pComputeShader->Bind_OutPut_SRV_VS(Index, iBufferIndex); + + return S_OK; +} + HRESULT CVIBuffer_Model_Instance::Bind_Matrial(CShader* pShader, _uint iMeshIndex) { if(FAILED(pShader->Bind_SRV("g_DiffuseTexture", m_MeshMaterialsSRV[iMeshIndex][0]))) @@ -284,6 +358,78 @@ HRESULT CVIBuffer_Model_Instance::Ready_Materials() return S_OK; } +HRESULT CVIBuffer_Model_Instance::Create_ComputeShader() +{ + _uint CS_InputStrides[] = { + sizeof(VTX_INSTANCE_MODEL), + sizeof(CS_MODEL_INSTANCE_DESC), + }; + + _uint CS_OutputStrides[] = { + sizeof(VTX_INSTANCE_MODEL), + }; + + m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext, + L"../Bin/Resources/ShaderFiles/Shader_Instance_Compute.hlsl", "CS_MAIN", m_iMaxNumInstance, 2, 1, CS_InputStrides, CS_OutputStrides); + + if (m_pComputeShader == nullptr) + return E_FAIL; + + return S_OK; +} + +HRESULT CVIBuffer_Model_Instance::Create_ConstantBuffer() +{ + //컨스턴트 버퍼 생성 + D3D11_BUFFER_DESC cbDesc = {}; + cbDesc.Usage = D3D11_USAGE_DYNAMIC; + cbDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + cbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + cbDesc.ByteWidth = sizeof(CS_MODEL_INSTANCE_CONSTANT_DESC); + + D3D11_SUBRESOURCE_DATA CBInitialDesc = {}; + + if (FAILED(m_pDevice->CreateBuffer(&cbDesc, nullptr, &m_pConstantBuffer))) + return E_FAIL; + + return S_OK; +} + +HRESULT CVIBuffer_Model_Instance::Create_Instance_Value_Buffer() +{ + // 벨류 버퍼 생성하기 + D3D11_BUFFER_DESC Particle_Buffer_Desc = {}; + Particle_Buffer_Desc.ByteWidth = sizeof(CS_MODEL_INSTANCE_DESC) * m_iNumInstance; + Particle_Buffer_Desc.Usage = D3D11_USAGE_DYNAMIC; + Particle_Buffer_Desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + Particle_Buffer_Desc.StructureByteStride = sizeof(CS_MODEL_INSTANCE_DESC); + Particle_Buffer_Desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + Particle_Buffer_Desc.MiscFlags = 0; + + D3D11_SUBRESOURCE_DATA InitialDesc = {}; + InitialDesc.pSysMem = nullptr; + + if (FAILED(m_pDevice->CreateBuffer(&Particle_Buffer_Desc, nullptr, &m_pParticleValueBuffer))) + return E_FAIL; + + D3D11_MAPPED_SUBRESOURCE InstanceValueResource = {}; + + if (SUCCEEDED(m_pContext->Map(m_pParticleValueBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &InstanceValueResource))) + { + CS_MODEL_INSTANCE_DESC* pDesc = static_cast(InstanceValueResource.pData); + + for (_uint i = 0; i < m_iNumInstance; ++i) + { + pDesc[i].fMaxRadian = 0.f; + pDesc[i].fSpeed = 0.f; + } + + m_pContext->Unmap(m_pParticleValueBuffer, 0); + } + + return S_OK; +} + #ifdef EDITOR_PROJECT HRESULT CVIBuffer_Model_Instance::SaveAssimpModel(const _char* pModelFilePath) @@ -563,6 +709,11 @@ void CVIBuffer_Model_Instance::Free() { __super::Free(); + SAFE_RELEASE(m_pComputeShader); + + SAFE_RELEASE(m_pConstantBuffer); + SAFE_RELEASE(m_pParticleValueBuffer); + for (auto& pMesh : m_Meshes) SAFE_RELEASE(pMesh); m_Meshes.clear(); diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 7aa2ece70..afa944605 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -66,7 +66,8 @@ class ENGINE_DLL CModel final : public CComponent #pragma endregion #pragma region Bone HRESULT Bind_BoneMatrices(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName); - const _float4x4* Get_BoneMatrixPtr(const _char* pBoneName) const; + const _float4x4* Get_BoneMatrixPtr(const _char* pBoneName) const; + _matrix Get_BoneMatrix(const _char* pBoneName) const; static _int Get_BoneIndex(const _char* pBoneName, vector Bones); // 본의 벡터와 이름을 넘겨주면 인덱스를 넘겨줌 ( n 순회 ) _int Get_BoneIndex(const _char* pBoneName) const; _matrix Get_BoneMatrix(_uint iBoneIndex); diff --git a/Jusin154_Team3D/Engine/Public/OcclusionQuery.h b/Jusin154_Team3D/Engine/Public/OcclusionQuery.h index 8b181cb43..55515af49 100644 --- a/Jusin154_Team3D/Engine/Public/OcclusionQuery.h +++ b/Jusin154_Team3D/Engine/Public/OcclusionQuery.h @@ -15,12 +15,14 @@ class ENGINE_DLL COcclusionQuery final : public CComponent void Begin_Query(); _bool isDraw(); void End_Query(); + void Set_PreFrameDraw() { m_bCurFrameDraw = false; } private: ID3D11Query* m_pQuery[5] = {}; _bool m_bPreFrameDraw = { true }; - _bool m_bThisFrameDraw = {}; + _bool m_bCurFrameDraw = {}; + _uint m_iNumCullFrame = {}; _uint m_iCountFrame = {}; _uint m_iGetFrameIndex = {}; diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_Model_Instance.h b/Jusin154_Team3D/Engine/Public/VIBuffer_Model_Instance.h index c459ea1bb..9484a81a3 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_Model_Instance.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_Model_Instance.h @@ -5,6 +5,21 @@ NS_BEGIN(Engine) class ENGINE_DLL CVIBuffer_Model_Instance final : public CVIBuffer_Instance { +public: + typedef struct tagCS_Model_Instacne_Desc + { + _float fSpeed; + _float fMaxRadian; + }CS_MODEL_INSTANCE_DESC; + + typedef struct tagCS_Model_Instacne_Constant_Desc + { + _float fTimeDelta; + _float fPading1; + _float fPading2; + _float fPading3; + }CS_MODEL_INSTANCE_CONSTANT_DESC; + private: CVIBuffer_Model_Instance(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CVIBuffer_Model_Instance(const CVIBuffer_Model_Instance& rhs); @@ -17,8 +32,12 @@ class ENGINE_DLL CVIBuffer_Model_Instance final : public CVIBuffer_Instance virtual HRESULT Initialize_Prototype(const _char* pModelFilePath, const _char* pMatrialPath); virtual HRESULT Initialize(void* pArg) override; virtual HRESULT Render(_uint iMeshIndex); + void Shake(_float fTimeDelta); + HRESULT Set_Shake_Value(_float2 vRadius, _float2 vSpeed); + HRESULT Bind_OutPut_SRV_VS(_uint iIndex, _uint iBufferIndex); HRESULT Bind_Matrial(class CShader* pShader, _uint iMeshIndex); + HRESULT Load_WorldData(vector<_float4x4>& WorldMatrices); private: _uint m_iNumBuffer = {}; @@ -27,6 +46,12 @@ class ENGINE_DLL CVIBuffer_Model_Instance final : public CVIBuffer_Instance _uint m_iCurrentNumInstance = {}; _uint m_iMaxNumInstance = {}; + _float m_fTimeAcc = {}; + class CComputeShader* m_pComputeShader = { nullptr }; + + ID3D11Buffer* m_pConstantBuffer = { nullptr }; + ID3D11Buffer* m_pParticleValueBuffer = { nullptr }; + INSTANCE_DESC m_InstanceDesc = {}; vector m_Meshes = {}; @@ -41,6 +66,9 @@ class ENGINE_DLL CVIBuffer_Model_Instance final : public CVIBuffer_Instance HRESULT Load_ModelData(const _char* pModelFilePath); HRESULT Load_Material(const _char* pModelFilePath, const _char* pMatrialPath); HRESULT Ready_Materials(); + HRESULT Create_ComputeShader(); + HRESULT Create_ConstantBuffer(); + HRESULT Create_Instance_Value_Buffer(); #ifdef EDITOR_PROJECT public: