diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 16287e040..da3d61395 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1745,6 +1745,27 @@ PS_OUT PS_Broomstick(PS_IN In) return Out; } +PS_OUT PS_SpellLearn(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 Color = float4(1.f, 1.f, 1.f, 1.f); + + float4 tex = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float tex1 = g_Texture1.Sample(DefaultSampler, In.vTexcoord).r; + Color = tex; + + tex1 *= 0.95f; + + Color.a = tex1; + + Color.a *= Alpha; + + Out.vColor = Color; + return Out; +} + struct VS_IN3D { float3 vPosition : POSITION; @@ -2305,6 +2326,16 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Broomstick(); } + pass SpellLearn + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, 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_SpellLearn(); + } + pass Enemy_Detection { SetRasterizerState(RS_Nocull); diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 8361cf5b7..a7b65b57e 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -221,7 +221,12 @@ call Update_Resources.bat + + + + + @@ -426,19 +431,24 @@ call Update_Resources.bat + + + + + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index ae1d4f460..e014dbc0b 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -632,10 +632,24 @@ 02.GameObjects\Effect\Effects\Stupefy - 02.GameObjects\Environment\03.MapElement\Static + + 04.Mechanic\State\State_Combat\State_FireSweep + + + 04.Mechanic\State\Movement\Ground + + + 04.Mechanic\State\State_Combat\State_Swipe + + + 04.Mechanic\State\Focus\Slide + + + 04.Mechanic\State\State_Combat\State_Skill + @@ -1327,6 +1341,21 @@ {c69a2485-7f6e-4e22-81b4-1410fdae9d57} + + {2c39ba68-2f23-4bc9-a277-b6e9295c11a0} + + + {9e2863cd-1a30-4a27-a076-5e1baff3dee8} + + + {2fd96fb0-dbc3-4486-afda-82b3b1b63060} + + + {ee880571-e18c-4206-80ea-448cadd04d9a} + + + {cef80506-72c7-4bb9-a691-760f0a576eb7} + {c3b86f00-da19-47ad-a26e-7ff641e2c4d4} @@ -1909,7 +1938,21 @@ 04.Mechanic\State\State_Combat\State_AncientSpell - + + 04.Mechanic\State\State_Combat\State_FireSweep + + + 04.Mechanic\State\Movement\Ground + + + 04.Mechanic\State\State_Combat\State_Swipe + + + 04.Mechanic\State\Focus\Slide + + + 04.Mechanic\State\State_Combat\State_Skill + 02.GameObjects\Environment\03.MapElement\Static diff --git a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp index 40050137e..6ce105aa7 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp @@ -326,6 +326,8 @@ void CGoblin_Mage::OnCollision(CGameObject* pOther, void* pDesc) m_pInfoInstance->Event_CallBack(TEXT("Monster_Hit"), &m_DamageInfo); if (0 == damagePair.second) { m_pFSM->Change_State(FSMSTATE::DEAD); + _int ID = m_pStat->Get_Stat().iObjectID; + m_pInfoInstance->Event_CallBack(TEXT("MonsterDead"), &ID); return; } diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index d57394f52..5c8ed4930 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -262,9 +262,9 @@ void CInfoInstance::Event_CallBack(_wstring EventName, void* pArg) } } -QUESTINFO CInfoInstance::Get_Quest(_int QuestID) +QUESTINFO CInfoInstance::Get_Quest(_int QuestType, _int QuestID) { - return m_pQuestInfo->Get_Quest(QuestID); + return m_pQuestInfo->Get_Quest(QuestType, QuestID); } _int CInfoInstance::Get_Quest_Count(_int Index) diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 9d86e9f03..810d0c333 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -258,7 +258,7 @@ HRESULT CLevel_GamePlay::Ready_Background() isReady_Background = false; #endif // #ifdef 기무리 - isReady_Background = false; + isReady_Background = true; #endif // #ifdef 인혁 isReady_Background = true; @@ -565,14 +565,14 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag) HRESULT CLevel_GamePlay::Ready_Layer_Monster() { - for (_uint i = 0; i < 0; ++i) + for (_uint i = 0; i <1; ++i) { if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { return E_FAIL; } } - for (_uint i = 0; i <3; ++i) + for (_uint i = 0; i <1; ++i) { if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Level_Loading.cpp b/Jusin154_Team3D/Client/Private/Level_Loading.cpp index ebb975b87..76c0dd92a 100644 --- a/Jusin154_Team3D/Client/Private/Level_Loading.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Loading.cpp @@ -38,6 +38,11 @@ void CLevel_Loading::Update(_float fTimeDelta) { if (true == m_pLoader->isFinished()) { +#ifdef _DEBUG +#ifdef 기무리 + m_bNextLevel = true; +#endif // 기무리 +#endif // _DEBUG if (m_eNextLevelID != LEVEL::LOGO) m_bNextLevel = true; else diff --git a/Jusin154_Team3D/Client/Private/Level_Logo.cpp b/Jusin154_Team3D/Client/Private/Level_Logo.cpp index 5a9e978f9..e78d63233 100644 --- a/Jusin154_Team3D/Client/Private/Level_Logo.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Logo.cpp @@ -26,9 +26,11 @@ HRESULT CLevel_Logo::Initialize() void CLevel_Logo::Update(_float fTimeDelta) { -//#ifdef 기무리 -// m_pGameInstance->Set_LevelToChange(); -//#endif // 기무리 +#ifdef _DEBUG +#ifdef 기무리 + m_pGameInstance->Set_LevelToChange(); +#endif // 기무리 +#endif // _DEBUG if (m_pGameInstance->Key_Down(DIK_F1)) { diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 61fc33829..1842c5dc2 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -335,7 +335,7 @@ HRESULT CLoader::Loading_For_GamePlay() isLoad_Background = false; #endif // #ifdef 기무리 - isLoad_Background = false; + isLoad_Background = true; #endif // #ifdef 인혁 isLoad_Background = true; @@ -911,6 +911,7 @@ HRESULT CLoader::Loading_For_GamePlay() #pragma endregion #if 진우 #elif 기무리 +#elif Bin #elif gimch #else #pragma region UI_ANI @@ -1467,7 +1468,7 @@ HRESULT CLoader::Loading_For_GamePlay() CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc1{}; { - Desc1.eType = ACTOR::BOX; + Desc1.eType = ACTOR::SPHERE; Desc1.ePxRigidBodyFlags = { PSX::PxRigidBodyFlag::eKINEMATIC }; Desc1.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE }; Desc1.ePxMaterialTypes = { PXMATERIAL::DEFAULT }; diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index a5e6db15d..6350d24fa 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -21,6 +21,7 @@ #include "State_Dodge.h" #include "State_Jump.h" #include "State_Land.h" +#include "State_Slide.h" #include "State_Move.h" #include "State_Combat.h" #include "State_LightAttack.h" @@ -497,6 +498,10 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); return S_OK; } + else if (m_pGameInstance->Key_Down(DIK_E)) + { + m_pFSM->Change_State(FSMSTATE::SLIDE); + } return E_FAIL; } @@ -841,6 +846,46 @@ void CPlayer::Behavior_DodgeExit() m_pFSM->Disable_State(FSMSTATE::DODGE); } +void CPlayer::Behavior_SlideEnter() +{ + pair<_uint, _bool> pairAnimInfo; + m_pFSM->Enable_State(FSMSTATE::SLIDE); + pairAnimInfo = m_Animation[STATEANIM::SLIDE_START_R]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + Add_Event(pairAnimInfo.first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::SLIDE_LOOP_R]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); }, + 0.95f); +} + +HRESULT CPlayer::Behavior_SlideExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo; + _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + if (m_pGameInstance->Key_Up(DIK_E)) + { + pairAnimInfo = m_Animation[STATEANIM::SLIDE_STOP_R]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + return S_OK; + } + if (iCurrAnimIndex == m_Animation[STATEANIM::SLIDE_STOP_R].first) + { + if (fRatio >=0.38f) + { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + } + + return S_OK; +} + +void CPlayer::Behavior_SlideExit() +{ + m_pFSM->Disable_State(FSMSTATE::SLIDE); +} + void CPlayer::Behavior_CombatEnter() { pair<_uint, _bool> pairAnimInfo = {}; @@ -883,11 +928,12 @@ void CPlayer::Behavior_CombatEnter() pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW]; } else if (nullptr != m_LockOnInfo.pInteractive) { + m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW); + pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW]; m_pGrapInteractive = m_LockOnInfo.pInteractive; SAFE_ADDREF(m_pGrapInteractive); m_pGrapInteractive->Set_KinematicFlag(true); m_vGrapInteratableLerp.x = 0.f; - return; } Add_Event(pairAnimInfo.first, @@ -938,29 +984,29 @@ HRESULT CPlayer::Behavior_CombatExitCheck() m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW); pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - Add_Event(pairAnimInfo.first, - [this]() { m_bLookAt = true; }, - 0.1f); - Add_Event(pairAnimInfo.first, - [this]() { - Throwing_Interactive(); - }, - 0.2f); - - Add_Event(pairAnimInfo.first, - [this]() { - m_pGameInstance->SlowMotion(0.1f, 0.35f); - }, - 0.1f); - - } else if (nullptr != m_LockOnInfo.pInteractive) { + m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW); + pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW]; m_pGrapInteractive = m_LockOnInfo.pInteractive; SAFE_ADDREF(m_pGrapInteractive); m_pGrapInteractive->Set_KinematicFlag(true); m_vGrapInteratableLerp.x = 0.f; } + Add_Event(pairAnimInfo.first, + [this]() { m_bLookAt = true; }, + 0.1f); + Add_Event(pairAnimInfo.first, + [this]() { + Throwing_Interactive(); + }, + 0.2f); + + Add_Event(pairAnimInfo.first, + [this]() { + m_pGameInstance->SlowMotion(0.1f, 0.35f); + }, + 0.1f); } } @@ -2309,7 +2355,7 @@ void CPlayer::Throwing_Interactive() { if (nullptr == m_pGrapInteractive) { return; - } _vector vDir = {}; _float vDistance = 45.f; + } _vector vDir = {}; _float vDistance = 60.f; CRigidBody_Dynamic* pBody = m_pGrapInteractive->Get_Component(); if (nullptr != m_LockOnInfo.pUnit) { vDir = XMVector3Normalize(m_LockOnInfo.pUnit->Get_LockOnPos() - m_pGrapInteractive->Get_LockOnPos()); @@ -2457,6 +2503,17 @@ void CPlayer::Add_FSM() Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc)); } + + { + CState_Slide::STATE_SLIDE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_SlideEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_SlideExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_SlideExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SLIDE, CState_Slide::Create(&Desc)); + } #pragma endregion #pragma region Behavior_Combat_NotFocus { @@ -2688,6 +2745,10 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::LAND] = { 259,false }; + m_Animation[STATEANIM::SLIDE_STOP_R] = { 568,false }; + m_Animation[STATEANIM::SLIDE_START_R] = { 566,false }; + m_Animation[STATEANIM::SLIDE_LOOP_R] = { 564,true }; + m_Animation[STATEANIM::DODGE] = { 878,false }; m_Animation[STATEANIM::DODGE_BLINK] = { 876,true }; @@ -2797,6 +2858,7 @@ void CPlayer::Set_Anim() // 947 // 755 기모으기 859 + //568 566 564 슬라이드 스탑/스타트/루프 } diff --git a/Jusin154_Team3D/Client/Private/Protego.cpp b/Jusin154_Team3D/Client/Private/Protego.cpp index 8ef8104c5..6558e1c7b 100644 --- a/Jusin154_Team3D/Client/Private/Protego.cpp +++ b/Jusin154_Team3D/Client/Private/Protego.cpp @@ -57,7 +57,6 @@ HRESULT CProtego::Initialize(void* pArg) void CProtego::Priority_Update(_float fTimeDelta) { __super::Priority_Update(fTimeDelta); - } void CProtego::Update(_float fTimeDelta) @@ -72,6 +71,9 @@ void CProtego::Update(_float fTimeDelta) Update_Event(fTimeDelta); + if (m_bVisible == false){ + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(0.f, 0.f, 0.f, 1.f)); + } /* 시작 사이즈 러프 */ @@ -89,9 +91,10 @@ void CProtego::Update(_float fTimeDelta) void CProtego::Late_Update(_float fTimeDelta) { - if (m_bVisible == false) + if (m_bVisible == false){ return; - + } + m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_Component()->Get_Position()); __super::Late_Update(fTimeDelta); @@ -126,14 +129,14 @@ HRESULT CProtego::Ready_Components(void* pArg) } - //{ // DO - // CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - // Desc.iSubKind = ENUM_CLASS(PXOBJECT::SKILL_PROTEGO); - // if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_SHIELD"), (CComponent**)&m_pRigidBody, &Desc))) { - // return E_FAIL; - // } - // m_pGameInstance->Attach_Actor(*m_pRigidBody->Get_Actor()); - //} + { // DO + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::SKILL_PROTEGO); + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_SHIELD"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + m_pGameInstance->Attach_Actor(*m_pRigidBody->Get_Actor()); + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Quest_Canvas.cpp b/Jusin154_Team3D/Client/Private/Quest_Canvas.cpp index 5da8c63a2..accca3075 100644 --- a/Jusin154_Team3D/Client/Private/Quest_Canvas.cpp +++ b/Jusin154_Team3D/Client/Private/Quest_Canvas.cpp @@ -44,6 +44,8 @@ HRESULT CQuest_Canvas::Initialize(void* pArg) } Visible(false); m_pInfoInstance->Set_AcceptQuest(0); + m_pInfoInstance->Set_AcceptQuest(1); + m_pInfoInstance->Set_AcceptQuest(2); return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Quest_Data.cpp b/Jusin154_Team3D/Client/Private/Quest_Data.cpp index e7eb9b0e0..6e850b057 100644 --- a/Jusin154_Team3D/Client/Private/Quest_Data.cpp +++ b/Jusin154_Team3D/Client/Private/Quest_Data.cpp @@ -95,9 +95,20 @@ HRESULT CQuest_Data::Load_QuestInfo(const _char* pFilePath) return S_OK; } -QUESTINFO CQuest_Data::Get_Quest(_int QuestID) +QUESTINFO CQuest_Data::Get_Quest(_int QuestType, _int QuestID) { - return QuestInfos[QuestID]; + switch (QuestType) + { + case 0: + return QuestInfos[QuestID]; + case 1: + return m_QuestAcceptedInfos[QuestID]; + case 2: + return m_QuestEndInfos[QuestID]; + default: + return QuestInfos[QuestID]; + } + } const vector& CQuest_Data::Get_AllQuest() const @@ -164,18 +175,24 @@ void CQuest_Data::Set_ClearQuest(_int Index) void CQuest_Data::Update_AcceptQuest(_int MonsterID) { - m_QuestAcceptedInfoObject.erase(remove_if(m_QuestAcceptedInfoObject.begin(), m_QuestAcceptedInfoObject.end(), - [MonsterID, this](auto& it) { - CQuestInstance* instance = static_cast(it); - if (static_cast(it)->Update_Objective(MonsterID) == true) - { - Set_ClearQuest(static_cast(it)->Get_QuestID()); - return true; - } - return false; - }), - m_QuestAcceptedInfoObject.end() - ); + vector<_int> toRemoveIndex; + + _int index = 0; + for (auto* instance : m_QuestAcceptedInfoObject) + { + if (static_cast(instance)->Update_Objective(MonsterID)) + { + Set_ClearQuest(static_cast(instance)->Get_QuestID()); + toRemoveIndex.push_back(index); + } + index++; + } + + for (auto it = toRemoveIndex.rbegin(); it != toRemoveIndex.rend(); ++it) + { + m_QuestAcceptedInfoObject.erase(m_QuestAcceptedInfoObject.begin() + *it); + m_QuestAcceptedInfos.erase(m_QuestAcceptedInfos.begin() + *it); + } } CQuest_Data* CQuest_Data::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) diff --git a/Jusin154_Team3D/Client/Private/Quest_Entry_Line.cpp b/Jusin154_Team3D/Client/Private/Quest_Entry_Line.cpp index a00e26462..c782b597a 100644 --- a/Jusin154_Team3D/Client/Private/Quest_Entry_Line.cpp +++ b/Jusin154_Team3D/Client/Private/Quest_Entry_Line.cpp @@ -40,11 +40,11 @@ HRESULT CQuest_Entry_Line::Initialize(void* pArg) m_fAlpha = 1.f; m_fAlphaTime = 5.f; m_vNine_Slice = _float4(0.f, 256.f, 0.f, 64.f); - m_fFontX = 928.f; + m_fFontX = 948.f; m_fFontY = 520.f; SizeUpX(800.f); SizeUpY(15.f); - static_cast(m_pOwner)->Add_Function(TEXT("QuestListHover"), [this](void* p) {this->Set_Hover(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("QuestListHover"), [this](void* p) {this->Set_Hover(p); }); Visible(false); return S_OK; } @@ -120,7 +120,7 @@ HRESULT CQuest_Entry_Line::Render() if (FAILED(m_pVIBufferCom->Render())) { return E_FAIL; } - + _float OffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), TEXT("보 상")) - 22) * 0.5f; m_pGameInstance->Render_Text(TEXT("Font_size20"), TEXT("조 건"), _float2((m_fFontX + m_fX) - OffSet, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); @@ -208,9 +208,12 @@ HRESULT CQuest_Entry_Line::Ready_Components(void* pArg) return S_OK; } -void CQuest_Entry_Line::Set_Hover(_int Index) +void CQuest_Entry_Line::Set_Hover(void* pArg) { - m_iQuest_Index = Index; + CURRENTQUESTSECETINFO* Desc = static_cast(pArg); + + m_iCurrentQuest = Desc->iQuestCategory; + m_iQuest_Index = Desc->iQuestIndex; if (m_iQuest_Index == -1) { Visible(false); diff --git a/Jusin154_Team3D/Client/Private/Quest_Info.cpp b/Jusin154_Team3D/Client/Private/Quest_Info.cpp index 1bbad4523..d15c82661 100644 --- a/Jusin154_Team3D/Client/Private/Quest_Info.cpp +++ b/Jusin154_Team3D/Client/Private/Quest_Info.cpp @@ -51,7 +51,7 @@ HRESULT CQuest_Info::Initialize(void* pArg) m_fFontY = 500.f; m_iPerQuestIndex = -1; Visible(false); - static_cast(m_pOwner)->Add_Function(TEXT("QuestListHover"), [this](void* p) {this->Set_Hover(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("QuestListHover"), [this](void* p) {this->Set_Hover(p); }); return S_OK; } @@ -129,7 +129,7 @@ HRESULT CQuest_Info::Render() return E_FAIL; } - m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iQuest_Index).pQuestInfo.c_str(), _float2(m_fFontX + m_fX, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); + m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iCurrentQuest ,m_iQuest_Index).pQuestInfo.c_str(), _float2(m_fFontX + m_fX, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); return S_OK; } @@ -217,9 +217,12 @@ HRESULT CQuest_Info::Ready_Components(void* pArg) return S_OK; } -void CQuest_Info::Set_Hover(_int Index) +void CQuest_Info::Set_Hover(void* pArg) { - m_iQuest_Index = Index; + CURRENTQUESTSECETINFO* Desc = static_cast(pArg); + + m_iCurrentQuest = Desc->iQuestCategory; + m_iQuest_Index = Desc->iQuestIndex; if (m_iQuest_Index == -1) { Visible(false); diff --git a/Jusin154_Team3D/Client/Private/Quest_Info_Header.cpp b/Jusin154_Team3D/Client/Private/Quest_Info_Header.cpp index 44ef44382..4d80896d8 100644 --- a/Jusin154_Team3D/Client/Private/Quest_Info_Header.cpp +++ b/Jusin154_Team3D/Client/Private/Quest_Info_Header.cpp @@ -48,7 +48,7 @@ HRESULT CQuest_Info_Header::Initialize(void* pArg) m_iColor = 2; SizeUpX(1105.f); SizeUpY(60.f); - static_cast(m_pOwner)->Add_Function(TEXT("QuestListHover"), [this](void* p) {this->Set_Hover(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("QuestListHover"), [this](void* p) {this->Set_Hover(p); }); Visible(false); return S_OK; } @@ -129,8 +129,8 @@ HRESULT CQuest_Info_Header::Render() return E_FAIL; } - _float OffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iQuest_Index).pQuestName.c_str()) - 30) * 0.5f; - m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iQuest_Index).pQuestName.c_str(), _float2((m_fFontX + m_fX) - OffSet, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); + _float OffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iCurrentQuest, m_iQuest_Index).pQuestName.c_str()) - 30) * 0.5f; + m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iCurrentQuest, m_iQuest_Index).pQuestName.c_str(), _float2((m_fFontX + m_fX) - OffSet, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); return S_OK; } @@ -214,9 +214,12 @@ HRESULT CQuest_Info_Header::Ready_Components(void* pArg) return S_OK; } -void CQuest_Info_Header::Set_Hover(_int Index) +void CQuest_Info_Header::Set_Hover(void* pArg) { - m_iQuest_Index = Index; + CURRENTQUESTSECETINFO* Desc = static_cast(pArg); + + m_iCurrentQuest = Desc->iQuestCategory; + m_iQuest_Index = Desc->iQuestIndex; if (m_iQuest_Index == -1) { Visible(false); diff --git a/Jusin154_Team3D/Client/Private/Quest_Info_Line.cpp b/Jusin154_Team3D/Client/Private/Quest_Info_Line.cpp index 64ed82ffc..c3d12233d 100644 --- a/Jusin154_Team3D/Client/Private/Quest_Info_Line.cpp +++ b/Jusin154_Team3D/Client/Private/Quest_Info_Line.cpp @@ -42,7 +42,7 @@ HRESULT CQuest_Info_Line::Initialize(void* pArg) m_vNine_Slice = _float4(11.f, 245.f, 0.f, 64.f); SizeUpX(934.f); SizeUpY(15.f); - static_cast(m_pOwner)->Add_Function(TEXT("QuestListHover"), [this](void* p) {this->Set_Hover(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("QuestListHover"), [this](void* p) {this->Set_Hover(p); }); Visible(false); return S_OK; } @@ -202,9 +202,12 @@ HRESULT CQuest_Info_Line::Ready_Components(void* pArg) return S_OK; } -void CQuest_Info_Line::Set_Hover(_int Index) +void CQuest_Info_Line::Set_Hover(void* pArg) { - m_iQuest_Index = Index; + CURRENTQUESTSECETINFO* Desc = static_cast(pArg); + + m_iCurrentQuest = Desc->iQuestCategory; + m_iQuest_Index = Desc->iQuestIndex; if (m_iQuest_Index == -1) { Visible(false); diff --git a/Jusin154_Team3D/Client/Private/Quest_Slot.cpp b/Jusin154_Team3D/Client/Private/Quest_Slot.cpp index 0b5d8f058..f927a1486 100644 --- a/Jusin154_Team3D/Client/Private/Quest_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Quest_Slot.cpp @@ -49,12 +49,15 @@ HRESULT CQuest_Slot::Initialize(void* pArg) m_fOffSetX = 0.f; m_fOffSetY = 85; m_iCols = 1; + m_fPositionX = -475.f; + m_fPositionY = 330.f; SizeUpX(495.f); SizeUpY(80.f); m_pVIBufferCom->Set_Cloned(true); - m_pVIBufferCom->Set_Pos(-475.f, 330.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Pos(m_fPositionX, m_fPositionY, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); m_iQuestCount = m_pInfoInstance->Get_Quest_Count(ENUM_CLASS(QUESTSTATE::NONE)); + Set_QuestType(ENUM_CLASS(QUESTSTATE::NONE)); Visible(true); return S_OK; } @@ -99,8 +102,7 @@ void CQuest_Slot::Update(_float fTimeDelta) } } Hover(); - - static_cast(m_pOwner)->Function_Callback(TEXT("QuestListHover"), &m_iQuestIndex); + static_cast(m_pOwner)->Function_Callback(TEXT("QuestListHover"), &m_Info); m_fTime += fTimeDelta * m_fTimeMult; @@ -139,19 +141,73 @@ HRESULT CQuest_Slot::Render() return E_FAIL; } + for (_int i = 0; i < m_iQuestCount; ++i) + { + m_pGameInstance->Render_Text(m_Fonts[i].pFontSizeName.c_str(), m_Fonts[i].pQuestName.c_str(), m_Fonts[i].m_fFontSize); + } + return S_OK; +} + +void CQuest_Slot::Font_Size() +{ for (_int i = 0; i < m_iQuestCount; ++i) { m_fFontY = 190 + i * 85.f; - if (i == m_iQuestIndex) + if (m_Index == -1) { - m_pGameInstance->Render_Text(TEXT("Font_size30"), m_pInfoInstance->Get_Quest(i).pQuestName.c_str(), _float2(m_fFontX - 10.f + m_fX, m_fFontY - 10.F - m_fY)); + m_Fonts[i].pFontSizeName = TEXT("Font_size20"); + m_Fonts[i].m_fFontSize = _float2(m_fFontX + m_fX, m_fFontY - m_fY); } else { - m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(i).pQuestName.c_str(), _float2(m_fFontX + m_fX, m_fFontY - m_fY)); + if (i == m_Index) + { + m_Fonts[i].pFontSizeName = TEXT("Font_size30"); + m_Fonts[i].m_fFontSize = _float2(m_fFontX - 10.f + m_fX, m_fFontY - 10.f - m_fY); + } + else + { + m_Fonts[i].pFontSizeName = TEXT("Font_size20"); + m_Fonts[i].m_fFontSize = _float2(m_fFontX + m_fX, m_fFontY - m_fY); + } } } - return S_OK; +} + +void CQuest_Slot::Font_Setting(_int Index) +{ + m_Fonts.clear(); + FontInfo Fonts; + + for (_int i = 0; i < Index; ++i) + { + m_fFontY = 190 + i * 85.f; + Fonts.pFontSizeName = TEXT("Font_size20"); + Fonts.pQuestName = m_pInfoInstance->Get_Quest(m_Info.iQuestCategory, i).pQuestName.c_str(); + Fonts.m_fFontSize = _float2(m_fFontX + m_fX, m_fFontY - m_fY); + + m_Fonts.push_back(Fonts); + } +} + +_int CQuest_Slot::Mousechack(POINT Mouse) +{ + for (_int i = 0; i < m_iQuestCount; ++i) + { + RECT Box = { + long(m_fPositionX - m_fSizeX * 0.5f), + long((m_fPositionY - (i * m_fOffSetY)) - m_fSizeY * 0.5f), + long(m_fPositionX + m_fSizeX * 0.5f), + long((m_fPositionY + (i * m_fOffSetY)) + m_fSizeY * 0.5f) }; + + if (PtInRect(&Box, Mouse)) + { + return i; + } + } + + + return -1; } _vector CQuest_Slot::Get_WorldPostion() @@ -258,9 +314,14 @@ void CQuest_Slot::Hover() fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); - m_iQuestIndex = m_pVIBufferCom->Set_Mouse_Hover(fMouse); + POINT Mouse{}; + Mouse.x = _long(fMouse.x); + Mouse.y = _long(fMouse.y); + + m_Index = Mousechack(Mouse); - if (m_iQuestIndex != -1) + m_pVIBufferCom->Set_Hover(m_Index); + if (m_Index != -1) { m_bHover = true; } @@ -268,23 +329,28 @@ void CQuest_Slot::Hover() { m_bHover = false; } + Font_Size(); } + void CQuest_Slot::Set_QuestType(_int Index) { switch (Index) { case 0: + m_Info.iQuestCategory = ENUM_CLASS(QUESTSTATE::NONE); m_iQuestCount = m_pInfoInstance->Get_Quest_Count(ENUM_CLASS(QUESTSTATE::NONE)); m_pVIBufferCom->Set_Draw(-1); break; case 1: + m_Info.iQuestCategory = ENUM_CLASS(QUESTSTATE::ACCEPTED); m_iQuestCount = m_pInfoInstance->Get_Quest_Count(ENUM_CLASS(QUESTSTATE::ACCEPTED)); m_pVIBufferCom->Set_Draw(m_iQuestCount); break; case 2: + m_Info.iQuestCategory = ENUM_CLASS(QUESTSTATE::CLEARED); m_iQuestCount = m_pInfoInstance->Get_Quest_Count(ENUM_CLASS(QUESTSTATE::CLEARED)); m_pVIBufferCom->Set_Draw(m_iQuestCount); break; @@ -292,6 +358,7 @@ void CQuest_Slot::Set_QuestType(_int Index) default: break; } + Font_Setting(m_iQuestCount); } CQuest_Slot* CQuest_Slot::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) diff --git a/Jusin154_Team3D/Client/Private/Ranrak.cpp b/Jusin154_Team3D/Client/Private/Ranrak.cpp index 0898a1720..0a84f3bf9 100644 --- a/Jusin154_Team3D/Client/Private/Ranrak.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrak.cpp @@ -58,11 +58,10 @@ HRESULT CRanrak::Initialize(void* pArg) m_pFSM->Bind_States(FSMDesc); m_pFSM->Change_State(FSMSTATE::IDLE); } + m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); - - m_pCharacter_Controller->Set_Position(XMVectorSet(-52.f, 0.f, 4.f, 1.f)); m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-52.f, 0.f, 4.f, 1.f)); @@ -76,6 +75,21 @@ void CRanrak::Priority_Update(_float fTimeDelta) void CRanrak::Update(_float fTimeDelta) { + if (m_pGameInstance->Key_Up(DIK_H)) + { + m_ePhase = ENUM_CLASS(RANRAK_PHASE::PHASE_GROUND); + m_pFSM->Change_State(FSMSTATE::LAND); + } + if (m_pGameInstance->Key_Up(DIK_Y)) + { + m_ePhase = ENUM_CLASS(RANRAK_PHASE::PHASE_AIR); + m_pFSM->Change_State(FSMSTATE::HOVER); + } + if (m_pGameInstance->Key_Up(DIK_I)) + { + m_pFSM->Change_State(FSMSTATE::SKILL); + } + m_pFSM->Update_State(fTimeDelta); m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); @@ -397,6 +411,15 @@ HRESULT CRanrak::Bind_ShaderResources() if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Ranrak_States.cpp b/Jusin154_Team3D/Client/Private/Ranrak_States.cpp index 147ac09d1..678b38f83 100644 --- a/Jusin154_Team3D/Client/Private/Ranrak_States.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrak_States.cpp @@ -9,11 +9,15 @@ #include "State_IdleBreak.h" #include "State_Land.h" #include "State_Move.h" +#include "State_Ground.h" #include "State_Combat.h" #include "State_Hover.h" #include "State_Fly.h" #include "State_FireBreath.h" +#include "State_FireSweep.h" #include "State_FireBall.h" +#include "State_Swipe.h" +#include "State_Skill.h" #include "State_Pulse.h" #include "State_Tucked.h" #include "State_Hit.h" @@ -26,12 +30,12 @@ void CRanrak::Behavior_IdleEnter() m_pFSM->Enable_State(FSMSTATE::IDLE); pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::HOVER_LOOP]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,1.f,true); } HRESULT CRanrak::Behavior_IdleExitCheck() { - if (m_fTargetDistance <= 20.f && m_fTargetDistance !=0.f) + if (m_fTargetDistance <= 30.f && m_fTargetDistance !=0.f) { m_pFSM->Change_State(FSMSTATE::COMBAT); return E_FAIL; @@ -48,7 +52,6 @@ void CRanrak::Behavior_IdleBreakEnter() { m_pFSM->Enable_State(FSMSTATE::IDLEBREAK); pair<_uint, _bool> pairAnimInfo; - } HRESULT CRanrak::Behavior_IdleBreakExitCheck() @@ -77,6 +80,13 @@ HRESULT CRanrak::Behavior_MoveExitCheck(_float fTimeDelta) { pair<_uint, _bool> pairAnimInfo = {}; _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + + if (m_fTargetDistance <= 30.f && m_fTargetDistance != 0.f) + { + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + return S_OK; } @@ -90,45 +100,68 @@ void CRanrak::Behavior_CombatEnter() pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::COMBAT); m_bLookAt = true; - - pairAnimInfo = m_Animation[STATEANIM::HOVER_LOOP]; - - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CRanrak::Behavior_CombatExitCheck(_float fTimeDelta) { - if (m_fTargetDistance > 30.f && m_fTargetDistance != 0.f) + if (m_fTargetDistance > 40.f && m_fTargetDistance != 0.f) { m_pFSM->Change_State(FSMSTATE::IDLE); return E_FAIL; } - else if (m_fTargetDistance > 25.f && m_fTargetDistance != 0.f) + else if (m_fTargetDistance > 35.f && m_fTargetDistance != 0.f) { m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; } - if (m_fTargetDistance <= 20.f && m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)] <= 0.f) + if (m_fTargetDistance <= 30.f && m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)] <= 0.f) { m_pFSM->Change_State(FSMSTATE::FIREBREATH); return E_FAIL; } - else if (m_fTargetDistance <= 20.f && m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBALL)] <= 0.f) + else if (m_fTargetDistance <= 30.f && m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBALL)] <= 0.f) { m_pFSM->Change_State(FSMSTATE::FIREBALL); return E_FAIL; } - else if (m_fTargetDistance <= 20.f && m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::PULSE)] <= 0.f) + else if (m_fTargetDistance <= 30.f && m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIRESWEEP)] <= 0.f) + { + m_pFSM->Change_State(FSMSTATE::FIRESWEEP); + return E_FAIL; + } + else if (m_fTargetDistance <= 30.f && m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::SWIPE)] <= 0.f && m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_GROUND)) + { + m_pFSM->Change_State(FSMSTATE::SWIPE); + return E_FAIL; + } + else if (m_fTargetDistance <= 30.f && m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::PULSE)] <= 0.f) { m_pFSM->Change_State(FSMSTATE::PULSE); return E_FAIL; } - else { - m_pFSM->Change_State(FSMSTATE::IDLE); + else if (m_fTargetDistance <= 30.f && m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::TUCKED)] <= 0.f) + { + m_pFSM->Change_State(FSMSTATE::TUCKED); return E_FAIL; } + else { + if (m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_AIR)) { + m_pFSM->Change_State(FSMSTATE::HOVER); + return E_FAIL; + } + else if (m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_GROUND)) { + if (m_pFSM->IsEnable_Previous(FSMSTATE::TUCKED| FSMSTATE::PULSE)) + { + m_pFSM->Change_State(FSMSTATE::LAND); + } + else { + m_pFSM->Change_State(FSMSTATE::GROUND); + } + return E_FAIL; + } + } return S_OK; } @@ -138,13 +171,56 @@ void CRanrak::Behavior_CombatExit() m_pFSM->Disable_State(FSMSTATE::COMBAT); } +void CRanrak::Behavior_GroundEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::GROUND); + m_bLookAt = true; + pairAnimInfo = m_Animation[STATEANIM::IDLE_G]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CRanrak::Behavior_GroundExitCheck(_float fTimeDelta) +{ + if (m_fTargetDistance <= 30.f && m_fTargetDistance != 0.f) + { + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return S_OK; +} + +void CRanrak::Behavior_GroundExit() +{ + m_pFSM->Disable_State(FSMSTATE::GROUND); +} + void CRanrak::Behavior_HoverEnter() { + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::HOVER); + _int iRand = m_pGameInstance->Real_Random_Int(0, 1); + switch (iRand) + { + case 0: + pairAnimInfo = m_Animation[STATEANIM::HOVER_DASH_LEFT]; + break; + case 1: + pairAnimInfo = m_Animation[STATEANIM::HOVER_DASH_RIGHT]; + break; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CRanrak::Behavior_HoverExitCheck(_float fTimeDelta) { - return E_NOTIMPL; + if (m_pModelCom->IsFinishedAnim()) + { + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } + return S_OK; } void CRanrak::Behavior_HoverExit() @@ -170,20 +246,27 @@ void CRanrak::Behavior_FireBreathEnter() { pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::FIREBREATH); + if (m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_AIR)) + { + pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_WINDUP_A]; - pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_WINDUP]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + Add_Event(pairAnimInfo.first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_A]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)]; }, + 0.9f); - Add_Event(pairAnimInfo.first, - [&]() { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)]; }, - 0.95f); - - Add_Event(m_Animation[STATEANIM::FIREBREATH].first, - [&]() { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_COOLDOWN]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); }, - 0.95f); + Add_Event(m_Animation[STATEANIM::FIREBREATH_A].first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_COOLDOWN_A]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); }, + 0.9f); + } + else if (m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_GROUND)) + { + pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_G]; + m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); } HRESULT CRanrak::Behavior_FireBreathExitCheck(_float fTimeDelta) @@ -191,7 +274,7 @@ HRESULT CRanrak::Behavior_FireBreathExitCheck(_float fTimeDelta) pair<_uint, _bool> pairAnimInfo = {}; _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); - if (m_pModelCom->IsFinishedAnim() && iCurrAnimIndex == m_Animation[STATEANIM::FIREBREATH_COOLDOWN].first) + if (m_pModelCom->IsFinishedAnim()) { m_pFSM->Change_State(FSMSTATE::COMBAT); return E_FAIL; @@ -205,24 +288,87 @@ void CRanrak::Behavior_FireBreathExit() m_pFSM->Disable_State(FSMSTATE::FIREBREATH); } +void CRanrak::Behavior_FireSweepEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::FIRESWEEP); + if (m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_AIR)) + { + pairAnimInfo = m_Animation[STATEANIM::FIRESWEEP_WINDUP_A]; + + Add_Event(pairAnimInfo.first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::FIRESWEEP_A]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIRESWEEP)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIRESWEEP)]; }, + 0.95f); + + Add_Event(m_Animation[STATEANIM::FIRESWEEP_A].first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::FIRESWEEP_COOLDOWN_A]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); }, + 0.95f); + } + else if (m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_GROUND)) + { + pairAnimInfo = m_Animation[STATEANIM::FIRESWEEP_G]; + m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIRESWEEP)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIRESWEEP)]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); +} + +HRESULT CRanrak::Behavior_FireSweepExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + + if (m_pModelCom->IsFinishedAnim()) + { + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return S_OK; +} + +void CRanrak::Behavior_FireSweepExit() +{ + m_pFSM->Disable_State(FSMSTATE::FIRESWEEP); +} + void CRanrak::Behavior_FireBallEnter() { pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::FIREBALL); - - _int iRand = m_pGameInstance->Real_Random_Int(0, 1); - - switch (iRand) + if (m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_AIR)) { - case 0 : - pairAnimInfo = m_Animation[STATEANIM::FIREBALL1]; - break; - case 1: - pairAnimInfo = m_Animation[STATEANIM::FIREBALL2]; - break; + _int iRand = m_pGameInstance->Real_Random_Int(0, 1); + + switch (iRand) + { + case 0: + pairAnimInfo = m_Animation[STATEANIM::FIREBALL1_A]; + break; + case 1: + pairAnimInfo = m_Animation[STATEANIM::FIREBALL2_A]; + break; + } } + else if (m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_GROUND)) + { + _int iRand = m_pGameInstance->Real_Random_Int(0, 1); + + switch (iRand) + { + case 0: + pairAnimInfo = m_Animation[STATEANIM::FIREBALL1_G]; + break; + case 1: + pairAnimInfo = m_Animation[STATEANIM::FIREBALL2_G]; + break; + } + } + m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBALL)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBALL)]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); } HRESULT CRanrak::Behavior_FireBallExitCheck(_float fTimeDelta) @@ -244,15 +390,79 @@ void CRanrak::Behavior_FireBallExit() m_pFSM->Disable_State(FSMSTATE::FIREBALL); } +void CRanrak::Behavior_SwipeEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::SWIPE); + if (m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_GROUND)) + { + _int iRand = m_pGameInstance->Real_Random_Int(0, 1); + + switch (iRand) + { + case 0: + pairAnimInfo = m_Animation[STATEANIM::GROUND_SWIPE_L]; + break; + case 1: + pairAnimInfo = m_Animation[STATEANIM::GROUND_SWIPE_R]; + break; + } + } + + m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::SWIPE)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::SWIPE)]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); +} + +HRESULT CRanrak::Behavior_SwipeExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + + if (m_pModelCom->IsFinishedAnim()) + { + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return S_OK; +} + +void CRanrak::Behavior_SwipeExit() +{ + m_pFSM->Disable_State(FSMSTATE::SWIPE); +} + +void CRanrak::Behavior_SkillEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::SKILL); + pairAnimInfo = m_Animation[STATEANIM::SKILL]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CRanrak::Behavior_SkillExitCheck(_float fTimeDelta) +{ + if (m_pModelCom->IsFinishedAnim()) + { + m_pFSM->Change_State(FSMSTATE::HOVER); + return E_FAIL; + } + return S_OK; +} + +void CRanrak::Behavior_SkillExit() +{ + m_pFSM->Disable_State(FSMSTATE::SKILL); +} + void CRanrak::Behavior_PulseEnter() { pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::PULSE); pairAnimInfo = m_Animation[STATEANIM::PULSE]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::PULSE)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::PULSE)]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); } HRESULT CRanrak::Behavior_PulseExitCheck(_float fTimeDelta) @@ -277,9 +487,10 @@ void CRanrak::Behavior_TuckedEnter() { pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::TUCKED); - + pairAnimInfo = m_Animation[STATEANIM::TUCKED]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::TUCKED)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::TUCKED)]; } HRESULT CRanrak::Behavior_TuckedExitCheck(_float fTimeDelta) @@ -287,6 +498,15 @@ HRESULT CRanrak::Behavior_TuckedExitCheck(_float fTimeDelta) pair<_uint, _bool> pairAnimInfo = {}; _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + m_fTuckedTime += fTimeDelta; + if (m_fTuckedTime >= 5.f && iCurrAnimIndex == m_Animation[STATEANIM::TUCKED].first) + { + m_fTuckedTime = 0.f; + pairAnimInfo = m_Animation[STATEANIM::FLY_TO_HOVER]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + return S_OK; + } + if (m_pModelCom->IsFinishedAnim()) { m_pFSM->Change_State(FSMSTATE::COMBAT); @@ -300,6 +520,30 @@ void CRanrak::Behavior_TuckedExit() m_pFSM->Disable_State(FSMSTATE::TUCKED); } +void CRanrak::Behavior_LandEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::LAND); + + pairAnimInfo = m_Animation[STATEANIM::LAND]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); +} + +HRESULT CRanrak::Behavior_LandExitCheck(_float fTimeDelta) +{ + if (m_pModelCom->IsFinishedAnim()) + { + m_pFSM->Change_State(FSMSTATE::GROUND); + return E_FAIL; + } + return S_OK; +} + +void CRanrak::Behavior_LandExit() +{ + m_pFSM->Disable_State(FSMSTATE::LAND); +} + void CRanrak::Behavior_HitEnter() { pair<_uint, _bool> pairAnimInfo = {}; @@ -476,6 +720,17 @@ void CRanrak::Add_FSM() Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); } + + { + CState_Ground::STATE_GROUND_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_GroundEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_GroundExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_GroundExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::GROUND, CState_Ground::Create(&Desc)); + } #pragma endregion #pragma region Hover @@ -531,6 +786,17 @@ void CRanrak::Add_FSM() m_States.emplace(FSMSTATE::FIREBREATH, CState_FireBreath::Create(&Desc)); } + { + CState_FireSweep::STATE_FIRESWEEP_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_FireSweepEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_FireSweepExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_FireSweepExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::FIRESWEEP, CState_FireSweep::Create(&Desc)); + } + { CState_FireBall::STATE_FIREBALL_DESC Desc{}; Desc.pOwner = this; @@ -542,6 +808,28 @@ void CRanrak::Add_FSM() m_States.emplace(FSMSTATE::FIREBALL, CState_FireBall::Create(&Desc)); } + { + CState_Swipe::STATE_SWIPE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_SwipeEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_SwipeExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_SwipeExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SWIPE, CState_Swipe::Create(&Desc)); + } + + + { + CState_Skill::STATE_SKILL_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_SkillEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_SkillExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_SkillExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SKILL, CState_Skill::Create(&Desc)); + } { CState_Pulse::STATE_PULSE_DESC Desc{}; Desc.pOwner = this; @@ -565,6 +853,18 @@ void CRanrak::Add_FSM() } #pragma endregion +#pragma region Land + { + CState_Land::STATE_LAND_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_LandExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_LandExit(); }; + m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc)); + } +#pragma endregion + + #pragma region Hit { @@ -599,12 +899,11 @@ void CRanrak::Add_FSM() } #pragma endregion - - } void CRanrak::Set_Anim() { + m_Animation[STATEANIM::IDLE_G] = { 52,true }; m_Animation[STATEANIM::IDLE_BREAK1] = { 27,false }; m_Animation[STATEANIM::IDLE_BREAK2] = { 28,false }; @@ -614,14 +913,36 @@ void CRanrak::Set_Anim() m_Animation[STATEANIM::HOVER_DASH_LEFT] = { 25,false }; m_Animation[STATEANIM::HOVER_DASH_RIGHT] = { 26,false }; - m_Animation[STATEANIM::FIREBREATH] = { 9,false }; - m_Animation[STATEANIM::FIREBREATH_COOLDOWN] = { 10,false }; - m_Animation[STATEANIM::FIREBREATH_WINDUP] = { 11,false }; + m_Animation[STATEANIM::FIREBREATH_A] = { 9,false }; + m_Animation[STATEANIM::FIREBREATH_COOLDOWN_A] = { 10,false }; + m_Animation[STATEANIM::FIREBREATH_WINDUP_A] = { 11,false }; + + m_Animation[STATEANIM::FIRESWEEP_A] = { 15,false }; + m_Animation[STATEANIM::FIRESWEEP_COOLDOWN_A] = { 16,false }; + m_Animation[STATEANIM::FIRESWEEP_WINDUP_A] = { 17,false }; + + m_Animation[STATEANIM::FIREBALL1_A] = { 0,false }; + m_Animation[STATEANIM::FIREBALL2_A] = { 1,false }; + + m_Animation[STATEANIM::GROUND_SWIPE_L] = { 3,false }; + m_Animation[STATEANIM::GROUND_SWIPE_R] = { 4,false }; + + m_Animation[STATEANIM::FIREBREATH_G] = { 6,false }; + + m_Animation[STATEANIM::FIRESWEEP_G] = { 7,false }; + + m_Animation[STATEANIM::FIREBALL1_G] = { 2,false }; + m_Animation[STATEANIM::FIREBALL2_G] = { 5,false }; - m_Animation[STATEANIM::FIREBALL1] = { 0,false }; - m_Animation[STATEANIM::FIREBALL2] = { 1,false }; m_Animation[STATEANIM::PULSE] = { 33,false }; m_Animation[STATEANIM::TUCKED] = { 21,true }; + m_Animation[STATEANIM::FLY_TO_HOVER] = { 22,false }; + + m_Animation[STATEANIM::LAND] = { 32,false }; + + m_Animation[STATEANIM::SKILL] = { 12,false }; + + //12 } diff --git a/Jusin154_Team3D/Client/Private/State_FireSweep.cpp b/Jusin154_Team3D/Client/Private/State_FireSweep.cpp new file mode 100644 index 000000000..6b9beae26 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_FireSweep.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_FireSweep.h" +#include "Unit.h" + + +CState_FireSweep::CState_FireSweep() + :CState_Root() +{ +} + +void CState_FireSweep::Enter() +{ + __super::Enter(); +} + +HRESULT CState_FireSweep::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_FireSweep::Exit() +{ + __super::Exit(); +} + +HRESULT CState_FireSweep::Initialize(STATE_FIRESWEEP_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_FireSweep* CState_FireSweep::Create(STATE_FIRESWEEP_DESC* pDesc) +{ + CState_FireSweep* pInstance = new CState_FireSweep; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_FireSweep::Free() +{ + __super::Free(); +} + +void CState_FireSweep::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Ground.cpp b/Jusin154_Team3D/Client/Private/State_Ground.cpp new file mode 100644 index 000000000..c6ba23f95 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Ground.cpp @@ -0,0 +1,65 @@ +#include "pch.h" +#include "State_Ground.h" +#include "Unit.h" + + +CState_Ground::CState_Ground() + :CState_Root() +{ +} + +void CState_Ground::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Ground::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_Ground::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Ground::Initialize(STATE_GROUND_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Ground* CState_Ground::Create(STATE_GROUND_DESC* pDesc) +{ + CState_Ground* pInstance = new CState_Ground; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Ground::Free() +{ + __super::Free(); +} + +void CState_Ground::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Skill.cpp b/Jusin154_Team3D/Client/Private/State_Skill.cpp new file mode 100644 index 000000000..00d086cdc --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Skill.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Skill.h" +#include "Unit.h" + + +CState_Skill::CState_Skill() + :CState_Root() +{ +} + +void CState_Skill::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Skill::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_Skill::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Skill::Initialize(STATE_SKILL_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Skill* CState_Skill::Create(STATE_SKILL_DESC* pDesc) +{ + CState_Skill* pInstance = new CState_Skill; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Skill::Free() +{ + __super::Free(); +} + +void CState_Skill::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Slide.cpp b/Jusin154_Team3D/Client/Private/State_Slide.cpp new file mode 100644 index 000000000..6cb404534 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Slide.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Slide.h" +#include "Unit.h" + + +CState_Slide::CState_Slide() + :CState_Root() +{ +} + +void CState_Slide::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Slide::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (FAILED(__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_Slide::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Slide::Initialize(STATE_SLIDE_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Slide* CState_Slide::Create(STATE_SLIDE_DESC* pDesc) +{ + CState_Slide* pInstance = new CState_Slide; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Slide::Free() +{ + __super::Free(); +} + +void CState_Slide::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Swipe.cpp b/Jusin154_Team3D/Client/Private/State_Swipe.cpp new file mode 100644 index 000000000..e122f7557 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Swipe.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Swipe.h" +#include "Unit.h" + + +CState_Swipe::CState_Swipe() + :CState_Root() +{ +} + +void CState_Swipe::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Swipe::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_Swipe::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Swipe::Initialize(STATE_SWIPE_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Swipe* CState_Swipe::Create(STATE_SWIPE_DESC* pDesc) +{ + CState_Swipe* pInstance = new CState_Swipe; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Swipe::Free() +{ + __super::Free(); +} + +void CState_Swipe::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Terrain.cpp b/Jusin154_Team3D/Client/Private/Terrain.cpp index 728614cfc..6dd50fffd 100644 --- a/Jusin154_Team3D/Client/Private/Terrain.cpp +++ b/Jusin154_Team3D/Client/Private/Terrain.cpp @@ -51,6 +51,7 @@ HRESULT CTerrain::Initialize(void* pArg) void CTerrain::Priority_Update(_float fTimeDelta) { + m_pTransformCom->RewindMomentum(); } void CTerrain::Update(_float fTimeDelta) @@ -169,6 +170,15 @@ HRESULT CTerrain::Bind_ShaderResources() return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index a9f0ec97d..0bf500331 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -402,6 +402,8 @@ void CTroll::OnCollision(CGameObject* pOther, void* pDesc) m_pInfoInstance->Event_CallBack(TEXT("Monster_Hit"), &m_DamageInfo); if (0 == damagePair.second) { m_pFSM->Change_State(FSMSTATE::DEAD); + _int ID = m_pStat->Get_Stat().iObjectID; + m_pInfoInstance->Event_CallBack(TEXT("MonsterDead"), &ID); return; } m_pFSM->Change_State(FSMSTATE::HIT); diff --git a/Jusin154_Team3D/Client/Private/Troll_States.cpp b/Jusin154_Team3D/Client/Private/Troll_States.cpp index b50f6e04f..6fbeae1c0 100644 --- a/Jusin154_Team3D/Client/Private/Troll_States.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_States.cpp @@ -106,9 +106,10 @@ HRESULT CTroll::Behavior_IdleBreakExitCheck() { if (m_pModelCom->IsFinishedAnim()){ m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; } - return E_FAIL; + return S_OK; } void CTroll::Behavior_IdleBreakExit() @@ -201,9 +202,12 @@ HRESULT CTroll::Behavior_MoveExitCheck(_float fTimeDelta) if (m_fTargetDistance <= 6.f && m_fTargetDistance != 0.f) + { m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } - return E_FAIL; + return S_OK; } void CTroll::Behavior_MoveExit() @@ -237,29 +241,35 @@ HRESULT CTroll::Behavior_CombatExitCheck(_float fTimeDelta) if (m_fTargetDistance <= 6.f && (m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] <= 0.f)) { m_pFSM->Change_State(FSMSTATE::SLAM); + return E_FAIL; } else if (m_fTargetDistance <= 6.f && (m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] <= 0.f)) { m_pFSM->Change_State(FSMSTATE::BACKHAND_SWING); + return E_FAIL; } else if (m_fTargetDistance <= 6.f && (m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] <= 0.f)) { m_pFSM->Change_State(FSMSTATE::SWING); + return E_FAIL; } - else if (m_fTargetDistance <= 15.f && m_fTargetDistance>=8.f &&m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::THROWROCK)] <= 0.f) + else if (m_fTargetDistance <= 15.f &&m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::THROWROCK)] <= 0.f) { m_pFSM->Change_State(FSMSTATE::THROW_ROCK); + return E_FAIL; } else if (m_fTargetDistance <= 18.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::RUSH)] <= 0.f) { m_pFSM->Change_State(FSMSTATE::RUSH); + return E_FAIL; } else { m_pFSM->Change_State(FSMSTATE::IDLEBREAK); + return E_FAIL; } - return E_FAIL; + return S_OK; } void CTroll::Behavior_CombatExit() @@ -326,8 +336,9 @@ HRESULT CTroll::Behavior_RushExitCheck(_float fTimeDelta) { m_bLookAt = true; m_pFSM->Change_State(FSMSTATE::IDLEBREAK); + return E_FAIL; } - return E_FAIL; + return S_OK; } void CTroll::Behavior_RushExit() @@ -391,8 +402,9 @@ HRESULT CTroll::Behavior_ThrowExitCheck(_float fTimeDelta) { m_bLookAt = true; m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; } - return E_FAIL; + return S_OK; } void CTroll::Behavior_ThrowExit() diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index 92c5ff8f9..dcf9216d9 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -67,7 +67,7 @@ DECLARE_SINGLETON(CInfoInstance) void Event_CallBack(_wstring EventName, void* pArg = nullptr); #pragma endregion #pragma region QuestINFO - QUESTINFO Get_Quest(_int QuestID); + QUESTINFO Get_Quest(_int QuestType, _int QuestID); _int Get_Quest_Count(_int Index); const vector& Get_AllQuest() const; const vector& Get_ClearQuest() const; diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 6ea3332be..0fdb84a3e 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -160,6 +160,10 @@ class CPlayer final : public CUnit HRESULT Behavior_DodgeExitCheck(_float fTimeDelta); void Behavior_DodgeExit(); + void Behavior_SlideEnter(); + HRESULT Behavior_SlideExitCheck(_float fTimeDelta); + void Behavior_SlideExit(); + void Behavior_CombatEnter(); HRESULT Behavior_CombatExitCheck(); void Behavior_CombatExit(); diff --git a/Jusin154_Team3D/Client/Public/Quest_Data.h b/Jusin154_Team3D/Client/Public/Quest_Data.h index 256bca4cc..eb283bcbd 100644 --- a/Jusin154_Team3D/Client/Public/Quest_Data.h +++ b/Jusin154_Team3D/Client/Public/Quest_Data.h @@ -25,7 +25,7 @@ class CQuest_Data final : public CBase void Update_AcceptQuest(_int MonsterIndex = -1); public: - QUESTINFO Get_Quest(_int QuestID); + QUESTINFO Get_Quest(_int QuestType, _int QuestID); _int Get_Count(_int Index); const vector& Get_AllQuest() const; const vector& Get_ClearQuest() const; diff --git a/Jusin154_Team3D/Client/Public/Quest_Entry_Line.h b/Jusin154_Team3D/Client/Public/Quest_Entry_Line.h index 9bde54342..c26680ae6 100644 --- a/Jusin154_Team3D/Client/Public/Quest_Entry_Line.h +++ b/Jusin154_Team3D/Client/Public/Quest_Entry_Line.h @@ -32,7 +32,7 @@ class CQuest_Entry_Line final : public CElementObject virtual HRESULT Initialize(void* pArg) override; public: - void Set_Hover(_int Index); + void Set_Hover(void* pArg); private: CTexture* m_pDiffuse_TextureCom = { nullptr }; @@ -41,6 +41,7 @@ class CQuest_Entry_Line final : public CElementObject _int m_iColor = { false }; _int m_iQuest_Index{}; + _int m_iCurrentQuest{}; public: static CQuest_Entry_Line* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/Quest_Info.h b/Jusin154_Team3D/Client/Public/Quest_Info.h index c80b80d3b..062e89e10 100644 --- a/Jusin154_Team3D/Client/Public/Quest_Info.h +++ b/Jusin154_Team3D/Client/Public/Quest_Info.h @@ -32,7 +32,7 @@ class CQuest_Info final : public CElementObject virtual HRESULT Initialize(void* pArg) override; public: - void Set_Hover(_int Index); + void Set_Hover(void* pArg); private: CTexture* m_pDiffuse_TextureCom = { nullptr }; @@ -46,7 +46,9 @@ class CQuest_Info final : public CElementObject _float m_fOriginPerviewSize{}; _float m_fPreviewOffSet{}; _float4 m_vHeaderBack{}; + _int m_iQuest_Index{}; + _int m_iCurrentQuest{}; _int m_iPerQuestIndex{}; public: diff --git a/Jusin154_Team3D/Client/Public/Quest_Info_Header.h b/Jusin154_Team3D/Client/Public/Quest_Info_Header.h index c2d336332..c40271cf7 100644 --- a/Jusin154_Team3D/Client/Public/Quest_Info_Header.h +++ b/Jusin154_Team3D/Client/Public/Quest_Info_Header.h @@ -32,7 +32,7 @@ class CQuest_Info_Header final : public CElementObject virtual HRESULT Initialize(void* pArg) override; public: - void Set_Hover(_int Index); + void Set_Hover(void* pArg); private: CTexture* m_pDiffuse_TextureCom = { nullptr }; @@ -42,6 +42,7 @@ class CQuest_Info_Header final : public CElementObject _int m_iColor = true; _int m_iQuest_Index{}; + _int m_iCurrentQuest{}; public: static CQuest_Info_Header* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Client/Public/Quest_Info_Line.h b/Jusin154_Team3D/Client/Public/Quest_Info_Line.h index a08b0d8db..4eb33ea1b 100644 --- a/Jusin154_Team3D/Client/Public/Quest_Info_Line.h +++ b/Jusin154_Team3D/Client/Public/Quest_Info_Line.h @@ -32,7 +32,7 @@ class CQuest_Info_Line final : public CElementObject virtual HRESULT Initialize(void* pArg) override; public: - void Set_Hover(_int Index); + void Set_Hover(void* pArg); private: CTexture* m_pDiffuse_TextureCom = { nullptr }; @@ -41,7 +41,7 @@ class CQuest_Info_Line final : public CElementObject _int m_iColor = { false }; _int m_iQuest_Index{}; - + _int m_iCurrentQuest{}; public: static CQuest_Info_Line* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Client/Public/Quest_Slot.h b/Jusin154_Team3D/Client/Public/Quest_Slot.h index 55992e9cc..5a51a0bcf 100644 --- a/Jusin154_Team3D/Client/Public/Quest_Slot.h +++ b/Jusin154_Team3D/Client/Public/Quest_Slot.h @@ -13,6 +13,12 @@ NS_BEGIN(Client) class CQuest_Slot final : public CElementObject { + struct FontInfo + { + _wstring pFontSizeName; + _wstring pQuestName; + _float2 m_fFontSize{}; + }; private: CQuest_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CQuest_Slot(const CQuest_Slot& rhs); @@ -37,6 +43,10 @@ class CQuest_Slot final : public CElementObject private: void Hover(); + void Font_Size(); + void Font_Setting(_int Index); + + _int Mousechack(POINT Mouse); public: void Set_QuestType(_int Index); @@ -46,14 +56,20 @@ class CQuest_Slot final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; CInfoInstance* m_pInfoInstance = { nullptr }; - + CURRENTQUESTSECETINFO m_Info; _float m_fOffSetX{}; _float m_fOffSetY{}; _uint m_iCols{}; _int m_iColor{}; - _int m_iQuestIndex{}; + _int m_iCurrentQeustClick{}; _int m_iQuestCount{}; + + _float m_fPositionX{}; + _float m_fPositionY{}; + + _int m_Index{}; + vector m_Fonts; public: static CQuest_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Client/Public/Ranrak.h b/Jusin154_Team3D/Client/Public/Ranrak.h index fa61490b3..ef4a46fcb 100644 --- a/Jusin154_Team3D/Client/Public/Ranrak.h +++ b/Jusin154_Team3D/Client/Public/Ranrak.h @@ -12,12 +12,20 @@ class CRanrak final : public CMonster enum class RANRAK_SKILL { FIREBREATH, + FIRESWEEP, FIREBALL, + SWIPE, PULSE, TUCKED, END }; + enum class RANRAK_PHASE + { + PHASE_AIR, + PHASE_GROUND, + END + }; private: CRanrak(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CRanrak(const CRanrak& Prototype); @@ -65,11 +73,14 @@ class CRanrak final : public CMonster virtual void Add_FSM(); virtual void Set_Anim(); + _int m_ePhase = ENUM_CLASS(RANRAK_PHASE::PHASE_AIR); + _float m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::END)] = {}; - _float m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::END)] = { 20.f ,20.f,20.f,20.f}; + _float m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::END)] = { 40.f,40.f ,15.f,40.f,40.f,40.f }; _float m_fDegree = {}; _float m_fCross = {}; + _float m_fTuckedTime = {}; void Behavior_IdleEnter(); HRESULT Behavior_IdleExitCheck(); @@ -87,6 +98,10 @@ class CRanrak final : public CMonster HRESULT Behavior_CombatExitCheck(_float fTimeDelta); void Behavior_CombatExit(); + void Behavior_GroundEnter(); + HRESULT Behavior_GroundExitCheck(_float fTimeDelta); + void Behavior_GroundExit(); + void Behavior_HoverEnter(); HRESULT Behavior_HoverExitCheck(_float fTimeDelta); void Behavior_HoverExit(); @@ -99,10 +114,22 @@ class CRanrak final : public CMonster HRESULT Behavior_FireBreathExitCheck(_float fTimeDelta); void Behavior_FireBreathExit(); + void Behavior_FireSweepEnter(); + HRESULT Behavior_FireSweepExitCheck(_float fTimeDelta); + void Behavior_FireSweepExit(); + void Behavior_FireBallEnter(); HRESULT Behavior_FireBallExitCheck(_float fTimeDelta); void Behavior_FireBallExit(); + void Behavior_SwipeEnter(); + HRESULT Behavior_SwipeExitCheck(_float fTimeDelta); + void Behavior_SwipeExit(); + + void Behavior_SkillEnter(); + HRESULT Behavior_SkillExitCheck(_float fTimeDelta); + void Behavior_SkillExit(); + void Behavior_PulseEnter(); HRESULT Behavior_PulseExitCheck(_float fTimeDelta); void Behavior_PulseExit(); @@ -111,6 +138,10 @@ class CRanrak final : public CMonster HRESULT Behavior_TuckedExitCheck(_float fTimeDelta); void Behavior_TuckedExit(); + void Behavior_LandEnter(); + HRESULT Behavior_LandExitCheck(_float fTimeDelta); + void Behavior_LandExit(); + void Behavior_HitEnter(); HRESULT Behavior_HitExitCheck(_float fTimeDelta); void Behavior_HitExit(); diff --git a/Jusin154_Team3D/Client/Public/State_FireSweep.h b/Jusin154_Team3D/Client/Public/State_FireSweep.h new file mode 100644 index 000000000..e9f89c73d --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_FireSweep.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_FireSweep final : public CState_Root +{ +public: + typedef struct tagFireSweep : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_FIRESWEEP_DESC; +private: + CState_FireSweep(); + virtual ~CState_FireSweep() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_FIRESWEEP_DESC* pDesc); + +public: + static CState_FireSweep* Create(STATE_FIRESWEEP_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Ground.h b/Jusin154_Team3D/Client/Public/State_Ground.h new file mode 100644 index 000000000..03b900dc3 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Ground.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Ground final : public CState_Root +{ +public: + typedef struct tagGround : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_GROUND_DESC; +private: + CState_Ground(); + virtual ~CState_Ground() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_GROUND_DESC* pDesc); + +public: + static CState_Ground* Create(STATE_GROUND_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Skill.h b/Jusin154_Team3D/Client/Public/State_Skill.h new file mode 100644 index 000000000..430260cc3 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Skill.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Skill final : public CState_Root +{ +public: + typedef struct tagSkill : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_SKILL_DESC; +private: + CState_Skill(); + virtual ~CState_Skill() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_SKILL_DESC* pDesc); + +public: + static CState_Skill* Create(STATE_SKILL_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Slide.h b/Jusin154_Team3D/Client/Public/State_Slide.h new file mode 100644 index 000000000..06c02c233 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Slide.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Slide final : public CState_Root +{ +public: + typedef struct tagSlide : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_SLIDE_DESC; +public: + CState_Slide(); + virtual ~CState_Slide() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_SLIDE_DESC* pDesc); + +public: + static CState_Slide* Create(STATE_SLIDE_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Swipe.h b/Jusin154_Team3D/Client/Public/State_Swipe.h new file mode 100644 index 000000000..7a45e97a4 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Swipe.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Swipe final : public CState_Root +{ +public: + typedef struct tagSwipe : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_SWIPE_DESC; +private: + CState_Swipe(); + virtual ~CState_Swipe() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_SWIPE_DESC* pDesc); + +public: + static CState_Swipe* Create(STATE_SWIPE_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml new file mode 100644 index 000000000..34ec5ed9b --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Dragon/Dragon_Anim.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Dragon/Dragon_Anim.bin new file mode 100644 index 000000000..b764e9693 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Dragon/Dragon_Anim.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81dff2d21b987eba50c06ab48989cfbf213754b48a997b82096dfde5b5a63127 +size 153894241 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Dragon/Dragon_Anim.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Dragon/Dragon_Anim.fbx new file mode 100644 index 000000000..7955864a8 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Dragon/Dragon_Anim.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:55f6d6df42fe0b86146d377af09e8fc5b1530d2e714c988f44053de5a0588192 +size 234407740 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli index 5aa7aec84..444f13d38 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -468,42 +468,47 @@ float4 BlendDiffuse(float4 vDiffuseA, Texture2D DiffuseBlendTexture, float2 vTex return lerp(vDiffuseA, vDiffuseBlendColor, fRatio); } - -float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos) +float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos, float fIntensity = 1.f) { - if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) { - return float2(0.0f, 0.0f); + if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) + { + return float2(0.5f, 0.5f); } - float2 currentUV = (vCurrentProjPos.xy/vCurrentProjPos.w); - float2 previousUV = (vPreviousProjPos.xy / vCurrentProjPos.w); + float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w; + float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w; - currentUV.y *= -1.f; - previousUV.y *= -1.f; + currentNDC.y *= -1.f; + previousNDC.y *= -1.f; - return currentUV - previousUV; + // UV 델타 + float2 velocityUV = (currentNDC - previousNDC) * 0.5f; + velocityUV *= fIntensity; + velocityUV = clamp(velocityUV, -1.0f, 1.0f); + + return velocityUV * 0.5f + 0.5f; // 0 속도 -> 0.5 } float3 DownSampleFast(Texture2D SrcTexture2D, float2 vCenterTexcoord, float2 vSrcTexelSize, float2 vResolution) { float2 uv = float2(0.f, 0.f); - float3 vCenterColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); + float3 vCenterColor = SrcTexture2D.SampleLevel(BorderZeroSampler, vCenterTexcoord, 0); uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, -1.0); - float3 fLTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroLinearSampler); + float3 fLTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); uv = vCenterTexcoord + vSrcTexelSize * float2(0.0, -1.0); float3 fTColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); uv = vCenterTexcoord + vSrcTexelSize * float2(+1.0, -1.0); - float3 fRTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroLinearSampler); + float3 fRTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, 0.0); float3 fLColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); uv = vCenterTexcoord + vSrcTexelSize * float2(1.0, 0.0); float3 fRColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, +1.0); - float3 fLBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroLinearSampler); + float3 fLBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); uv = vCenterTexcoord + vSrcTexelSize * float2(0.0, 1.0); float3 fBColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); uv = vCenterTexcoord + vSrcTexelSize * float2(+1.0, +1.0); - float3 fRBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroLinearSampler); + float3 fRBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); return vCenterColor * 0.25f + (fLTColor + fRTColor + fLBColor + fRBColor) * 0.0625f + (fTColor + fLColor + fRColor + fBColor) * 0.125f; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli index b70ca6161..f21518030 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli @@ -27,6 +27,13 @@ sampler ClampSampler = sampler_state AddressV = clamp; }; +sampler ClampLinearSampler = sampler_state +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = clamp; + AddressV = clamp; +}; + sampler MirrorSampler = sampler_state { Filter = MIN_MAG_MIP_LINEAR; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index f819bafeb..6b8a4a2e6 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -14,9 +14,12 @@ float g_fShadowFar_MIDDDLE; float g_fShadowFar_FAR; float g_fCascadeSplitRatioNear; float g_fCascadeSplitRatioFar; -uint g_iMaxShadowWidth; -uint g_iMaxShadowHeight; +float2 g_vNearShadowResolution; +float2 g_vMiddleShadowResolution; +float2 g_vFarShadowResolution; +float2 g_vPreShadowResolution; float2 g_vResolution; +float2 g_vSrcResolution; float4 g_vShadowBias; uint g_iBloomEmbossingPass; @@ -60,7 +63,6 @@ Texture2D g_DepthTexture; Texture2D g_SpecularTexture; Texture2D g_ShadowNearTexture; Texture2D g_ShadowMiddleTexture; -Texture2D g_ShadowFarTexture; Texture2D g_PreShadowTexture; Texture2D g_BlurTexture; Texture2D g_BlurXTexture; @@ -73,10 +75,14 @@ Texture2D g_OriginalTexture; Texture2D g_ColorTexture; Texture2D g_VelocityTexture; +Texture2D g_TileVelocityTexture; int g_iMBSampleCount; -int g_fMBBlurRadius; -float g_iMBType; +int g_iMBMaxSampleCount; +float g_fMBBlurRadius; +int g_iMBType; +int g_iMBTileSize; +float g_fMBSampleBias; vector g_vLightDiffuse; vector g_vLightAmbient; @@ -147,6 +153,11 @@ struct VS_OUT struct PS_OUT_VELOCITYBLUR { float4 vColor : SV_TARGET0; + float2 vVelocity : SV_TARGET1; +}; +struct PS_OUT_VELOCITYTILE +{ + float2 vVelocity : SV_TARGET0; }; VS_OUT VS_MAIN(VS_IN In) { @@ -227,25 +238,178 @@ struct PS_OUT_SSAO_BLUR // g_ColorTexture; // g_DepthTexture; // g_VelocityTexture; +// g_DiffuseTexture; // g_fFar +// g_fMBSampleBias // g_fMBBlurRadius -// g_iMBType // g_iMBSampleCount -PS_OUT_VELOCITYBLUR PS_MOTIONBLUR_X(PS_IN In) +// g_iMBMaxSampleCount +// g_iMBType +PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In) { - PS_OUT_VELOCITYBLUR Out = (PS_OUT_VELOCITYBLUR)0; - //float2 uv = In.vTexcoord; - //float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); - //float3 vColor = (0.f, 0.f, 0.f); + PS_OUT_VELOCITYBLUR Out = (PS_OUT_VELOCITYBLUR) 0; - //for (int i = -g_iMBSampleCount; i < g_iMBSampleCount; ++i) - //{ - // vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x; - // vTexcoord.y = In.vTexcoord.y; + float2 vCenterUV = In.vTexcoord; + float2 vFullResolutionTexelSize = 1.f / g_vResolution; + float fCenterDepth = g_DepthTexture.Sample(PointSampler, vCenterUV).y; + float2 vCenterVelo = g_VelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; // 0~1 -> -1~+1 + float2 vCenterVeloPixel = vCenterVelo * g_vResolution.xy; + bool bBorrowedVelocityFromTile = false; + + float2 vBlurVelo = vCenterVelo; + float2 vBlurVeloPixel = vCenterVeloPixel; + if (length(vBlurVeloPixel) < 0.5f) { + vBlurVelo = g_TileVelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; + vBlurVeloPixel = vBlurVelo * g_vResolution.xy; + bBorrowedVelocityFromTile = true; + } + + if (length(vBlurVeloPixel) < 0.5f) { + Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, vCenterUV); + Out.vVelocity = float2(0.5f, 0.5f); + return Out; + } + + float2 vBlurDirPixel = (vBlurVeloPixel / max(length(vBlurVeloPixel), FLT_EPSILON5)); + int iMaxRadius = min(g_iMBSampleCount, g_iMBMaxSampleCount); + + // 샘플링 당 이동 픽셀 + float fSamplePixelSpeed = g_fMBBlurRadius / max((float) iMaxRadius, 1.f); + + // 샘플유닛의 크기 + float fScalePixelToSampleUnit = (float) iMaxRadius / max(g_fMBBlurRadius, FLT_EPSILON5); + float fScaleDepth = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5); + float4 vAccColorSum = float4(0.f, 0.f, 0.f, 0.f); + float2 vAccVeloSum = float2(0.f, 0.f); + float fAccWeight = 0.f; + + // 센터의 스프레드 길이 + float2 vReferenceVelocityPixel = vCenterVeloPixel; + if (true == bBorrowedVelocityFromTile) + { + vReferenceVelocityPixel = vBlurVeloPixel; + } + float fCenterSpreadLengthPixel = clamp(abs(dot(vReferenceVelocityPixel, vBlurDirPixel)), 0.f, g_fMBBlurRadius); + + [loop] + for (int iInterval = -iMaxRadius; iInterval <= iMaxRadius; ++iInterval) { + float fOffset = (float) abs(iInterval); + float2 vOffsetPixel = vBlurDirPixel * ((float) iInterval * fSamplePixelSpeed); + float2 vSamplingUV = vCenterUV + vOffsetPixel * vFullResolutionTexelSize; + if (false == IsValidUV(vSamplingUV)) { + continue; + } + + float fSampledDepth = g_DepthTexture.Sample(PointSampler, vSamplingUV).y; + float2 vSampledVelo = g_VelocityTexture.Sample(PointSampler, vSamplingUV).xy * 2.f - 1.f; + float2 vSampledVeloPixel = vSampledVelo * g_vResolution.xy; + + // 샘플의 스프레드 길이 + float fBlurSampleAccurate = abs(dot(vSampledVeloPixel, vBlurDirPixel)); + float fSampleSpreadLengthPixel = clamp(fBlurSampleAccurate, 0.f, g_fMBBlurRadius); + if (true == bBorrowedVelocityFromTile) + { + fSampleSpreadLengthPixel = max(fSampleSpreadLengthPixel, fCenterSpreadLengthPixel); + } + + // 샘플과 센터의 (깊이테스트 + 스프레드테스트) + float fWeightCalculated = SampleWeight(fCenterDepth, fSampledDepth, fOffset, fCenterSpreadLengthPixel, fSampleSpreadLengthPixel, fScalePixelToSampleUnit, fScaleDepth); - // vColor += g_fWeights_32[i + 15] * g_BlurTexture.Sample(ClampSampler, vTexcoord); - //} + if (fWeightCalculated <= 0.f) { + continue; + } + + float4 vSampledColor = g_ColorTexture.Sample(ClampLinearSampler, vSamplingUV); + vAccColorSum += vSampledColor * fWeightCalculated; + vAccVeloSum += vSampledVelo * fWeightCalculated; + fAccWeight += fWeightCalculated; + } + float4 vBlurredColor = vAccColorSum / max(fAccWeight, FLT_EPSILON5); + float2 vBlurredVelo = vAccVeloSum / max(fAccWeight, FLT_EPSILON5); + Out.vColor = vBlurredColor; + Out.vVelocity = vBlurredVelo * 0.5f + 0.5f; + return Out; +} +PS_OUT_VELOCITYTILE PS_MOTIONBLUR_TILESAMPLE(PS_IN In) +{ + PS_OUT_VELOCITYTILE Out = (PS_OUT_VELOCITYTILE) 0; + float2 uv = In.vTexcoord; + float2 vSrcTexelSize = float2(1.f / g_vSrcResolution.x, 1.f / g_vSrcResolution.y); + + int2 vTilePixelIndex = int2(uv * g_vResolution); + vTilePixelIndex = clamp(vTilePixelIndex, int2(0, 0), int2(g_vResolution) - 1); + + int2 vTileStartSourcePixel = vTilePixelIndex * g_iMBTileSize; + + float2 vMaxVel = float2(0.5f, 0.5f); + float fMaxSpeed = 0.f; + float2 vSampleVel; + float2 vSampleUV; + float2 vSampleDiff; + float fSampleSpeed; + + [loop] + for (int iY = 0; iY < g_iMBTileSize; ++iY) + { + [loop] + for (int iX = 0; iX < g_iMBTileSize; ++iX) + { + int2 vSourcePixel = vTileStartSourcePixel + int2(iX, iY); + + if (vSourcePixel.x < 0 || vSourcePixel.y < 0 || vSourcePixel.x >= (int) g_vSrcResolution.x || vSourcePixel.y >= (int) g_vSrcResolution.y) + { + continue; + } + + float2 vSourceUV = (float2(vSourcePixel) + 0.5f) * vSrcTexelSize; + + vSampleVel = g_VelocityTexture.SampleLevel(ClampSampler, vSourceUV, 0).xy; + + vSampleUV = vSampleVel * 2.0f - 1.0f; + + fSampleSpeed = length(vSampleUV * g_vSrcResolution); + + if (fSampleSpeed > fMaxSpeed) + { + fMaxSpeed = fSampleSpeed; + vMaxVel = vSampleVel; + } + } + } + + Out.vVelocity = vMaxVel; + return Out; +} +PS_OUT_VELOCITYTILE PS_MOTIONBLUR_TENTSAMPLE(PS_IN In) +{ + PS_OUT_VELOCITYTILE Out = (PS_OUT_VELOCITYTILE) 0; + + float2 uv = In.vTexcoord; + float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); + float2 vMaxVel = float2(0.5f, 0.5f); + float vMaxSpeed = 0.f; + float2 vSampleVel; + float2 vSampleUV; + float2 vSampleDiff; + float fSampleSpeed; + + for (int i = -1; i <= 1; ++i) + { + for (int j = -1; j <= 1; ++j) + { + vSampleUV.x = uv.x + vSrcTexelSize.x * i; + vSampleUV.y = uv.y + vSrcTexelSize.y * j; + vSampleVel = g_VelocityTexture.Sample(ClampSampler, vSampleUV); + vSampleDiff = vSampleVel *2.f - 1.f; + fSampleSpeed = length(vSampleDiff * g_vResolution * g_iMBTileSize); + if (fSampleSpeed > vMaxSpeed) { + vMaxSpeed = fSampleSpeed; + vMaxVel = vSampleVel; + } + } + } + Out.vVelocity = vMaxVel; return Out; } PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) @@ -641,10 +805,9 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) vPreShadowPosition = mul(vPreShadowPosition, g_PreShadowLightProjMatrix); } /* 광원의 NDC에서 샘플링 */ - float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vNearShadowPos, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), g_vShadowBias.x); - float fVisibility_Dynamic_Middle = ShadowVisibility_hwPCF(g_ShadowMiddleTexture, vMiddleShadowPos, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), g_vShadowBias.y); - //float fVisibility_Dynamic_Far = ShadowVisibility_hwPCF(g_ShadowFarTexture, vFarShadowPos, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), g_vShadowBias.z); - float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), g_vShadowBias.w); + float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vNearShadowPos, g_vNearShadowResolution, g_vShadowBias.x); + float fVisibility_Dynamic_Middle = ShadowVisibility_hwPCF(g_ShadowMiddleTexture, vMiddleShadowPos, g_vMiddleShadowResolution, g_vShadowBias.y); + float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, g_vPreShadowResolution, g_vShadowBias.w); //////////////////////////// // 케스케이드 @@ -661,9 +824,6 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) // Near -> Middle float fVisibilityDynamic = lerp(fVisibility_Dynamic_Near, fVisibility_Dynamic_Middle, fCascadeBlend_NearToMiddle); - // Middle -> Far 경계 부드럽게 - //fVisibilityDynamic = lerp(fVisibilityDynamic, fVisibility_Dynamic_Far, fCascadeBlend_MiddleToFar); - // 1번째 방법 // Dynamic->Static 부드럽게 전환 @@ -794,11 +954,11 @@ PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In) { PS_OUT_FLT4_SINGLE Out; float2 uv = In.vTexcoord; - float4 fSrcAlpha = g_DiffuseTexture.Sample(PointSampler, uv); - float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); + float fSrcAlpha = g_DiffuseTexture.Sample(PointSampler, uv).a; + float2 vSrcTexelSize = float2(1.f / g_vSrcResolution.x, 1.f / g_vSrcResolution.y); float3 vColor = (0.f, 0.f, 0.f); - vColor = DownSampleFast(g_DiffuseTexture, In.vTexcoord, vSrcTexelSize, g_vResolution); + vColor = DownSampleFast(g_DiffuseTexture, In.vTexcoord, vSrcTexelSize, g_vSrcResolution); float fIntensity = dot(vColor, float3(0.2126f, 0.7152f, 0.0722f)); fIntensity = max(FLT_EPSILON3, fIntensity); @@ -806,7 +966,7 @@ PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In) float fBloomIntensity = GetBloomCurve(fIntensity, g_fBloomThreshold, g_iBloomEmbossingPass); float3 bloomColor = (vColor * fBloomIntensity) / fIntensity; - Out.vFirstTarget = fSrcAlpha; + Out.vFirstTarget = float4(bloomColor, fSrcAlpha); return Out; } @@ -815,13 +975,13 @@ PS_OUT_FLT4_SINGLE PS_MAIN_DOWNSAMPLE(PS_IN In) { PS_OUT_FLT4_SINGLE Out; float2 uv = In.vTexcoord; - float fMask = g_DiffuseTexture.SampleLevel(BorderZeroSampler, uv, 0).a; - float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); + float fSrcAlpha = g_DiffuseTexture.SampleLevel(BorderZeroSampler, uv, 0).a; + float2 vSrcTexelSize = float2(1.f / g_vSrcResolution.x, 1.f / g_vSrcResolution.y); float3 vColor = (0.f, 0.f, 0.f); - vColor = DownSampleFast(g_DiffuseTexture, In.vTexcoord, vSrcTexelSize, g_vResolution); + vColor = DownSampleFast(g_DiffuseTexture, In.vTexcoord, vSrcTexelSize, g_vSrcResolution); - Out.vFirstTarget = float4(vColor, 1.f); + Out.vFirstTarget = float4(vColor, fSrcAlpha); return Out; } @@ -1394,7 +1554,7 @@ technique11 DefaultTechnique 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_MOTIONBLUR_X(); + PixelShader = compile ps_5_0 PS_MOTIONBLUR(); } pass DownSamplePass // 19 { @@ -1405,5 +1565,22 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN_DOWNSAMPLE(); } - + pass MotionBlurTileSamplePass // 20 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_CAPTURE(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MOTIONBLUR_TILESAMPLE(); + } + pass MotionBlurTentSamplePass // 21 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_CAPTURE(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MOTIONBLUR_TENTSAMPLE(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl index 8ba6cb495..fa37c7a5f 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl @@ -215,6 +215,15 @@ void SampleLocalTRS_Cur(uint bone, float t, out float3 S, out float4 R, out floa DecomposeAffine_RowMajor(g_BoneLocalBuffer[bone].BoneLocal, S, R, T); return; } + + if (ch.KeyCount < 2) + { + KeyFrame k = g_KeyFrameBuffer[ch.StartIndex]; + S = k.vScale; + T = k.vTranslation; + R = QuatNormalize(k.vRotation); + return; + } uint idx0 = FindKeyIndexCur(ch.StartIndex, ch.KeyCount, t); uint idx1 = idx0 + 1; @@ -239,6 +248,15 @@ void SampleLocalTRS_Prev(uint bone, float t, out float3 S, out float4 R, out flo DecomposeAffine_RowMajor(g_BoneLocalBuffer[bone].BoneLocal, S, R, T); return; } + + if (ch.KeyCount < 2) + { + KeyFrame k = g_KeyFrameBuffer[ch.StartIndex]; + S = k.vScale; + T = k.vTranslation; + R = QuatNormalize(k.vRotation); + return; + } uint idx0 = FindKeyIndexPrev(ch.StartIndex, ch.KeyCount, t); uint idx1 = idx0 + 1; @@ -256,6 +274,20 @@ void SampleLocalTRS_Prev(uint bone, float t, out float3 S, out float4 R, out flo row_major float4x4 SampleBlendedLocal(uint bone) { + if (PrevAnimIndex == 0xFFFFFFFFu) + { + float3 S; + float4 R; + float3 T; + SampleLocalTRS_Cur(bone, CurrentTime, S, R, T); + if ((int) bone == RootBoneIndex) + { + T = 0; + R = RootInitRot; + } + return MakeAffine(S, R, T); + } + if (CurrentAnimIndex == PrevAnimIndex) { float3 S; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl index 58006cf58..e87c7476e 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -39,19 +39,19 @@ void CS_MAIN(uint3 DTid : SV_DispatchThreadID) uint global = g_BoneRemap[local]; - row_major float4x4 combined = g_LocalMatIn[global]; + float4x4 combined = g_LocalMatIn[global]; int p = g_ParentBuffer[global]; while (p != -1) { - combined = mul(combined, g_LocalMatIn[(uint) p]); - p = g_ParentBuffer[(uint) p]; + combined = mul(combined,g_LocalMatIn[p]); + p = g_ParentBuffer[p]; } combined = mul(combined, PreTransformMatrix); - - g_LocalPosOutput[local].Combined = combined; - g_LocalPosOutput[local].LocalCombined = combined; - + g_LocalPosOutput[local].Local = g_LocalMatIn[global]; + g_LocalPosOutput[local].LocalCombined = combined; + g_LocalPosOutput[local].Combined = combined; + } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 16287e040..da3d61395 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1745,6 +1745,27 @@ PS_OUT PS_Broomstick(PS_IN In) return Out; } +PS_OUT PS_SpellLearn(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 Color = float4(1.f, 1.f, 1.f, 1.f); + + float4 tex = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float tex1 = g_Texture1.Sample(DefaultSampler, In.vTexcoord).r; + Color = tex; + + tex1 *= 0.95f; + + Color.a = tex1; + + Color.a *= Alpha; + + Out.vColor = Color; + return Out; +} + struct VS_IN3D { float3 vPosition : POSITION; @@ -2305,6 +2326,16 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Broomstick(); } + pass SpellLearn + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, 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_SpellLearn(); + } + pass Enemy_Detection { SetRasterizerState(RS_Nocull); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl index 2edb5c92a..2e61e5543 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl @@ -431,7 +431,7 @@ PS_OUT PS_GLASS_CUBE(PS_IN In) Out.vNormal = float4(In.vNormal * 0.5f + 0.5f, 0.f); Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 15.f / 27.f, 1.f); Out.vSurface = vSurface; - Out.vVelocityUV = CalcVelocityUV(In.vProjPos, In.vPrevProjPos); + Out.vVelocityUV = CalcVelocityUV(In.vProjPos, In.vPrevProjPos) * 0.5f + 0.5f; return Out; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/SpellLearn.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/SpellLearn.png new file mode 100644 index 000000000..97ff44aed Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/SpellLearn.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Accio_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Accio_Path.png new file mode 100644 index 000000000..eed73b87d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Accio_Path.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Descendo_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Descendo_Path.png new file mode 100644 index 000000000..b6a2f11f3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Descendo_Path.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Levioso_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Levioso_Path.png new file mode 100644 index 000000000..bbc9cc45e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Levioso_Path.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Lumos_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Lumos_Path.png new file mode 100644 index 000000000..431c70c4a Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Lumos_Path.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Revelio_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Revelio_Path.png new file mode 100644 index 000000000..75edd419f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Revelio_Path.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SpellLinkDivide.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SpellLinkDivide.png index 7da69c4b5..3c8d8edb6 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SpellLinkDivide.png and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SpellLinkDivide.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_Spell_Name.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_Spell_Name.png new file mode 100644 index 000000000..52d774819 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_Spell_Name.png differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index ed7bf8cef..39ddab3ef 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -197,6 +197,11 @@ call Update_Shaders.bat + + + + + @@ -415,6 +420,11 @@ call Update_Shaders.bat + + + + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index da3bf4584..5efb931c5 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -610,6 +610,24 @@ {a2d06f57-c74f-4604-91b4-884bf6586584} + + {91999870-f29b-4c24-b888-09eb08b8e10c} + + + {37571a2a-97dd-447b-a25b-11194584a57a} + + + {f4d24f99-186c-4074-90ef-48a95d74fb47} + + + {7a016450-f745-4313-ba9d-781fa5909b76} + + + {d9382839-c0b8-4b3d-9227-6dcf65fba44f} + + + {eef1db06-8a9f-42b4-93e2-cc29de2b275d} + @@ -1218,6 +1236,21 @@ 50.UI\QuestInstance + + 50.UI\SpellLearn_Canvas + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_Name + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_MovePointer + @@ -1828,6 +1861,21 @@ 50.UI\QuestInstance + + 50.UI\SpellLearn_Canvas + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_Name + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_MovePointer + diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 24b66f5a8..05c32c8f4 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -111,6 +111,12 @@ #include "QuestInstance.h" +#include "SpellLearn_Canvas.h" +#include "SpellLearn_Panel.h" +#include "SpellLearn_Name.h" +#include "SpellLearn.h" +#include "SpellLearn_MovePointer.h" + #include "IMGUIUI.h" #pragma endregion @@ -531,6 +537,22 @@ HRESULT CLoader::Loading_For_UI() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/SpellUnlock", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) + { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; @@ -1184,6 +1206,27 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_Canvas::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_Panel::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_Name::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_MovePointer::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CIMGUIUI::Create(m_pDevice, m_pContext)))) { @@ -2226,10 +2269,10 @@ HRESULT CLoader::Loading_For_ObjectViewer() vector*>> futures = {}; - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SM_BRR_RaceRing_01_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM_LOCAL, "C:/MeshTable\\Game\\Environment\\BroomFlight\\Meshes\\SM_BRR_RaceRing_01.fbx", XMMatrixIdentity())))) { - return E_FAIL; - } + //if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SK_ConjuredDragon_Model"), + // CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\RiggedObjects\\Characters\\Creatures\\Dragons\\ConjuredDragon\\SK_ConjuredDragon.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) { + // return E_FAIL; + //} #pragma region BODY @@ -2332,6 +2375,11 @@ HRESULT CLoader::Loading_For_ObjectViewer() TEXT("Prototype_Component_Dragon_Model") )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Monster/Dragon/Dragon_Anim.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_Dragon_Model") + )); + #pragma endregion futures.emplace_back(Deferred_ModelLoad( @@ -2359,6 +2407,12 @@ HRESULT CLoader::Loading_For_ObjectViewer() TEXT("Prototype_Component_Npc_Model") )); + + //futures.emplace_back(Deferred_ModelLoad( + // MODEL::ANIM, "../Bin/Resources/Models/Monster/Dragon/SK_ConjuredDragon_Anim.fbx", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(), + // TEXT("Prototype_Component_Npc_Model") + //)); + futures.emplace_back(Deferred_ModelLoad( MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin",XMMatrixIdentity(), TEXT("Prototype_Component_Wand_Model") diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn.cpp new file mode 100644 index 000000000..947fe07b2 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SpellLearn.cpp @@ -0,0 +1,223 @@ +#include "pch.h" +#include "SpellLearn.h" +#include "GameInstance.h" + +CSpellLearn::CSpellLearn(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpellLearn::CSpellLearn(const CSpellLearn& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpellLearn::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 600.f; + Desc.fY = 0.f; + Desc.fSizeX = 550.f; + Desc.fSizeY = 550.f; + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 5.f; + Visible(false); + return S_OK; +} + +void CSpellLearn::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + { + m_fAlpha += fTimeDelta * m_fAlphaTime; + } + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpellLearn::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpellLearn::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpellLearn::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SU_Levioso_Path"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpellLearn* CSpellLearn::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn* pInstance = new CSpellLearn(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn* pInstance = new CSpellLearn(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpellLearn::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Canvas.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Canvas.cpp new file mode 100644 index 000000000..c77af7192 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Canvas.cpp @@ -0,0 +1,138 @@ +#include "pch.h" +#include "UI_Manager.h" +#include "SpellLearn_Canvas.h" +#include "GameInstance.h" +#include "SpellLearn_Panel.h" + +CSpellLearn_Canvas::CSpellLearn_Canvas(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CCanvasObject(pDevice, pContext) +{ +} + +CSpellLearn_Canvas::CSpellLearn_Canvas(const CSpellLearn_Canvas& rhs) + :CCanvasObject(rhs) +{ +} + +HRESULT CSpellLearn_Canvas::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_Canvas::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 1920.f; + Desc.fSizeY = 1080.f; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Panel(pArg))) + { + return E_FAIL; + } + Visible(false); + return S_OK; +} + +void CSpellLearn_Canvas::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_Canvas::Update(_float fTimeDelta) +{ + __super::Update(fTimeDelta); +} + +void CSpellLearn_Canvas::Late_Update(_float fTimeDelta) +{ + if (m_bVisible) { + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpellLearn_Canvas::Render() +{ + return S_OK; +} + +_vector CSpellLearn_Canvas::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_Canvas::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CSpellLearn_Canvas::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpellLearn_Canvas::Ready_Panel(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast (&m_pSpellLearn_Panel)))) + { + return E_FAIL; + } + Add_Panel(TEXT("SpellLearn_Panel"), m_pSpellLearn_Panel); + + return S_OK; +} + +void CSpellLearn_Canvas::Clear_Penel() +{ +} + +CSpellLearn_Canvas* CSpellLearn_Canvas::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_Canvas* pInstance = new CSpellLearn_Canvas(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_Canvas"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_Canvas::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_Canvas* pInstance = new CSpellLearn_Canvas(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_Canvas"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_Canvas::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpellLearn_Canvas::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_MovePointer.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_MovePointer.cpp new file mode 100644 index 000000000..86b1ccd78 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_MovePointer.cpp @@ -0,0 +1,272 @@ +#include "pch.h" +#include "SpellLearn_MovePointer.h" +#include "GameInstance.h" + +CSpellLearn_MovePointer::CSpellLearn_MovePointer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpellLearn_MovePointer::CSpellLearn_MovePointer(const CSpellLearn_MovePointer& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpellLearn_MovePointer::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_MovePointer::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 454.f; + Desc.fY = -240.f; + Desc.fSizeX = 32.f; + Desc.fSizeY = 32.f; + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 5.f; + m_fMoveSpeed = 15.f; + m_MoveLine.push_back(XMVectorSet(454.f, -240.f, 0.f, 1.f)); + m_MoveLine.push_back(XMVectorSet(454.f, 90.f, 0.f, 1.f)); + + + + Index = 0; + + Visible(false); + return S_OK; +} + +void CSpellLearn_MovePointer::SpellLearn(_int Index) +{ + m_iSpell = Index; + m_bMoveStart = true; +} + +void CSpellLearn_MovePointer::Line(_float fTime) +{ + m_vLerp_Position = m_MoveLine[Index]; + + if (Start_Lerp(m_fMoveSpeed * fTime) == true) + { + if (Index < m_MoveLine.size() -1) + { + ++Index; + } + else + { + m_bMoveStart = false; + } + } + +} + +void CSpellLearn_MovePointer::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_MovePointer::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + { + m_fAlpha += fTimeDelta * m_fAlphaTime; + } + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + if (m_pGameInstance->Key_Down(DIK_L)) + { + m_bMoveStart = true; + } + + if (m_bMoveStart == true) + { + if (m_iSpell == ENUM_CLASS(SPELL_LINE::LINE)) + { + Line(fTimeDelta); + } + else if (m_iSpell == ENUM_CLASS(SPELL_LINE::CURVE)) + { + //Curve(); + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpellLearn_MovePointer::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn_MovePointer::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpellLearn_MovePointer::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_MovePointer::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpellLearn_MovePointer::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SU_Cursor"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpellLearn_MovePointer* CSpellLearn_MovePointer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_MovePointer* pInstance = new CSpellLearn_MovePointer(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_MovePointer"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_MovePointer::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_MovePointer* pInstance = new CSpellLearn_MovePointer(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_MovePointer"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_MovePointer::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpellLearn_MovePointer::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Name.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Name.cpp new file mode 100644 index 000000000..ed9106018 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Name.cpp @@ -0,0 +1,243 @@ +#include "pch.h" +#include "SpellLearn_Name.h" + +CSpellLearn_Name::CSpellLearn_Name(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpellLearn_Name::CSpellLearn_Name(const CSpellLearn_Name& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpellLearn_Name::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_Name::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 600.f; + Desc.fY = 420.f; + Desc.fSizeX = 432.f; + Desc.fSizeY = 27.f; + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 5.f; + m_vNine_Slice = _float4(216.f, 216.f, 0.f, 27.f); + m_fFontX = 944.f; + m_fFontY = 520.f; + SizeUpX(550.f); + SizeUpY(27.f); + Visible(false); + return S_OK; +} + + +void CSpellLearn_Name::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_Name::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + { + m_fAlpha += fTimeDelta * m_fAlphaTime; + } + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpellLearn_Name::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn_Name::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::QUEST_BORDER)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + _float OffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), TEXT("봄바르다")) - 30) * 0.5f; + m_pGameInstance->Render_Text(TEXT("Font_size20"), TEXT("봄바르다"), _float2((m_fFontX + m_fX) - OffSet, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); + + return S_OK; +} + +_vector CSpellLearn_Name::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_Name::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fNine_Slice", &m_vNine_Slice, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_fOrigin_Size, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpellLearn_Name::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_Spell_Name"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpellLearn_Name* CSpellLearn_Name::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_Name* pInstance = new CSpellLearn_Name(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_Name"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_Name::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_Name* pInstance = new CSpellLearn_Name(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_Name"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_Name::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpellLearn_Name::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp new file mode 100644 index 000000000..fc448de6a --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp @@ -0,0 +1,229 @@ +#include "pch.h" +#include "SpellLearn_Panel.h" +#include "GameInstance.h" +#include "SpellLearn_Name.h" +#include "SpellLearn.h" +#include "SpellLearn_MovePointer.h" + +CSpellLearn_Panel::CSpellLearn_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CPanelObject(pDevice, pContext) +{ +} + +CSpellLearn_Panel::CSpellLearn_Panel(const CSpellLearn_Panel& rhs) + :CPanelObject(rhs) +{ +} + +HRESULT CSpellLearn_Panel::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_Panel::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 960.f; + Desc.fY = -540.f; + Desc.fSizeX = g_iWinSizeX; + Desc.fSizeY = g_iWinSizeY; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Element(pArg))) + { + return E_FAIL; + } + m_fCanvasAlpha = 1.f; + m_fSortZ = 0.05f; + m_fDelayTime = 1.f; + Visible(true); + ElementAllVisible(true); + return S_OK; +} + +void CSpellLearn_Panel::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_Panel::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Update(fTimeDelta); +} + +void CSpellLearn_Panel::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn_Panel::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_LEARN)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpellLearn_Panel::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_Panel::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpellLearn_Panel::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_SpellLearn"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SpellLinkDivide"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpellLearn_Panel::Ready_Element(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn_Name)))) + { + return E_FAIL; + } + Add_Element(TEXT("SpellLearn_Name"), m_pSpellLearn_Name); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn)))) + { + return E_FAIL; + } + Add_Element(TEXT("SpellLearn"), m_pSpellLearn); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn_MovePointer)))) + { + return E_FAIL; + } + Add_Element(TEXT("SpellLearn_MovePointer"), m_pSpellLearn_MovePointer); + + return S_OK; +} + +CSpellLearn_Panel* CSpellLearn_Panel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_Panel* pInstance = new CSpellLearn_Panel(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_Panel::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_Panel* pInstance = new CSpellLearn_Panel(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_Panel::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpellLearn_Panel::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp b/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp index 1b53268cb..347f2947e 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp @@ -92,6 +92,7 @@ HRESULT CSpell_Canvas::Ready_Panel(void* pArg) return E_FAIL; } Add_Panel(TEXT("Spell_Panel"), m_pSpell_Panel); + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/UI_Manager.cpp b/Jusin154_Team3D/Editor/Private/UI_Manager.cpp index 7d42624bf..b8d75a4dc 100644 --- a/Jusin154_Team3D/Editor/Private/UI_Manager.cpp +++ b/Jusin154_Team3D/Editor/Private/UI_Manager.cpp @@ -4,6 +4,7 @@ #include "GamePlay_Canvas.h" #include "Spell_Canvas.h" #include "Quest_Canvas.h" +#include "SpellLearn_Canvas.h" #include "Mouse_Cursor.h" #include "CameraLockOn.h" #include "Loding_Canvas.h" @@ -165,6 +166,11 @@ HRESULT CUI_Manager::Ready_Components(void* pArg) } Add_Canvas(TEXT("Quest_Canves"), m_pQuest_Canves); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, g_iStaticLevel, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn_Canvas)))) { + return E_FAIL; + } + Add_Canvas(TEXT("SpellLearn_Canvas"), m_pSpellLearn_Canvas); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, g_iStaticLevel, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMouse_Cursor)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index f1f6529c7..35c5b4156 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -34,6 +34,7 @@ namespace Editor REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, SPELL_DRAG, CAMERA_LOCKON, LODING_SCREEN, ENEMY_HPBAR, BOSS_HPBAR, QUEST_BORDER, QUEST_INFO, QUEST_STATUS, BROOMSTICK, + SPELL_LEARN, ENEMY_DETECTION, INTERACTION_OBJECT, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, BLUR_NO_EMMISVE, BLUR_NO_WORLD_NO_EMISSIVE, WEIGHTBLEND_FOR_BLEND, DEPTH_STOP, WB_CULLING, SCREEN_FX , DISTORTION ,END }; enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, UVALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, SPELL_SLOT, SPELL_LOCK, QUEST_SLOT, END }; @@ -58,6 +59,8 @@ namespace Editor END }; + enum class SPELL_LINE { LINE, CURVE }; + enum class BLOOM_TYPE { NONE, BASIC, MULTIPLY, END }; enum class ELEMENT_INTERACTABLE_ID { BARREL, BOX, END }; diff --git a/Jusin154_Team3D/Editor/Public/IMGUIUI.h b/Jusin154_Team3D/Editor/Public/IMGUIUI.h index 69d0a7a48..d8a26a832 100644 --- a/Jusin154_Team3D/Editor/Public/IMGUIUI.h +++ b/Jusin154_Team3D/Editor/Public/IMGUIUI.h @@ -101,6 +101,7 @@ class CIMGUIUI final : public CGameObject _float2 m_fFontPos {}; _float m_fFontX {}; _float m_fFontY {}; + public: static CIMGUIUI* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn.h b/Jusin154_Team3D/Editor/Public/SpellLearn.h new file mode 100644 index 000000000..e5dcfcd5b --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SpellLearn.h @@ -0,0 +1,40 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpellLearn final : public CElementObject +{ +private: + CSpellLearn(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn(const CSpellLearn& rhs); + virtual ~CSpellLearn() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpellLearn* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn_Canvas.h b/Jusin154_Team3D/Editor/Public/SpellLearn_Canvas.h new file mode 100644 index 000000000..bd7299667 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_Canvas.h @@ -0,0 +1,48 @@ +#pragma once + +#include "Editor_Define.h" +#include "CanvasObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpellLearn_Canvas final : public CCanvasObject +{ +private: + CSpellLearn_Canvas(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_Canvas(const CSpellLearn_Canvas& rhs); + virtual ~CSpellLearn_Canvas() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Ready_Panel(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +public: + void Clear_Penel(); + +private: + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + CGameObject* m_pSpellLearn_Panel = { nullptr }; + +public: + static CSpellLearn_Canvas* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h b/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h new file mode 100644 index 000000000..1cbad5c47 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h @@ -0,0 +1,52 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpellLearn_MovePointer final : public CElementObject +{ +private: + CSpellLearn_MovePointer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_MovePointer(const CSpellLearn_MovePointer& rhs); + virtual ~CSpellLearn_MovePointer() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +public: + void SpellLearn(_int Index); +private: + void Line(_float fTime); + + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _bool m_bMoveStart = { false }; + _int m_iSpell{}; + + _int Index{}; + vector<_vector> m_MoveLine; + +public: + static CSpellLearn_MovePointer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn_Name.h b/Jusin154_Team3D/Editor/Public/SpellLearn_Name.h new file mode 100644 index 000000000..6449ec521 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_Name.h @@ -0,0 +1,40 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpellLearn_Name final : public CElementObject +{ +private: + CSpellLearn_Name(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_Name(const CSpellLearn_Name& rhs); + virtual ~CSpellLearn_Name() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpellLearn_Name* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn_Panel.h b/Jusin154_Team3D/Editor/Public/SpellLearn_Panel.h new file mode 100644 index 000000000..8cb5c3066 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_Panel.h @@ -0,0 +1,51 @@ +#pragma once + +#include "Editor_Define.h" +#include "PanelObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpellLearn_Panel final : public CPanelObject +{ + +private: + CSpellLearn_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_Panel(const CSpellLearn_Panel& rhs); + virtual ~CSpellLearn_Panel() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Ready_Element(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + CGameObject* m_pSpellLearn_Name = { nullptr }; + CGameObject* m_pSpellLearn = { nullptr }; + CGameObject* m_pSpellLearn_MovePointer = { nullptr }; + +public: + static CSpellLearn_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/UI_Manager.h b/Jusin154_Team3D/Editor/Public/UI_Manager.h index 9461bd7df..7f3a92171 100644 --- a/Jusin154_Team3D/Editor/Public/UI_Manager.h +++ b/Jusin154_Team3D/Editor/Public/UI_Manager.h @@ -53,6 +53,7 @@ class CUI_Manager final : public CUIObject CGameObject* m_pSpell_Canvas = { nullptr }; CGameObject* m_pLoding_Canvas= { nullptr }; CGameObject* m_pQuest_Canves= { nullptr }; + CGameObject* m_pSpellLearn_Canvas = { nullptr }; CGameObject* m_pMouse_Cursor = { nullptr }; CGameObject* m_pCamera_LockOn = { nullptr }; _bool m_bCanvas_Change = { false }; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli index 5aa7aec84..444f13d38 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -468,42 +468,47 @@ float4 BlendDiffuse(float4 vDiffuseA, Texture2D DiffuseBlendTexture, float2 vTex return lerp(vDiffuseA, vDiffuseBlendColor, fRatio); } - -float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos) +float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos, float fIntensity = 1.f) { - if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) { - return float2(0.0f, 0.0f); + if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) + { + return float2(0.5f, 0.5f); } - float2 currentUV = (vCurrentProjPos.xy/vCurrentProjPos.w); - float2 previousUV = (vPreviousProjPos.xy / vCurrentProjPos.w); + float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w; + float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w; - currentUV.y *= -1.f; - previousUV.y *= -1.f; + currentNDC.y *= -1.f; + previousNDC.y *= -1.f; - return currentUV - previousUV; + // UV 델타 + float2 velocityUV = (currentNDC - previousNDC) * 0.5f; + velocityUV *= fIntensity; + velocityUV = clamp(velocityUV, -1.0f, 1.0f); + + return velocityUV * 0.5f + 0.5f; // 0 속도 -> 0.5 } float3 DownSampleFast(Texture2D SrcTexture2D, float2 vCenterTexcoord, float2 vSrcTexelSize, float2 vResolution) { float2 uv = float2(0.f, 0.f); - float3 vCenterColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); + float3 vCenterColor = SrcTexture2D.SampleLevel(BorderZeroSampler, vCenterTexcoord, 0); uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, -1.0); - float3 fLTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroLinearSampler); + float3 fLTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); uv = vCenterTexcoord + vSrcTexelSize * float2(0.0, -1.0); float3 fTColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); uv = vCenterTexcoord + vSrcTexelSize * float2(+1.0, -1.0); - float3 fRTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroLinearSampler); + float3 fRTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, 0.0); float3 fLColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); uv = vCenterTexcoord + vSrcTexelSize * float2(1.0, 0.0); float3 fRColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, +1.0); - float3 fLBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroLinearSampler); + float3 fLBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); uv = vCenterTexcoord + vSrcTexelSize * float2(0.0, 1.0); float3 fBColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); uv = vCenterTexcoord + vSrcTexelSize * float2(+1.0, +1.0); - float3 fRBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroLinearSampler); + float3 fRBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); return vCenterColor * 0.25f + (fLTColor + fRTColor + fLBColor + fRBColor) * 0.0625f + (fTColor + fLColor + fRColor + fBColor) * 0.125f; } diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli index b70ca6161..f21518030 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli @@ -27,6 +27,13 @@ sampler ClampSampler = sampler_state AddressV = clamp; }; +sampler ClampLinearSampler = sampler_state +{ + Filter = MIN_MAG_MIP_LINEAR; + AddressU = clamp; + AddressV = clamp; +}; + sampler MirrorSampler = sampler_state { Filter = MIN_MAG_MIP_LINEAR; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index f819bafeb..6b8a4a2e6 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -14,9 +14,12 @@ float g_fShadowFar_MIDDDLE; float g_fShadowFar_FAR; float g_fCascadeSplitRatioNear; float g_fCascadeSplitRatioFar; -uint g_iMaxShadowWidth; -uint g_iMaxShadowHeight; +float2 g_vNearShadowResolution; +float2 g_vMiddleShadowResolution; +float2 g_vFarShadowResolution; +float2 g_vPreShadowResolution; float2 g_vResolution; +float2 g_vSrcResolution; float4 g_vShadowBias; uint g_iBloomEmbossingPass; @@ -60,7 +63,6 @@ Texture2D g_DepthTexture; Texture2D g_SpecularTexture; Texture2D g_ShadowNearTexture; Texture2D g_ShadowMiddleTexture; -Texture2D g_ShadowFarTexture; Texture2D g_PreShadowTexture; Texture2D g_BlurTexture; Texture2D g_BlurXTexture; @@ -73,10 +75,14 @@ Texture2D g_OriginalTexture; Texture2D g_ColorTexture; Texture2D g_VelocityTexture; +Texture2D g_TileVelocityTexture; int g_iMBSampleCount; -int g_fMBBlurRadius; -float g_iMBType; +int g_iMBMaxSampleCount; +float g_fMBBlurRadius; +int g_iMBType; +int g_iMBTileSize; +float g_fMBSampleBias; vector g_vLightDiffuse; vector g_vLightAmbient; @@ -147,6 +153,11 @@ struct VS_OUT struct PS_OUT_VELOCITYBLUR { float4 vColor : SV_TARGET0; + float2 vVelocity : SV_TARGET1; +}; +struct PS_OUT_VELOCITYTILE +{ + float2 vVelocity : SV_TARGET0; }; VS_OUT VS_MAIN(VS_IN In) { @@ -227,25 +238,178 @@ struct PS_OUT_SSAO_BLUR // g_ColorTexture; // g_DepthTexture; // g_VelocityTexture; +// g_DiffuseTexture; // g_fFar +// g_fMBSampleBias // g_fMBBlurRadius -// g_iMBType // g_iMBSampleCount -PS_OUT_VELOCITYBLUR PS_MOTIONBLUR_X(PS_IN In) +// g_iMBMaxSampleCount +// g_iMBType +PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In) { - PS_OUT_VELOCITYBLUR Out = (PS_OUT_VELOCITYBLUR)0; - //float2 uv = In.vTexcoord; - //float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); - //float3 vColor = (0.f, 0.f, 0.f); + PS_OUT_VELOCITYBLUR Out = (PS_OUT_VELOCITYBLUR) 0; - //for (int i = -g_iMBSampleCount; i < g_iMBSampleCount; ++i) - //{ - // vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x; - // vTexcoord.y = In.vTexcoord.y; + float2 vCenterUV = In.vTexcoord; + float2 vFullResolutionTexelSize = 1.f / g_vResolution; + float fCenterDepth = g_DepthTexture.Sample(PointSampler, vCenterUV).y; + float2 vCenterVelo = g_VelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; // 0~1 -> -1~+1 + float2 vCenterVeloPixel = vCenterVelo * g_vResolution.xy; + bool bBorrowedVelocityFromTile = false; + + float2 vBlurVelo = vCenterVelo; + float2 vBlurVeloPixel = vCenterVeloPixel; + if (length(vBlurVeloPixel) < 0.5f) { + vBlurVelo = g_TileVelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; + vBlurVeloPixel = vBlurVelo * g_vResolution.xy; + bBorrowedVelocityFromTile = true; + } + + if (length(vBlurVeloPixel) < 0.5f) { + Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, vCenterUV); + Out.vVelocity = float2(0.5f, 0.5f); + return Out; + } + + float2 vBlurDirPixel = (vBlurVeloPixel / max(length(vBlurVeloPixel), FLT_EPSILON5)); + int iMaxRadius = min(g_iMBSampleCount, g_iMBMaxSampleCount); + + // 샘플링 당 이동 픽셀 + float fSamplePixelSpeed = g_fMBBlurRadius / max((float) iMaxRadius, 1.f); + + // 샘플유닛의 크기 + float fScalePixelToSampleUnit = (float) iMaxRadius / max(g_fMBBlurRadius, FLT_EPSILON5); + float fScaleDepth = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5); + float4 vAccColorSum = float4(0.f, 0.f, 0.f, 0.f); + float2 vAccVeloSum = float2(0.f, 0.f); + float fAccWeight = 0.f; + + // 센터의 스프레드 길이 + float2 vReferenceVelocityPixel = vCenterVeloPixel; + if (true == bBorrowedVelocityFromTile) + { + vReferenceVelocityPixel = vBlurVeloPixel; + } + float fCenterSpreadLengthPixel = clamp(abs(dot(vReferenceVelocityPixel, vBlurDirPixel)), 0.f, g_fMBBlurRadius); + + [loop] + for (int iInterval = -iMaxRadius; iInterval <= iMaxRadius; ++iInterval) { + float fOffset = (float) abs(iInterval); + float2 vOffsetPixel = vBlurDirPixel * ((float) iInterval * fSamplePixelSpeed); + float2 vSamplingUV = vCenterUV + vOffsetPixel * vFullResolutionTexelSize; + if (false == IsValidUV(vSamplingUV)) { + continue; + } + + float fSampledDepth = g_DepthTexture.Sample(PointSampler, vSamplingUV).y; + float2 vSampledVelo = g_VelocityTexture.Sample(PointSampler, vSamplingUV).xy * 2.f - 1.f; + float2 vSampledVeloPixel = vSampledVelo * g_vResolution.xy; + + // 샘플의 스프레드 길이 + float fBlurSampleAccurate = abs(dot(vSampledVeloPixel, vBlurDirPixel)); + float fSampleSpreadLengthPixel = clamp(fBlurSampleAccurate, 0.f, g_fMBBlurRadius); + if (true == bBorrowedVelocityFromTile) + { + fSampleSpreadLengthPixel = max(fSampleSpreadLengthPixel, fCenterSpreadLengthPixel); + } + + // 샘플과 센터의 (깊이테스트 + 스프레드테스트) + float fWeightCalculated = SampleWeight(fCenterDepth, fSampledDepth, fOffset, fCenterSpreadLengthPixel, fSampleSpreadLengthPixel, fScalePixelToSampleUnit, fScaleDepth); - // vColor += g_fWeights_32[i + 15] * g_BlurTexture.Sample(ClampSampler, vTexcoord); - //} + if (fWeightCalculated <= 0.f) { + continue; + } + + float4 vSampledColor = g_ColorTexture.Sample(ClampLinearSampler, vSamplingUV); + vAccColorSum += vSampledColor * fWeightCalculated; + vAccVeloSum += vSampledVelo * fWeightCalculated; + fAccWeight += fWeightCalculated; + } + float4 vBlurredColor = vAccColorSum / max(fAccWeight, FLT_EPSILON5); + float2 vBlurredVelo = vAccVeloSum / max(fAccWeight, FLT_EPSILON5); + Out.vColor = vBlurredColor; + Out.vVelocity = vBlurredVelo * 0.5f + 0.5f; + return Out; +} +PS_OUT_VELOCITYTILE PS_MOTIONBLUR_TILESAMPLE(PS_IN In) +{ + PS_OUT_VELOCITYTILE Out = (PS_OUT_VELOCITYTILE) 0; + float2 uv = In.vTexcoord; + float2 vSrcTexelSize = float2(1.f / g_vSrcResolution.x, 1.f / g_vSrcResolution.y); + + int2 vTilePixelIndex = int2(uv * g_vResolution); + vTilePixelIndex = clamp(vTilePixelIndex, int2(0, 0), int2(g_vResolution) - 1); + + int2 vTileStartSourcePixel = vTilePixelIndex * g_iMBTileSize; + + float2 vMaxVel = float2(0.5f, 0.5f); + float fMaxSpeed = 0.f; + float2 vSampleVel; + float2 vSampleUV; + float2 vSampleDiff; + float fSampleSpeed; + + [loop] + for (int iY = 0; iY < g_iMBTileSize; ++iY) + { + [loop] + for (int iX = 0; iX < g_iMBTileSize; ++iX) + { + int2 vSourcePixel = vTileStartSourcePixel + int2(iX, iY); + + if (vSourcePixel.x < 0 || vSourcePixel.y < 0 || vSourcePixel.x >= (int) g_vSrcResolution.x || vSourcePixel.y >= (int) g_vSrcResolution.y) + { + continue; + } + + float2 vSourceUV = (float2(vSourcePixel) + 0.5f) * vSrcTexelSize; + + vSampleVel = g_VelocityTexture.SampleLevel(ClampSampler, vSourceUV, 0).xy; + + vSampleUV = vSampleVel * 2.0f - 1.0f; + + fSampleSpeed = length(vSampleUV * g_vSrcResolution); + + if (fSampleSpeed > fMaxSpeed) + { + fMaxSpeed = fSampleSpeed; + vMaxVel = vSampleVel; + } + } + } + + Out.vVelocity = vMaxVel; + return Out; +} +PS_OUT_VELOCITYTILE PS_MOTIONBLUR_TENTSAMPLE(PS_IN In) +{ + PS_OUT_VELOCITYTILE Out = (PS_OUT_VELOCITYTILE) 0; + + float2 uv = In.vTexcoord; + float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); + float2 vMaxVel = float2(0.5f, 0.5f); + float vMaxSpeed = 0.f; + float2 vSampleVel; + float2 vSampleUV; + float2 vSampleDiff; + float fSampleSpeed; + + for (int i = -1; i <= 1; ++i) + { + for (int j = -1; j <= 1; ++j) + { + vSampleUV.x = uv.x + vSrcTexelSize.x * i; + vSampleUV.y = uv.y + vSrcTexelSize.y * j; + vSampleVel = g_VelocityTexture.Sample(ClampSampler, vSampleUV); + vSampleDiff = vSampleVel *2.f - 1.f; + fSampleSpeed = length(vSampleDiff * g_vResolution * g_iMBTileSize); + if (fSampleSpeed > vMaxSpeed) { + vMaxSpeed = fSampleSpeed; + vMaxVel = vSampleVel; + } + } + } + Out.vVelocity = vMaxVel; return Out; } PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) @@ -641,10 +805,9 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) vPreShadowPosition = mul(vPreShadowPosition, g_PreShadowLightProjMatrix); } /* 광원의 NDC에서 샘플링 */ - float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vNearShadowPos, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), g_vShadowBias.x); - float fVisibility_Dynamic_Middle = ShadowVisibility_hwPCF(g_ShadowMiddleTexture, vMiddleShadowPos, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), g_vShadowBias.y); - //float fVisibility_Dynamic_Far = ShadowVisibility_hwPCF(g_ShadowFarTexture, vFarShadowPos, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), g_vShadowBias.z); - float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), g_vShadowBias.w); + float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vNearShadowPos, g_vNearShadowResolution, g_vShadowBias.x); + float fVisibility_Dynamic_Middle = ShadowVisibility_hwPCF(g_ShadowMiddleTexture, vMiddleShadowPos, g_vMiddleShadowResolution, g_vShadowBias.y); + float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, g_vPreShadowResolution, g_vShadowBias.w); //////////////////////////// // 케스케이드 @@ -661,9 +824,6 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) // Near -> Middle float fVisibilityDynamic = lerp(fVisibility_Dynamic_Near, fVisibility_Dynamic_Middle, fCascadeBlend_NearToMiddle); - // Middle -> Far 경계 부드럽게 - //fVisibilityDynamic = lerp(fVisibilityDynamic, fVisibility_Dynamic_Far, fCascadeBlend_MiddleToFar); - // 1번째 방법 // Dynamic->Static 부드럽게 전환 @@ -794,11 +954,11 @@ PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In) { PS_OUT_FLT4_SINGLE Out; float2 uv = In.vTexcoord; - float4 fSrcAlpha = g_DiffuseTexture.Sample(PointSampler, uv); - float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); + float fSrcAlpha = g_DiffuseTexture.Sample(PointSampler, uv).a; + float2 vSrcTexelSize = float2(1.f / g_vSrcResolution.x, 1.f / g_vSrcResolution.y); float3 vColor = (0.f, 0.f, 0.f); - vColor = DownSampleFast(g_DiffuseTexture, In.vTexcoord, vSrcTexelSize, g_vResolution); + vColor = DownSampleFast(g_DiffuseTexture, In.vTexcoord, vSrcTexelSize, g_vSrcResolution); float fIntensity = dot(vColor, float3(0.2126f, 0.7152f, 0.0722f)); fIntensity = max(FLT_EPSILON3, fIntensity); @@ -806,7 +966,7 @@ PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In) float fBloomIntensity = GetBloomCurve(fIntensity, g_fBloomThreshold, g_iBloomEmbossingPass); float3 bloomColor = (vColor * fBloomIntensity) / fIntensity; - Out.vFirstTarget = fSrcAlpha; + Out.vFirstTarget = float4(bloomColor, fSrcAlpha); return Out; } @@ -815,13 +975,13 @@ PS_OUT_FLT4_SINGLE PS_MAIN_DOWNSAMPLE(PS_IN In) { PS_OUT_FLT4_SINGLE Out; float2 uv = In.vTexcoord; - float fMask = g_DiffuseTexture.SampleLevel(BorderZeroSampler, uv, 0).a; - float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); + float fSrcAlpha = g_DiffuseTexture.SampleLevel(BorderZeroSampler, uv, 0).a; + float2 vSrcTexelSize = float2(1.f / g_vSrcResolution.x, 1.f / g_vSrcResolution.y); float3 vColor = (0.f, 0.f, 0.f); - vColor = DownSampleFast(g_DiffuseTexture, In.vTexcoord, vSrcTexelSize, g_vResolution); + vColor = DownSampleFast(g_DiffuseTexture, In.vTexcoord, vSrcTexelSize, g_vSrcResolution); - Out.vFirstTarget = float4(vColor, 1.f); + Out.vFirstTarget = float4(vColor, fSrcAlpha); return Out; } @@ -1394,7 +1554,7 @@ technique11 DefaultTechnique 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_MOTIONBLUR_X(); + PixelShader = compile ps_5_0 PS_MOTIONBLUR(); } pass DownSamplePass // 19 { @@ -1405,5 +1565,22 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN_DOWNSAMPLE(); } - + pass MotionBlurTileSamplePass // 20 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_CAPTURE(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MOTIONBLUR_TILESAMPLE(); + } + pass MotionBlurTentSamplePass // 21 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_CAPTURE(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MOTIONBLUR_TENTSAMPLE(); + } } diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl index 8ba6cb495..fa37c7a5f 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl @@ -215,6 +215,15 @@ void SampleLocalTRS_Cur(uint bone, float t, out float3 S, out float4 R, out floa DecomposeAffine_RowMajor(g_BoneLocalBuffer[bone].BoneLocal, S, R, T); return; } + + if (ch.KeyCount < 2) + { + KeyFrame k = g_KeyFrameBuffer[ch.StartIndex]; + S = k.vScale; + T = k.vTranslation; + R = QuatNormalize(k.vRotation); + return; + } uint idx0 = FindKeyIndexCur(ch.StartIndex, ch.KeyCount, t); uint idx1 = idx0 + 1; @@ -239,6 +248,15 @@ void SampleLocalTRS_Prev(uint bone, float t, out float3 S, out float4 R, out flo DecomposeAffine_RowMajor(g_BoneLocalBuffer[bone].BoneLocal, S, R, T); return; } + + if (ch.KeyCount < 2) + { + KeyFrame k = g_KeyFrameBuffer[ch.StartIndex]; + S = k.vScale; + T = k.vTranslation; + R = QuatNormalize(k.vRotation); + return; + } uint idx0 = FindKeyIndexPrev(ch.StartIndex, ch.KeyCount, t); uint idx1 = idx0 + 1; @@ -256,6 +274,20 @@ void SampleLocalTRS_Prev(uint bone, float t, out float3 S, out float4 R, out flo row_major float4x4 SampleBlendedLocal(uint bone) { + if (PrevAnimIndex == 0xFFFFFFFFu) + { + float3 S; + float4 R; + float3 T; + SampleLocalTRS_Cur(bone, CurrentTime, S, R, T); + if ((int) bone == RootBoneIndex) + { + T = 0; + R = RootInitRot; + } + return MakeAffine(S, R, T); + } + if (CurrentAnimIndex == PrevAnimIndex) { float3 S; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl index 58006cf58..e87c7476e 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -39,19 +39,19 @@ void CS_MAIN(uint3 DTid : SV_DispatchThreadID) uint global = g_BoneRemap[local]; - row_major float4x4 combined = g_LocalMatIn[global]; + float4x4 combined = g_LocalMatIn[global]; int p = g_ParentBuffer[global]; while (p != -1) { - combined = mul(combined, g_LocalMatIn[(uint) p]); - p = g_ParentBuffer[(uint) p]; + combined = mul(combined,g_LocalMatIn[p]); + p = g_ParentBuffer[p]; } combined = mul(combined, PreTransformMatrix); - - g_LocalPosOutput[local].Combined = combined; - g_LocalPosOutput[local].LocalCombined = combined; - + g_LocalPosOutput[local].Local = g_LocalMatIn[global]; + g_LocalPosOutput[local].LocalCombined = combined; + g_LocalPosOutput[local].Combined = combined; + } diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index c18541234..d1ab424f7 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -182,6 +182,7 @@ call Update_Lib.bat + @@ -214,6 +215,7 @@ call Update_Lib.bat + true @@ -328,14 +330,6 @@ call Update_Lib.bat - - true - true - - - true - true - @@ -429,6 +423,7 @@ call Update_Lib.bat + @@ -436,19 +431,12 @@ call Update_Lib.bat + true true - - true - true - - - true - true - diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index fea5f2ad2..6b2d87ae9 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -307,6 +307,9 @@ {5e5c6c23-470f-4e7a-93e0-303e5171f4fd} + + {fd18d84d-d656-4dbd-9859-436191a27b91} + @@ -522,12 +525,6 @@ 02.Element\02.Component\07.RigidBody - - 02.Element\02.Component\08.Character_Controller\CallBack - - - 02.Element\02.Component\08.Character_Controller\CallBack - 02.Element\02.Component\10.FSM @@ -588,6 +585,12 @@ 02.Element\01.GameObject\51.Quest + + 01.Utility\01.Renderer\RenderEventDebugger + + + 02.Element\02.Component\08.Character_Controller\CallBack + @@ -1166,12 +1169,6 @@ 02.Element\02.Component\07.RigidBody\10.Dynamic - - 02.Element\02.Component\08.Character_Controller\CallBack - - - 02.Element\02.Component\08.Character_Controller\CallBack - 02.Element\02.Component\10.FSM @@ -1235,6 +1232,12 @@ 02.Element\01.GameObject\51.Quest + + 01.Utility\01.Renderer\RenderEventDebugger + + + 02.Element\02.Component\08.Character_Controller\CallBack + diff --git a/Jusin154_Team3D/Engine/Private/CallBack_QueryFilterCallback.cpp b/Jusin154_Team3D/Engine/Private/CallBack_QueryFilterCallback.cpp new file mode 100644 index 000000000..7791d8193 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/CallBack_QueryFilterCallback.cpp @@ -0,0 +1,2 @@ +#include "pch.h" +#include "CallBack_QueryFilterCallback.h" diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp index 674a256fe..891419287 100644 --- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp +++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp @@ -2,6 +2,8 @@ #include "Character_Controller.h" #include "GameInstance.h" +CPhysX_CctQueryFilterCallback CCharacter_Controller::s_QueryFilterCallback_IGNORE_Shield = {}; + CCharacter_Controller::CCharacter_Controller(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CComponent{ pDevice, pContext } { @@ -248,6 +250,7 @@ void CCharacter_Controller::Move(_float fTimeDelta) PSX::PxVec3 pxVecMomentum = {}; // 순간 이동량 _float fMinimumDistant = FLT_EPSILON3; // 이동량 오차 허용치, ( 크면 클수록 이동이 더 일찍 끝난다, 순간 이동량보다 같거나 더 크면 안움직일듯? ) PSX::PxControllerFilters pxFilter = {}; // 충돌 대상 필터 + pxFilter.mFilterCallback = &s_QueryFilterCallback_IGNORE_Shield; // 쉴드 무시 const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다? if (true == m_bGravity) { if (0 >= m_iIsOnGround) { // 공중: 무조건 중력 diff --git a/Jusin154_Team3D/Engine/Private/ElementObject.cpp b/Jusin154_Team3D/Engine/Private/ElementObject.cpp index ae0cb26f6..92e573c9f 100644 --- a/Jusin154_Team3D/Engine/Private/ElementObject.cpp +++ b/Jusin154_Team3D/Engine/Private/ElementObject.cpp @@ -130,7 +130,7 @@ _float CElementObject::Get_Nine_Slice_Bottom() return m_vNine_Slice.w; } -void CElementObject::Start_Lerp(_float fTimeDelta) +_bool CElementObject::Start_Lerp(_float fTimeDelta) { _vector Pos = m_fCurrent_Position; @@ -146,7 +146,7 @@ void CElementObject::Start_Lerp(_float fTimeDelta) { m_fX = m_vLerp_Position.m128_f32[0]; m_fY = m_vLerp_Position.m128_f32[1]; - m_bLerpOn = false; + return true; } else @@ -154,6 +154,7 @@ void CElementObject::Start_Lerp(_float fTimeDelta) XMVECTOR DirNorm = XMVector3Normalize(Dir); m_fX = (Pos + DirNorm * move).m128_f32[0]; m_fY = (Pos + DirNorm * move).m128_f32[1]; + return false; } } diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 1751480cb..99495c23e 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -860,13 +860,17 @@ HRESULT CGameInstance::Bind_RenderTarget(const _wstring& strTargetTag, CShader* return m_pRenderTarget_Manager->Bind_RenderTarget(strTargetTag, pShader, pConstantName); } -HRESULT CGameInstance::Copy_RenderTargetTo(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D) +HRESULT CGameInstance::Copy_RenderTargetTo(const _wstring& strSrcTag, ID3D11Texture2D* pDst2D) { - return m_pRenderTarget_Manager->Copy_RenderTargetTo(strTargetTag, pTexture2D); + return m_pRenderTarget_Manager->Copy_RenderTargetTo(strSrcTag, pDst2D); } -HRESULT CGameInstance::Copy_RenderTargetFrom(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D) +HRESULT CGameInstance::Copy_RenderTargetFrom(const _wstring& strDstTag, ID3D11Texture2D* pSrc2D) { - return m_pRenderTarget_Manager->Copy_RenderTargetFrom(strTargetTag, pTexture2D); + return m_pRenderTarget_Manager->Copy_RenderTargetFrom(strDstTag, pSrc2D); +} +HRESULT CGameInstance::Copy_RenderTargetAToB(const _wstring& strATag, const _wstring& strBTag) +{ + return m_pRenderTarget_Manager->Copy_RenderTargetAToB(strATag, strBTag); } HRESULT CGameInstance::Accumulate_RenderTarget(CVIBuffer_Rect* pVIBuffer, CShader* pShader, const _wstring& wstrRenderTarget_SrcA, const _wstring& wstrRenderTarget_SrcB, const _wstring& wstrRenderTarget_Target, SHADER_PASS_DEFERRED ePass) { @@ -884,6 +888,10 @@ HRESULT CGameInstance::Bind_CS_RenderTarget(_uint iIndex, const _wstring& strTar { return m_pRenderTarget_Manager->Bind_CS_RenderTarget(iIndex, strTargetTag); } +_float2 CGameInstance::Get_RenderTargetSize(const _wstring& wstrTargetKey) +{ + return m_pRenderTarget_Manager->Get_RenderTargetSize(wstrTargetKey); +} #ifdef _DEBUG void CGameInstance::RenderTarget_Debuger() { @@ -948,7 +956,7 @@ void CGameInstance::Add_ModelToMap(const _char* filePath, CModel* pModel) } #endif -void CGameInstance::Add_SaveModel(const _char* filePath, SaveModel sModel) +void CGameInstance::Add_SaveModel(const _char* filePath, SaveModel& sModel) { lock_guard lock(m_mtxLoadModelLock); m_sModelMap[filePath] = sModel; diff --git a/Jusin154_Team3D/Engine/Private/GameObject.cpp b/Jusin154_Team3D/Engine/Private/GameObject.cpp index be6790410..1066bd828 100644 --- a/Jusin154_Team3D/Engine/Private/GameObject.cpp +++ b/Jusin154_Team3D/Engine/Private/GameObject.cpp @@ -108,7 +108,8 @@ void CGameObject::Set_Shadow(pair<_bool, _ubyte> shadowResult) m_pGameInstance->Add_RenderGroup(RENDER::SHADOW_MIDDLE, this); } if (0 < (m_iShadow & (_ubyte)SHADOW::SHADOW_FAR)) { - m_pGameInstance->Add_RenderGroup(RENDER::SHADOW_FAR, this); + m_iShadow = 0; + assert(false); // 지금은 Shadow_Far 미사용 } } else { diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index 81f001606..d4db9762a 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -23,7 +23,7 @@ HRESULT CMesh::Bind_BoneMatrices(const vector& Bones, CShader* pSh for (size_t i = 0; i < m_iNumBones; ++i) { XMStoreFloat4x4(&m_pBoneMatrices[i], - /*XMLoadFloat4x4(&m_offsetMatrices[i]) **/ Bones[m_BoneIndices[i]]->Get_CombinedTransformationMatrix()); + XMLoadFloat4x4(&m_offsetMatrices[i]) * Bones[m_BoneIndices[i]]->Get_CombinedTransformationMatrix()); } if (0 == m_iNumBones) { @@ -645,6 +645,7 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(vector& Bones, const ai return S_OK; } + #endif CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix) diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 464eb7e84..c811d2423 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -159,6 +159,8 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) m_bIsFinishedAnim = pCurAnim->Update_TransformationMatrices(m_Bones, m_bIsLoop, fTimeDelta, true, m_iBoneMask, m_vector,m_iRootBoneIndex); + pCurAnim->InterpAnim(pPreAnim, m_Bones, m_fRatio); + if (m_fRatio >= 1.f) { m_iPreAnimIndex = m_iCurrentAnimIndex; @@ -172,7 +174,6 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) m_iPreAnimIndex = m_iCurrentAnimIndex; } - if (m_bIsFinishedAnim) { if (m_bIsLoop) @@ -184,14 +185,10 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) XMStoreFloat3(&m_vPrevRootPos, m_vector[2]); } } - + ComputeAnimation(m_iCurrentAnimIndex, 0); - if (m_bIsFinishedAnim) - { - m_vPrevRootRot = { 0.f,0.f,0.f,0.f }; - m_bInitialRootRotSaved = false; - } + if (m_bRatio) { Update_RootBone(m_fAmount * m_fRatio); @@ -513,11 +510,6 @@ void CModel::Initialize_RootBone() } } -void CModel::BeginFrame() -{ - fill(m_CPUBoneMask.begin(), m_CPUBoneMask.end(), false); -} - vector<_float4x4> CModel::Get_OffsetMatrix(_int iIndex) { return m_Meshes[iIndex]->Get_OffsetMatrix(); @@ -542,52 +534,6 @@ void CModel::Mark_CPUChain(_int boneIdx) } } -//void CModel::Create_BoneStagingBuffer() -//{ -// D3D11_BUFFER_DESC desc{}; -// desc.Usage = D3D11_USAGE_STAGING; -// desc.ByteWidth = sizeof(BONE_DESC) * (_uint)m_Bones.size(); -// desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; -// desc.BindFlags = 0; -// desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; -// desc.StructureByteStride = sizeof(BONE_DESC); -// -// HRESULT hr = m_pDevice->CreateBuffer(&desc, nullptr, &m_pBoneStagingBuffer); -//} - -//const _float4x4 CModel::Get_BoneMatrix_GPU(_uint boneIndex) -//{ -// -// m_pContext->CopyResource(m_pBoneStagingBuffer, m_pBoneMatrixBuffer); -// -// D3D11_MAPPED_SUBRESOURCE mapped{}; -// m_pContext->Map( -// m_pBoneStagingBuffer, -// 0, -// D3D11_MAP_READ, -// 0, -// &mapped -// ); -// -// BONE_DESC*pBone = static_cast(mapped.pData); -// -// m_pContext->Unmap(m_pBoneStagingBuffer, 0); -// -// return pBone->Combined; -//} - -//const _float4x4* CModel::Get_BoneMatrixPtr_Socket(const _char* name) -//{ -// _int idx = Find_BoneIndex(name); -// if (idx < 0) -// return nullptr; -// -// _float4x4 mat = Get_BoneMatrix_GPU(idx); -// m_SocketCache[name] = mat; -// -// return &m_SocketCache[name]; -//} - const _float4x4* CModel::Get_BoneMatrixPtr(const _char* pBoneName) { @@ -2112,9 +2058,7 @@ _bool CModel::LoadData(const _char* filename) fclose(fp); - m_SaveModel.push_back(NewModel); - - m_pGameInstance->Add_SaveModel(filename, m_SaveModel.back()); + m_pGameInstance->Add_SaveModel(filename, NewModel); return true; } @@ -2256,7 +2200,6 @@ HRESULT CModel::Initialize(void* pArg) Create_BoneLocalVB(); Create_ParentSrv(); Create_BoneLocalSrv(); - //Create_BoneStagingBuffer(); if (FAILED(Create_ComputeShaderLocal())) return E_FAIL; @@ -2403,8 +2346,6 @@ void CModel::Free() SAFE_RELEASE(m_pTransform); - m_SaveModel.clear(); - m_Parent.clear(); m_AnimRanges.clear(); diff --git a/Jusin154_Team3D/Engine/Private/PipeLine.cpp b/Jusin154_Team3D/Engine/Private/PipeLine.cpp index ba495a997..9647912da 100644 --- a/Jusin154_Team3D/Engine/Private/PipeLine.cpp +++ b/Jusin154_Team3D/Engine/Private/PipeLine.cpp @@ -312,7 +312,27 @@ void CPipeLine::Make_LightBoxes() fMinZ += m_vShadowBoxMarginMin.z; fMaxZ += m_vShadowBoxMarginMax.z; - Adjust_ShadowTexcel(fMinX, fMinY, fMaxX, fMaxY, g_iMaxShadowWidth, g_iMaxShadowHeight); + _uint iShadowWidth = { 0 }; + _uint iShadowHeight = { 0 }; + switch (iIndex) + { + case 0: + iShadowWidth = g_iNearShadowWidth; + iShadowHeight = g_iNearShadowHeight; + break; + case 1: + iShadowWidth = g_iMiddleShadowWidth; + iShadowHeight = g_iMiddleShadowHeight; + break; + case 2: + iShadowWidth = g_iFarShadowWidth; + iShadowHeight = g_iFarShadowHeight; + break; + default: + break; + } + + Adjust_ShadowTexcel(fMinX, fMinY, fMaxX, fMaxY, iShadowWidth, iShadowHeight); targetPlanes[0] = _float4(-1.f, 0.f, 0.f, fMinX); // Left targetPlanes[1] = _float4(1.f, 0.f, 0.f, -fMaxX); // Right @@ -386,7 +406,7 @@ void CPipeLine::Update_ShadowDepthNdcZ() } } -// Out으로 _float4를 새롭게 메모리로 받고 다시 밖에서 할당할 바에 레퍼런스로 쓰는게 더 나은듯 +// Out으로 _float4를 새롭게 메모리로 받고 다시 밖에서 할당할 바에 레퍼런스로 쓰는게 더 나을지도? // 카메라 미세 흔들림으로 인한 그림자 튐 보정 void CPipeLine::Adjust_ShadowTexcel(_float& fMinX, _float& fMinY, _float& fMaxX, _float& fMaxY, _uint iShadowWidth, _uint iShadowHeight) { diff --git a/Jusin154_Team3D/Engine/Private/RenderEventDebugger.cpp b/Jusin154_Team3D/Engine/Private/RenderEventDebugger.cpp new file mode 100644 index 000000000..750362586 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/RenderEventDebugger.cpp @@ -0,0 +1,2 @@ +#include "pch.h" +#include "RenderEventDebugger.h" diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget.cpp index 499034c9e..39aeceb80 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget.cpp @@ -12,11 +12,12 @@ CRenderTarget::CRenderTarget(ID3D11Device* pDevice, ID3D11DeviceContext* pContex SAFE_ADDREF(m_pContext); } - HRESULT CRenderTarget::Initialize(_uint iSizeX, _uint iSizeY, DXGI_FORMAT ePixelFormat, const _float4& vClearColor) { D3D11_TEXTURE2D_DESC TextureDesc{}; + m_vTargetSize.x = (_float)iSizeX; + m_vTargetSize.y = (_float)iSizeY; TextureDesc.Width = iSizeX; TextureDesc.Height = iSizeY; TextureDesc.MipLevels = 1; @@ -63,7 +64,6 @@ HRESULT CRenderTarget::Bind_ShaderResource(CShader* pShader, const _char* pConst return S_OK; } - void CRenderTarget::Clear() { m_pContext->ClearRenderTargetView(m_pRTV, reinterpret_cast<_float*>(&m_vClearColor)); @@ -73,10 +73,19 @@ void CRenderTarget::Copy_ResourceTo(ID3D11Texture2D* pTexture2D) { m_pContext->CopyResource(pTexture2D, m_pTexture2D); } +void CRenderTarget::Copy_ResourceTo(const CRenderTarget& Target) +{ + m_pContext->CopyResource(Target.m_pTexture2D, m_pTexture2D); +} + void CRenderTarget::Copy_ResourceFrom(ID3D11Texture2D* pTexture2D) { m_pContext->CopyResource(m_pTexture2D, pTexture2D); } +void CRenderTarget::Copy_ResourceFrom(const CRenderTarget& Target) +{ + m_pContext->CopyResource(m_pTexture2D, Target.m_pTexture2D); +} void CRenderTarget::Get_TextureDesc(D3D11_TEXTURE2D_DESC& Desc) { m_pTexture2D->GetDesc(&Desc); diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp index 0c63df85f..cdbec8ce2 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp @@ -175,26 +175,42 @@ HRESULT CRenderTarget_Manager::Begin_MRT_NO_DepthStencil(const _wstring& strMRTT return S_OK; } -HRESULT CRenderTarget_Manager::Copy_RenderTargetTo(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D) +HRESULT CRenderTarget_Manager::Copy_RenderTargetTo(const _wstring& strSrcTag, ID3D11Texture2D* pDst2D) { - CRenderTarget* pRenderTarget = Find_RenderTarget(strTargetTag); + CRenderTarget* pRenderTarget = Find_RenderTarget(strSrcTag); if (nullptr == pRenderTarget) { return E_FAIL; } - pRenderTarget->Copy_ResourceTo(pTexture2D); + pRenderTarget->Copy_ResourceTo(pDst2D); return S_OK; } -HRESULT CRenderTarget_Manager::Copy_RenderTargetFrom(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D) +HRESULT CRenderTarget_Manager::Copy_RenderTargetFrom(const _wstring& strDstTag, ID3D11Texture2D* pSrc2D) { - CRenderTarget* pRenderTarget = Find_RenderTarget(strTargetTag); + CRenderTarget* pRenderTarget = Find_RenderTarget(strDstTag); if (nullptr == pRenderTarget) { return E_FAIL; } - pRenderTarget->Copy_ResourceFrom(pTexture2D); + pRenderTarget->Copy_ResourceFrom(pSrc2D); + + return S_OK; +} + +HRESULT CRenderTarget_Manager::Copy_RenderTargetAToB(const _wstring& strATag, const _wstring& strBTag) +{ + CRenderTarget* pTargetA = Find_RenderTarget(strATag); + if (nullptr == pTargetA) { + return E_FAIL; + } + CRenderTarget* pTargetB = Find_RenderTarget(strBTag); + if (nullptr == pTargetB) { + return E_FAIL; + } + + pTargetA->Copy_ResourceTo(*pTargetB); return S_OK; } @@ -344,6 +360,11 @@ HRESULT CRenderTarget_Manager::Refit_RenderTarget(CVIBuffer_Rect* pVIBuffer, CSh assert(false); } + vResolution = { vp.Width, vp.Height }; + if (FAILED(pShader->Bind_RawValue("g_vSrcResolution", &vResolution, sizeof(_float2)))) { + assert(false); + } + pOutput->Clear(); { // Bind RTVs @@ -370,6 +391,12 @@ HRESULT CRenderTarget_Manager::Refit_RenderTarget(CVIBuffer_Rect* pVIBuffer, CSh case Engine::SHADER_PASS_DEFERRED::DOWNSAMPLE: pConstantName = "g_DiffuseTexture"; break; + case Engine::SHADER_PASS_DEFERRED::MOTIONBLURTENT: + pConstantName = "g_VelocityTexture"; + break; + case Engine::SHADER_PASS_DEFERRED::MOTIONBLURTILE: + pConstantName = "g_VelocityTexture"; + break; case Engine::SHADER_PASS_DEFERRED::BLOOM_BLURY: pConstantName = "g_BlurXTexture"; break; @@ -469,6 +496,16 @@ HRESULT CRenderTarget_Manager::Finish_RenderTarget(CVIBuffer_Rect* pVIBuffer, CS return S_OK; } +_float2 CRenderTarget_Manager::Get_RenderTargetSize(const _wstring& wstrTargetKey) +{ + CRenderTarget* pRenderTarget = Find_RenderTarget(wstrTargetKey); + if (nullptr == pRenderTarget) { + return _float2(); + } + + return pRenderTarget->Get_TargetSize(); +} + HRESULT CRenderTarget_Manager::End_MRT() { ID3D11RenderTargetView* pRenderTargets[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = { m_pBackBufferRTV }; diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index ff2bc6d32..cccd59741 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -6,11 +6,7 @@ void CRenderer::Render() { - _uint iNumViewPort = { 1 }; - D3D11_VIEWPORT vp = {}; - m_pContext->RSGetViewports(&iNumViewPort, &vp); - _float2 vResolution = { vp.Width, vp.Height }; - + Bind_RawValue(); Render_Priority(); Render_Shadow(); Render_NonBlend(); @@ -130,6 +126,29 @@ HRESULT CRenderer::Bind_PrevMatrix(class CShader* pShader, const _char* pConstan return S_OK; } +void CRenderer::Bind_RawValue() +{ + _uint iNumViewPort = { 1 }; + D3D11_VIEWPORT vp = {}; + m_pContext->RSGetViewports(&iNumViewPort, &vp); + _float2 vResolution = { vp.Width, vp.Height }; + if (FAILED(m_pShader->Bind_RawValue("g_vResolution", &vResolution, sizeof(_float2)))) { + assert(false); + } + if (FAILED(m_pShader->Bind_RawValue("g_vNearShadowResolution", &m_vNearShadowResoltion, sizeof(_float2)))) { + return; + } + if (FAILED(m_pShader->Bind_RawValue("g_vMiddleShadowResolution", &m_vMiddleShadowResoltion, sizeof(_float2)))) { + return; + } + if (FAILED(m_pShader->Bind_RawValue("g_vFarShadowResolution", &m_vFarShadowResoltion, sizeof(_float2)))) { + return; + } + if (FAILED(m_pShader->Bind_RawValue("g_vPreShadowResolution", &m_vPreShadowResoltion, sizeof(_float2)))) { + return; + } +} + void CRenderer::Render_Occlusion() { COMPUTE_TIMEDELTA("Timer_Render_Occlusion"); @@ -163,6 +182,7 @@ void CRenderer::Render_Occlusion() void CRenderer::Render_Priority() { COMPUTE_TIMEDELTA("Timer_Render_Priority"); + EVENTSCOPE_("Render_Priority"); for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::PRIORITY)]) { if (nullptr != pRenderObject) { @@ -181,6 +201,7 @@ void CRenderer::Render_Priority() void CRenderer::Render_Shadow() { COMPUTE_TIMEDELTA("Timer_Render_Shadow"); + EVENTSCOPE_("Render_Shadow"); D3D11_VIEWPORT ViewPortOldDesc; _uint iNumViewOldPort = { 1 }; ZeroMemory(&ViewPortOldDesc, sizeof(D3D11_VIEWPORT)); @@ -207,8 +228,8 @@ void CRenderer::Render_Shadow() { ViewPortDesc.TopLeftX = 0; ViewPortDesc.TopLeftY = 0; - ViewPortDesc.Width = (_float)(g_iMaxShadowWidth); - ViewPortDesc.Height = (_float)(g_iMaxShadowHeight); + ViewPortDesc.Width = (_float)(m_vNearShadowResoltion.x); + ViewPortDesc.Height = (_float)(m_vNearShadowResoltion.y); ViewPortDesc.MinDepth = 0.f; ViewPortDesc.MaxDepth = 1.f; } @@ -240,8 +261,8 @@ void CRenderer::Render_Shadow() { ViewPortDesc.TopLeftX = 0; ViewPortDesc.TopLeftY = 0; - ViewPortDesc.Width = (_float)(g_iMaxShadowWidth); - ViewPortDesc.Height = (_float)(g_iMaxShadowHeight); + ViewPortDesc.Width = (_float)(m_vMiddleShadowResoltion.x); + ViewPortDesc.Height = (_float)(m_vMiddleShadowResoltion.y); ViewPortDesc.MinDepth = 0.f; ViewPortDesc.MaxDepth = 1.f; } @@ -263,48 +284,15 @@ void CRenderer::Render_Shadow() return; } } - { // MRT_Shadow_Far - if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Shadow_Far"), m_pShadowDSV_FAR))) { - return; - } - - D3D11_VIEWPORT ViewPortDesc; - ZeroMemory(&ViewPortDesc, sizeof(D3D11_VIEWPORT)); - { - ViewPortDesc.TopLeftX = 0; - ViewPortDesc.TopLeftY = 0; - ViewPortDesc.Width = (_float)(g_iMaxShadowWidth); - ViewPortDesc.Height = (_float)(g_iMaxShadowHeight); - ViewPortDesc.MinDepth = 0.f; - ViewPortDesc.MaxDepth = 1.f; - } - m_pContext->RSSetViewports(1, &ViewPortDesc); - - for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::SHADOW_FAR)]) { - if (nullptr != pRenderObject) { - if (FAILED(pRenderObject->Render_Shadow(SHADOW::SHADOW_FAR))) { - assert(false); - } - } - - SAFE_RELEASE(pRenderObject); - } - - m_RenderObjects[ENUM_CLASS(RENDER::SHADOW_FAR)].clear(); - - if (FAILED(m_pGameInstance->End_MRT())) { - return; - } - } m_pContext->RSSetViewports(iNumViewOldPort, &ViewPortOldDesc); - COMPUTE_TIMEDELTA("Timer_Render_Shadow"); } void CRenderer::Render_NonBlend() { COMPUTE_TIMEDELTA("Timer_Render_NonBlend"); + EVENTSCOPE_("Render_NonBlend"); if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_GameObjects")))) { return; } @@ -330,6 +318,7 @@ void CRenderer::Render_NonBlend() void CRenderer::Render_LightAcc() { COMPUTE_TIMEDELTA("Timer_Render_LightAcc"); + EVENTSCOPE_("Render_LightAcc"); if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_LightAcc")))) { return; } @@ -373,6 +362,7 @@ void CRenderer::Render_LightAcc() void CRenderer::Render_Combined() { COMPUTE_TIMEDELTA("Timer_Render_Combined"); + EVENTSCOPE_("Render_Combined"); if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Combined")))) { return; } @@ -384,13 +374,7 @@ void CRenderer::Render_Combined() m_pShader->Bind_Matrix("g_ProjMatrix", &m_ScreenProjMatrix); m_pShader->Bind_Matrix("g_invMatView", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW_INV)); m_pShader->Bind_Matrix("g_invmatProj", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ_INV)); - - if (FAILED(m_pShader->Bind_RawValue("g_iMaxShadowWidth", &g_iMaxShadowWidth, sizeof(_uint)))) { - return; - } - if (FAILED(m_pShader->Bind_RawValue("g_iMaxShadowHeight", &g_iMaxShadowHeight, sizeof(_uint)))) { - return; - } + if (FAILED(m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return; } @@ -441,9 +425,6 @@ void CRenderer::Render_Combined() if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Shadow_Middle"), m_pShader, "g_ShadowMiddleTexture"))) { return; } - if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Shadow_Far"), m_pShader, "g_ShadowFarTexture"))) { - return; - } if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_PreShadow"), m_pShader, "g_PreShadowTexture"))) { return; } @@ -469,6 +450,7 @@ void CRenderer::Render_Combined() void CRenderer::Render_EnvironmentPostProcess() { COMPUTE_TIMEDELTA("Timer_Render_EnvironmentPostProcess"); + EVENTSCOPE_("Render_EnvironmentPostProcess"); if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_ENV_Blur_X")))) { // Target_ENV_Blur_X return; } @@ -539,6 +521,7 @@ void CRenderer::Render_EnvironmentPostProcess() void CRenderer::Render_Fog() { COMPUTE_TIMEDELTA("Timer_Render_Fog"); + EVENTSCOPE_("Render_Fog"); m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)); if (FAILED(m_pGameInstance->Bind_FogValue(m_pShader))) { // 여기서 포그에서 쓰는 상수들 바인딩 해줌 @@ -563,6 +546,7 @@ void CRenderer::Render_Fog() void CRenderer::Render_Effect() { COMPUTE_TIMEDELTA("Timer_Render_Effect"); + EVENTSCOPE_("Render_Effect"); if (FAILED(m_pGameInstance->Begin_MRT_NO_DepthStencil(TEXT("MRT_WB")))) { return; @@ -587,6 +571,7 @@ void CRenderer::Render_Effect() void CRenderer::Render_WeightBlend() { COMPUTE_TIMEDELTA("Timer_Render_WeightBlend"); + EVENTSCOPE_("Render_WeightBlend"); // Bind_Resorces m_pWeightBlendShader->Bind_Matrix("g_WorldMatrix", &m_ScreenWorldMatrix); @@ -612,6 +597,7 @@ void CRenderer::Render_WeightBlend() void CRenderer::Render_NonLight() { COMPUTE_TIMEDELTA("Timer_Render_NonLight"); + EVENTSCOPE_("Render_NonLight"); for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::NONLIGHT)]) { if (nullptr != pRenderObject) @@ -627,6 +613,7 @@ void CRenderer::Render_NonLight() void CRenderer::Render_Blur() { COMPUTE_TIMEDELTA("Timer_Render_Blur"); + EVENTSCOPE_("Render_Blur"); if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Blur")))) { return; } @@ -678,6 +665,7 @@ void CRenderer::Render_Blur() void CRenderer::Render_SSAO() { COMPUTE_TIMEDELTA("Timer_Render_SSAO"); + EVENTSCOPE_("Render_SSAO"); _uint iKernelSize = SSAO_SAMPLE_NUMBER; if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_SSAO_OCCLUSION")))) { @@ -772,6 +760,7 @@ void CRenderer::Render_SSAO() void CRenderer::Render_SSAO_BLUR() { COMPUTE_TIMEDELTA("Timer_Render_SSAO_BLUR"); + EVENTSCOPE_("Render_SSAO_BLUR"); if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_SSAO_BLUR")))) { return; } @@ -800,6 +789,7 @@ void CRenderer::Render_SSAO_BLUR() void CRenderer::Render_Blend() { COMPUTE_TIMEDELTA("Timer_Render_Blend"); + EVENTSCOPE_("Render_Blend"); m_RenderObjects[ENUM_CLASS(RENDER::BLEND)].sort([](CGameObject* pSour, CGameObject* pDest)->_bool { return pSour->Get_Depth() > pDest->Get_Depth(); }); @@ -824,45 +814,88 @@ void CRenderer::Render_PostProcessing() { /* POSTPROCESSING */ COMPUTE_TIMEDELTA("Timer_Render_PostProcessing"); - //{ - // ID3D11Texture2D* pBackBuffer = { nullptr }; - // m_pGameInstance->Get_BackBufferPTR(&pBackBuffer); - // if (FAILED(m_pGameInstance->Copy_RenderTargetTo(TEXT("Target_AfterBlend"), pBackBuffer))) { - // assert(false); - // } - // m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_AfterBlend"), TEXT("Target_AfterBlend2x2"), SHADER_PASS_DEFERRED::DOWNSAMPLE); - //} - ///* MotionBlur */ - // - //{ // Bind_Resorces - // m_pShader->Bind_Matrix("g_WorldMatrix", &m_ScreenWorldMatrix); - // m_pShader->Bind_Matrix("g_ViewMatrix", &m_ScreenViewMatrix); - // m_pShader->Bind_Matrix("g_ProjMatrix", &m_ScreenProjMatrix); - // m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)); - // m_pShader->Bind_RawValue("g_fMBBlurRadius", &m_fMBBlurRadius, sizeof(_float)); - // m_pShader->Bind_RawValue("g_iMBSampleCount", &m_iMBSampleCount, sizeof(_int)); - // m_pShader->Bind_RawValue("g_iMBType", &m_iMBType, sizeof(_int)); - //} - //{ - // // Bind_Targets - // if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_AfterBlend2x2"), m_pShader, "g_ColorTexture"))) { - // assert(false); - // return; - // } - // if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Depth"), m_pShader, "g_DepthTexture"))) { - // assert(false); - // return; - // } - // if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_VelocityMap"), m_pShader, "g_VelocityTexture"))) { - // assert(false); - // return; - // } - //} - //m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::MOTIONBLUR)); - - //m_pVIBuffer->Bind_Resources(); - //m_pVIBuffer->Render(); + EVENTSCOPE_("Render_PostProcessing"); + { + ID3D11Texture2D* pBackBuffer = { nullptr }; + m_pGameInstance->Get_BackBufferPTR(&pBackBuffer); + if (FAILED(m_pGameInstance->Copy_RenderTargetFrom(TEXT("Target_AfterBlend"), pBackBuffer))) { + assert(false); + } + SAFE_RELEASE(pBackBuffer); + if (FAILED(m_pShader->Bind_RawValue("g_iMBTileSize", &m_iMBTileSize, sizeof(_int)))) { + assert(false); return; + } + m_pGameInstance->Copy_RenderTargetAToB(TEXT("Target_AfterBlend"), TEXT("Target_MotionBlur")); + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_VelocityMap"), TEXT("Target_VelocityTile"), SHADER_PASS_DEFERRED::MOTIONBLURTILE); + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_VelocityTile"), TEXT("Target_VelocityTent"), SHADER_PASS_DEFERRED::MOTIONBLURTENT); + } + /* MotionBlur */ + if (false == m_bMB) { + if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_MotionBlur")))) { + assert(false); return; + } + } + { // Bind_Resorces + if (FAILED(m_pShader->Bind_Matrix("g_WorldMatrix", &m_ScreenWorldMatrix))) { + assert(false); return; + } + if (FAILED(m_pShader->Bind_Matrix("g_ViewMatrix", &m_ScreenViewMatrix))) { + assert(false); return; + } + if (FAILED(m_pShader->Bind_Matrix("g_ProjMatrix", &m_ScreenProjMatrix))) { + assert(false); return; + } + if (FAILED(m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + assert(false); return; + } + if (FAILED(m_pShader->Bind_RawValue("g_fMBBlurRadius", &m_fMBBlurRadius, sizeof(_float)))) { + assert(false); return; + } + if (FAILED(m_pShader->Bind_RawValue("g_fMBSampleBias", &m_fMBSampleBias, sizeof(_float)))) { + assert(false); return; + } + if (FAILED(m_pShader->Bind_RawValue("g_iMBSampleCount", &m_iMBSampleCount, sizeof(_int)))) { + assert(false); return; + } + if (FAILED(m_pShader->Bind_RawValue("g_iMBMaxSampleCount", &m_iMBMaxSampleCount, sizeof(_int)))) { + assert(false); return; + } + if (FAILED(m_pShader->Bind_RawValue("g_iMBType", &m_iMBType, sizeof(_int)))) { + assert(false); return; + } + } + { + // Bind_Targets + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_AfterBlend"), m_pShader, "g_DiffuseTexture"))) { + assert(false); + return; + } + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_AfterBlend"), m_pShader, "g_ColorTexture"))) { + assert(false); + return; + } + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Depth"), m_pShader, "g_DepthTexture"))) { + assert(false); + return; + } + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_VelocityMap"), m_pShader, "g_VelocityTexture"))) { + assert(false); + return; + } + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_VelocityTent"), m_pShader, "g_TileVelocityTexture"))) { + assert(false); + return; + } + } + m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::MOTIONBLUR)); + m_pVIBuffer->Bind_Resources(); + m_pVIBuffer->Render(); + if (false == m_bMB) { + if (FAILED(m_pGameInstance->End_MRT())) { + return; + } + } if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Bloom")))) { return; } @@ -928,6 +961,7 @@ void CRenderer::Render_PostProcessing() void CRenderer::Render_Distortion() { COMPUTE_TIMEDELTA("Timer_Render_Distortion"); + EVENTSCOPE_("Render_Distortion"); if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Distortion")))) { return; @@ -953,6 +987,7 @@ void CRenderer::Render_Distortion() void CRenderer::Render_DistortionAcc() { COMPUTE_TIMEDELTA("Timer_Render_DistortionAcc"); + EVENTSCOPE_("Render_DistortionAcc"); // Bind_Resorces ID3D11Texture2D* pBackBufferTexture2D = { nullptr }; @@ -988,6 +1023,7 @@ void CRenderer::Render_DistortionAcc() void CRenderer::Render_UI() { COMPUTE_TIMEDELTA("Timer_Render_UI"); + EVENTSCOPE_("Render_UI"); m_RenderObjects[ENUM_CLASS(RENDER::UI)].sort([](CGameObject* pDest, CGameObject* pSrc)->_bool { _float3 vDstPos = {}; _float3 vSrcPos = {}; @@ -1016,6 +1052,7 @@ void CRenderer::Render_UI() void CRenderer::Render_UI_Overley() { COMPUTE_TIMEDELTA("Timer_Render_UI_Overley"); + EVENTSCOPE_("Render_UI_Overley"); for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::UI_OVERLAY)]) { if (nullptr != pRenderObject) { @@ -1034,6 +1071,7 @@ void CRenderer::Render_UI_Overley() void CRenderer::Render_LastColor() { COMPUTE_TIMEDELTA("Timer_Render_LastColor"); + EVENTSCOPE_("Render_LastColor"); // Bind_Resorces m_pLastColorShader->Bind_Matrix("g_WorldMatrix", &m_ScreenWorldMatrix); @@ -1054,6 +1092,7 @@ void CRenderer::Render_LastColor() void CRenderer::Render_Tone_Mapping() { COMPUTE_TIMEDELTA("Timer_Render_Tone_Mapping"); + EVENTSCOPE_("Render_Tone_Mapping"); { // BackBuffer ID3D11Texture2D* pBackBuffer = nullptr; m_pGameInstance->Get_BackBufferPTR(&pBackBuffer); @@ -1090,6 +1129,7 @@ void CRenderer::Render_Tone_Mapping() void CRenderer::Render_Debug() { + EVENTSCOPE_("Render_Debug"); for (auto& pDebugCom : m_DebugComponents) { if (nullptr != pDebugCom) { @@ -1111,7 +1151,7 @@ void CRenderer::Render_Debug() return; } - /* 렌더타겟을 디버그로 직교투영을 통해 그려라. */ + /* 렌더타겟을 디버그로 직교투영 */ if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(m_pShader, m_pVIBuffer))) { return; } diff --git a/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp b/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp index 7e242f96a..18e6a7ed9 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp @@ -37,15 +37,15 @@ HRESULT CRenderer::Add_DebugComponent(CComponent* pDebugCom) } #endif -HRESULT CRenderer::Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY) +HRESULT CRenderer::Ready_ShadowDepthStencilView(_float2 vSize, ID3D11DepthStencilView** pDSV) { ID3D11Texture2D* pShadowDepthStencilTexture = nullptr; D3D11_TEXTURE2D_DESC TextureDesc; ZeroMemory(&TextureDesc, sizeof(D3D11_TEXTURE2D_DESC)); - TextureDesc.Width = iSizeX; - TextureDesc.Height = iSizeY; + TextureDesc.Width = (_uint)vSize.x; + TextureDesc.Height = (_uint)vSize.y; TextureDesc.MipLevels = 1; TextureDesc.ArraySize = 1; TextureDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; @@ -62,18 +62,7 @@ HRESULT CRenderer::Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY) return E_FAIL; } - if (FAILED(m_pDevice->CreateDepthStencilView(pShadowDepthStencilTexture, nullptr, &m_pShadowDSV_NEAR))) { - return E_FAIL; - } - - if (FAILED(m_pDevice->CreateDepthStencilView(pShadowDepthStencilTexture, nullptr, &m_pShadowDSV_MIDDLE))) { - return E_FAIL; - } - - if (FAILED(m_pDevice->CreateDepthStencilView(pShadowDepthStencilTexture, nullptr, &m_pShadowDSV_FAR))) { - return E_FAIL; - } - if (FAILED(m_pDevice->CreateDepthStencilView(pShadowDepthStencilTexture, nullptr, &m_pPreShadowDSV))) { + if (FAILED(m_pDevice->CreateDepthStencilView(pShadowDepthStencilTexture, nullptr, pDSV))) { return E_FAIL; } @@ -148,6 +137,11 @@ void CRenderer::Fill_Geometry(_uint iNumSample) } HRESULT CRenderer::Initialize() { +#ifdef _DEBUG + m_AnnotationHelper.Initialize(m_pContext); +#endif // _DEBUG + + _uint iNumViewports = { 1 }; D3D11_VIEWPORT Viewport{}; @@ -194,22 +188,17 @@ HRESULT CRenderer::Initialize() return E_FAIL; } /* Target_Shadow_Near */ - if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Shadow_Near"), (_uint)g_iMaxShadowWidth, (_uint)g_iMaxShadowHeight, + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Shadow_Near"), (_uint)m_vNearShadowResoltion.x, (_uint)m_vNearShadowResoltion.y, DXGI_FORMAT_R32_FLOAT, _float4(1.f, 1.f, 1.f, 1.f)))) { return E_FAIL; } /* Target_Shadow_Middle */ - if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Shadow_Middle"), (_uint)g_iMaxShadowWidth, (_uint)g_iMaxShadowHeight, - DXGI_FORMAT_R32_FLOAT, _float4(1.f, 1.f, 1.f, 1.f)))) { - return E_FAIL; - } - /* Target_Shadow_Far */ - if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Shadow_Far"), (_uint)g_iMaxShadowWidth, (_uint)g_iMaxShadowHeight, + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Shadow_Middle"), (_uint)m_vMiddleShadowResoltion.x, (_uint)m_vMiddleShadowResoltion.y, DXGI_FORMAT_R32_FLOAT, _float4(1.f, 1.f, 1.f, 1.f)))) { return E_FAIL; } /* Target_PreShadow */ - if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_PreShadow"), (_uint)g_iMaxShadowWidth, (_uint)g_iMaxShadowHeight, + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_PreShadow"), (_uint)m_vPreShadowResoltion.x, (_uint)m_vPreShadowResoltion.y, DXGI_FORMAT_R32_FLOAT, _float4(1.f, 1.f, 1.f, 1.f)))) { return E_FAIL; } @@ -269,14 +258,13 @@ HRESULT CRenderer::Initialize() /* Target_AfterBlend */ if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_AfterBlend"), (_uint)Viewport.Width, (_uint)Viewport.Height, - DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.0f, 0, 1.0f)))) { + DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_AfterBlend_2x2"), (_uint)(Viewport.Width * 0.5f), (_uint)(Viewport.Height * 0.5f), - DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.0f, 0, 1.0f)))) { + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_MotionBlur"), (_uint)Viewport.Width, (_uint)Viewport.Height, + DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) { return E_FAIL; } - /* Target_Color*/ if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Color"), (_uint)Viewport.Width, (_uint)Viewport.Height, DXGI_FORMAT_R32G32B32A32_FLOAT, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) { @@ -350,7 +338,15 @@ HRESULT CRenderer::Initialize() /* Target_VelocityMap */ if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_VelocityMap"), (_uint)Viewport.Width, (_uint)Viewport.Height, - DXGI_FORMAT_R32G32_FLOAT, _float4(0.0f, 0.f, 0.f, 0.f)))) { + DXGI_FORMAT_R32G32_FLOAT, _float4(0.5f, 0.5f, 0.f, 0.f)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_VelocityTile"), (_uint)(Viewport.Width / (_float)m_iMBTileSize), (_uint)(Viewport.Height / (_float)m_iMBTileSize), + DXGI_FORMAT_R32G32_FLOAT, _float4(0.5f, 0.5f, 0.f, 0.f)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_VelocityTent"), (_uint)(Viewport.Width / (_float)m_iMBTileSize), (_uint)(Viewport.Height / (_float)m_iMBTileSize), + DXGI_FORMAT_R32G32_FLOAT, _float4(0.5f, 0.5f, 0.f, 0.f)))) { return E_FAIL; } if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_BeforeNormal"), (_uint)Viewport.Width, (_uint)Viewport.Height, @@ -373,7 +369,19 @@ HRESULT CRenderer::Initialize() - if (FAILED(Ready_ShadowDepthStencilView(g_iMaxShadowWidth, g_iMaxShadowHeight))) { + if (FAILED(Ready_ShadowDepthStencilView(m_vNearShadowResoltion, &m_pShadowDSV_NEAR))) { + return E_FAIL; + } + + if (FAILED(Ready_ShadowDepthStencilView(m_vMiddleShadowResoltion, &m_pShadowDSV_MIDDLE))) { + return E_FAIL; + } + + if (FAILED(Ready_ShadowDepthStencilView(m_vFarShadowResoltion, &m_pShadowDSV_FAR))) { + return E_FAIL; + } + + if (FAILED(Ready_ShadowDepthStencilView(m_vPreShadowResoltion, &m_pPreShadowDSV))) { return E_FAIL; } @@ -431,10 +439,6 @@ HRESULT CRenderer::Initialize() if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Shadow_Middle"), TEXT("Target_Shadow_Middle")))) { return E_FAIL; } - /* MRT_Shadow_Far */ - if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Shadow_Far"), TEXT("Target_Shadow_Far")))) { - return E_FAIL; - } /* MRT_PreShadow */ if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_PreShadow"), TEXT("Target_PreShadow")))) { @@ -498,9 +502,10 @@ HRESULT CRenderer::Initialize() return E_FAIL; } - - - + /* MRT_MotionBlur */ + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_MotionBlur"), TEXT("Target_MotionBlur")))) { + return E_FAIL; + } } m_pShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, FX_DEFERRED, nullptr, nullptr); @@ -639,6 +644,12 @@ void CRenderer::Describe_Entitiy() GUI::SliderFloat("m_fExposure", &m_fExposure, 0.5f, 2.f, "%.3f"); GUI::EndChild(); } + if (GUI::CollapsingHeader("MotionBlurr")) { + GUI::Checkbox("m_bMB", &m_bMB); + GUI::SliderFloat("g_fMBSampleBias", &m_fMBSampleBias, -1.f, 1.f, "%.3f"); + GUI::SliderFloat("g_fMBBlurRadius", &m_fMBBlurRadius, 0.1f, (_float)m_iMBMaxSampleCount, "%.1f"); + GUI::SliderInt("g_iMBSampleCount", &m_iMBSampleCount, 0, m_iMBMaxSampleCount, "%d"); + } if (GUI::CollapsingHeader("End_Padding")) { } } diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index abfb41447..d88e3d418 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -304,7 +304,7 @@ void CUIObject::Nine_Slice_Left(_float X) void CUIObject::Nine_Slice_Right(_float Y) { - m_vNine_Slice.y =Y; + m_vNine_Slice.y = Y; } void CUIObject::Nine_Slice_Top(_float Z) @@ -367,8 +367,14 @@ void CUIObject::Lerp_PosY(_float PosY) m_fLerpY = PosY; } -void CUIObject::Start_Lerp(_float fTimeDelta) +_bool CUIObject::Start_Lerp(_float fTimeDelta) { + return false; +} + +_bool CUIObject::Start_Bezier(_float fTimeDelta) +{ + return _bool(); } void CUIObject::Reset_Pos(_float fTimeDelta) diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp index 9fcd697a4..5c6c197e2 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp @@ -336,6 +336,32 @@ _int CVIBuffer_UI_Instance::Set_Mouse_Hover(_float2 fMousePos) return hoveredIndex; } +void CVIBuffer_UI_Instance::Set_Hover(_int Index) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + if(Index == -1) + for (_uint i = 0; i < m_iNumInstance; i++) + pVertices[i].bHover = 0.f; + + for (_uint i = 0; i < m_iNumInstance; i++) + { + if (i == Index) + { + pVertices[i].bHover = 1.f; + } + else + { + pVertices[i].bHover = 0.f; + } + } + m_pContext->Unmap(m_pVBInstance, 0); +} + void CVIBuffer_UI_Instance::Set_Hover_Index(_uint iIndex) { D3D11_MAPPED_SUBRESOURCE SubResource{}; diff --git a/Jusin154_Team3D/Engine/Public/CallBack_QueryFilterCallback.h b/Jusin154_Team3D/Engine/Public/CallBack_QueryFilterCallback.h new file mode 100644 index 000000000..4cf8bdf97 --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/CallBack_QueryFilterCallback.h @@ -0,0 +1,29 @@ +#pragma once +#include "Engine_Define.h" + +class CPhysX_CctQueryFilterCallback final : public PSX::PxQueryFilterCallback +{ +public: + PSX::PxQueryHitType::Enum preFilter(const PSX::PxFilterData& controllerQueryFilterData, const PSX::PxShape* shape, + const PSX::PxRigidActor* actor, PSX::PxHitFlags& queryHitFlags) override + { + if (actor != nullptr && actor->userData != nullptr) + { + PhsXUserData* physxUserData = (PhsXUserData*)actor->userData; + + if (physxUserData->eKind == PHYSX_KIND::BODY_DYNAMIC) + { + if (PXOBJECT(physxUserData->iSubKind) == PXOBJECT::SKILL_PROTEGO) + return PSX::PxQueryHitType::eNONE; + } + } + + return PSX::PxQueryHitType::eBLOCK; // 기본은 막는 충돌 + } + + PSX::PxQueryHitType::Enum postFilter(const PSX::PxFilterData& controllerQueryFilterData, const PSX::PxQueryHit& hit, + const PSX::PxShape* shape, const PSX::PxRigidActor* actor) override + { + return PSX::PxQueryHitType::eBLOCK; + } +}; diff --git a/Jusin154_Team3D/Engine/Public/Character_Controller.h b/Jusin154_Team3D/Engine/Public/Character_Controller.h index ecae14333..9ffd5791a 100644 --- a/Jusin154_Team3D/Engine/Public/Character_Controller.h +++ b/Jusin154_Team3D/Engine/Public/Character_Controller.h @@ -1,5 +1,6 @@ #pragma once #include "Component.h" +#include "CallBack_QueryFilterCallback.h" NS_BEGIN(Engine) class CTransform; @@ -13,6 +14,7 @@ class ENGINE_DLL CCharacter_Controller final : /* dev-treadmill.tistory.com/159 */ // 기본적으로 아무 힘도 받지 않는, 주지 않는 놈임 // kinematic 기반임 + static CPhysX_CctQueryFilterCallback s_QueryFilterCallback_IGNORE_Shield; public: #pragma region STRUCT typedef struct tagCharacter_ControllerDesc @@ -86,7 +88,7 @@ class ENGINE_DLL CCharacter_Controller final : _int m_iIsOnGround = { 0 }; _float4 m_vAccHeight = { 0.f, 0.16f, 0.f, 0.01f }; PhsXUserData m_tagData = {}; - + PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {}; _bool m_bActive = { true }; _bool m_bGravity = { true }; diff --git a/Jusin154_Team3D/Engine/Public/ElementObject.h b/Jusin154_Team3D/Engine/Public/ElementObject.h index 8ace2e23b..90b5c68b5 100644 --- a/Jusin154_Team3D/Engine/Public/ElementObject.h +++ b/Jusin154_Team3D/Engine/Public/ElementObject.h @@ -30,7 +30,7 @@ class ENGINE_DLL CElementObject abstract : public CUIObject virtual _float Get_Nine_Slice_Top() override; virtual _float Get_Nine_Slice_Bottom() override; - virtual void Start_Lerp(_float fTimeDelta) override; + virtual _bool Start_Lerp(_float fTimeDelta) override; virtual void Reset_Pos(_float fTimeDelta)override; virtual void Start_Size_Lerp(_float fTimeDelta) override; virtual void Reset_Size_Lerp(_float fTimeDelta) override; @@ -41,6 +41,8 @@ class ENGINE_DLL CElementObject abstract : public CUIObject virtual HRESULT Initialize(void* pArg); virtual HRESULT Ready_Components(void* pArg) override; + _float m_fBezierTime = 0; + public: virtual void Free() override; }; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index 4ed420a88..7989b842c 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -5,7 +5,7 @@ NS_BEGIN(Engine) enum class STATE { RIGHT, UP, LOOK, POSITION, END }; enum class LIGHT { DIRECTIONAL, POINT, SPOT, END }; enum class COLLIDER { AABB, OBB, SPHERE, END }; -enum class RENDER {PRIORITY, SHADOW_NEAR, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, BLOOM, DISTORTION, UI, OCCLUSION, SHADOW_MIDDLE, SHADOW_FAR, PRESHADOW, UI_OVERLAY ,END }; +enum class RENDER {PRIORITY, SHADOW_NEAR, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, BLOOM, DISTORTION, UI, OCCLUSION, SHADOW_MIDDLE, PRESHADOW, UI_OVERLAY ,END }; enum class RAY { LOCAL, WORLD, END }; enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END }; enum class BLEND_BONE{SPINE,SHOULDER_L,SHOULDER_R,NECK,SHOULDER_NECK_L, SHOULDER_NECK_R,END}; @@ -48,7 +48,7 @@ enum class SHADER_PASS_CELL { DEBUG, END }; enum class SHADER_PASS_DEFERRED { DEBUG, DIRECTIONAL, POINT, COMBINED, BLUR, SPOT, UPSAMPLE, BLOOM_BLURX, BLOOM_BLURY, EMBOSSING, BLOOM_ACCUM, BLOOM_FINISH, BLURX_ENVIRONMENT, - POSTCOMBINED, FOG, TONE_MAPPING, SSAO_OCCLUSION, SSAO_BLUR, MOTIONBLUR, DOWNSAMPLE, + POSTCOMBINED, FOG, TONE_MAPPING, SSAO_OCCLUSION, SSAO_BLUR, MOTIONBLUR, DOWNSAMPLE, MOTIONBLURTILE, MOTIONBLURTENT, END }; enum class TEXTURE_MOUNT_SLOT0 { NOT_DEFINED, METALLIC, SPECULAR, HEIGHT, END }; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Macro.h b/Jusin154_Team3D/Engine/Public/Engine_Macro.h index 9833605c6..8a05494c6 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Macro.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Macro.h @@ -113,13 +113,20 @@ #define SSAO_SAMPLE_NUMBER 64 #define TIMER_SHORT_LERP 0.16f + +constexpr unsigned int g_iNearShadowWidth = 8192; +constexpr unsigned int g_iNearShadowHeight = 4096; + +constexpr unsigned int g_iMiddleShadowWidth = 4096; +constexpr unsigned int g_iMiddleShadowHeight = 2304; + +constexpr unsigned int g_iFarShadowWidth = 6144; +constexpr unsigned int g_iFarShadowHeight = 3072; + constexpr unsigned int g_iPreShadowWidth = 16384; constexpr unsigned int g_iPreShadowHeight = 9216; -constexpr unsigned int g_iMaxShadowWidth = 16384; -constexpr unsigned int g_iMaxShadowHeight = 9216; -//constexpr unsigned int g_iMaxShadowWidth = 4096; -//constexpr unsigned int g_iMaxShadowHeight = 2304; + #ifndef AI_TEXTURE_TYPE_MAX #define AI_TEXTURE_TYPE_MAX 27 diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 229297616..e9c8506c8 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -48,6 +48,10 @@ enum ESTATE : _u64Flag PULSE = 1ULL << 41, TUCKED = 1ULL << 42, ANCIENT_SPELL = 1ULL << 43, + FIRESWEEP = 1ULL << 44, + GROUND = 1ULL << 45, + SWIPE = 1ULL << 46, + SLIDE = 1ULL << 47, END }; NS_END diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 42783418a..d5e0349ce 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -173,12 +173,14 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag); HRESULT End_MRT(); HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName); - HRESULT Copy_RenderTargetTo(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D); - HRESULT Copy_RenderTargetFrom(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D); + HRESULT Copy_RenderTargetTo(const _wstring& strSrcTag, ID3D11Texture2D* pDst2D); + HRESULT Copy_RenderTargetFrom(const _wstring& strDstTag, ID3D11Texture2D* pSrc2D); + HRESULT Copy_RenderTargetAToB(const _wstring& strATag, const _wstring& strBTag); HRESULT Accumulate_RenderTarget(class CVIBuffer_Rect* pVIBuffer, class CShader* pShader, const _wstring& wstrRenderTarget_SrcA, const _wstring& wstrRenderTarget_SrcB, const _wstring& wstrRenderTarget_Target, SHADER_PASS_DEFERRED ePass); HRESULT Refit_RenderTarget(class CVIBuffer_Rect* pVIBuffer, class CShader* pShader, const _wstring& wstrRenderTargetInput, const _wstring& wstrRenderTargetOutput, SHADER_PASS_DEFERRED ePass); HRESULT Finish_RenderTarget(class CVIBuffer_Rect* pVIBuffer, class CShader* pShader, const _wstring& wstrRenderTargetOriginal, const _wstring& wstrRenderTargetBloomed, SHADER_PASS_DEFERRED ePass); HRESULT Bind_CS_RenderTarget(_uint iIndex, const _wstring& strTargetTag); + _float2 Get_RenderTargetSize(const _wstring& wstrTargetKey); #ifdef _DEBUG void RenderTarget_Debuger(); HRESULT Render_RenderTarget_Debug(class CShader* pShader, class CVIBuffer_Rect* pVIBuffer); @@ -265,7 +267,7 @@ class ENGINE_DLL CGameInstance final : public CBase public: void Add_ModelToMap(const _char* filePath, CModel* pModel); - void Add_SaveModel(const _char* filePath, SaveModel sModel); + void Add_SaveModel(const _char* filePath, SaveModel& sModel); SaveModel* Load_SaveModel(const _char* filePath); #ifdef EDITOR_PROJECT diff --git a/Jusin154_Team3D/Engine/Public/Mesh.h b/Jusin154_Team3D/Engine/Public/Mesh.h index 59e2a3193..9110f48d3 100644 --- a/Jusin154_Team3D/Engine/Public/Mesh.h +++ b/Jusin154_Team3D/Engine/Public/Mesh.h @@ -28,6 +28,8 @@ class ENGINE_DLL CMesh final : public CVIBuffer HRESULT Ready_VertexBuffer_For_NonAnim(const aiMesh* pAIMesh, _fmatrix PreTransformMatrix); HRESULT Ready_VertexBuffer_For_Anim(vector& Bones, const aiMesh* pAIMesh); + void BuildGlobalToLocal(_uint boneCount); + public: static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, vector& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix); #endif // EDITOR_PROJECT @@ -62,11 +64,9 @@ class ENGINE_DLL CMesh final : public CVIBuffer ID3D11ShaderResourceView* m_pBoneRemapSRV = nullptr; ID3D11Buffer* m_pBoneRemapBuffer = nullptr; - - // 바이너리 - std::vector<_uint> m_Indices; - std::vector<_float3> m_Vertices; + vector<_uint> m_Indices; + vector<_float3> m_Vertices; // private: diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index ab36e820f..2e41c7a4b 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -74,7 +74,6 @@ class ENGINE_DLL CModel final : public CComponent _uint Get_NumMeshes() const { return m_iNumMeshes; } void Update_RootBone(_float Amount = 1.f); void Initialize_RootBone(); - void BeginFrame(); vector<_float4x4> Get_OffsetMatrix(_int iIndex); void Apply_CPUMask_ToBones(); void Mark_CPUChain(_int boneIdx); @@ -168,9 +167,9 @@ class ENGINE_DLL CModel final : public CComponent // 바이너리 SaveModel* m_pSaveModel = { nullptr }; - list m_SaveModel; // + vector<_float4x4> m_BoneMatrix; _float3 m_vPrevRootPos = { 0.f, 0.f, 0.f }; @@ -191,7 +190,6 @@ class ENGINE_DLL CModel final : public CComponent _bool m_bRatio = { false }; _bool m_bRootBone = {}; _float4x4 m_RootMatrix = {}; - unordered_map<_string, _float4x4> m_SocketCache; private: diff --git a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_Behavior.cpp b/Jusin154_Team3D/Engine/Public/NCallBack_Playable_Behavior.cpp deleted file mode 100644 index 327329d62..000000000 --- a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_Behavior.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "pch.h" -#include "CallBack_Playable_Behavior.h" - - -CCallBack_Playable_Behavior::CCallBack_Playable_Behavior() -{ -} - -PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) -{ - if (nullptr == actor.userData) { - return PSX::PxControllerBehaviorFlags(0); - } - PhsXUserData* pActorData = static_cast(actor.userData); - - switch (pActorData->eKind) - { - case PHYSX_KIND::BODY_STATIC: - return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT - | PSX::PxControllerBehaviorFlag::eCCT_SLIDE; - break; - case PHYSX_KIND::BODY_DYNAMIC: - return PSX::PxControllerBehaviorFlag::eCCT_SLIDE; - break; - case PHYSX_KIND::CCTActor: - // Action - break; - case PHYSX_KIND::OBSTACLEActor: - break; - default: - break; - } - - - // 나머지는 아무 특별 동작 없음 - return PSX::PxControllerBehaviorFlags(0); -} - -PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxController& controller) -{ - // CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴 - return PSX::PxControllerBehaviorFlags(0); -} - -PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle) -{ - // Obstacle이 움직이는 발판이다? - // 여기서 ride/slide 세팅 - //return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; - - return PSX::PxControllerBehaviorFlags(0); -} diff --git a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_Behavior.h b/Jusin154_Team3D/Engine/Public/NCallBack_Playable_Behavior.h deleted file mode 100644 index cd512f1aa..000000000 --- a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_Behavior.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "Base.h" - - -class CCallBack_Playable_Behavior final : public PSX::PxControllerBehaviorCallback -{ - // 구현 예시 - // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 - // - // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" - // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" - // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" - -public: - CCallBack_Playable_Behavior(); - ~CCallBack_Playable_Behavior() = default; - -public: - // PxControllerBehaviorCallback을(를) 통해 상속됨 - // 충돌알림이 아닌, 행동정책 정해주기. CCT vs CCT는 지원안함 - // slopeLimit로 미끄러져 갈 수 있는지 없는지 이분법적인 계산 대신, 원하는 물체에 대해서만 미끄러운 표면으로 정의해줌 - // 주인이 되는 CCT가 이 물체에 대해 이 물체를 어떻게 해야 할까? -> (타고 올라갈까? Ride?) (미끄러져갈까? Slide?) ( 직접 내가 구현할까? user defined ride? ) - virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) override; - - virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxController& controller) override; - - virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxObstacle& obstacle) override; -}; diff --git a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_HitRepot.cpp b/Jusin154_Team3D/Engine/Public/NCallBack_Playable_HitRepot.cpp deleted file mode 100644 index 71ecacfcf..000000000 --- a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_HitRepot.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "pch.h" -#include "CallBack_Playable_HitRepot.h" -#include "GameInstance.h" - -CCallBack_Playable_HitRepot::CCallBack_Playable_HitRepot() -{ -} - -void CCallBack_Playable_HitRepot::onShapeHit(const PSX::PxControllerShapeHit& hit) -{ - PSX::PxController* pController = hit.controller; - PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점 - PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말 - PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향 - _float fLength = hit.length; // 시도한 move 길이 - - PSX::PxShape* pShape = hit.shape; - PSX::PxRigidActor* pActor = hit.actor; - - if (nullptr != pController && nullptr != pActor) { - PhsXUserData* pActorData = static_cast(pActor->userData); - if (nullptr == pActorData) { // missing user data - return; - } - switch (pActorData->eKind) - { - case PHYSX_KIND::BODY_STATIC: - // action - break; - case PHYSX_KIND::BODY_DYNAMIC: - { - PSX::PxRigidDynamic* pDynamic = static_cast(pActor); - pDynamic->addForce(vDir * fLength, PSX::PxForceMode::eIMPULSE); - } break; - case PHYSX_KIND::CCTActor: - assert(false); - break; - case PHYSX_KIND::OBSTACLEActor: - break; - default: - break; - } - } -} - -void CCallBack_Playable_HitRepot::onControllerHit(const PSX::PxControllersHit& hit) -{ - PSX::PxController* pController = hit.controller; - PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점 - PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말 - PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향 - _float fLength = hit.length; // 시도한 move 길이 - - PSX::PxController* pOtherController = hit.other; // 다른 컨트롤러 - - if (nullptr != pController && nullptr != pOtherController) { - PhsXUserData* pActorData = static_cast(pOtherController->getActor()->userData); - assert(nullptr != pActorData); // missing user data - - switch (pActorData->eKind) - { - case PHYSX_KIND::BODY_STATIC: - assert(false); - break; - case PHYSX_KIND::BODY_DYNAMIC: - assert(false); - break; - case PHYSX_KIND::CCTActor: - // Action - break; - case PHYSX_KIND::OBSTACLEActor: - break; - default: - break; - } - } -} - -void CCallBack_Playable_HitRepot::onObstacleHit(const PSX::PxControllerObstacleHit& hit) -{ - PSX::PxController* pController = hit.controller; - PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점 - PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말 - PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향 - _float fLength = hit.length; // 시도한 move 길이 - - const void* pOtherController = hit.userData; // 장애물 - - //switch (pOtherController.member) - //{ - //default: - // break; - //} -} diff --git a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_HitRepot.h b/Jusin154_Team3D/Engine/Public/NCallBack_Playable_HitRepot.h deleted file mode 100644 index 4d3031fb7..000000000 --- a/Jusin154_Team3D/Engine/Public/NCallBack_Playable_HitRepot.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include "Base.h" - - -class CCallBack_Playable_HitRepot final : public PSX::PxUserControllerHitReport -{ - // 구현 예시 - // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 - // - // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" - // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" - // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" - -public: - CCallBack_Playable_HitRepot(); - ~CCallBack_Playable_HitRepot() = default; - -public: - // PxUserControllerHitReport을(를) 통해 상속됨 - // 충돌알림!! - // 주인이 되는 CCT가 이 물체에 대해 어떻게 반응해야 할까? - virtual void onShapeHit(const PSX::PxControllerShapeHit& hit) override; // statc, rigid 등과 부딪힌 경우 - - virtual void onControllerHit(const PSX::PxControllersHit& hit) override; // 다른 CCT와 부딪힌 경우 - - virtual void onObstacleHit(const PSX::PxControllerObstacleHit& hit) override; // 사용자 정의 장애물과 부딪힌 경우 -}; diff --git a/Jusin154_Team3D/Engine/Public/PhysX/PxQueryFiltering.h b/Jusin154_Team3D/Engine/Public/PhysX/PxQueryFiltering.h index 97c200c36..987bd0fcd 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/PxQueryFiltering.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/PxQueryFiltering.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/RenderEventDebugger.h b/Jusin154_Team3D/Engine/Public/RenderEventDebugger.h new file mode 100644 index 000000000..801a916fc --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/RenderEventDebugger.h @@ -0,0 +1,72 @@ +#pragma once +#include "Base.h" +#ifdef _DEBUG +#include +#include + +NS_BEGIN(Engine) +class CRenderEventDebugger +{ +public: + HRESULT Initialize(ID3D11DeviceContext* pContext) + { + if (pContext == nullptr) { + return E_INVALIDARG; + } + + return pContext->QueryInterface( __uuidof(ID3DUserDefinedAnnotation), reinterpret_cast(m_pUserAnnotation.ReleaseAndGetAddressOf()) + ); + } + + ID3DUserDefinedAnnotation* GetUserDefinedAnnotation() + { + return m_pUserAnnotation.Get(); + } + +private: + Microsoft::WRL::ComPtr m_pUserAnnotation; +}; + +class CRenderEventScope +{ +public: + CRenderEventScope(ID3DUserDefinedAnnotation* pUserDefinedAnnotation, const wchar_t* pEventName) + : m_pUserAnnotation(pUserDefinedAnnotation) + , m_bIsEventStart(false) + { + if (m_pUserAnnotation != nullptr && pEventName != nullptr) + { + if (m_pUserAnnotation->GetStatus() != 0) + { + m_pUserAnnotation->BeginEvent(pEventName); + m_bIsEventStart = true; + } + } + } + + ~CRenderEventScope() + { + if (m_pUserAnnotation != nullptr && m_bIsEventStart) + { + m_pUserAnnotation->EndEvent(); + } + } + + CRenderEventScope(const CRenderEventScope&) = delete; + CRenderEventScope& operator=(const CRenderEventScope&) = delete; + +private: + ID3DUserDefinedAnnotation* m_pUserAnnotation; + _bool m_bIsEventStart; +}; + +#define EVENTSCOPE_(message) CRenderEventScope __EventScope(m_AnnotationHelper.GetUserDefinedAnnotation(), TEXT(message)); + +NS_END + +#endif // _DEBUG\ + +#ifndef _DEBUG +#define EVENTSCOPE_(message) +#endif // !_DEBUG + diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget.h b/Jusin154_Team3D/Engine/Public/RenderTarget.h index bf8e5c77a..00abc3ec4 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget.h @@ -9,18 +9,20 @@ class CRenderTarget final : public CBase private: CRenderTarget(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual ~CRenderTarget() = default; - public: ID3D11RenderTargetView* Get_RTV() const { return m_pRTV; } + ID3D11ShaderResourceView* Get_SRV() const { return m_pSRV; } public: HRESULT Initialize(_uint iSizeX, _uint iSizeY, DXGI_FORMAT ePixelFormat, const _float4& vClearColor); HRESULT Bind_ShaderResource(class CShader* pShader, const _char* pConstantName); void Clear(); void Copy_ResourceTo(ID3D11Texture2D* pTexture2D); + void Copy_ResourceTo(const CRenderTarget& Target); void Copy_ResourceFrom(ID3D11Texture2D* pTexture2D); + void Copy_ResourceFrom(const CRenderTarget& Target); void Get_TextureDesc(D3D11_TEXTURE2D_DESC& Desc); - ID3D11ShaderResourceView* Get_SRV() const { return m_pSRV; } + _float2 Get_TargetSize() { return m_vTargetSize; }; #ifdef _DEBUG public: @@ -43,6 +45,7 @@ class CRenderTarget final : public CBase private: _float4x4 m_WorldMatrix = {}; _point m_ptWindowSize = {}; + _float2 m_vTargetSize = {}; _bool m_isDraw = { false }; #endif diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h index 2df798017..f8f42c8af 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h @@ -18,8 +18,9 @@ class CRenderTarget_Manager final : public CBase HRESULT Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag); HRESULT End_MRT(); HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName); - HRESULT Copy_RenderTargetTo(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D); - HRESULT Copy_RenderTargetFrom(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D); + HRESULT Copy_RenderTargetTo(const _wstring& strSrcTag, ID3D11Texture2D* pDst2D); + HRESULT Copy_RenderTargetFrom(const _wstring& strDstTag, ID3D11Texture2D* pSrc2D); + HRESULT Copy_RenderTargetAToB(const _wstring& strATag, const _wstring& strBTag); HRESULT Bind_CS_RenderTarget(_uint iIndex, const _wstring& strTargetTag); @@ -28,6 +29,7 @@ class CRenderTarget_Manager final : public CBase // 랜더 타겟의 크기를 dest로 다시 맞춤 HRESULT Refit_RenderTarget(class CVIBuffer_Rect* pVIBuffer, class CShader* pShader, const _wstring& wstrRenderTargetInput, const _wstring& wstrRenderTargetOutput, SHADER_PASS_DEFERRED ePass); HRESULT Finish_RenderTarget(class CVIBuffer_Rect* pVIBuffer, class CShader* pShader, const _wstring& wstrRenderTargetOriginal, const _wstring& wstrRenderTargetBloomed, SHADER_PASS_DEFERRED ePass); + _float2 Get_RenderTargetSize(const _wstring& wstrRenderTargetOriginal); #ifdef _DEBUG public: @@ -38,8 +40,8 @@ class CRenderTarget_Manager final : public CBase #ifdef _DEBUG private: - _int m_iSizeX = { 200 }; - _int m_iSizeY = { 200 }; + _int m_iSizeX = { 16 * 14 }; + _int m_iSizeY = { 9 * 14 }; #endif // _DEBUG private: diff --git a/Jusin154_Team3D/Engine/Public/Renderer.h b/Jusin154_Team3D/Engine/Public/Renderer.h index ed3b04dfe..76fb011a5 100644 --- a/Jusin154_Team3D/Engine/Public/Renderer.h +++ b/Jusin154_Team3D/Engine/Public/Renderer.h @@ -1,6 +1,7 @@ #pragma once #include "Base.h" +#include "RenderEventDebugger.h" NS_BEGIN(Engine) @@ -27,6 +28,11 @@ class CRenderer final : public CBase class CGameInstance* m_pGameInstance = { nullptr }; list m_RenderObjects[ENUM_CLASS(RENDER::END)]; +#ifdef _DEBUG + CRenderEventDebugger m_AnnotationHelper = {}; +#endif // _DEBUG + + #ifdef _DEBUG private: list m_DebugComponents; @@ -46,6 +52,13 @@ class CRenderer final : public CBase ID3D11DepthStencilView* m_pShadowDSV_NEAR = { nullptr }; ID3D11DepthStencilView* m_pShadowDSV_MIDDLE = { nullptr }; ID3D11DepthStencilView* m_pShadowDSV_FAR = { nullptr }; + + _float2 m_vNearShadowResoltion = { (_float)g_iNearShadowWidth,(_float)g_iNearShadowHeight }; + _float2 m_vMiddleShadowResoltion = { (_float)g_iMiddleShadowWidth,(_float)g_iMiddleShadowHeight }; + _float2 m_vFarShadowResoltion = { (_float)g_iFarShadowWidth,(_float)g_iFarShadowHeight }; + _float2 m_vPreShadowResoltion = { (_float)g_iPreShadowWidth,(_float)g_iPreShadowHeight }; + + ID3D11DepthStencilView* m_pPreShadowDSV = { nullptr }; ID3D11ShaderResourceView* m_pSSAO_NoiseSRV = { nullptr }; ID3D11Texture2D* m_pSSAO_NoiseTexture = { nullptr }; @@ -62,9 +75,13 @@ class CRenderer final : public CBase /* TunningParam */ // MotionBlur - _float m_fMBBlurRadius = { 1.f }; - _int m_iMBSampleCount = { 3 }; + _float m_fMBBlurRadius = { 28.f }; + _float m_fMBSampleBias = { 0.005f }; + _int m_iMBMaxSampleCount = { 28 }; + _int m_iMBSampleCount = { m_iMBMaxSampleCount }; + _int m_iMBTileSize = { 20 }; _int m_iMBType = { 0 }; + _bool m_bMB = { true }; // ToneMapping _int m_iToneMappingType = { 2 }; @@ -91,6 +108,7 @@ class CRenderer final : public CBase #pragma endregion private: + void Bind_RawValue(); void Render_Occlusion(); void Render_Priority(); void Render_Shadow(); @@ -122,7 +140,7 @@ class CRenderer final : public CBase private: void Fill_Geometry(_uint iNumSample); - HRESULT Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY); + HRESULT Ready_ShadowDepthStencilView(_float2 vSize, ID3D11DepthStencilView** pDSV); private: HRESULT Initialize(); diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index 8d3437cf0..281194e38 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -4,11 +4,12 @@ NS_BEGIN(STATEANIM) enum ESTATE { - IDLE,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, IDLE_COMBAT_TURN_BWD_L, IDLE_COMBAT_TURN_BWD_R, IDLE_COMBAT_TURN_90_L, IDLE_COMBAT_TURN_90_R,IDLE_BREAK1,IDLE_BREAK2,IDLE_BREAK3,IDLE_BREAK4, IDLE_BREAK5, IDLE_BREAK6, IDLE_BREAK7, + IDLE, IDLE_G,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, IDLE_COMBAT_TURN_BWD_L, IDLE_COMBAT_TURN_BWD_R, IDLE_COMBAT_TURN_90_L, IDLE_COMBAT_TURN_90_R,IDLE_BREAK1,IDLE_BREAK2,IDLE_BREAK3,IDLE_BREAK4, IDLE_BREAK5, IDLE_BREAK6, IDLE_BREAK7, MOVE, WALK, WALK_FWD,WALK_RIGHT,WALK_LEFT, WALK_BWD,WALK_START,WALK_STOP, JOG,JOG_START, JOG_FWD, JOG_RIGHT, JOG_LEFT, JOG_BWD, JOG_STOP, JOG_AIM_LEFT, JOG_AIM_RIGHT, JOG_AIM_BWD, JOG_AIM_STOP_L, JOG_AIM_STOP_R, JOG_AIM_STOP_BWD,JOG_LEFT_TURN,JOG_RIGHT_TURN,JOG_112_L,JOG_112_R,JOG_90_L,JOG_90_R, SPRINT, + SLIDE_START_R,SLIDE_LOOP_R,SLIDE_STOP_R, JUMP,JUMP_JOG,JUMP_SPRINT, LAND, DODGE,DODGE_BLINK, DODGE_LEFT, DODGE_RIGHT, @@ -39,10 +40,11 @@ enum ESTATE FLINCH_BWD,FLINCH_FWD, FLINCH_LEFT, FLINCH_RIGHT, STUMBLE_BWD_L,STUMBLE_BWD_R,STUMBLE_FWD, HOVER_LOOP,HOVER_DASH_FWD, HOVER_DASH_BWD, HOVER_DASH_LEFT, HOVER_DASH_RIGHT, - FIREBALL1,FIREBALL2, - FIREBREATH,FIREBREATH_COOLDOWN,FIREBREATH_WINDUP, + FIREBALL1_A,FIREBALL2_A, FIREBALL1_G, FIREBALL2_G, + FIREBREATH_A,FIREBREATH_COOLDOWN_A,FIREBREATH_WINDUP_A, FIRESWEEP_A, FIRESWEEP_COOLDOWN_A, FIRESWEEP_WINDUP_A, FIREBREATH_G, FIRESWEEP_G, PULSE, - TUCKED, + GROUND_SWIPE_L,GROUND_SWIPE_R, + TUCKED,FLY_TO_HOVER, ////////////////////////// 빗자루 BROOM_MOUNT_B, BROOM_HOVER_IDLE_B, BROOM_HOVER_STOP_B,BROOM_HOVER_DOWN_B,BROOM_HOVER_UP_B,BROOM_HOVER_LEFT_B,BROOM_HOVER_RIGHT_B,BROOM_FLY_DOWN_B, BROOM_FLY_LEFT_B, BROOM_FLY_RIGHT_B, BROOM_FLY_UP_B,BROOM_FLY_B,BROOM_ADD, /// //////////////////////////// diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index 8f823ba89..cbd2bff11 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -67,6 +67,13 @@ typedef struct SlotHover _int iSlotID{}; _int iHover_Index{}; }HOVER_INFO; + +typedef struct tagCurrentQeustSerectInfo +{ + _int iQuestCategory{}; + _int iQuestIndex{}; +}CURRENTQUESTSECETINFO; + protected: CUIObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CUIObject(const CUIObject& rhs); @@ -134,7 +141,8 @@ typedef struct SlotHover virtual void Lerp_PosX(_float PosX); virtual void Lerp_PosY(_float PosY); - virtual void Start_Lerp(_float fTimeDelta); + virtual _bool Start_Lerp(_float fTimeDelta); + virtual _bool Start_Bezier(_float fTimeDelta); virtual void Reset_Pos(_float fTimeDelta); virtual void Start_Size_Lerp(_float fTimeDelta); virtual void Reset_Size_Lerp(_float fTimeDelta); diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h index fe5e72dc6..7238bcae2 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h @@ -36,6 +36,7 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance void Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float vColor); void Set_Index_Color(_int Index, _float vColor); _int Set_Mouse_Hover(_float2 fMousePos); + void Set_Hover(_int Index); void Set_Hover_Index(_uint iIndex); void Set_Equip_Index(_uint iIndex); void Set_Draw(_int iCount = -1);