diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 067d90c1d..cd43fbd4d 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -13,6 +13,7 @@ uint g_iSpellType; float g_fPI; float g_fFar; +float g_fBlinkTime; float g_fTime; float g_fTimeMult; float g_fFrame; @@ -28,12 +29,20 @@ float g_fHp; float2 g_fOrigin_Size; float2 g_fCurrent_Size; float2 g_fHpBG; +float2 g_Pos; +float2 g_fImageSize; float4 g_fNine_Slice; float4 g_fImageUV; float4 g_fImageUV1; +uint g_iArrayCount; +float2 g_fItemPosition1; +float2 g_fItemImageSizes1; +float2 g_fItemPosition2; +float2 g_fItemImageSizes2; float2 g_fPosition[4]; +float2 g_fImageSizes[4]; float4 g_fImagesUV[4]; Texture2D g_Texture; @@ -41,6 +50,7 @@ Texture2D g_Texture1; Texture2D g_Texture2; Texture2D g_Texture3; Texture2D g_Texture4; +Texture2D g_Texture5; Texture2D g_DiffuseTexture; Texture2D g_MaskingTexture; @@ -251,6 +261,7 @@ PS_OUT PS_Sptire_Sheet(PS_IN In) if (Color.r <= 0.4f) discard; + Color.a *= Alpha; Out.vColor = Color; @@ -416,8 +427,30 @@ PS_OUT PS_SpellAnim(PS_IN In) float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float4 color = float4(1.f, 1.f, 1.f, 1.f); - + float4 color = float4(0.f, 0.f, 0.f, 0.f); + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float2 startUV = g_fImageUV.xy; + float2 endUV = g_fImageUV.zw; + + float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex2 = g_Texture2.Sample(DefaultSampler, atlasUV); + + tex1.rgb *= 0.4f; + color = tex1; + tex2.rgb *= 0.3f; + + if (tex2.a >= 0.9f) + color = tex2; float3 BGColor = float3(1.f, 1.f, 1.f); switch (g_iSpellType) @@ -444,39 +477,42 @@ PS_OUT PS_SpellAnim(PS_IN In) BGColor = float3(0.f, 0.f, 0.f); break; } + float4 color1 = float4(1.f, 1.f, 1.f, 1.f); - float2 uv = In.vTexcoord; + float2 OverrayUV = In.vTexcoord; float CoolTime = 1.f - g_fDeltaV; float CoolTime2 = 1.f - g_fDeltaV + 0.05; + atlasUV = startUV + In.vTexcoord * (endUV - startUV); + float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); + tex3.rgb *= BGColor; + float4 tex4 = g_Texture2.Sample(DefaultSampler, atlasUV); - float4 tex1 = g_Texture.Sample(ClampSampler, uv); - tex1.rgb *= BGColor; - float4 tex2 = g_Texture1.Sample(DefaultSampler, uv); + if (tex4.a >= 0.9f) + tex3 = tex4; - if (tex2.a >= 0.9f) - tex1 = tex2; - - color = tex1; + color1 = tex3; - float wave1 = sin(uv.x * 10.f + g_fTime * 2.f) * 0.01f; - float wave2 = sin(uv.x * 10.f + g_fTime * 2.f) * 0.01f; + float wave1 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; + float wave2 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; float waveThreshold1 = CoolTime + wave1; float waveThreshold2 = CoolTime2 + wave2; if (g_fDeltaV <= 1.f) { - if (uv.y >= waveThreshold1 && uv.y <= waveThreshold2) + if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) { - color.rgb = float3(1.f, 1.f, 1.f); + color1.rgb = float3(1.f, 1.f, 1.f); } } - if (uv.y <= CoolTime) + if (OverrayUV.y <= CoolTime) { - color.a = 0.f; + color1.a = 0.f; } + color = lerp(color, color1, color1.a); + color.a *= Alpha; Out.vColor = color; @@ -488,6 +524,7 @@ PS_OUT PS_HpBar(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 Color1 = float4(1.f, 1.f, 1.f, 1.f); float2 uv = In.vTexcoord; float2 CurrentPixelPosition = uv * g_fCurrent_Size; float OriginLeft = g_fNine_Slice.x; @@ -533,24 +570,46 @@ PS_OUT PS_HpBar(PS_IN In) } float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv); + tex1.rgb = float3(255.f, 0.f, 0.f) / 255.f; + if (g_fHp <= 0.3f) + { + tex1.a *= (sin(g_fBlinkTime) * 0.25f + 0.75f) * 1.5f; + } + else + { + tex1.a = 0.f; + } Color = tex1; + + float2 BGPos = g_Pos; + float2 BGSize = g_fImageSize; + float2 BGPixel = Finaluv * g_fOrigin_Size; + float2 localUV = (BGPixel - BGPos) / BGSize; + bool inside = all(localUV >= 0.0f && localUV <= 1.0f); + + float4 tex2 = g_Texture1.Sample(ClampSampler, localUV); + + if (inside) + Color = lerp(Color, tex2, tex2.a); + float2 reversuv = In.vTexcoord; - reversuv.x = 1.0f - Finaluv; + reversuv.x = 1.0f - localUV.x; - float4 tex2 = g_Texture1.Sample(ClampSampler, Finaluv); + float4 tex3 = g_Texture2.Sample(ClampSampler, localUV); if (reversuv.x >= g_fHp) { - tex2.rgb = float3(0.f, 0.f, 0.f); + tex3.rgb = float3(0.f, 0.f, 0.f); } - float3 Green = float3(112.f, 241.f, 31.f) / 255.f; - Green *= 1.2f; - tex2.rgb *= Green; + float3 Green = (float3(112.f, 241.f, 31.f) / 255.f) * 1.2f; + float3 Red = (float3(255.f, 0.f, 0.f) / 255.f) * 1.2f; - if (all(Color.rgb >= float3(70.f / 255.f, 70.f / 255.f, 70.f / 255.f))) - Color = tex2; + tex3.rgb *= lerp(Green, Red, g_fTime); + + if (all(Color.rgb >= float3(55.f / 255.f, 0.f / 255.f, 55.f / 255.f))) + Color = lerp(Color, tex3, tex3.a); Color.a *= Alpha; Out.vColor = Color; @@ -595,18 +654,28 @@ PS_OUT PS_Magic_Icon(PS_IN In) float4 Color = float4(1.f, 1.f, 1.f, 1.f); - float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float2 center = float2(0.5f, 0.5f); + float2 BGuv = In.vTexcoord - center; + BGuv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = BGuv.x * cos(g_fAngle) - BGuv.y * sin(g_fAngle); + Rotation.y = BGuv.x * sin(g_fAngle) + BGuv.y * cos(g_fAngle); + Rotation += center; + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex2 = g_Texture1.Sample(ClampSampler, Rotation); + + Color = tex1; + Color = lerp(tex1, tex2, tex2.a); + float2 uv = In.vTexcoord; - float2 center = float2(0.5, 0.5); float scale = 1.2; uv = (uv - center) * scale + center; - float4 tex2 = g_Texture1.Sample(ClampSampler, uv); + float4 tex3 = g_Texture2.Sample(ClampSampler, uv); - Color = tex1; - - Color = tex1 * (1 - tex2.a) + tex2; + Color = Color * (1 - tex3.a) + tex3; Color.a *= Alpha; Out.vColor = Color; @@ -645,30 +714,30 @@ PS_OUT PS_Revelio(PS_IN In) float4 Color = float4(1.f, 1.f, 1.f, 1.f); float2 UV = In.vTexcoord; - float2 Position[4]; - float2 startUV[4]; - float2 endUV[4]; + //float2 Position[4]; + //float2 startUV[4]; + //float2 endUV[4]; - float2 Atlases[4]; + //float2 Atlases[4]; - for (int i = 0; i < 4; ++i) - { - Position[i] = g_fPosition[i]; - startUV[i] = g_fImagesUV[i].xy; - endUV[i] = g_fImagesUV[i].zw; + //for (int i = 0; i < 4; ++i) + //{ + // Position[i] = g_fPosition[i]; + // startUV[i] = g_fImagesUV[i].xy; + // endUV[i] = g_fImagesUV[i].zw; - Atlases[i] = startUV[i] + UV * (endUV[i] - startUV[i]); - } + // Atlases[i] = startUV[i] + UV * (endUV[i] - startUV[i]); + //} - float4 tex1 = g_Texture.Sample(DefaultSampler, UV); - float4 tex2 = g_Texture1.Sample(DefaultSampler, Atlases[0]); - float4 tex3 = g_Texture1.Sample(DefaultSampler, Atlases[1]); - float4 tex4 = g_Texture2.Sample(DefaultSampler, Atlases[2]); - float4 tex5 = g_Texture2.Sample(DefaultSampler, Atlases[3]); + //float4 tex1 = g_Texture.Sample(DefaultSampler, UV); + //float4 tex2 = g_Texture1.Sample(DefaultSampler, Atlases[0]); + //float4 tex3 = g_Texture1.Sample(DefaultSampler, Atlases[1]); + //float4 tex4 = g_Texture2.Sample(DefaultSampler, Atlases[2]); + //float4 tex5 = g_Texture2.Sample(DefaultSampler, Atlases[3]); - //float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); + ////float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); Color.a *= Alpha; Out.vColor = Color; @@ -676,6 +745,169 @@ PS_OUT PS_Revelio(PS_IN In) return Out; } +PS_OUT PS_Potion(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 Color = float4(214.f / 255.f, 225 / 255.f, 36 / 255.f, 1.f); + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + Color = tex1; + + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + //Color += tex2; + float4 tex3 = g_Texture2.Sample(ClampSampler, Rotation); + Color = lerp(Color, tex3, tex3.a); + + float2 Potionuv = In.vTexcoord; + float scale = 1.2; + + Potionuv = (Potionuv - center) * scale + center; + float4 tex4 = g_Texture3.Sample(ClampSampler, Potionuv); + Color = lerp(Color, tex4, tex4.a); + + float2 tex5pos = g_Pos / g_fCurrent_Size; + float2 tex5size = g_fOrigin_Size / g_fCurrent_Size; + float2 tex5local = (In.vTexcoord - tex5pos) / tex5size; + bool inside = all(tex5local >= 0.0f && tex5local <= 1.0f); + float4 tex5 = g_Texture4.Sample(ClampSampler, tex5local); + if (inside) + Color = lerp(Color, tex5, tex5.a); + + Color.a *= Alpha; + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Magic_Item(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); + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float2 startUV = g_fImageUV.xy; + float2 endUV = g_fImageUV.zw; + + float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex2 = g_Texture3.Sample(ClampSampler, atlasUV); + + tex1.rgb *= 0.4f; + color = tex1; + tex2.rgb *= 0.3f; + + if (tex2.a >= 0.9f) + color = tex2; + float3 BGColor = float3(1.f, 1.f, 1.f); + + switch (g_iSpellType) + { + case 0: + BGColor = float3(50.f, 50.f, 50.f) / 255.f; + break; + case 1: + BGColor = float3(89.f, 32.f, 215.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(37.f, 129.f, 162.f) / 255.f; + break; + case 4: + BGColor = float3(134.f, 171.f, 78.f) / 255.f; + break; + } + + float4 color1 = float4(1.f, 1.f, 1.f, 1.f); + + float2 OverrayUV = In.vTexcoord; + float CoolTime = 0.f + g_fDeltaV; + float CoolTime2 = 0.f + g_fDeltaV + 0.05; + atlasUV = startUV + In.vTexcoord * (endUV - startUV); + float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); + tex3.rgb *= BGColor; + float4 tex4 = g_Texture3.Sample(DefaultSampler, atlasUV); + + if (g_fDeltaV <= 1.f) + { + if (tex4.a >= 0.9f) + tex3 = tex4; + + color1 = tex3; + + float wave1 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; + float wave2 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; + + float waveThreshold1 = CoolTime + wave1; + float waveThreshold2 = CoolTime2 + wave2; + + if (g_fDeltaV <= 1.f) + { + if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) + { + color1.rgb = float3(1.f, 1.f, 1.f); + } + } + + if (OverrayUV.y <= CoolTime) + { + color1.a = 0.f; + } + + color = lerp(color, color1, color1.a); + } + else if (g_fDeltaV >= 1.f) + color = lerp(color, tex4, tex4.a); + + float4 tex5 = g_Texture2.Sample(ClampSampler, Rotation); + color = lerp(color, tex5, tex5.a); + + float2 texpos1 = g_fItemPosition1 / g_fCurrent_Size; + float2 texpos2 = g_fItemPosition2 / g_fCurrent_Size; + float2 texsize1 = g_fItemImageSizes1 / g_fCurrent_Size; + float2 texsize2 = g_fItemImageSizes2 / g_fCurrent_Size; + float2 texlocal1 = (In.vTexcoord - texpos1) / texsize1; + float2 texlocal2 = (In.vTexcoord - texpos2) / texsize2; + + + bool inside1 = all(texlocal1 >= 0.0f && texlocal1 <= 1.0f); + float4 tex6 = g_Texture4.Sample(DefaultSampler, texlocal1); + + if (inside1) + color = lerp(color, tex6, tex6.a); + + bool inside2 = all(texlocal2 >= 0.0f && texlocal2 <= 1.0f); + + float4 tex7 = g_Texture5.Sample(DefaultSampler, texlocal2); + if (inside2) + color = lerp(color, tex7, tex7.a); + + color.a *= Alpha; + + Out.vColor = color; + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -856,4 +1088,24 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Revelio(); } + pass Potion + { + SetRasterizerState(RS_Default); + 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_Potion(); + } + + pass Magic_Item + { + SetRasterizerState(RS_Default); + 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_Magic_Item(); + } + } diff --git a/Jusin154_Team3D/Client/Default/Client.cpp b/Jusin154_Team3D/Client/Default/Client.cpp index 0dfea5d85..149f8d4c1 100644 --- a/Jusin154_Team3D/Client/Default/Client.cpp +++ b/Jusin154_Team3D/Client/Default/Client.cpp @@ -25,10 +25,18 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, { #ifdef _DEBUG _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); + //_CrtSetBreakAlloc(1181); + //_CrtSetBreakAlloc(1182); + //_CrtSetBreakAlloc(1183); + //_CrtSetBreakAlloc(1184); + //_CrtSetBreakAlloc(1185); + //_CrtSetBreakAlloc(1186); + //_CrtSetBreakAlloc(1187); #endif UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); + CMainApp* pMainApp = { nullptr }; LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); @@ -41,8 +49,8 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, } HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_CLIENT)); - - MSG msg = {}; + + MSG msg; pMainApp = CMainApp::Create(); if (nullptr == pMainApp) @@ -106,13 +114,13 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, #endif // _DEBUG pGameInstance->Compute_TimeDelta(TEXT("Timer_60")); + #ifdef _DEBUG - pMainApp->Update(0.0166f); -#endif // _DEBUG + pMainApp->Update(1.f / 60.f); +#endif // _DEBUG #ifndef _DEBUG pMainApp->Update(pGameInstance->Get_TimeDelta(TEXT("Timer_60"))); -#endif // !_DEBUG - +#endif pMainApp->Render(); fTimeAcc = 0.f; @@ -163,7 +171,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) RECT rcWindow = { 0, 0, g_iWinSizeX, g_iWinSizeY }; - AdjustWindowRect(&rcWindow, WS_OVERLAPPEDWINDOW, TRUE); + AdjustWindowRect(&rcWindow, WS_OVERLAPPEDWINDOW, FALSE); HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, nullptr, nullptr, hInstance, nullptr); @@ -178,18 +186,20 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) g_hWnd = hWnd; - return TRUE; + return TRUE; } LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - if (ImGui_ImplWin32_WndProcHandler(hWnd, message, wParam, lParam)) + if (ImGui_ImplWin32_WndProcHandler(hWnd, message, wParam, lParam)) { return true; + } switch (message) { case WM_DESTROY: PostQuitMessage(0); break; + default: return DefWindowProc(hWnd, message, wParam, lParam); } diff --git a/Jusin154_Team3D/Client/Private/EffectObject.cpp b/Jusin154_Team3D/Client/Private/EffectObject.cpp index 204608121..c46bf2ebb 100644 --- a/Jusin154_Team3D/Client/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Client/Private/EffectObject.cpp @@ -84,7 +84,7 @@ HRESULT CEffectObject::Render_Blur() if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NON_WORLD) { - BlurPass = SHADER_PASS_INSTANCE_MODEL::BLUR_NO_WORLD; + BlurPass = SHADER_PASS_INSTANCE_MODEL::NON_WORLD_BLUR; } else { diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 82d1ddf03..66bf65703 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -58,11 +58,13 @@ HRESULT CGoblin::Initialize(void* pArg) void CGoblin::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + __super::Priority_Update(fTimeDelta); } void CGoblin::Update(_float fTimeDelta) { + __super::Update(fTimeDelta); + m_pFSM->Update_State(fTimeDelta); m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); @@ -76,7 +78,7 @@ void CGoblin::Late_Update(_float fTimeDelta) __super::Late_Update(fTimeDelta); m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position()); - m_pTransformCom->LookAt(m_pPlayerTransform->Get_State(STATE::POSITION)); + m_pTransformCom->LookAt(XMLoadFloat4(&m_vTargetPos)); m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); } diff --git a/Jusin154_Team3D/Client/Private/Goblin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_States.cpp index 956e940c9..2778e4285 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_States.cpp @@ -136,15 +136,62 @@ void CGoblin::Add_FSM() void CGoblin::Set_Anim() { - m_Animation[STATEANIM::IDLE] = { 22,true }; + m_Animation[STATEANIM::IDLE_TURN_BWD] = { 24, false }; + m_Animation[STATEANIM::IDLE_TURN_L] = { 26, false }; + m_Animation[STATEANIM::IDLE_TURN_R] = { 30, false }; m_Animation[STATEANIM::WALK_FWD] = { 50,true }; m_Animation[STATEANIM::WALK_STOP] = { 58,false }; + m_Animation[STATEANIM::WALK_BWD] = { 49, true }; m_Animation[STATEANIM::JOG_FWD] = { 46,true }; m_Animation[STATEANIM::JOG_BWD] = { 154,false }; + m_Animation[STATEANIM::DODGE_LEFT] = { 125, false }; + m_Animation[STATEANIM::DODGE_RIGHT] = { 126, false }; + m_Animation[STATEANIM::SPRINT] = { 90, true }; + m_Animation[STATEANIM::SKILL] = { 70,false }; // 도끼 스윙 m_Animation[STATEANIM::SKILL2] = { 85,false }; // 나이프 던지기 + + m_Animation[STATEANIM::HIT_FWD] = { 353, false }; + m_Animation[STATEANIM::HIT_BWD] = { 352, false }; + m_Animation[STATEANIM::HIT_BWD2] = { 349, false }; + m_Animation[STATEANIM::HIT_BWD3] = { 350, false }; + m_Animation[STATEANIM::HIT_BWD4] = { 351, false }; + m_Animation[STATEANIM::HIT_L] = { 354, false }; + m_Animation[STATEANIM::HIT_R] = { 355, false }; + + m_Animation[STATEANIM::KNOCKDOWN_BWD] = { 374, false }; + m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT] = { 375, false }; + m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT_HOLD] = { 370, false }; + m_Animation[STATEANIM::KNOCKDOWN_FWD] = { 371, false }; + m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT] = { 372, false }; + m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT_HOLD] = { 373, false }; + + m_Animation[STATEANIM::GETUP_BWD] = { 330, false }; + m_Animation[STATEANIM::GETUP_FWD] = { 332, false }; + m_Animation[STATEANIM::GETUP_L] = { 334, false }; + m_Animation[STATEANIM::GETUP_L_FD] = { 336, false }; + m_Animation[STATEANIM::GETUP_L_FU] = { 338, false }; + m_Animation[STATEANIM::GETUP_R] = { 340, false }; + m_Animation[STATEANIM::GETUP_R_FD] = { 342, false }; + m_Animation[STATEANIM::GETUP_R_FU] = { 344, false }; + m_Animation[STATEANIM::GETUP_SLOUCH] = { 346, false }; + + m_Animation[STATEANIM::KNOCKBACK] = { 377, true }; + m_Animation[STATEANIM::KNOCKBACK2] = { 378, true }; + m_Animation[STATEANIM::TUMBLE] = { 379, true }; + m_Animation[STATEANIM::TUMBLE2] = { 380, true }; + m_Animation[STATEANIM::PETRIFICUSED_START] = { 383, false }; + + m_Animation[STATEANIM::DEAD_BWD] = { 317, false }; + m_Animation[STATEANIM::DEAD_BWD2] = { 318, false }; + m_Animation[STATEANIM::DEAD_FWD] = { 319, false }; + m_Animation[STATEANIM::DEAD_FWD2] = { 320, false }; + m_Animation[STATEANIM::DEAD_L] = { 321, false }; + m_Animation[STATEANIM::DEAD_L2] = { 322, false }; + m_Animation[STATEANIM::DEAD_R] = { 323, false }; + m_Animation[STATEANIM::DEAD_R2] = { 324, false }; } diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index 97e98fb42..abebb92ae 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -14,14 +14,55 @@ CInfoInstance::CInfoInstance() void CInfoInstance::Update(_float fTimeDelta) { - + m_pPlayerInfo->Update(fTimeDelta); + m_pMonsterInfo->Update(fTimeDelta); + m_pMapInfo->Update(fTimeDelta); } +void CInfoInstance::Change_Level() +{ + m_pPlayerInfo->Change_Level(); + m_pMonsterInfo->Change_Level(); + m_pMapInfo->Change_Level(); +} + +#pragma region MONSTER_INFO +HRESULT CInfoInstance::Regist_PlayerAlly(CUnit* pUnit) +{ + return m_pMonsterInfo->Regist_PlayerAlly(pUnit); +} + +HRESULT CInfoInstance::Deregist_PlayerAlly(CUnit* pUnit) +{ + return m_pMonsterInfo->Deregist_PlayerAlly(pUnit); +} + +HRESULT CInfoInstance::Regist_ActiveMonster(CMonster* pUnit) +{ + return m_pMonsterInfo->Regist_ActiveMonster(pUnit); +} + +HRESULT CInfoInstance::Deregist_ActiveMonster(CMonster* pUnit) +{ + return m_pMonsterInfo->Deregist_ActiveMonster(pUnit); +} + +CMonster* CInfoInstance::Get_LockOnMonster() +{ + return m_pMonsterInfo->Get_LockOnMonster(); +} + +pair CInfoInstance::Get_NearestPlayerAlly(_fvector vPos) +{ + return m_pMonsterInfo->Get_NearestPlayerAlly(vPos); +} +#pragma endregion +#pragma region MAP_INFO HRESULT CInfoInstance::Load_MapObjects(const _char* pFilePath) { return m_pMapInfo->Load_MapObjects(pFilePath); } - +#pragma endregion LEVEL CInfoInstance::Get_RestartLevel() { return LEVEL::GAMEPLAY; diff --git a/Jusin154_Team3D/Client/Private/Level_Field.cpp b/Jusin154_Team3D/Client/Private/Level_Field.cpp index b13002b56..251db9428 100644 --- a/Jusin154_Team3D/Client/Private/Level_Field.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Field.cpp @@ -48,6 +48,7 @@ void CLevel_Field::Update(_float fTimeDelta) m_pInfoInstance->Update(fTimeDelta); if (true == m_pGameInstance->Check_LevelShouldChange()) { + m_pInfoInstance->Change_Level(); if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::RESTART)))) { return; } diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 80c098524..c45ee8b63 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -65,6 +65,7 @@ void CLevel_GamePlay::Update(_float fTimeDelta) m_pInfoInstance->Update(fTimeDelta); if (true == m_pGameInstance->Check_LevelShouldChange()) { + m_pInfoInstance->Change_Level(); if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD)))) { return; } @@ -99,7 +100,7 @@ HRESULT CLevel_GamePlay::Ready_Background() return E_FAIL; } - CInfoInstance::GetInstance()->Load_MapObjects("ClientTest"); + //CInfoInstance::GetInstance()->Load_MapObjects("ClientTest"); return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Level_Logo.cpp b/Jusin154_Team3D/Client/Private/Level_Logo.cpp index 3520a55ea..d0bd0854a 100644 --- a/Jusin154_Team3D/Client/Private/Level_Logo.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Logo.cpp @@ -28,7 +28,7 @@ void CLevel_Logo::Update(_float fTimeDelta) m_pGameInstance->Set_LevelToChange(); } - m_pInfoInstance->Update(fTimeDelta); + //m_pInfoInstance->Update(fTimeDelta); if (true == m_pGameInstance->Check_LevelShouldChange()) { if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::GAMEPLAY)))) { diff --git a/Jusin154_Team3D/Client/Private/Level_Restart.cpp b/Jusin154_Team3D/Client/Private/Level_Restart.cpp index 48f96f994..ddab4e3cf 100644 --- a/Jusin154_Team3D/Client/Private/Level_Restart.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Restart.cpp @@ -27,7 +27,7 @@ void CLevel_Restart::Update(_float fTimeDelta) m_pGameInstance->Set_LevelToChange(); } - m_pInfoInstance->Update(fTimeDelta); + //m_pInfoInstance->Update(fTimeDelta); if (true == m_pGameInstance->Check_LevelShouldChange()) { if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, m_eNextLevel)))) { diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 3bd3572cc..7965426e1 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -398,72 +398,72 @@ HRESULT CLoader::Loading_For_GamePlay() }); #pragma region MAP_MODELS - vector> jobFutures; + //vector> jobFutures; - _uint iLoadCount = 5; - vector*> Contents(iLoadCount); + //_uint iLoadCount = 5; + //vector*> Contents(iLoadCount); - { /* Terrain */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Terrain", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Terrain", - ".bin", false, - &Contents[jobFutures.size()] - )); - } + //{ /* Terrain */ + // jobFutures.emplace_back(Deferred_FolderLoad( + // "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Terrain", + // ".bin", false, + // &Contents[jobFutures.size()] + // )); + // jobFutures.emplace_back(Deferred_FolderLoad( + // "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Terrain", + // ".bin", false, + // &Contents[jobFutures.size()] + // )); + //} - { /* Ollivanders*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } + //{ /* Ollivanders*/ + // jobFutures.emplace_back(Deferred_FolderLoad( + // "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Meshes", + // ".bin", false, + // &Contents[jobFutures.size()] + // )); + // jobFutures.emplace_back(Deferred_FolderLoad( + // "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Collision", + // ".bin", false, + // &Contents[jobFutures.size()] + // )); + //} - { /* Gatehouse*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Gatehouse/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - } + //{ /* Gatehouse*/ + // jobFutures.emplace_back(Deferred_FolderLoad( + // "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Gatehouse/Meshes", + // ".bin", false, + // &Contents[jobFutures.size()] + // )); + //} - for (auto& jobFuture : jobFutures) - { - jobFuture.get(); - } + //for (auto& jobFuture : jobFutures) + //{ + // jobFuture.get(); + //} - for (_uint i = 0; i < Contents.size(); ++i) { - for (_uint j = 0; j < (Contents[i])->size(); ++j) { - FOLDER_LOAD* pContents = (*Contents[i])[j]; - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { - return E_FAIL; - } + //for (_uint i = 0; i < Contents.size(); ++i) { + // for (_uint j = 0; j < (Contents[i])->size(); ++j) { + // FOLDER_LOAD* pContents = (*Contents[i])[j]; + // if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { + // return E_FAIL; + // } - for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { - return E_FAIL; - } - } + // for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { + // if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { + // return E_FAIL; + // } + // } - } - } + // } + //} - for (_uint i = 0; i < Contents.size(); ++i) { - for (_uint j = 0; j < (Contents[i])->size(); ++j) { - Safe_Delete((*Contents[i])[j]); - } - Safe_Delete(Contents[i]); - } + //for (_uint i = 0; i < Contents.size(); ++i) { + // for (_uint j = 0; j < (Contents[i])->size(); ++j) { + // Safe_Delete((*Contents[i])[j]); + // } + // Safe_Delete(Contents[i]); + //} #pragma endregion diff --git a/Jusin154_Team3D/Client/Private/MapInfo.cpp b/Jusin154_Team3D/Client/Private/MapInfo.cpp index b556b49f6..ca6e5880e 100644 --- a/Jusin154_Team3D/Client/Private/MapInfo.cpp +++ b/Jusin154_Team3D/Client/Private/MapInfo.cpp @@ -15,6 +15,10 @@ void CMapInfo::Update(_float fTimeDelta) { } +void CMapInfo::Change_Level() +{ +} + HRESULT CMapInfo::Load_MapObjects(const _char* pFileName) { tinyxml2::XMLDocument xmlDoc; diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp index 2600aecab..d0e910781 100644 --- a/Jusin154_Team3D/Client/Private/Monster.cpp +++ b/Jusin154_Team3D/Client/Private/Monster.cpp @@ -2,6 +2,7 @@ #include "Monster.h" #include "GameInstance.h" +#include "InfoInstance.h" #include "Player.h" CMonster::CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -10,8 +11,10 @@ CMonster::CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) } CMonster::CMonster(const CMonster& Prototype) - : CUnit(Prototype) + : CUnit(Prototype), + m_pInfoInstance(CInfoInstance::GetInstance()) { + SAFE_ADDREF(m_pInfoInstance); } HRESULT CMonster::Initialize_Prototype() @@ -21,28 +24,37 @@ HRESULT CMonster::Initialize_Prototype() HRESULT CMonster::Initialize(void* pArg) { - if (FAILED(__super::Initialize(pArg))) + if (FAILED(__super::Initialize(pArg))){ return E_FAIL; + } - m_pPlayerTransform = static_cast(pArg)->Get_Component(); - SAFE_ADDREF(m_pPlayerTransform); return S_OK; } void CMonster::Priority_Update(_float fTimeDelta) { - + m_pTransformCom->RewindMomentum(); + __super::Priority_Update(fTimeDelta); } void CMonster::Update(_float fTimeDelta) { - + _vector vCurrentPos = Get_WorldPostion(); + pair pairTarget = m_pInfoInstance->Get_NearestPlayerAlly(vCurrentPos); + if (nullptr != pairTarget.first) { + Set_Target(*pairTarget.first, *pairTarget.second); + } + if (nullptr != m_pTarget && m_pTarget->isDead()) { + SAFE_RELEASE(m_pTarget); + m_fTargetDistance = { FLT_MAX }; + } + __super::Update(fTimeDelta); } void CMonster::Late_Update(_float fTimeDelta) { - m_fTargetDistance = m_pTransformCom->TargetDis(m_pPlayerTransform->Get_State(STATE::POSITION)); + __super::Late_Update(fTimeDelta); } HRESULT CMonster::Render() @@ -56,8 +68,9 @@ HRESULT CMonster::Ready_Components(void*pArg) /* Com_Shader */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH, - reinterpret_cast(&m_pShaderCom)))) + reinterpret_cast(&m_pShaderCom)))){ return E_FAIL; + } return S_OK; } @@ -67,11 +80,25 @@ HRESULT CMonster::Bind_ShaderResources() return S_OK; } +void CMonster::Set_Target(CUnit& pTarget, CTransform& pTransform) +{ + SAFE_RELEASE(m_pTarget); + m_pTarget = &pTarget; + SAFE_ADDREF(m_pTarget); + + _vector vTargetPos = pTransform.Get_State(STATE::POSITION); + _vector vToTargetDir = vTargetPos - Get_WorldPostion(); + XMStoreFloat4(&m_vTargetPos, vTargetPos); + XMStoreFloat3(&m_vToTargetDir, XMVector3Normalize(vToTargetDir)); + m_fTargetDistance = XMVectorGetX(XMVector3Length(vToTargetDir)); +} + void CMonster::Free() { __super::Free(); - SAFE_RELEASE(m_pPlayerTransform); + SAFE_RELEASE(m_pTarget); + SAFE_RELEASE(m_pInfoInstance); } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp index 27d673a78..3b45a35b0 100644 --- a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp +++ b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp @@ -2,6 +2,7 @@ #include "MonsterInfo.h" #include "GameInstance.h" #include "InfoInstance.h" +#include "Monster.h" CMonsterInfo::CMonsterInfo() { @@ -9,6 +10,150 @@ CMonsterInfo::CMonsterInfo() void CMonsterInfo::Update(_float fTimeDelta) { + Refresh_PlayerAllies(); + Refresh_LockOnMonsters(); +} + +void CMonsterInfo::Change_Level() +{ + SAFE_RELEASE(m_pLockOnMonster); + for (CMonster* pMonster : m_ActiveMonsters) { + SAFE_RELEASE(pMonster); + } m_ActiveMonsters.clear(); + for (CUnit* pPlayerAlly : m_PlayerAllies) { + SAFE_RELEASE(pPlayerAlly); + } m_PlayerAllies.clear(); +} + +HRESULT CMonsterInfo::Regist_PlayerAlly(CUnit* pUnit) +{ + for (CUnit* pAlly : m_PlayerAllies) { + if (pAlly == pUnit) { + return E_ACCESSDENIED; + } + } m_PlayerAllies.push_back(pUnit); + SAFE_ADDREF(pUnit); + return S_OK; +} + +HRESULT CMonsterInfo::Deregist_PlayerAlly(CUnit* pUnit) +{ + for (list::iterator iter = m_PlayerAllies.begin(); iter != m_PlayerAllies.end();) { + if (*iter == pUnit) { + SAFE_RELEASE(*iter); + m_PlayerAllies.erase(iter); + break; + } + } + return E_FAIL; +} + +HRESULT CMonsterInfo::Regist_ActiveMonster(CMonster* pUnit) +{ + for (CMonster* pMonster : m_ActiveMonsters) { + if (pMonster == pUnit) { + return E_ACCESSDENIED; + } + } m_ActiveMonsters.push_back(pUnit); + SAFE_ADDREF(pUnit); + return S_OK; +} + +HRESULT CMonsterInfo::Deregist_ActiveMonster(CMonster* pUnit) +{ + for (list::iterator iter = m_ActiveMonsters.begin(); iter != m_ActiveMonsters.end();) { + if (*iter == pUnit) { + SAFE_RELEASE(*iter); + m_ActiveMonsters.erase(iter); + break; + } + } + return E_FAIL; +} + +CMonster* CMonsterInfo::Get_LockOnMonster() +{ + return m_pLockOnMonster; +} + +pair CMonsterInfo::Get_NearestPlayerAlly(_fvector vPos) +{ + _float fLengthMAX = FLT_MAX; + CTransform* pNearestPlayerAllyTransform = { nullptr }; + CUnit* pNearestPlayerAlly = { nullptr }; + + for (list::iterator iter = m_PlayerAllies.begin(); iter != m_PlayerAllies.end(); ++iter) { + + CTransform* pTransform = (*iter)->Get_Component(); + _float fNewLength = XMVectorGetX(XMVector3LengthSq(pTransform->Get_State(STATE::POSITION) - vPos)); + + if (nullptr == pNearestPlayerAlly) { + pNearestPlayerAlly = (*iter); + fLengthMAX = fNewLength; + pNearestPlayerAllyTransform = pTransform; + continue; + } + + if (fNewLength < fLengthMAX) { + pNearestPlayerAlly = (*iter); + pNearestPlayerAllyTransform = pTransform; + fLengthMAX = fNewLength; + } + } + return { pNearestPlayerAlly, pNearestPlayerAllyTransform }; +} + +HRESULT CMonsterInfo::Refresh_LockOnMonsters() +{ + SAFE_RELEASE(m_pLockOnMonster); + _vector vCameraLook = m_pGameInstance->Get_CameraLook(); + _vector vCameraPos = m_pGameInstance->Get_CamXMPosition(); + _float fMaxDot = { 0.f }; + + _vector vMonsterPos; + _vector vToMonsterDir; + + { // 뷰프러스텀 순회해서 가장 중앙에 근접한 몬스터 찾기 + for (list::iterator iter = m_ActiveMonsters.begin(); iter != m_ActiveMonsters.end(); ++iter) { + + // (카메라의 룩)과 (카메라 -> 몬스터 방향 벡터)를 내적해서 가장 큰 크기가 나온 몬스타가 락온 대상 + vMonsterPos = (*iter)->Get_WorldPostion(); + vToMonsterDir = vMonsterPos - vCameraPos; + _float fDotResult = CMyTools::DirectionCompare(vCameraLook, vToMonsterDir); + if (fDotResult <= 0.f) { + continue; + } + + if (nullptr == m_pLockOnMonster) { + m_pLockOnMonster = (*iter); + fMaxDot = fDotResult; + continue; + } + + if (fMaxDot < fDotResult) { + m_pLockOnMonster = (*iter); + fMaxDot = fDotResult; + } + } + } + if (nullptr != m_pLockOnMonster) { + SAFE_ADDREF(m_pLockOnMonster); + } + return S_OK; +} + +HRESULT CMonsterInfo::Refresh_PlayerAllies() +{ + for (list::iterator iter = m_PlayerAllies.begin(); iter != m_PlayerAllies.end();) { + if (true == (*iter)->isDead()) { + SAFE_RELEASE(*iter); + iter = m_PlayerAllies.erase(iter); + } + else { + iter++; + } + } + return S_OK; } HRESULT CMonsterInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) @@ -23,7 +168,6 @@ HRESULT CMonsterInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pCo SAFE_ADDREF(m_pDevice); SAFE_ADDREF(m_pContext); - return S_OK; } @@ -42,9 +186,16 @@ void CMonsterInfo::Free() { __super::Free(); + SAFE_RELEASE(m_pLockOnMonster); + for (CMonster* pMonster : m_ActiveMonsters) { + SAFE_RELEASE(pMonster); + } m_ActiveMonsters.clear(); + for (CUnit* pAlly : m_PlayerAllies) { + SAFE_RELEASE(pAlly); + } m_PlayerAllies.clear(); + SAFE_RELEASE(m_pGameInstance); SAFE_RELEASE(m_pInfoInstance); SAFE_RELEASE(m_pDevice); SAFE_RELEASE(m_pContext); - } diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index b9d22ce31..3aadbfd63 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -2,6 +2,7 @@ #include "Player.h" #include "GameInstance.h" +#include "InfoInstance.h" #include "CamPosition_Socket.h" #include "Camera_Gaze.h" #include "CamPosition_Arm.h" @@ -28,8 +29,10 @@ CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) } CPlayer::CPlayer(const CPlayer& Prototype) - : CUnit(Prototype) + : CUnit(Prototype), + m_pInfoInstance(CInfoInstance::GetInstance()) { + SAFE_ADDREF(m_pInfoInstance); } HRESULT CPlayer::Initialize_Prototype() @@ -73,6 +76,8 @@ HRESULT CPlayer::Initialize(void* pArg) m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); + m_pInfoInstance->Regist_PlayerAlly(this); + #ifdef _DEBUG m_BasicEffect = make_unique(m_pDevice); m_BasicEffect->SetVertexColorEnabled(true); @@ -362,6 +367,7 @@ void CPlayer::Free() SAFE_RELEASE(m_pCamPosition_TopDown_FollowPart); SAFE_RELEASE(m_pCamPosition_TopDown_LookPart); SAFE_RELEASE(m_pCamPosition_ShoulderPart); + SAFE_RELEASE(m_pInfoInstance); } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/PlayerInfo.cpp b/Jusin154_Team3D/Client/Private/PlayerInfo.cpp index d355667a6..a923b62a7 100644 --- a/Jusin154_Team3D/Client/Private/PlayerInfo.cpp +++ b/Jusin154_Team3D/Client/Private/PlayerInfo.cpp @@ -11,6 +11,10 @@ void CPlayerInfo::Update(_float fTimeDelta) { } +void CPlayerInfo::Change_Level() +{ +} + HRESULT CPlayerInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) { m_pGameInstance = CGameInstance::GetInstance(); diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index f9d694570..351319525 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -22,6 +22,20 @@ #include "Bombard.h" +template +void CPlayer::Spawn_Effect() +{ + CPartObject::PARTOBJECT_DESC PartsDesc{}; + + PartsDesc.pParentTransform = m_pTransformCom; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(NEXT_LEVEL, NEXT_LEVEL, TEXT("Layer_Effect"), &PartsDesc, this, nullptr))) { + assert(false); + return; + } +} + + #pragma region States void CPlayer::TestKeyInput(_float fTimeDelta) { @@ -64,6 +78,7 @@ HRESULT CPlayer::InputAction() || m_pGameInstance->Key_Down(DIK_LSHIFT) || m_pGameInstance->Key_Down(DIK_C) || m_pGameInstance->Key_Down(DIK_V) + || m_pGameInstance->Key_Down(DIK_Z) ) { return S_OK; @@ -83,6 +98,18 @@ HRESULT CPlayer::InputMove() return E_FAIL; } +HRESULT CPlayer::InputKeyUpMove() +{ + if (m_pGameInstance->Key_Up(DIK_W) + || m_pGameInstance->Key_Up(DIK_A) + || m_pGameInstance->Key_Up(DIK_S) + || m_pGameInstance->Key_Up(DIK_D)) + { + return S_OK; + } + return E_FAIL; +} + HRESULT CPlayer::InputSpell() { if ( @@ -108,11 +135,12 @@ void CPlayer::Behavior_IdleEnter() { // S_OK -> 현 상태 유지 // E_FAIL -> 현 상태 탈출 -HRESULT CPlayer::Behavior_IdleExitCheck() +HRESULT CPlayer::Behavior_IdleExitCheck(_float fTimeDelta) { pair<_uint, _bool> pairAnimInfo; _vector xmvLook = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); _vector xmvRight = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::RIGHT), 0.f)); + _uint iCurrentAnimIndex = m_pModelCom->Get_AnimIndex(); if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) { if (m_pGameInstance->Key_Down(DIK_SPACE)) { m_pFSM->Change_State(FSMSTATE::JUMP); @@ -138,37 +166,77 @@ HRESULT CPlayer::Behavior_IdleExitCheck() return E_FAIL; } - if (SUCCEEDED(InputMove())) { - - if (m_pGameInstance->Key_Pressing(DIK_W)) + if (SUCCEEDED(InputMove())) + { + m_fInputTime += fTimeDelta; + if (m_fInputTime > 0.2f) { + m_fInputTime = 0.f; m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; } } - if (m_pGameInstance->Key_Down(DIK_D)) + if (SUCCEEDED(InputKeyUpMove())) { - pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_R]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + _vector xmvInputDir = XMVectorZero(); + + _vector xmvCamLook = XMVector4Normalize(XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f)); + _vector xmvCamRight = XMVector4Normalize(XMVectorSet(m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z, 0.f)); + + if (m_pGameInstance->Key_Up(DIK_W)) + xmvInputDir += xmvCamLook; + if (m_pGameInstance->Key_Up(DIK_S)) + xmvInputDir -= xmvCamLook; + if (m_pGameInstance->Key_Up(DIK_A)) + xmvInputDir -= xmvCamRight; + if (m_pGameInstance->Key_Up(DIK_D)) + xmvInputDir += xmvCamRight; + + if (XMVector3Equal(xmvInputDir, XMVectorZero())) + return E_FAIL; + + xmvInputDir = XMVector3Normalize(xmvInputDir); + + _float2 vInputDir = { XMVectorGetX(xmvInputDir),XMVectorGetZ(xmvInputDir) }; + + _vector xmvCurLook = XMVector4Normalize( + XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); + _float2 vCurLook = { XMVectorGetX(xmvCurLook),XMVectorGetZ(xmvCurLook) }; + + _float vDir = CMyTools::Get_Direction2D(vCurLook, vInputDir); + _float absDir = fabsf(vDir); + + _float cross = vCurLook.x * vInputDir.y - vCurLook.y * vInputDir.x; + + if (m_pFSM->IsEnable(FSMSTATE::IDLE)) + { + if (absDir < XMConvertToRadians(45.f)) + { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + else if (absDir < XMConvertToRadians(135.f)) + { + if (cross > 0.f) { + pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_L]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_R]; + } + } + else + { + pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_BWD]; + } + + m_pFSM->Enable_State(FSMSTATE::IDLE_TURN); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,m_fAmount); + } + return E_FAIL; } - if (m_pGameInstance->Key_Down(DIK_A)) - { - pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_L]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - return E_FAIL; - } - - if (m_pGameInstance->Key_Down(DIK_S)) - { - pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_BWD]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - return E_FAIL; - } - - if (m_pModelCom->IsFinishedAnim()) { pairAnimInfo = m_Animation[STATEANIM::IDLE]; @@ -179,7 +247,7 @@ HRESULT CPlayer::Behavior_IdleExitCheck() void CPlayer::Behavior_IdleExit() { - m_pFSM->Disable_State(FSMSTATE::IDLE); + m_pFSM->Disable_State(FSMSTATE::IDLE | FSMSTATE::IDLE_TURN); } void CPlayer::Behavior_MoveEnter() @@ -213,15 +281,10 @@ void CPlayer::Behavior_MoveEnter() m_pFSM->Enable_State(FSMSTATE::JOG); m_bSprintToggle = false; m_bWalkToggle = false; - if (bFoward) + if (SUCCEEDED(InputMove())) { pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; } - else if (bBackward) - { - pairAnimInfo = m_Animation[STATEANIM::JOG_BWD]; - m_fAmount = 0.2f; - } } } else { // While Moving @@ -245,14 +308,12 @@ void CPlayer::Behavior_MoveEnter() m_pFSM->Enable_State(FSMSTATE::JOG); m_bSprintToggle = false; m_bWalkToggle = false; - if (bFoward) - { - pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; - } + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + m_bRatio = true; } } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount, m_bRatio); m_fAmount = 1.f; } @@ -285,6 +346,9 @@ HRESULT CPlayer::Behavior_MoveExitCheck() else if (m_pGameInstance->Key_Down(DIK_V)) { m_pFSM->Change_State(FSMSTATE::COMBAT); } + else if (m_pGameInstance->Key_Down(DIK_Z)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } else if (m_pGameInstance->Key_Down(DIK_LSHIFT)) { m_bSprintToggle = !m_bSprintToggle; m_bWalkToggle = false; @@ -323,29 +387,36 @@ HRESULT CPlayer::Behavior_MoveExitCheck() } if (SUCCEEDED(InputMove())) { - _vector xmvPlayerDir = { }; + _vector xmvInputDir = XMVectorZero(); - { // 이동방향 누적 - if (m_pGameInstance->Key_Pressing(DIK_W)) { - xmvPlayerDir += xmvLook; - } - if (m_pGameInstance->Key_Pressing(DIK_A)) { - xmvPlayerDir -= xmvRight; - } - if (m_pGameInstance->Key_Pressing(DIK_S)) { - xmvPlayerDir -= xmvLook; - } - if (m_pGameInstance->Key_Pressing(DIK_D)) { - xmvPlayerDir += xmvRight; - } - } + _vector xmvCamLook = XMVector4Normalize(XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f)); + _vector xmvCamRight = XMVector4Normalize(XMVectorSet(m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z, 0.f)); - xmvPlayerDir = XMVectorSetW(XMVector3Normalize(xmvPlayerDir), 0.f); + if (m_pGameInstance->Key_Pressing(DIK_W)) + xmvInputDir += xmvCamLook; + if (m_pGameInstance->Key_Pressing(DIK_S)) + xmvInputDir -= xmvCamLook; + if (m_pGameInstance->Key_Pressing(DIK_A)) + xmvInputDir -= xmvCamRight; + if (m_pGameInstance->Key_Pressing(DIK_D)) + xmvInputDir += xmvCamRight; - _float2 vPlayerDir = { XMVectorGetX(xmvPlayerDir), XMVectorGetZ(xmvPlayerDir) }; - _float2 vCameraLookDir = { m_vCameraLookDir.x, m_vCameraLookDir.z }; + if (XMVector3Equal(xmvInputDir, XMVectorZero())) + return E_FAIL; + + xmvInputDir = XMVector3Normalize(xmvInputDir); + + _float2 vInputDir = { XMVectorGetX(xmvInputDir),XMVectorGetZ(xmvInputDir) }; + + _vector xmvCurLook = XMVector4Normalize( + XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); + _float2 vCurLook = { XMVectorGetX(xmvCurLook),XMVectorGetZ(xmvCurLook) }; + + _float vDir = CMyTools::Get_Direction2D(vCurLook, vInputDir); + _float absDir = fabsf(vDir); + + _float cross = vCurLook.x * vInputDir.y - vCurLook.y * vInputDir.x; - _float vDir = CMyTools::Get_Direction2D(vCameraLookDir, vPlayerDir); _bool bSkipAngleCheck = { false }; if (m_pFSM->IsEnable(FSMSTATE::JOG)) { if (iCurrentAnimIndex != m_Animation[STATEANIM::JOG_FWD].first) { @@ -357,38 +428,31 @@ HRESULT CPlayer::Behavior_MoveExitCheck() } } if (!bSkipAngleCheck) { - _bool bLeft = { true }; - if (vDir < 0.f) - { - // + left - } - else - { - // - Right - } - _float absDir = fabsf(vDir); - if (absDir < XMConvertToRadians(160.f)) { + if (absDir <= XMConvertToRadians(80.f)) { pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; } - else if (absDir < XMConvertToRadians(90.f)) { - // pairAnimInfo = m_Animation[STATEANIM::] + else if (absDir < XMConvertToRadians(160.f)) { + if (cross > 0) + { + pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT]; + m_fAmount = 0.2f; + m_bRatio = true; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT]; + m_fAmount = 0.2f; + m_bRatio = true; + } } - else if (absDir < XMConvertToRadians(112.f)) { - // pairAnimInfo = m_Animation[STATEANIM::] - } - else if (absDir < XMConvertToRadians(135.f)) { - // pairAnimInfo = m_Animation[STATEANIM::] - } - else if (absDir < XMConvertToRadians(180.f)) { + else { pairAnimInfo = m_Animation[STATEANIM::JOG_BWD]; - + m_fAmount = 0.2f; + m_bRatio = true; } - { // left Right - - } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,m_fAmount, m_bRatio); + m_fAmount = 1.f; } } return S_OK; @@ -413,7 +477,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck() m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } } - else if (IsCurrentKeyFrame("Dodge")) + else if (IsCurrentKeyFrame("TurnStop")) { m_pFSM->Change_State(FSMSTATE::IDLE); @@ -572,7 +636,10 @@ void CPlayer::Behavior_CombatEnter() else if (m_pGameInstance->Key_Down(DIK_V)) { m_pFSM->Enable_State(FSMSTATE::MAPHELP); pairAnimInfo = m_Animation[STATEANIM::MAPHELP]; - + } + else if (m_pGameInstance->Key_Down(DIK_Z)) { + m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW); + pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW]; } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); @@ -624,6 +691,11 @@ HRESULT CPlayer::Behavior_CombatExitCheck() pairAnimInfo = m_Animation[STATEANIM::MAPHELP]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } + else if (m_pGameInstance->Key_Down(DIK_Z)) { + m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW); + pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } } if (m_pFSM->IsEnable(FSMSTATE::SPELL) && IsCurrentKeyFrame("Combat")) @@ -636,16 +708,7 @@ HRESULT CPlayer::Behavior_CombatExitCheck() { /* TODO 임시 방편 */ pairAnimInfo = m_Animation[STATEANIM::ACCIO]; - - CPartObject::PARTOBJECT_DESC PartsDesc{}; - - PartsDesc.pParentTransform = m_pTransformCom; - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(NEXT_LEVEL, NEXT_LEVEL, TEXT("Layer_Effect"), &PartsDesc, this, nullptr))) { - assert(false); - return E_FAIL; - } - + } break; case STATEANIM::DESCENDO: @@ -655,15 +718,30 @@ HRESULT CPlayer::Behavior_CombatExitCheck() break; } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - m_eSpell = STATEANIM::END; + m_pModelCom->Anim_Event(0.1f, m_Animation[STATEANIM::ACCIO].first, [this]() { + Spawn_Effect(); + m_eSpell = STATEANIM::END; + return E_FAIL; + }); + } + } + + + if (m_pFSM->IsEnable(FSMSTATE::ANCIENT_THROW)) + { + if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Throw")) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + } + else + { + if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) { + m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; } } - if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) { - m_pFSM->Change_State(FSMSTATE::MOVE); - return E_FAIL; - } if (m_pModelCom->IsFinishedAnim()) { m_pFSM->Change_State(FSMSTATE::IDLE); @@ -675,7 +753,7 @@ HRESULT CPlayer::Behavior_CombatExitCheck() void CPlayer::Behavior_CombatExit() { - m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::SPELL | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP); + m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::SPELL | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP | FSMSTATE::ANCIENT_THROW); } void CPlayer::Add_FSM() @@ -685,7 +763,7 @@ void CPlayer::Add_FSM() CState_Idle::STATE_IDLE_DESC Desc{}; Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); }; - Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(fTimedelta); }; Desc.funcExitEvent = [this]() { Behavior_IdleExit(); }; Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; @@ -702,9 +780,13 @@ void CPlayer::Add_FSM() _vector xmvPlayerDir = { }; { - _float3 fMove = m_pGameInstance->Get_MouseMove(); - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x* 0.1f); - m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.y * 0.1f); + if (!m_pFSM->IsEnable(FSMSTATE::STOP)) + { + _float3 fMove = m_pGameInstance->Get_MouseMove(); + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.05f); + m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.y * 0.05f); + } + if (m_pGameInstance->Key_Pressing(DIK_A)) { xmvPlayerDir -= xmvRight; @@ -720,10 +802,10 @@ void CPlayer::Add_FSM() _float vDir = CMyTools::Get_Direction2D(vCameraLookDir, vPlayerDir); _float absDir = fabsf(vDir); - if (m_pGameInstance->Key_Pressing(DIK_A)&& vDir < XMConvertToRadians(140.f) ) { + /*if (m_pGameInstance->Key_Pressing(DIK_A)&& vDir < XMConvertToRadians(140.f) ) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); } if (m_pGameInstance->Key_Pressing(DIK_D)&& vDir > XMConvertToRadians(-140.f) ) { - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }; + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };*/ }; @@ -782,7 +864,7 @@ void CPlayer::Add_FSM() void CPlayer::Set_Anim() { - m_Animation[STATEANIM::IDLE] = { 817,true }; + m_Animation[STATEANIM::IDLE] = { 266,true }; m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false }; m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false }; m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false }; @@ -792,7 +874,9 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::WALK_STOP] = { 344,false }; m_Animation[STATEANIM::JOG_FWD] = { 167,true }; - m_Animation[STATEANIM::JOG_BWD] = { 154,false }; + m_Animation[STATEANIM::JOG_LEFT] = { 164,false }; + m_Animation[STATEANIM::JOG_RIGHT] = { 185,false }; + m_Animation[STATEANIM::JOG_BWD] = { 154,false };//176 m_Animation[STATEANIM::JOG_STOP] = { 289,false }; m_Animation[STATEANIM::JUMP] = { 205,false }; @@ -818,6 +902,7 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::LUMOS] = { 782,false }; m_Animation[STATEANIM::DISILLUSION_ENTER] = { 585,false }; m_Animation[STATEANIM::DISILLUSION_EXIT] = { 586,false }; + m_Animation[STATEANIM::ANCIENT_THROW] = { 843,false }; } #pragma endregion State diff --git a/Jusin154_Team3D/Client/Private/Terrain.cpp b/Jusin154_Team3D/Client/Private/Terrain.cpp index 019ea5f7d..d6c9f79a4 100644 --- a/Jusin154_Team3D/Client/Private/Terrain.cpp +++ b/Jusin154_Team3D/Client/Private/Terrain.cpp @@ -166,8 +166,9 @@ HRESULT CTerrain::Bind_ShaderResources() return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fUsingSurfaceParams", &m_fUsingSurfaceParams, sizeof(_float)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_fUsingSurfaceParams", &m_fUsingSurfaceParams, sizeof(_float)))){ return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Public/Client_Define.h b/Jusin154_Team3D/Client/Public/Client_Define.h index 875851cbf..2c0362b5d 100644 --- a/Jusin154_Team3D/Client/Public/Client_Define.h +++ b/Jusin154_Team3D/Client/Public/Client_Define.h @@ -12,7 +12,7 @@ namespace Client { const unsigned int g_iWinSizeX = 1920; const unsigned int g_iWinSizeY = 1080; - + class CInfoInstance; } using namespace Client; diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 63f562157..99f111ed4 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -13,7 +13,7 @@ namespace Client enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR, END }; - enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, BLUR_NO_WORLD, END }; + enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, END }; enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, END }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; diff --git a/Jusin154_Team3D/Client/Public/Goblin.h b/Jusin154_Team3D/Client/Public/Goblin.h index 0665ba634..4769da3e5 100644 --- a/Jusin154_Team3D/Client/Public/Goblin.h +++ b/Jusin154_Team3D/Client/Public/Goblin.h @@ -15,8 +15,6 @@ class CGoblin final : public CMonster virtual ~CGoblin() = default; public: - virtual HRESULT Initialize_Prototype() override; - virtual HRESULT Initialize(void* pArg) override; virtual void Priority_Update(_float fTimeDelta) override; virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; @@ -30,6 +28,8 @@ class CGoblin final : public CMonster CRigidBody_Dynamic* m_pRigidBody = { nullptr }; private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; HRESULT Ready_Components(); HRESULT Bind_ShaderResources(); diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index 3ac241636..982be5a56 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -5,6 +5,8 @@ NS_BEGIN(Engine) class CGameInstance; +class CTransform; +class CUnit; NS_END NS_BEGIN(Client) @@ -21,8 +23,17 @@ class CInfoInstance final : public CBase LEVEL Get_RestartLevel(); public: void Update(_float fTimeDelta); + void Change_Level(); +#pragma region MONSTER_INFO + HRESULT Regist_PlayerAlly(CUnit* pUnit); + HRESULT Deregist_PlayerAlly(CUnit* pUnit); + HRESULT Regist_ActiveMonster(class CMonster* pUnit); + HRESULT Deregist_ActiveMonster(class CMonster* pUnit); + class CMonster* Get_LockOnMonster(); + pair Get_NearestPlayerAlly(_fvector vPos); +#pragma endregion #pragma region MAP_INFO HRESULT Load_MapObjects(const _char* pFilePath); #pragma endregion diff --git a/Jusin154_Team3D/Client/Public/MapInfo.h b/Jusin154_Team3D/Client/Public/MapInfo.h index b75b500ec..0a3e4c98b 100644 --- a/Jusin154_Team3D/Client/Public/MapInfo.h +++ b/Jusin154_Team3D/Client/Public/MapInfo.h @@ -16,6 +16,7 @@ class CMapInfo final : public CBase ~CMapInfo() = default; public: void Update(_float fTimeDelta); + void Change_Level(); HRESULT Load_MapObjects(const _char* pFilePath); diff --git a/Jusin154_Team3D/Client/Public/Monster.h b/Jusin154_Team3D/Client/Public/Monster.h index dfca98381..d14859b21 100644 --- a/Jusin154_Team3D/Client/Public/Monster.h +++ b/Jusin154_Team3D/Client/Public/Monster.h @@ -13,20 +13,24 @@ class CMonster abstract : public CUnit virtual ~CMonster() = default; public: - virtual HRESULT Initialize_Prototype() override; - virtual HRESULT Initialize(void* pArg) override; virtual void Priority_Update(_float fTimeDelta) override; virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; protected: - CTransform* m_pPlayerTransform = { nullptr }; - _float m_fTargetDistance = {}; + CInfoInstance* m_pInfoInstance = { nullptr }; + CUnit* m_pTarget = { nullptr }; + _float4 m_vTargetPos = { }; + _float3 m_vToTargetDir = { }; + _float m_fTargetDistance = { FLT_MAX }; protected: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; HRESULT Ready_Components(void* pArg); HRESULT Bind_ShaderResources(); + void Set_Target(CUnit& pTarget, CTransform& pTransform); public: virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE; diff --git a/Jusin154_Team3D/Client/Public/MonsterInfo.h b/Jusin154_Team3D/Client/Public/MonsterInfo.h index 66828a8de..e16801af6 100644 --- a/Jusin154_Team3D/Client/Public/MonsterInfo.h +++ b/Jusin154_Team3D/Client/Public/MonsterInfo.h @@ -5,6 +5,8 @@ NS_BEGIN(Engine) class CGameInstance; +class CUnit; +class CTransform; NS_END NS_BEGIN(Client) @@ -16,6 +18,15 @@ class CMonsterInfo final : public CBase ~CMonsterInfo() = default; public: void Update(_float fTimeDelta); + void Change_Level(); + + HRESULT Regist_PlayerAlly(CUnit* pUnit); + HRESULT Deregist_PlayerAlly(CUnit* pUnit); + HRESULT Regist_ActiveMonster(class CMonster* pUnit); + HRESULT Deregist_ActiveMonster(class CMonster* pUnit); + + class CMonster* Get_LockOnMonster(); + pair Get_NearestPlayerAlly(_fvector vPos); private: CGameInstance* m_pGameInstance = { nullptr }; @@ -23,8 +34,15 @@ class CMonsterInfo final : public CBase ID3D11Device* m_pDevice = { nullptr }; ID3D11DeviceContext* m_pContext = { nullptr }; + class CMonster* m_pLockOnMonster = { nullptr }; + list m_ActiveMonsters = {}; + list m_PlayerAllies = {}; + private: HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + HRESULT Refresh_LockOnMonsters(); + HRESULT Refresh_PlayerAllies(); + public: static CMonsterInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 39f0b6ba7..650ffe4d0 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -23,6 +23,7 @@ class CPlayer final : public CUnit _bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; } private: + CInfoInstance* m_pInfoInstance = { nullptr }; _float m_fDirectionRadian = 0.f; _bool m_bSprintToggle = { false }; @@ -68,20 +69,27 @@ class CPlayer final : public CUnit public: virtual void Reset_Sprint() { m_bSprintToggle = false; } virtual void Reset_Walk() { m_bWalkToggle = false; } + template + void Spawn_Effect(); private: + + void TestKeyInput(_float fTimeDelta); virtual void Add_FSM(); virtual void Set_Anim(); _float m_fAmount = { 1.f }; + _float m_fInputTime = {}; + _bool m_bRatio = { false }; HRESULT InputAction(); HRESULT InputMove(); + HRESULT InputKeyUpMove(); HRESULT InputSpell(); void Behavior_IdleEnter(); - HRESULT Behavior_IdleExitCheck(); + HRESULT Behavior_IdleExitCheck(_float fTimeDelta); void Behavior_IdleExit(); void Behavior_MoveEnter(); diff --git a/Jusin154_Team3D/Client/Public/PlayerInfo.h b/Jusin154_Team3D/Client/Public/PlayerInfo.h index 84027298e..01ebcd01b 100644 --- a/Jusin154_Team3D/Client/Public/PlayerInfo.h +++ b/Jusin154_Team3D/Client/Public/PlayerInfo.h @@ -5,6 +5,7 @@ NS_BEGIN(Engine) class CGameInstance; +class CTransform; NS_END NS_BEGIN(Client) @@ -16,6 +17,7 @@ class CPlayerInfo final : public CBase ~CPlayerInfo() = default; public: void Update(_float fTimeDelta); + void Change_Level(); private: CGameInstance* m_pGameInstance = { nullptr }; @@ -23,6 +25,10 @@ class CPlayerInfo final : public CBase ID3D11Device* m_pDevice = { nullptr }; ID3D11DeviceContext* m_pContext = { nullptr }; +private: + CTransform* m_pTransform = { nullptr }; + + private: HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/KeyFrame.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/KeyFrame.bin index db111f003..1659b3c53 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/KeyFrame.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/KeyFrame.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:712744472b22eae067bd6cbc4da787016126d0b705448efff431cfd21e337281 -size 43 +oid sha256:c72bebef45c2f8b41a979d946702bdbe447aefb9c1a055e66c91901e3bc21e5b +size 72 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin_Anim.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin_Anim.fbx index 320b93641..24f3df2f4 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin_Anim.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin_Anim.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a6b3c84007827d3b00905b78ca4de6a4a88a05d2996410b3677ad65530ef6ce -size 43823820 +oid sha256:7a79d73c0eeab355f9fbbab5ba1c4c42896d33efecb885325ea3c0f036dd4507 +size 43823420 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 7037ecd28..754d895eb 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -165,18 +165,30 @@ PBR_LIGHT_OUT PBR_Lighting( Out.vShade = (kD / PI) * (NdotL * fAttenuation) * vLightColor; Out.vSpecular = specularBRDF * vLightColor * fAttenuation * NdotL; - + return Out; } -float GetBloomCurve(float x) +float GetBloomCurve(float x, float fThreshold, uint iMethod) { float fResult = x; - float fThreshold = 0.68f * 2.f; + // float fThreshold = 0.68f * 2.f; x *= 2.f; - fResult = x * 0.05f // 최소 기본값 보장 + if (iMethod == 0) + { + fResult = x * 0.05f // 최소 기본값 보장 + max(0, x - fThreshold) // 밝기값 68 이하는 기본값으로하고 초과하면 그 값만큼 더해줌 * 0.5f; // 0~2로 정규화 되어있기 때문에 강조 값 보정해줌 + } + else if (iMethod == 1) + { + fResult = x * x / 3.2f; + } + else if (iMethod == 2) + { + fResult = max(0, x - fThreshold); + fResult = pow(fResult, 3.f); + } return fResult * 0.5f; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli index 3b37f3b2c..f8468ae65 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli @@ -61,6 +61,13 @@ DepthStencilState DSS_Effect BlendState BS_None { BlendEnable[0] = false; + BlendEnable[1] = false; + BlendEnable[2] = false; + BlendEnable[3] = false; + BlendEnable[4] = false; + BlendEnable[5] = false; + BlendEnable[6] = false; + BlendEnable[7] = false; }; BlendState BS_AlphaBlend // ALPHA_BLEND diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index eef8ea86c..f401dc228 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -11,6 +11,9 @@ uint g_iMaxShadowWidth; uint g_iMaxShadowHeight; float2 g_vResolution; +uint g_iBloomEmbossingPass; +float g_fThreshold; + Texture2D g_Texture; float g_fLightRange; @@ -90,6 +93,7 @@ struct PS_IN struct PS_OUT_BACKBUFFER { float4 vBackBuffer : SV_TARGET0; + float4 vBloomBuffer : SV_Target1; }; PS_OUT_BACKBUFFER PS_MAIN_DEBUG(PS_IN In) @@ -97,7 +101,7 @@ PS_OUT_BACKBUFFER PS_MAIN_DEBUG(PS_IN In) PS_OUT_BACKBUFFER Out; Out.vBackBuffer = g_Texture.Sample(DefaultSampler, In.vTexcoord); - + Out.vBloomBuffer = float4(0.f, 0.f, 0.f, 0.f); return Out; } @@ -146,7 +150,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) fMetallic = vMRO.r; fRoughness = vMRO.g; fOcclusion = vMRO.b; - + vF0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic); } else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_SPECULAR)) // Specular @@ -412,36 +416,8 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) Out.vBackBuffer.rgb *= lerp(0.5f, 1.f, min(fVisibility_Dynamic, fVisibility_Static)); - //float fShadowDepth = g_ShadowTexture.Sample(DefaultSampler, vTexcoord).x; - //float fPreShadowDepth = g_PreShadowTexture.Sample(DefaultSampler, vPreShadowTexcoord).x; - //bool IsShadow = { false }; - //if (vPosition.z - 0.0005f > fShadowDepth) - //{ - // IsShadow = true; - //} - //if (vPreShadowPosition.z - 0.0005f > fPreShadowDepth) - //{ - // IsShadow = true; - //} - //if (true == IsShadow) - //{ - // Out.vBackBuffer *= 0.5f; - //} float4 vColor = 0.f; - - - int iBlurWeight = (int)(round(g_BlurWeightXTexture.Sample(ClampSampler, In.vTexcoord).r) * 128.f); - - int iBlurMin; - int iBlurMax; - - iBlurMin = -1 * (iBlurWeight / 2) + 1; - iBlurMax = iBlurWeight / 2; - - // // 변수로 루프돌리려면 반드시 필요함 - - for (int i = -63; i < 64; ++i) { vTexcoord.x = In.vTexcoord.x; @@ -451,40 +427,64 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) } Out.vBackBuffer += vColor; + Out.vBloomBuffer; return Out; } -PS_OUT_BACKBUFFER PS_MAIN_REFIT(PS_IN In) -{ - PS_OUT_BACKBUFFER Out; - Out.vBackBuffer = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord); +struct PS_OUT_FLT4_SINGLE +{ + vector vSingleTarget : SV_TARGET0; +}; + + +PS_OUT_FLT4_SINGLE PS_MAIN_REFIT(PS_IN In) +{ + PS_OUT_FLT4_SINGLE Out; + + Out.vSingleTarget = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord); return Out; } -PS_OUT_BACKBUFFER PS_MAIN_EMBOSS(PS_IN In) +PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In) { - PS_OUT_BACKBUFFER Out; + PS_OUT_FLT4_SINGLE Out; - float3 vColor = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord).xyz; + vector vInput = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord); + //float fMask = g_BloomMaskTexture.Sample(PointSampler, In.vTexcoord).a; + float3 vColor = vInput.rgb; + uint iMask = (uint) round(vInput.a * 255.f); // int a = 1 // vBloom.a = (enum / 255); - // temp 이거 키면 겁나 빤짞빤짞 빛남 ㄷㄷ - //vColor *= 3.f; - // temp + switch (iMask) + { + case 0: + /* None */ + vColor = float3(0.f, 0.f, 0.f); + break; + case 1: + /* Basic_Apply */ + break; + case 2: + /* Multiply */ + vColor *= 3; + break; + case 3: + break; + } - //float fIntensity = dot(vColor, float3(0.3333f, 0.3333f, 0.3333f)); // 대략적인 밝기 float fIntensity = dot(vColor, float3(0.2126f, 0.7152f, 0.0722f)); // 대략적인 밝기 ( 인간적인 ) if (fIntensity <= 1e-4f) { - Out.vBackBuffer = 0; + Out.vSingleTarget = 0; return Out; } - float fBloomIntensity = GetBloomCurve(fIntensity); + + float fBloomIntensity = GetBloomCurve(fIntensity, g_fThreshold, g_iBloomEmbossingPass); float3 bloomColor = (vColor * fBloomIntensity) / fIntensity; - Out.vBackBuffer = float4(bloomColor, 1.f); + Out.vSingleTarget = float4(bloomColor, 1.f); return Out; } @@ -495,26 +495,26 @@ struct PS_OUT_BLUR_X float4 vBlurWeight : SV_TARGET1; }; -PS_OUT_BACKBUFFER PS_MAIN_BLOOM_ACCUM(PS_IN In) +PS_OUT_FLT4_SINGLE PS_MAIN_BLOOM_ACCUM(PS_IN In) { - PS_OUT_BACKBUFFER Out; + PS_OUT_FLT4_SINGLE Out; float3 vColorSrcA = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord).xyz; float3 vColorSrcB = g_BlurTexture.Sample(PointSampler, In.vTexcoord).xyz; - Out.vBackBuffer = float4(saturate(vColorSrcA + vColorSrcB), 1.f); + Out.vSingleTarget = float4(saturate(vColorSrcA + vColorSrcB), 1.f); return Out; } -PS_OUT_BACKBUFFER PS_MAIN_BLOOM_FINISH(PS_IN In) +PS_OUT_FLT4_SINGLE PS_MAIN_BLOOM_FINISH(PS_IN In) { - PS_OUT_BACKBUFFER Out; + PS_OUT_FLT4_SINGLE Out; vector vColor = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord); float3 vBloom = g_BlurTexture.Sample(PointSampler, In.vTexcoord).xyz; - Out.vBackBuffer = vColor; - Out.vBackBuffer += float4(vBloom, 1.f); + Out.vSingleTarget = vColor; + Out.vSingleTarget += float4(vBloom, 1.f); return Out; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 067d90c1d..cd43fbd4d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -13,6 +13,7 @@ uint g_iSpellType; float g_fPI; float g_fFar; +float g_fBlinkTime; float g_fTime; float g_fTimeMult; float g_fFrame; @@ -28,12 +29,20 @@ float g_fHp; float2 g_fOrigin_Size; float2 g_fCurrent_Size; float2 g_fHpBG; +float2 g_Pos; +float2 g_fImageSize; float4 g_fNine_Slice; float4 g_fImageUV; float4 g_fImageUV1; +uint g_iArrayCount; +float2 g_fItemPosition1; +float2 g_fItemImageSizes1; +float2 g_fItemPosition2; +float2 g_fItemImageSizes2; float2 g_fPosition[4]; +float2 g_fImageSizes[4]; float4 g_fImagesUV[4]; Texture2D g_Texture; @@ -41,6 +50,7 @@ Texture2D g_Texture1; Texture2D g_Texture2; Texture2D g_Texture3; Texture2D g_Texture4; +Texture2D g_Texture5; Texture2D g_DiffuseTexture; Texture2D g_MaskingTexture; @@ -251,6 +261,7 @@ PS_OUT PS_Sptire_Sheet(PS_IN In) if (Color.r <= 0.4f) discard; + Color.a *= Alpha; Out.vColor = Color; @@ -416,8 +427,30 @@ PS_OUT PS_SpellAnim(PS_IN In) float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float4 color = float4(1.f, 1.f, 1.f, 1.f); - + float4 color = float4(0.f, 0.f, 0.f, 0.f); + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float2 startUV = g_fImageUV.xy; + float2 endUV = g_fImageUV.zw; + + float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex2 = g_Texture2.Sample(DefaultSampler, atlasUV); + + tex1.rgb *= 0.4f; + color = tex1; + tex2.rgb *= 0.3f; + + if (tex2.a >= 0.9f) + color = tex2; float3 BGColor = float3(1.f, 1.f, 1.f); switch (g_iSpellType) @@ -444,39 +477,42 @@ PS_OUT PS_SpellAnim(PS_IN In) BGColor = float3(0.f, 0.f, 0.f); break; } + float4 color1 = float4(1.f, 1.f, 1.f, 1.f); - float2 uv = In.vTexcoord; + float2 OverrayUV = In.vTexcoord; float CoolTime = 1.f - g_fDeltaV; float CoolTime2 = 1.f - g_fDeltaV + 0.05; + atlasUV = startUV + In.vTexcoord * (endUV - startUV); + float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); + tex3.rgb *= BGColor; + float4 tex4 = g_Texture2.Sample(DefaultSampler, atlasUV); - float4 tex1 = g_Texture.Sample(ClampSampler, uv); - tex1.rgb *= BGColor; - float4 tex2 = g_Texture1.Sample(DefaultSampler, uv); + if (tex4.a >= 0.9f) + tex3 = tex4; - if (tex2.a >= 0.9f) - tex1 = tex2; - - color = tex1; + color1 = tex3; - float wave1 = sin(uv.x * 10.f + g_fTime * 2.f) * 0.01f; - float wave2 = sin(uv.x * 10.f + g_fTime * 2.f) * 0.01f; + float wave1 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; + float wave2 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; float waveThreshold1 = CoolTime + wave1; float waveThreshold2 = CoolTime2 + wave2; if (g_fDeltaV <= 1.f) { - if (uv.y >= waveThreshold1 && uv.y <= waveThreshold2) + if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) { - color.rgb = float3(1.f, 1.f, 1.f); + color1.rgb = float3(1.f, 1.f, 1.f); } } - if (uv.y <= CoolTime) + if (OverrayUV.y <= CoolTime) { - color.a = 0.f; + color1.a = 0.f; } + color = lerp(color, color1, color1.a); + color.a *= Alpha; Out.vColor = color; @@ -488,6 +524,7 @@ PS_OUT PS_HpBar(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 Color1 = float4(1.f, 1.f, 1.f, 1.f); float2 uv = In.vTexcoord; float2 CurrentPixelPosition = uv * g_fCurrent_Size; float OriginLeft = g_fNine_Slice.x; @@ -533,24 +570,46 @@ PS_OUT PS_HpBar(PS_IN In) } float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv); + tex1.rgb = float3(255.f, 0.f, 0.f) / 255.f; + if (g_fHp <= 0.3f) + { + tex1.a *= (sin(g_fBlinkTime) * 0.25f + 0.75f) * 1.5f; + } + else + { + tex1.a = 0.f; + } Color = tex1; + + float2 BGPos = g_Pos; + float2 BGSize = g_fImageSize; + float2 BGPixel = Finaluv * g_fOrigin_Size; + float2 localUV = (BGPixel - BGPos) / BGSize; + bool inside = all(localUV >= 0.0f && localUV <= 1.0f); + + float4 tex2 = g_Texture1.Sample(ClampSampler, localUV); + + if (inside) + Color = lerp(Color, tex2, tex2.a); + float2 reversuv = In.vTexcoord; - reversuv.x = 1.0f - Finaluv; + reversuv.x = 1.0f - localUV.x; - float4 tex2 = g_Texture1.Sample(ClampSampler, Finaluv); + float4 tex3 = g_Texture2.Sample(ClampSampler, localUV); if (reversuv.x >= g_fHp) { - tex2.rgb = float3(0.f, 0.f, 0.f); + tex3.rgb = float3(0.f, 0.f, 0.f); } - float3 Green = float3(112.f, 241.f, 31.f) / 255.f; - Green *= 1.2f; - tex2.rgb *= Green; + float3 Green = (float3(112.f, 241.f, 31.f) / 255.f) * 1.2f; + float3 Red = (float3(255.f, 0.f, 0.f) / 255.f) * 1.2f; - if (all(Color.rgb >= float3(70.f / 255.f, 70.f / 255.f, 70.f / 255.f))) - Color = tex2; + tex3.rgb *= lerp(Green, Red, g_fTime); + + if (all(Color.rgb >= float3(55.f / 255.f, 0.f / 255.f, 55.f / 255.f))) + Color = lerp(Color, tex3, tex3.a); Color.a *= Alpha; Out.vColor = Color; @@ -595,18 +654,28 @@ PS_OUT PS_Magic_Icon(PS_IN In) float4 Color = float4(1.f, 1.f, 1.f, 1.f); - float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float2 center = float2(0.5f, 0.5f); + float2 BGuv = In.vTexcoord - center; + BGuv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = BGuv.x * cos(g_fAngle) - BGuv.y * sin(g_fAngle); + Rotation.y = BGuv.x * sin(g_fAngle) + BGuv.y * cos(g_fAngle); + Rotation += center; + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex2 = g_Texture1.Sample(ClampSampler, Rotation); + + Color = tex1; + Color = lerp(tex1, tex2, tex2.a); + float2 uv = In.vTexcoord; - float2 center = float2(0.5, 0.5); float scale = 1.2; uv = (uv - center) * scale + center; - float4 tex2 = g_Texture1.Sample(ClampSampler, uv); + float4 tex3 = g_Texture2.Sample(ClampSampler, uv); - Color = tex1; - - Color = tex1 * (1 - tex2.a) + tex2; + Color = Color * (1 - tex3.a) + tex3; Color.a *= Alpha; Out.vColor = Color; @@ -645,30 +714,30 @@ PS_OUT PS_Revelio(PS_IN In) float4 Color = float4(1.f, 1.f, 1.f, 1.f); float2 UV = In.vTexcoord; - float2 Position[4]; - float2 startUV[4]; - float2 endUV[4]; + //float2 Position[4]; + //float2 startUV[4]; + //float2 endUV[4]; - float2 Atlases[4]; + //float2 Atlases[4]; - for (int i = 0; i < 4; ++i) - { - Position[i] = g_fPosition[i]; - startUV[i] = g_fImagesUV[i].xy; - endUV[i] = g_fImagesUV[i].zw; + //for (int i = 0; i < 4; ++i) + //{ + // Position[i] = g_fPosition[i]; + // startUV[i] = g_fImagesUV[i].xy; + // endUV[i] = g_fImagesUV[i].zw; - Atlases[i] = startUV[i] + UV * (endUV[i] - startUV[i]); - } + // Atlases[i] = startUV[i] + UV * (endUV[i] - startUV[i]); + //} - float4 tex1 = g_Texture.Sample(DefaultSampler, UV); - float4 tex2 = g_Texture1.Sample(DefaultSampler, Atlases[0]); - float4 tex3 = g_Texture1.Sample(DefaultSampler, Atlases[1]); - float4 tex4 = g_Texture2.Sample(DefaultSampler, Atlases[2]); - float4 tex5 = g_Texture2.Sample(DefaultSampler, Atlases[3]); + //float4 tex1 = g_Texture.Sample(DefaultSampler, UV); + //float4 tex2 = g_Texture1.Sample(DefaultSampler, Atlases[0]); + //float4 tex3 = g_Texture1.Sample(DefaultSampler, Atlases[1]); + //float4 tex4 = g_Texture2.Sample(DefaultSampler, Atlases[2]); + //float4 tex5 = g_Texture2.Sample(DefaultSampler, Atlases[3]); - //float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); + ////float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); Color.a *= Alpha; Out.vColor = Color; @@ -676,6 +745,169 @@ PS_OUT PS_Revelio(PS_IN In) return Out; } +PS_OUT PS_Potion(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 Color = float4(214.f / 255.f, 225 / 255.f, 36 / 255.f, 1.f); + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + Color = tex1; + + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + //Color += tex2; + float4 tex3 = g_Texture2.Sample(ClampSampler, Rotation); + Color = lerp(Color, tex3, tex3.a); + + float2 Potionuv = In.vTexcoord; + float scale = 1.2; + + Potionuv = (Potionuv - center) * scale + center; + float4 tex4 = g_Texture3.Sample(ClampSampler, Potionuv); + Color = lerp(Color, tex4, tex4.a); + + float2 tex5pos = g_Pos / g_fCurrent_Size; + float2 tex5size = g_fOrigin_Size / g_fCurrent_Size; + float2 tex5local = (In.vTexcoord - tex5pos) / tex5size; + bool inside = all(tex5local >= 0.0f && tex5local <= 1.0f); + float4 tex5 = g_Texture4.Sample(ClampSampler, tex5local); + if (inside) + Color = lerp(Color, tex5, tex5.a); + + Color.a *= Alpha; + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Magic_Item(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); + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float2 startUV = g_fImageUV.xy; + float2 endUV = g_fImageUV.zw; + + float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex2 = g_Texture3.Sample(ClampSampler, atlasUV); + + tex1.rgb *= 0.4f; + color = tex1; + tex2.rgb *= 0.3f; + + if (tex2.a >= 0.9f) + color = tex2; + float3 BGColor = float3(1.f, 1.f, 1.f); + + switch (g_iSpellType) + { + case 0: + BGColor = float3(50.f, 50.f, 50.f) / 255.f; + break; + case 1: + BGColor = float3(89.f, 32.f, 215.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(37.f, 129.f, 162.f) / 255.f; + break; + case 4: + BGColor = float3(134.f, 171.f, 78.f) / 255.f; + break; + } + + float4 color1 = float4(1.f, 1.f, 1.f, 1.f); + + float2 OverrayUV = In.vTexcoord; + float CoolTime = 0.f + g_fDeltaV; + float CoolTime2 = 0.f + g_fDeltaV + 0.05; + atlasUV = startUV + In.vTexcoord * (endUV - startUV); + float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); + tex3.rgb *= BGColor; + float4 tex4 = g_Texture3.Sample(DefaultSampler, atlasUV); + + if (g_fDeltaV <= 1.f) + { + if (tex4.a >= 0.9f) + tex3 = tex4; + + color1 = tex3; + + float wave1 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; + float wave2 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; + + float waveThreshold1 = CoolTime + wave1; + float waveThreshold2 = CoolTime2 + wave2; + + if (g_fDeltaV <= 1.f) + { + if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) + { + color1.rgb = float3(1.f, 1.f, 1.f); + } + } + + if (OverrayUV.y <= CoolTime) + { + color1.a = 0.f; + } + + color = lerp(color, color1, color1.a); + } + else if (g_fDeltaV >= 1.f) + color = lerp(color, tex4, tex4.a); + + float4 tex5 = g_Texture2.Sample(ClampSampler, Rotation); + color = lerp(color, tex5, tex5.a); + + float2 texpos1 = g_fItemPosition1 / g_fCurrent_Size; + float2 texpos2 = g_fItemPosition2 / g_fCurrent_Size; + float2 texsize1 = g_fItemImageSizes1 / g_fCurrent_Size; + float2 texsize2 = g_fItemImageSizes2 / g_fCurrent_Size; + float2 texlocal1 = (In.vTexcoord - texpos1) / texsize1; + float2 texlocal2 = (In.vTexcoord - texpos2) / texsize2; + + + bool inside1 = all(texlocal1 >= 0.0f && texlocal1 <= 1.0f); + float4 tex6 = g_Texture4.Sample(DefaultSampler, texlocal1); + + if (inside1) + color = lerp(color, tex6, tex6.a); + + bool inside2 = all(texlocal2 >= 0.0f && texlocal2 <= 1.0f); + + float4 tex7 = g_Texture5.Sample(DefaultSampler, texlocal2); + if (inside2) + color = lerp(color, tex7, tex7.a); + + color.a *= Alpha; + + Out.vColor = color; + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -856,4 +1088,24 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Revelio(); } + pass Potion + { + SetRasterizerState(RS_Default); + 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_Potion(); + } + + pass Magic_Item + { + SetRasterizerState(RS_Default); + 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_Magic_Item(); + } + } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/HpBarBG.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/HpBarBG.png index 217244033..4da41e168 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/HpBarBG.png and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/HpBarBG.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/Revelio_SpellSelectionGridIcon.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/Revelio_SpellSelectionGridIcon.dds new file mode 100644 index 000000000..a372b35c5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/Revelio_SpellSelectionGridIcon.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/Revelio_SpellSelectionGridIcon.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/Revelio_SpellSelectionGridIcon.png deleted file mode 100644 index f69d616ef..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/Revelio_SpellSelectionGridIcon.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/T_EdgeFade_A.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/T_EdgeFade_A.png new file mode 100644 index 000000000..72133390a Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/T_EdgeFade_A.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_BroomMeterGlow.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_BroomMeterGlow.png new file mode 100644 index 000000000..5cf8ed275 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_BroomMeterGlow.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_ButtonFlameTopClamp.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_ButtonFlameTopClamp.png new file mode 100644 index 000000000..e7be07db8 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_ButtonFlameTopClamp.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_FG_IndexIconBorder.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_FG_IndexIconBorder.png new file mode 100644 index 000000000..c44453025 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_FG_IndexIconBorder.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_GlowBar.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_GlowBar.png new file mode 100644 index 000000000..a711f5ec7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_GlowBar.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_GlowRays.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_GlowRays.png new file mode 100644 index 000000000..41800cbfc Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_GlowRays.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_MagicEffect1.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_MagicEffect1.png deleted file mode 100644 index fc5d83568..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_MagicEffect1.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_revelio.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_revelio.png deleted file mode 100644 index 9bae427b4..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_revelio.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/VFX_T_FlameNoise_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/VFX_T_FlameNoise_E.png new file mode 100644 index 000000000..74baf3efd Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/VFX_T_FlameNoise_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Enemy_Health_Fill.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Enemy_Health_Fill.png new file mode 100644 index 000000000..0d9c3cf61 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Enemy_Health_Fill.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_NPC_Alert.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_NPC_Alert.png new file mode 100644 index 000000000..ebcd74953 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_NPC_Alert.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_NPC_WhiteFrameBlip.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_NPC_WhiteFrameBlip.png new file mode 100644 index 000000000..b22c3bf91 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_NPC_WhiteFrameBlip.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Ring_Aggro_Blip.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Ring_Aggro_Blip.png new file mode 100644 index 000000000..4a08d10a7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Ring_Aggro_Blip.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Ring_Alert_Fill.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Ring_Alert_Fill.png new file mode 100644 index 000000000..2f83eb415 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Ring_Alert_Fill.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Ring_Alert_Yellow.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Ring_Alert_Yellow.png new file mode 100644 index 000000000..d2045819b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Enemy/UI_T_HUD_Ring_Alert_Yellow.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Atlas_Item.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Atlas_Item.dds new file mode 100644 index 000000000..547369235 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Atlas_Item.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item0.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item0.png new file mode 100644 index 000000000..fbe5c92fe Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item0.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item1.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item1.png new file mode 100644 index 000000000..3fc28a190 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item1.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item2.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item2.png new file mode 100644 index 000000000..4045f375c Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item2.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item3.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item3.png new file mode 100644 index 000000000..975e21363 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item3.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item4.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item4.png new file mode 100644 index 000000000..30bd47966 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item4.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item5.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item5.png new file mode 100644 index 000000000..609cd463a Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item5.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item6.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item6.png new file mode 100644 index 000000000..89382cf44 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item6.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item7.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item7.png new file mode 100644 index 000000000..5f7282ea7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/Item7.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_FelixFelicis_Meter.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_FelixFelicis_Meter.png new file mode 100644 index 000000000..5a276961a Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_FelixFelicis_Meter.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_IconNone_Meter.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_IconNone_Meter.png new file mode 100644 index 000000000..a5e747417 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_IconNone_Meter.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Keyboard.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Keyboard.dds new file mode 100644 index 000000000..546a17121 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Keyboard.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Keyboard.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Keyboard.png deleted file mode 100644 index 0ee96f06f..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Keyboard.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Number.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Number.dds new file mode 100644 index 000000000..1a0dcb8c4 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Number.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Number.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Number.png deleted file mode 100644 index f59fd8019..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Keyboard/Atlas_Number.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/Atlas_Spell.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/Atlas_Spell.dds new file mode 100644 index 000000000..dd494f042 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/Atlas_Spell.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Accio_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Accio_Overlay.png deleted file mode 100644 index c31f18e77..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Accio_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_ArrestoMomentum_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_ArrestoMomentum_Overlay.png deleted file mode 100644 index 729ca6487..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_ArrestoMomentum_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_AvadaKedavra_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_AvadaKedavra_Overlay.png deleted file mode 100644 index e9aefbcf5..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_AvadaKedavra_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Bombarda_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Bombarda_Overlay.png deleted file mode 100644 index 2c5cc763a..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Bombarda_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Confringo_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Confringo_Overlay.png deleted file mode 100644 index 333f60c69..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Confringo_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Conjuration_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Conjuration_Overlay.png deleted file mode 100644 index b2b53460f..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Conjuration_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Crucio_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Crucio_Overlay.png deleted file mode 100644 index 22936f0ec..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Crucio_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Depulso_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Depulso_Overlay.png deleted file mode 100644 index ba8548917..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Depulso_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Descendo_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Descendo_Overlay.png deleted file mode 100644 index dbaeaa4dd..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Descendo_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Diffindo_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Diffindo_Overlay.png deleted file mode 100644 index f3104ad50..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Diffindo_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Disillusionment_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Disillusionment_Overlay.png deleted file mode 100644 index 9ded70cc6..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Disillusionment_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Evanesco_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Evanesco_Overlay.png deleted file mode 100644 index 8644c0734..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Evanesco_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Expelliarmus_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Expelliarmus_Overlay.png deleted file mode 100644 index f32f732a5..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Expelliarmus_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Flipendo_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Flipendo_Overlay.png deleted file mode 100644 index dcb050dbb..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Flipendo_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Glacius_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Glacius_Overlay.png deleted file mode 100644 index d28e4381e..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Glacius_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Imperio_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Imperio_Overlay.png deleted file mode 100644 index a5bdc5591..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Imperio_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Incendio_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Incendio_Overlay.png deleted file mode 100644 index 54b22c688..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Incendio_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Levioso_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Levioso_Overlay.png deleted file mode 100644 index 1c7a67509..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Levioso_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Lumos_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Lumos_Overlay.png deleted file mode 100644 index 325214588..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Lumos_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_TransformationOverlandOverlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_TransformationOverlandOverlay.png deleted file mode 100644 index 4797e9fde..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_TransformationOverlandOverlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Transformation_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Transformation_Overlay.png deleted file mode 100644 index a3484001d..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_Transformation_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_WingardiumLeviosa_Overlay.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_WingardiumLeviosa_Overlay.png deleted file mode 100644 index 46848d338..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_spellmeter_WingardiumLeviosa_Overlay.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 04ff97b0c..225bb9fc3 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -212,6 +212,7 @@ + @@ -256,7 +257,6 @@ - @@ -350,6 +350,7 @@ + @@ -395,7 +396,6 @@ - diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 254146203..a661f822a 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -235,9 +235,6 @@ {93166105-4863-4435-b2a1-7c97f9f3226f} - - {a5069e0b-5f20-44e5-bb86-56d4febc0996} - {1bc9f833-8d1b-4576-9ae5-51a039f4d2ff} @@ -385,6 +382,9 @@ {93ae1d33-fb58-4793-9e7e-5b8d27e163d1} + + {5b287b4f-4f71-4458-85a1-c753fd121c53} + @@ -612,9 +612,6 @@ 50.UI\GamePlay_Canvas\Action_Panel\Spell_Slot - - 50.UI\GamePlay_Canvas\Action_Panel\Spell_Image - 50.UI\GamePlay_Canvas\Action_Panel\Spell_Overlay @@ -750,6 +747,9 @@ 50.UI\GamePlay_Canvas\Action_Panel\Spell_UI + + 50.UI\GamePlay_Canvas\Action_Panel\Magic_Item + @@ -979,9 +979,6 @@ 50.UI\GamePlay_Canvas\Action_Panel\Spell_Slot - - 50.UI\GamePlay_Canvas\Action_Panel\Spell_Image - 50.UI\GamePlay_Canvas\Action_Panel\Spell_Overlay @@ -1101,6 +1098,9 @@ 02.GameObjects\Env\06.InstancedProp + + + 02.GameObjects\Monster\Goblin 50.UI\GamePlay_Canvas\Action_Panel\Magic_Icon @@ -1113,6 +1113,9 @@ 02.GameObjects\Monster\Goblin + + + 50.UI\GamePlay_Canvas\Action_Panel\Magic_Item diff --git a/Jusin154_Team3D/Editor/Private/Action_Panel.cpp b/Jusin154_Team3D/Editor/Private/Action_Panel.cpp index c6a2b9ce9..0954840ab 100644 --- a/Jusin154_Team3D/Editor/Private/Action_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Action_Panel.cpp @@ -2,13 +2,14 @@ #include "Action_Panel.h" #include "GameInstance.h" #include "Spell_Slot.h" -#include "Spell_Image.h" #include "Spell_Overlay.h" #include "Slot_Number.h" #include "HpBarBG.h" #include "Magic_Meter.h" #include "Magic_Icon.h" #include "Spell_UI.h" +#include "Potion.h" +#include "Magic_Item.h" CAction_Panel::CAction_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -252,13 +253,6 @@ HRESULT CAction_Panel::Ready_Element(void* pArg) return E_FAIL; } Add_Element(TEXT("Spell_Slot"), m_pSpell_Slot); - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Image)))) - { - return E_FAIL; - } - Add_Element(TEXT("Spell_Image"), m_pSpell_Image); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay)))) { return E_FAIL; @@ -309,6 +303,16 @@ HRESULT CAction_Panel::Ready_Element(void* pArg) return E_FAIL; } Add_Element(TEXT("Spell_UI"), m_pSpell_UI); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pPotion)))) + { + return E_FAIL; + } + Add_Element(TEXT("Potion"), m_pPotion); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMagic_Item)))) + { + return E_FAIL; + } + Add_Element(TEXT("Magic_Item"), m_pMagic_Item); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Action_Panel.cpp.bak b/Jusin154_Team3D/Editor/Private/Action_Panel.cpp.bak deleted file mode 100644 index c91f89041..000000000 --- a/Jusin154_Team3D/Editor/Private/Action_Panel.cpp.bak +++ /dev/null @@ -1,193 +0,0 @@ -#include "pch.h" -#include "Action_Panel.h" -#include "GameInstance.h" -#include "Spell_Slot.h" -#include "Spell_Image.h" -#include "Spell_Overlay.h" -#include "Slot_Number.h" -#include "HpBarBG.h" -#include "Magic_Meter.h - -CAction_Panel::CAction_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) - :CPanelObject(pDevice, pContext) -{ -} - -CAction_Panel::CAction_Panel(const CAction_Panel& rhs) - :CPanelObject(rhs) -{ -} - -HRESULT CAction_Panel::Initialize_Prototype() -{ - return S_OK; -} - -HRESULT CAction_Panel::Initialize(void* pArg) -{ - CUIObject::UIOBJECT_DESC Desc{}; - - Desc.fX = 1515.f; - Desc.fY = 850.f; - Desc.fSizeX = 700.f; - Desc.fSizeY = 400.f; - - - 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_bVisible = true; - return S_OK; -} - -void CAction_Panel::Priority_Update(_float fTimeDelta) -{ - if (!__super::Chack_Visible()) - { - return; - } - __super::Priority_Update(fTimeDelta); -} - -void CAction_Panel::Update(_float fTimeDelta) -{ - if (!__super::Chack_Visible()) - { - return; - } - - __super::Update(fTimeDelta); -} - -void CAction_Panel::Late_Update(_float fTimeDelta) -{ - if (!__super::Chack_Visible()) - { - return; - } - - if (m_bVisible) { - - } - __super::Late_Update(fTimeDelta); - -} - -HRESULT CAction_Panel::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 CAction_Panel::Get_WorldPostion() -{ - return m_pTransformCom->Get_State(STATE::POSITION); -} - -HRESULT CAction_Panel::Bind_ShaderResources() -{ - return S_OK; -} - -HRESULT CAction_Panel::Ready_Components(void* pArg) -{ - return S_OK; -} - -HRESULT CAction_Panel::Ready_Element(void* pArg) -{ - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast (&m_pSpell_Slot)))) - { - return E_FAIL; - } - Add_Element(TEXT("Spell_Slot"), m_pSpell_Slot); - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Image)))) - { - return E_FAIL; - } - Add_Element(TEXT("Spell_Image"), m_pSpell_Image); - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay)))) - { - return E_FAIL; - } - Add_Element(TEXT("Spell_Overlay"), m_pSpell_Overlay); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSlot_Number)))) - { - return E_FAIL; - } - Add_Element(TEXT("Slot_Number"), m_pSlot_Number); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pHpBarBG)))) - { - return E_FAIL; - } - Add_Element(TEXT("HpBarBG"), m_pHpBarBG); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMagic_Meter)))) - { - return E_FAIL; - } - Add_Element(TEXT("Magic_Meter"), m_pMagic_Meter); - return S_OK; -} - -CAction_Panel* CAction_Panel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) -{ - CAction_Panel* pInstance = new CAction_Panel(pDevice, pContext); - - if (FAILED(pInstance->Initialize_Prototype())) - { - MSG_BOX("Failed to Created : CAction_Panel"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - -CGameObject* CAction_Panel::Clone(void* pArg, CGameObject* pOwner) -{ - CAction_Panel* pInstance = new CAction_Panel(*this); - pInstance->m_pOwner = pOwner; - if (FAILED(pInstance->Initialize(pArg))) - { - MSG_BOX("Failed to Cloned : CAction_Panel"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - -void CAction_Panel::Free() -{ - __super::Free(); - - SAFE_RELEASE(m_pDiffuse_TextureCom); - SAFE_RELEASE(m_pShaderCom); - SAFE_RELEASE(m_pVIBufferCom); -} - -void CAction_Panel::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/DummyObject.cpp b/Jusin154_Team3D/Editor/Private/DummyObject.cpp index 7f3568f40..80fe4cfde 100644 --- a/Jusin154_Team3D/Editor/Private/DummyObject.cpp +++ b/Jusin154_Team3D/Editor/Private/DummyObject.cpp @@ -39,11 +39,11 @@ HRESULT CDummyObject::Initialize(void* pArg) void CDummyObject::Priority_Update(_float fTimeDelta) { - } void CDummyObject::Update(_float fTimeDelta) { + Describe_Entity(); m_pModelCom->Play_Animation(fTimeDelta,m_pTransformCom); } @@ -154,4 +154,7 @@ void CDummyObject::Free() void CDummyObject::Describe_Entity() { + if (nullptr != m_pModelCom) { + m_pModelCom->Describe_Entity(); + } } diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Globe.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Globe.cpp index 713f37acf..ad4e239d6 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_Globe.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_Globe.cpp @@ -106,7 +106,6 @@ HRESULT CDummy_Globe::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_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/EffectObject.cpp b/Jusin154_Team3D/Editor/Private/EffectObject.cpp index 403d6720b..1a57a01fe 100644 --- a/Jusin154_Team3D/Editor/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectObject.cpp @@ -77,7 +77,7 @@ HRESULT CEffectObject::Render_Blur() if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NON_WORLD) { - BlurPass = SHADER_PASS_INSTANCE_MODEL::BLUR_NO_WORLD; + BlurPass = SHADER_PASS_INSTANCE_MODEL::NON_WORLD_BLUR; } else { diff --git a/Jusin154_Team3D/Editor/Private/HpBarBG.cpp b/Jusin154_Team3D/Editor/Private/HpBarBG.cpp index 469872bfb..d65652395 100644 --- a/Jusin154_Team3D/Editor/Private/HpBarBG.cpp +++ b/Jusin154_Team3D/Editor/Private/HpBarBG.cpp @@ -24,7 +24,7 @@ HRESULT CHpBarBG::Initialize(void* pArg) Desc.fX = 600.f; Desc.fY = 180.f; Desc.fSizeX = 144.f; - Desc.fSizeY = 24.f; + Desc.fSizeY = 50.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) }; @@ -37,15 +37,17 @@ HRESULT CHpBarBG::Initialize(void* pArg) return E_FAIL; } - m_fTimeMult = 3.f; + m_fTimeMult = 5.f; m_fAlpha = 1.f; m_fAlphaTime = 1.f; m_vNine_Slice = _float4(27.f, 125.f, m_fSizeY * 0.5f, m_fSizeY * 0.5f); - m_fMaxHp = 20.f; + m_fMaxHp = 1000.f; m_fCurrentHp = m_fMaxHp; m_fMoveSpeed = 5.f; + m_fHpBGSize = _float2(144.f, 24.f); + m_fHpBGPos = _float2(0.f, 13.f); m_fHpBG = _float2(0, m_fSizeX); - SizeUpX(210.f); + SizeUpX(240.f); return S_OK; } @@ -87,7 +89,7 @@ void CHpBarBG::Update(_float fTimeDelta) m_bFadeOut = false; m_fAlpha = 0.f; } - } + } if (m_fCurrentHp < 0.f) m_fCurrentHp = 0.f; @@ -97,12 +99,32 @@ void CHpBarBG::Update(_float fTimeDelta) if (m_fTargetHp > m_fCurrentHp) Heal(fTimeDelta); - else if(m_fTargetHp < m_fCurrentHp) + else if (m_fTargetHp < m_fCurrentHp) Hit(fTimeDelta); m_fHpBar = m_fCurrentHp / m_fMaxHp; - m_fTime += fTimeDelta * m_fTimeMult; + if (m_pGameInstance->Key_Down(DIK_3)) + { + Lerp_PosX(100.f); + } + if (m_pGameInstance->Key_Down(DIK_4)) + { + Lerp_PosX(-101.f); + } + if (m_fHpBar <= 0.3f) + { + m_fBlinkTime += fTimeDelta * m_fTimeMult; + if (m_fTime <= 1.f) + { + m_fTime += fTimeDelta * m_fTimeMult; + } + } + else + { + m_fBlinkTime = 0.f; + m_fTime = 0.f; + } __super::Update(fTimeDelta); } @@ -184,6 +206,10 @@ HRESULT CHpBarBG::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -192,6 +218,10 @@ HRESULT CHpBarBG::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlinkTime", &m_fBlinkTime, sizeof(_float)))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) { return E_FAIL; @@ -224,6 +254,14 @@ HRESULT CHpBarBG::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageSize", &m_fHpBGSize, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_Pos", &m_fHpBGPos, sizeof(_float2)))) + { + return E_FAIL; + } return S_OK; } @@ -233,11 +271,15 @@ HRESULT CHpBarBG::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_HpBarBG"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_GlowBar"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_HUD_HealthMeterFill"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_HpBarBG"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_HUD_HealthMeterFill"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) { return E_FAIL; } @@ -280,6 +322,7 @@ void CHpBarBG::Free() SAFE_RELEASE(m_pDiffuse_TextureCom); SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pDiffuse_TextureCom2); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp index b57ac7eab..0b731a6f6 100644 --- a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp +++ b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp @@ -98,7 +98,7 @@ void CIMGUIUI::Priority_Update(_float fTimeDelta) void CIMGUIUI::Update(_float fTimeDelta) { - static const char* SpellTypeNames[] = { "SHADOW", "CONTROL","POWER", "DAMAGE","UTILITY", "TRANSFORM", "CURSE", "ESSENTIAL" }; + static const char* SpellTypeNames[] = { "CONTROL","POWER", "DAMAGE","UTILITY", "TRANSFORM", "CURSE", "ESSENTIAL" }; int itemCount = sizeof(SpellTypeNames) / sizeof(const char*); if (m_pGamePlay_Canvas != nullptr) { @@ -348,7 +348,7 @@ void CIMGUIUI::Update(_float fTimeDelta) static_cast(m_pElementObject)->Set_TimeMult(m_fDelayTime); } - if (GUI::DragFloat("TimeMult", &m_fTimeMult, 0.01f, 0.f, 10.f)) + if (GUI::DragFloat("TimeMult", &m_fTimeMult, 0.01f, 0.f, 100.f)) { static_cast(m_pElementObject)->Set_TimeMult(m_fTimeMult); } diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index b11a3bf44..3360e7650 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -57,7 +57,6 @@ #include "Action_Panel.h" #include "Spell_Slot.h" -#include "Spell_Image.h" #include "Spell_Overlay.h" #include "Slot_Number.h" #include "HpBarBG.h" @@ -65,6 +64,7 @@ #include "Magic_Meter.h" #include "Magic_Icon.h" #include "Spell_UI.h" +#include "Magic_Item.h" #include "IMGUIUI.h" @@ -453,6 +453,27 @@ HRESULT CLoader::Loading_For_UI() }); + Asset_FileLoad("../Bin/Resources/Textures/GadgetWheel", 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; + } + + return S_OK; + + }); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), TEXT("Item"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/GadgetWheel/Item%d.png"), 8)))) { + return E_FAIL; + } + m_strMessage = TEXT("Model Loading.."); CVIBuffer_UI_Instance::UI_INSTANCE_DESC SpellSlotUIDesc{}; @@ -582,10 +603,6 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Image::Create(m_pDevice, m_pContext)))) - { - return E_FAIL; - } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Overlay::Create(m_pDevice, m_pContext)))) { return E_FAIL; @@ -614,6 +631,10 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMagic_Item::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CIMGUIUI::Create(m_pDevice, m_pContext)))) { @@ -1169,6 +1190,28 @@ HRESULT CLoader::Loading_For_PhysXLevel() HRESULT CLoader::Loading_For_Bloom() { + vector*>> futures = {}; + +#pragma region HAIR + + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair1/M_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_M_Hair1_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair2/M_Hair2.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_M_Hair2_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair3/M_Hair3.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_M_Hair3_Model") + )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/FeMale/F_Hair1/F_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), + TEXT("Prototype_Component_F_Hair1_Model") + )); + +#pragma endregion if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Desc_Box"), CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixScaling(10.f, 10.f, 10.f) * XMMatrixIdentity())))){ return E_FAIL; @@ -1215,6 +1258,15 @@ HRESULT CLoader::Loading_For_Bloom() return E_FAIL; } + for (auto& job : futures) { + pair<_wstring, CModel*>* pResult = job.get(); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pResult->first, pResult->second))) { + assert(false); + return E_FAIL; + } + Safe_Delete(pResult); + } + m_strMessage = TEXT("Loading Success!"); m_isFinished = true; @@ -1619,6 +1671,18 @@ HRESULT CLoader::Loading_For_ObjectViewer() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CWand::Create(m_pDevice, m_pContext)))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTrail::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTrailObject::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBombard::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + m_strMessage = TEXT("Loading Success!"); m_isFinished = true; diff --git a/Jusin154_Team3D/Editor/Private/Magic_Icon.cpp b/Jusin154_Team3D/Editor/Private/Magic_Icon.cpp index 93478a435..379c8fe4f 100644 --- a/Jusin154_Team3D/Editor/Private/Magic_Icon.cpp +++ b/Jusin154_Team3D/Editor/Private/Magic_Icon.cpp @@ -141,6 +141,10 @@ HRESULT CMagic_Icon::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -166,11 +170,15 @@ HRESULT CMagic_Icon::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_HealthMeter_LevelBox"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_AncientMagicFinisher"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_AncientMagicFinisher"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) { return E_FAIL; } @@ -214,6 +222,7 @@ void CMagic_Icon::Free() SAFE_RELEASE(m_pDiffuse_TextureCom); SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pDiffuse_TextureCom2); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/Magic_Item.cpp b/Jusin154_Team3D/Editor/Private/Magic_Item.cpp new file mode 100644 index 000000000..e2da15982 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Magic_Item.cpp @@ -0,0 +1,369 @@ +#include "pch.h" +#include "Magic_Item.h" +#include "GameInstance.h" + +CMagic_Item::CMagic_Item(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CMagic_Item::CMagic_Item(const CMagic_Item& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CMagic_Item::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMagic_Item::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = -800.f; + Desc.fY = 100.f; + Desc.fSizeX = 100.f; + Desc.fSizeY = 100.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_fAlpha = 1.f; + m_fTimeMult = 0.5f; + m_fAngle = XMConvertToRadians(-135.f); + m_fAlphaTime = 1.f; + m_fSortZ = 0.2f; + m_fCoolTime = 5.f; + m_vUVScale.y = 1.f; + m_iArratCount = 2; + Compute_UV(0); + Compute_Image(); + return S_OK; +} + +void CMagic_Item::Compute_UV(_uint iItemID) +{ + _float2 fImage_Size = { 1024.f, 512.f }; + + _uint iCountX = 4; + _uint iCountY = 2; + + _float iImageX = 256.f; + _float iImageY = 256.f; + + _uint iframeX = iItemID % iCountX; + _uint iframeY = iItemID / iCountX; + + _float2 UVStart{}; + UVStart.x = iframeX * iImageX / fImage_Size.x; + UVStart.y = iframeY * iImageY / fImage_Size.y; + + _float2 UVEnd{}; + UVEnd.x = UVStart.x + (iImageX / fImage_Size.x); + UVEnd.y = UVStart.y + (iImageY / fImage_Size.y); + + _float4 UV = _float4{ UVStart.x, UVStart.y, UVEnd.x, UVEnd.y }; + m_vUV = UV; +} + +void CMagic_Item::Compute_Image() +{ + m_vImagePos1 = _float2(72.f, 0.f); + m_vImageSize1 = _float2(30.f, 30.f); + m_vImagePos2 = _float2(65.f, 65.f); + m_vImageSize2 = _float2(30.f, 30.f); +} + +void CMagic_Item::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + + +void CMagic_Item::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; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + if (m_vUVScale.y >= 1.f) + { + if (m_pGameInstance->Key_Down(DIK_TAB)) + { + m_vUVScale.y = 0.f; + } + } + + if (m_vUVScale.y <= 1) + { + m_vUVScale.y += fTimeDelta * (1.f / m_fCoolTime); + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CMagic_Item::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CMagic_Item::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::MAGIC_ITEM)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CMagic_Item::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CMagic_Item::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_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom3->Bind_ShaderResource(m_pShaderCom, "g_Texture3", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom4->Bind_ShaderResource(m_pShaderCom, "g_Texture4", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom5->Bind_ShaderResource(m_pShaderCom, "g_Texture5", 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_fAngle", &m_fAngle, 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_fImageUV", &m_vUV, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCoolTime", &m_fCoolTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDeltaV", &m_vUVScale.y, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_iArrayCount", &m_iArratCount, sizeof(_uint)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fItemPosition1", &m_vImagePos1, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fItemImageSizes1", &m_vImageSize1, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fItemPosition2", &m_vImagePos2, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fItemImageSizes2", &m_vImageSize2, 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 CMagic_Item::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_ActionItemBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_spellmeter_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Item"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Keyboard_Tab"), reinterpret_cast(&m_pDiffuse_TextureCom4), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_AmountFrame"), reinterpret_cast(&m_pDiffuse_TextureCom5), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CMagic_Item* CMagic_Item::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMagic_Item* pInstance = new CMagic_Item(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMagic_Item"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CMagic_Item::Clone(void* pArg, CGameObject* pOwner) +{ + CMagic_Item* pInstance = new CMagic_Item(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMagic_Item"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMagic_Item::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pDiffuse_TextureCom2); + SAFE_RELEASE(m_pDiffuse_TextureCom3); + SAFE_RELEASE(m_pDiffuse_TextureCom4); + SAFE_RELEASE(m_pDiffuse_TextureCom5); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CMagic_Item::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Mission_Key.cpp b/Jusin154_Team3D/Editor/Private/Mission_Key.cpp index b405c6b85..a95b2c00a 100644 --- a/Jusin154_Team3D/Editor/Private/Mission_Key.cpp +++ b/Jusin154_Team3D/Editor/Private/Mission_Key.cpp @@ -126,7 +126,7 @@ _float4 CMission_Key::AlphabetUV(_tchar Alphabet) { _uint Number = CMyTools::AlphabetToInt(Alphabet); - _float2 fIamge_Size = { 320.f, 384.f }; + _float2 fImage_Size = { 320.f, 384.f }; _uint iXCount = 5; _uint iYCount = 6; @@ -134,16 +134,16 @@ _float4 CMission_Key::AlphabetUV(_tchar Alphabet) _float frameWidth = 64.f; _float frameHeight = 64.f; - _uint frameX = Number % iXCount; - _uint frameY = Number / iXCount; + _uint iframeX = Number % iXCount; + _uint iframeY = Number / iXCount; _float2 UVStart; - UVStart.x = frameX * frameWidth / fIamge_Size.x; - UVStart.y = frameY * frameHeight / fIamge_Size.y; + UVStart.x = iframeX * frameWidth / fImage_Size.x; + UVStart.y = iframeY * frameHeight / fImage_Size.y; _float2 UVEnd; - UVEnd.x = UVStart.x + (frameWidth / fIamge_Size.x); - UVEnd.y = UVStart.y + (frameHeight / fIamge_Size.y); + UVEnd.x = UVStart.x + (frameWidth / fImage_Size.x); + UVEnd.y = UVStart.y + (frameHeight / fImage_Size.y); return m_vUV = _float4(UVStart.x, UVStart.y, UVEnd.x, UVEnd.y); } diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index fb200e130..8bc2bd8c9 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -105,6 +105,9 @@ void CPlayer::Late_Update(_float fTimeDelta) HRESULT CPlayer::Render() { + + if (!m_bVisible) + return S_OK; if (FAILED(Bind_ShaderResources())) { return E_FAIL; } @@ -202,10 +205,10 @@ HRESULT CPlayer::Ready_Parts() WandDesc.pParentTransform = m_pTransformCom; WandDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand"); - if (FAILED(Add_PartObject("Wand", g_iStaticLevel, nullptr, &WandDesc))) - { - return E_FAIL; - } + //if (FAILED(Add_PartObject("Wand", g_iStaticLevel, nullptr, &WandDesc))) + //{ + // return E_FAIL; + //} { CCamPosition_Shoulder::CAMERA_SHOULDER_DESC Desc; @@ -323,6 +326,6 @@ void CPlayer::Describe_Entity() string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex()); GUI::Text(AnimList.c_str()); - //GUI::Checkbox("Render", &m_bVisible); + GUI::Checkbox("Render", &m_bVisible); } diff --git a/Jusin154_Team3D/Editor/Private/Player_States.cpp b/Jusin154_Team3D/Editor/Private/Player_States.cpp index b5389679f..5e957002f 100644 --- a/Jusin154_Team3D/Editor/Private/Player_States.cpp +++ b/Jusin154_Team3D/Editor/Private/Player_States.cpp @@ -240,7 +240,7 @@ void CPlayer::Behavior_MoveEnter() } } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,m_fAmount); m_fAmount = 1.f; } diff --git a/Jusin154_Team3D/Editor/Private/Potion.cpp b/Jusin154_Team3D/Editor/Private/Potion.cpp index 49ede637d..8005fa92f 100644 --- a/Jusin154_Team3D/Editor/Private/Potion.cpp +++ b/Jusin154_Team3D/Editor/Private/Potion.cpp @@ -21,10 +21,10 @@ HRESULT CPotion::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 220.f; - Desc.fY = 180.f; - Desc.fSizeX = 144.f; - Desc.fSizeY = 24.f; + Desc.fX = 700.f; + Desc.fY = 150.f; + Desc.fSizeX = 80.f; + Desc.fSizeY = 80.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) }; @@ -40,6 +40,8 @@ HRESULT CPotion::Initialize(void* pArg) m_fTimeMult = 3.f; m_fAlpha = 1.f; m_fAlphaTime = 1.f; + m_vImageSlotPos = _float2(45.f,45.f); + m_vImageSize = _float2(32.f,32.f); return S_OK; } @@ -84,6 +86,12 @@ void CPotion::Update(_float fTimeDelta) } } + if (m_pGameInstance->Key_Down(DIK_G)) + { + m_fTime = -1.f; + } + + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); @@ -106,7 +114,7 @@ HRESULT CPotion::Render() if (FAILED(Bind_ShaderResources())) { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::POTION)))) { return E_FAIL; } if (FAILED(m_pVIBufferCom->Bind_Resources())) { @@ -142,6 +150,22 @@ HRESULT CPotion::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom3->Bind_ShaderResource(m_pShaderCom, "g_Texture3", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom4->Bind_ShaderResource(m_pShaderCom, "g_Texture4", 0))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -162,6 +186,18 @@ HRESULT CPotion::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_Pos", &m_vImageSlotPos, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_vImageSize, sizeof(_float2)))) + { + return E_FAIL; + } return S_OK; } @@ -171,7 +207,23 @@ HRESULT CPotion::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_WoundCleaning"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_FG_IndexIconBorder"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_WoundCleaning"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_AmountFrame"), reinterpret_cast(&m_pDiffuse_TextureCom4), nullptr))) { return E_FAIL; } @@ -213,6 +265,10 @@ void CPotion::Free() __super::Free(); SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pDiffuse_TextureCom2); + SAFE_RELEASE(m_pDiffuse_TextureCom3); + SAFE_RELEASE(m_pDiffuse_TextureCom4); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Image.cpp b/Jusin154_Team3D/Editor/Private/Spell_Image.cpp deleted file mode 100644 index 9e7923d0b..000000000 --- a/Jusin154_Team3D/Editor/Private/Spell_Image.cpp +++ /dev/null @@ -1,235 +0,0 @@ -#include "pch.h" -#include "Spell_Image.h" -#include "GameInstance.h" - -CSpell_Image::CSpell_Image(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) - :CElementObject(pDevice, pContext) -{ -} - -CSpell_Image::CSpell_Image(const CSpell_Image& rhs) - :CElementObject(rhs) -{ -} - -HRESULT CSpell_Image::Initialize_Prototype() -{ - return S_OK; -} - -HRESULT CSpell_Image::Initialize(void* pArg) -{ - CUIObject::UIOBJECT_DESC Desc{}; - - Desc.fX = 380.f; - Desc.fY = 0.f; - Desc.fSizeX = 100.f; - Desc.fSizeY = 100.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_fAngle = XMConvertToRadians(-135.f); - m_fAlpha = 1.f; - m_fAlphaTime = 1.f; - m_fSortZ = 1.f; - return S_OK; -} - -void CSpell_Image::Priority_Update(_float fTimeDelta) -{ - if (!__super::Chack_Visible()) - { - return; - } - __super::Priority_Update(fTimeDelta); -} - -void CSpell_Image::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; - - if (m_fAlpha <= 0.f) - { - m_bFadeOut = false; - m_fAlpha = 0.f; - } - } - - m_fTime += fTimeDelta * m_fTimeMult; - __super::Update(fTimeDelta); -} - -void CSpell_Image::Late_Update(_float fTimeDelta) -{ - if (!__super::Chack_Visible()) - { - return; - } - if (m_bVisible) { - m_pGameInstance->Add_RenderGroup(RENDER::UI, this); - __super::Late_Update(fTimeDelta); - } -} - -HRESULT CSpell_Image::Render() -{ - if (FAILED(Bind_ShaderResources())) { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ROTATION)))) { - return E_FAIL; - } - if (FAILED(m_pVIBufferCom->Bind_Resources())) { - return E_FAIL; - } - if (FAILED(m_pVIBufferCom->Render())) { - return E_FAIL; - } - - return S_OK; -} - -_vector CSpell_Image::Get_WorldPostion() -{ - return m_pTransformCom->Get_State(STATE::POSITION); -} - -HRESULT CSpell_Image::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_fTime", &m_fTime, sizeof(_float)))) - { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, 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 CSpell_Image::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_ActionItemBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) - { - return E_FAIL; - } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_spellmeter_Accio_Overlay"), 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; -} - -CSpell_Image* CSpell_Image::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) -{ - CSpell_Image* pInstance = new CSpell_Image(pDevice, pContext); - - if (FAILED(pInstance->Initialize_Prototype())) - { - MSG_BOX("Failed to Created : CSpell_Image"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - -CGameObject* CSpell_Image::Clone(void* pArg, CGameObject* pOwner) -{ - CSpell_Image* pInstance = new CSpell_Image(*this); - pInstance->m_pOwner = pOwner; - if (FAILED(pInstance->Initialize(pArg))) - { - MSG_BOX("Failed to Cloned : CSpell_Image"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - -void CSpell_Image::Free() -{ - __super::Free(); - - SAFE_RELEASE(m_pDiffuse_TextureCom); - SAFE_RELEASE(m_pDiffuse_TextureCom1); - SAFE_RELEASE(m_pShaderCom); - SAFE_RELEASE(m_pVIBufferCom); -} - -void CSpell_Image::Describe_Entity() -{ -} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp index efb75a6a9..7b2fb303c 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp @@ -48,9 +48,35 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) m_fCoolTime = 5.f; m_fSortZ = 1.f; m_iSkillType = ENUM_CLASS(SKILLTYPE::CONTROL); + Compute_UI(5); return S_OK; } +void CSpell_Overlay::Compute_UI(_uint SpellID) +{ + _float2 fImage_Size = { 1024.f, 1536.f }; + + _uint iCountX = 4; + _uint iCountY = 6; + + _float iImageX = 256.f; + _float iImageY = 256.f; + + _uint iframeX = SpellID % iCountX; + _uint iframeY = SpellID / iCountX; + + _float2 UVStart; + UVStart.x = iframeX * iImageX / fImage_Size.x; + UVStart.y = iframeY * iImageY / fImage_Size.y; + + _float2 UVEnd; + UVEnd.x = UVStart.x + (iImageX / fImage_Size.x); + UVEnd.y = UVStart.y + (iImageY / fImage_Size.y); + + _float4 UV = _float4{UVStart.x, UVStart.y, UVEnd.x, UVEnd.y}; + m_vUV = UV; +} + void CSpell_Overlay::Priority_Update(_float fTimeDelta) { if (!__super::Chack_Visible()) @@ -222,6 +248,10 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV, sizeof(_float4)))) + { + return E_FAIL; + } return S_OK; } @@ -231,15 +261,15 @@ HRESULT CSpell_Overlay::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_spellmeter_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_spellmeter_Accio_Overlay"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_spellmeter_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_MagicEffect1"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Spell"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Wand.cpp b/Jusin154_Team3D/Editor/Private/Wand.cpp index 6c085e83f..b2106de12 100644 --- a/Jusin154_Team3D/Editor/Private/Wand.cpp +++ b/Jusin154_Team3D/Editor/Private/Wand.cpp @@ -36,7 +36,7 @@ HRESULT CWand::Initialize(void* pArg) PartsDesc.pParentTransform = m_pTransformCom; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(NEXT_LEVEL, NEXT_LEVEL, TEXT("Layer_Trail"), &PartsDesc, this, &m_pTrail))) { + /*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Trail"), &PartsDesc, this, &m_pTrail))) { assert(false); return E_FAIL; } @@ -45,13 +45,13 @@ HRESULT CWand::Initialize(void* pArg) return E_FAIL; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(NEXT_LEVEL, NEXT_LEVEL, TEXT("Layer_Effect"), &PartsDesc, this, &m_pEffectParts))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Effect"), &PartsDesc, this, &m_pEffectParts))) { assert(false); return E_FAIL; } m_pEffectParts->Load("../Bin/Resources/Data/Effect/Lumos/Lumos", static_cast(NEXT_LEVEL)); - m_pEffectParts->Set_Visible(true); + m_pEffectParts->Set_Visible(true);*/ return S_OK; } @@ -75,18 +75,18 @@ void CWand::Update(_float fTimeDelta) m_pModelCom->Combined_BoneMatrix(); - _matrix BoneMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("root")); + //_matrix BoneMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("root")); - BoneMatrix = BoneMatrix * m_pTransformCom->Get_XMWorldMatrix(); + //BoneMatrix = BoneMatrix * m_pTransformCom->Get_XMWorldMatrix(); - BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[0]) * m_vOffset.x; - BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[1]) * m_vOffset.y; - BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[2]) * m_vOffset.z; + //BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[0]) * m_vOffset.x; + //BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[1]) * m_vOffset.y; + //BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[2]) * m_vOffset.z; - m_pEffectParts->Get_Component()->Set_WorldMatrix(BoneMatrix); + //m_pEffectParts->Get_Component()->Set_WorldMatrix(BoneMatrix); - m_pTrail->Trail_Update(BoneMatrix, fTimeDelta); + //m_pTrail->Trail_Update(BoneMatrix, fTimeDelta); } diff --git a/Jusin154_Team3D/Editor/Public/Action_Panel.h b/Jusin154_Team3D/Editor/Public/Action_Panel.h index 24b4b938a..e928abc00 100644 --- a/Jusin154_Team3D/Editor/Public/Action_Panel.h +++ b/Jusin154_Team3D/Editor/Public/Action_Panel.h @@ -38,18 +38,20 @@ class CAction_Panel final : public CPanelObject _float2 m_vMagic_MeterUV[5] = {}; _uint m_iMagic_Meter_Count{}; - CGameObject* m_pSpell_Slot = { nullptr }; - CGameObject* m_pSpell_Image = { nullptr }; - CGameObject* m_pSpell_Overlay = { nullptr }; - CGameObject* m_pSlot_Number = { nullptr }; - CGameObject* m_pHpBarBG= { nullptr }; - CGameObject* m_pMagic_Meter1 = { nullptr }; - CGameObject* m_pMagic_Meter2 = { nullptr }; - CGameObject* m_pMagic_Meter3 = { nullptr }; - CGameObject* m_pMagic_Meter4 = { nullptr }; - CGameObject* m_pMagic_Meter5 = { nullptr }; - CGameObject* m_pMagic_Icon = { nullptr }; - CGameObject* m_pSpell_UI = { nullptr }; + CGameObject* m_pSpell_Slot = { nullptr }; + CGameObject* m_pSpell_Overlay = { nullptr }; + CGameObject* m_pSlot_Number = { nullptr }; + CGameObject* m_pHpBarBG = { nullptr }; + CGameObject* m_pMagic_Meter1 = { nullptr }; + CGameObject* m_pMagic_Meter2 = { nullptr }; + CGameObject* m_pMagic_Meter3 = { nullptr }; + CGameObject* m_pMagic_Meter4 = { nullptr }; + CGameObject* m_pMagic_Meter5 = { nullptr }; + CGameObject* m_pMagic_Icon = { nullptr }; + CGameObject* m_pSpell_UI = { nullptr }; + CGameObject* m_pPotion = { nullptr }; + CGameObject* m_pMagic_Item = { nullptr }; + public: static CAction_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index c283d4bb4..d7a83e80b 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -24,8 +24,8 @@ namespace Editor enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR ,END }; - enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND ,NON_WORLD , BLUR_NO_WORLD , ALPHA_BLEND, END }; - enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, SPELLTYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV,END }; + enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, END }; + enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, SPELLTYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, END }; enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, END }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; diff --git a/Jusin154_Team3D/Editor/Public/HpBarBG.h b/Jusin154_Team3D/Editor/Public/HpBarBG.h index 6c97eea15..46c0162d8 100644 --- a/Jusin154_Team3D/Editor/Public/HpBarBG.h +++ b/Jusin154_Team3D/Editor/Public/HpBarBG.h @@ -33,15 +33,19 @@ class CHpBarBG final : public CElementObject private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + _float m_fBlinkTime{}; _float m_fMaxHp{}; _float m_fCurrentHp{}; _float m_fHpBar{}; _float m_fDamage{}; _float m_fTargetHp{}; _float2 m_fHpBG{}; + _float2 m_fHpBGPos{}; + _float2 m_fHpBGSize{}; public: static CHpBarBG* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Magic_Icon.h b/Jusin154_Team3D/Editor/Public/Magic_Icon.h index 68ae18752..2fb108918 100644 --- a/Jusin154_Team3D/Editor/Public/Magic_Icon.h +++ b/Jusin154_Team3D/Editor/Public/Magic_Icon.h @@ -29,6 +29,7 @@ class CMagic_Icon final : public CElementObject private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Image.h b/Jusin154_Team3D/Editor/Public/Magic_Item.h similarity index 56% rename from Jusin154_Team3D/Editor/Public/Spell_Image.h rename to Jusin154_Team3D/Editor/Public/Magic_Item.h index cf4bd94ce..83cf77f0c 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Image.h +++ b/Jusin154_Team3D/Editor/Public/Magic_Item.h @@ -5,12 +5,12 @@ NS_BEGIN(Editor) -class CSpell_Image final : public CElementObject +class CMagic_Item final : public CElementObject { private: - CSpell_Image(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - CSpell_Image(const CSpell_Image& rhs); - virtual ~CSpell_Image() = default; + CMagic_Item(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMagic_Item(const CMagic_Item& rhs); + virtual ~CMagic_Item() = default; public: virtual void Priority_Update(_float fTimeDelta); @@ -19,21 +19,33 @@ class CSpell_Image final : public CElementObject 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: + void Compute_UV(_uint iItemID); + void Compute_Image(); private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; + CTexture* m_pDiffuse_TextureCom4 = { nullptr }; + CTexture* m_pDiffuse_TextureCom5 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + _float4 m_vUV{}; + _uint m_iArratCount{}; + _float2 m_vImageSize1 = {}; + _float2 m_vImagePos1 = {}; + _float2 m_vImageSize2 = {}; + _float2 m_vImagePos2 = {}; public: - static CSpell_Image* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + static CMagic_Item* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; virtual void Free() override; void Describe_Entity() override; diff --git a/Jusin154_Team3D/Editor/Public/Potion.h b/Jusin154_Team3D/Editor/Public/Potion.h index 604263141..c9cab3a7f 100644 --- a/Jusin154_Team3D/Editor/Public/Potion.h +++ b/Jusin154_Team3D/Editor/Public/Potion.h @@ -27,9 +27,15 @@ class CPotion final : public CElementObject private: CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; + CTexture* m_pDiffuse_TextureCom4 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + _float2 m_vImageSlotPos{}; + _float2 m_vImageSize{}; public: static CPotion* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Overlay.h b/Jusin154_Team3D/Editor/Public/Spell_Overlay.h index 6de3ecc97..9e7a52fb5 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Overlay.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Overlay.h @@ -26,6 +26,9 @@ class CSpell_Overlay final : public CElementObject virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; +private: + void Compute_UI(_uint SpellID); + private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CTexture* m_pDiffuse_TextureCom1 = { nullptr }; @@ -36,6 +39,7 @@ class CSpell_Overlay final : public CElementObject _int m_iImageFrameX{}; _int m_iImageFrameY{}; _float m_fFrame{}; + _float4 m_vUV{}; public: static CSpell_Overlay* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); 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 7037ecd28..754d895eb 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -165,18 +165,30 @@ PBR_LIGHT_OUT PBR_Lighting( Out.vShade = (kD / PI) * (NdotL * fAttenuation) * vLightColor; Out.vSpecular = specularBRDF * vLightColor * fAttenuation * NdotL; - + return Out; } -float GetBloomCurve(float x) +float GetBloomCurve(float x, float fThreshold, uint iMethod) { float fResult = x; - float fThreshold = 0.68f * 2.f; + // float fThreshold = 0.68f * 2.f; x *= 2.f; - fResult = x * 0.05f // 최소 기본값 보장 + if (iMethod == 0) + { + fResult = x * 0.05f // 최소 기본값 보장 + max(0, x - fThreshold) // 밝기값 68 이하는 기본값으로하고 초과하면 그 값만큼 더해줌 * 0.5f; // 0~2로 정규화 되어있기 때문에 강조 값 보정해줌 + } + else if (iMethod == 1) + { + fResult = x * x / 3.2f; + } + else if (iMethod == 2) + { + fResult = max(0, x - fThreshold); + fResult = pow(fResult, 3.f); + } return fResult * 0.5f; } diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli index 3b37f3b2c..f8468ae65 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli @@ -61,6 +61,13 @@ DepthStencilState DSS_Effect BlendState BS_None { BlendEnable[0] = false; + BlendEnable[1] = false; + BlendEnable[2] = false; + BlendEnable[3] = false; + BlendEnable[4] = false; + BlendEnable[5] = false; + BlendEnable[6] = false; + BlendEnable[7] = false; }; BlendState BS_AlphaBlend // ALPHA_BLEND diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index eef8ea86c..f401dc228 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -11,6 +11,9 @@ uint g_iMaxShadowWidth; uint g_iMaxShadowHeight; float2 g_vResolution; +uint g_iBloomEmbossingPass; +float g_fThreshold; + Texture2D g_Texture; float g_fLightRange; @@ -90,6 +93,7 @@ struct PS_IN struct PS_OUT_BACKBUFFER { float4 vBackBuffer : SV_TARGET0; + float4 vBloomBuffer : SV_Target1; }; PS_OUT_BACKBUFFER PS_MAIN_DEBUG(PS_IN In) @@ -97,7 +101,7 @@ PS_OUT_BACKBUFFER PS_MAIN_DEBUG(PS_IN In) PS_OUT_BACKBUFFER Out; Out.vBackBuffer = g_Texture.Sample(DefaultSampler, In.vTexcoord); - + Out.vBloomBuffer = float4(0.f, 0.f, 0.f, 0.f); return Out; } @@ -146,7 +150,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) fMetallic = vMRO.r; fRoughness = vMRO.g; fOcclusion = vMRO.b; - + vF0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic); } else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_SPECULAR)) // Specular @@ -412,36 +416,8 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) Out.vBackBuffer.rgb *= lerp(0.5f, 1.f, min(fVisibility_Dynamic, fVisibility_Static)); - //float fShadowDepth = g_ShadowTexture.Sample(DefaultSampler, vTexcoord).x; - //float fPreShadowDepth = g_PreShadowTexture.Sample(DefaultSampler, vPreShadowTexcoord).x; - //bool IsShadow = { false }; - //if (vPosition.z - 0.0005f > fShadowDepth) - //{ - // IsShadow = true; - //} - //if (vPreShadowPosition.z - 0.0005f > fPreShadowDepth) - //{ - // IsShadow = true; - //} - //if (true == IsShadow) - //{ - // Out.vBackBuffer *= 0.5f; - //} float4 vColor = 0.f; - - - int iBlurWeight = (int)(round(g_BlurWeightXTexture.Sample(ClampSampler, In.vTexcoord).r) * 128.f); - - int iBlurMin; - int iBlurMax; - - iBlurMin = -1 * (iBlurWeight / 2) + 1; - iBlurMax = iBlurWeight / 2; - - // // 변수로 루프돌리려면 반드시 필요함 - - for (int i = -63; i < 64; ++i) { vTexcoord.x = In.vTexcoord.x; @@ -451,40 +427,64 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) } Out.vBackBuffer += vColor; + Out.vBloomBuffer; return Out; } -PS_OUT_BACKBUFFER PS_MAIN_REFIT(PS_IN In) -{ - PS_OUT_BACKBUFFER Out; - Out.vBackBuffer = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord); +struct PS_OUT_FLT4_SINGLE +{ + vector vSingleTarget : SV_TARGET0; +}; + + +PS_OUT_FLT4_SINGLE PS_MAIN_REFIT(PS_IN In) +{ + PS_OUT_FLT4_SINGLE Out; + + Out.vSingleTarget = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord); return Out; } -PS_OUT_BACKBUFFER PS_MAIN_EMBOSS(PS_IN In) +PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In) { - PS_OUT_BACKBUFFER Out; + PS_OUT_FLT4_SINGLE Out; - float3 vColor = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord).xyz; + vector vInput = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord); + //float fMask = g_BloomMaskTexture.Sample(PointSampler, In.vTexcoord).a; + float3 vColor = vInput.rgb; + uint iMask = (uint) round(vInput.a * 255.f); // int a = 1 // vBloom.a = (enum / 255); - // temp 이거 키면 겁나 빤짞빤짞 빛남 ㄷㄷ - //vColor *= 3.f; - // temp + switch (iMask) + { + case 0: + /* None */ + vColor = float3(0.f, 0.f, 0.f); + break; + case 1: + /* Basic_Apply */ + break; + case 2: + /* Multiply */ + vColor *= 3; + break; + case 3: + break; + } - //float fIntensity = dot(vColor, float3(0.3333f, 0.3333f, 0.3333f)); // 대략적인 밝기 float fIntensity = dot(vColor, float3(0.2126f, 0.7152f, 0.0722f)); // 대략적인 밝기 ( 인간적인 ) if (fIntensity <= 1e-4f) { - Out.vBackBuffer = 0; + Out.vSingleTarget = 0; return Out; } - float fBloomIntensity = GetBloomCurve(fIntensity); + + float fBloomIntensity = GetBloomCurve(fIntensity, g_fThreshold, g_iBloomEmbossingPass); float3 bloomColor = (vColor * fBloomIntensity) / fIntensity; - Out.vBackBuffer = float4(bloomColor, 1.f); + Out.vSingleTarget = float4(bloomColor, 1.f); return Out; } @@ -495,26 +495,26 @@ struct PS_OUT_BLUR_X float4 vBlurWeight : SV_TARGET1; }; -PS_OUT_BACKBUFFER PS_MAIN_BLOOM_ACCUM(PS_IN In) +PS_OUT_FLT4_SINGLE PS_MAIN_BLOOM_ACCUM(PS_IN In) { - PS_OUT_BACKBUFFER Out; + PS_OUT_FLT4_SINGLE Out; float3 vColorSrcA = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord).xyz; float3 vColorSrcB = g_BlurTexture.Sample(PointSampler, In.vTexcoord).xyz; - Out.vBackBuffer = float4(saturate(vColorSrcA + vColorSrcB), 1.f); + Out.vSingleTarget = float4(saturate(vColorSrcA + vColorSrcB), 1.f); return Out; } -PS_OUT_BACKBUFFER PS_MAIN_BLOOM_FINISH(PS_IN In) +PS_OUT_FLT4_SINGLE PS_MAIN_BLOOM_FINISH(PS_IN In) { - PS_OUT_BACKBUFFER Out; + PS_OUT_FLT4_SINGLE Out; vector vColor = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord); float3 vBloom = g_BlurTexture.Sample(PointSampler, In.vTexcoord).xyz; - Out.vBackBuffer = vColor; - Out.vBackBuffer += float4(vBloom, 1.f); + Out.vSingleTarget = vColor; + Out.vSingleTarget += float4(vBloom, 1.f); return Out; } diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index ffed8f443..495a08229 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -169,24 +169,6 @@ {0e35cd1b-88f6-46b9-b72e-b46eeaacd4e0} - - {32ca0c26-d3e2-49c5-8dc6-cc67e5291214} - - - {17dcadfe-e4cd-46c6-8122-e5e02bb73e57} - - - {c3e7b75b-ec8b-4071-8b52-e5c356febfa6} - - - {57dd171f-f788-4918-aae2-85c20794b3cb} - - - {40758cb1-0f91-4db9-bad7-7c77eb8002da} - - - {bbf3ec67-56f5-4e67-b6cf-8eb1eb4400ff} - {30c382b4-2ac9-4355-b3a5-c1b3622c2982} @@ -202,9 +184,6 @@ {be0d499e-e4cf-4dde-92a0-a0904e713045} - - {d93660eb-4bf9-43d2-902e-8ecbefd02481} - {41e9427d-6e3b-4424-b2d0-0496a0a875af} @@ -217,9 +196,6 @@ {96600587-16b1-4627-914d-7fc413c501ba} - - {5948985e-f67e-4627-aca4-09b8e9edc359} - {5e6a85cd-455a-4161-83c8-ba5f4ce2ba41} @@ -289,6 +265,30 @@ {d76a5d4a-1627-448d-9631-239540dd8eb2} + + {32ca0c26-d3e2-49c5-8dc6-cc67e5291214} + + + {17dcadfe-e4cd-46c6-8122-e5e02bb73e57} + + + {c3e7b75b-ec8b-4071-8b52-e5c356febfa6} + + + {57dd171f-f788-4918-aae2-85c20794b3cb} + + + {40758cb1-0f91-4db9-bad7-7c77eb8002da} + + + {bbf3ec67-56f5-4e67-b6cf-8eb1eb4400ff} + + + {d93660eb-4bf9-43d2-902e-8ecbefd02481} + + + {5948985e-f67e-4627-aca4-09b8e9edc359} + diff --git a/Jusin154_Team3D/Engine/Private/Camera.cpp b/Jusin154_Team3D/Engine/Private/Camera.cpp index d320b6f3f..2bd96f181 100644 --- a/Jusin154_Team3D/Engine/Private/Camera.cpp +++ b/Jusin154_Team3D/Engine/Private/Camera.cpp @@ -56,7 +56,7 @@ HRESULT CCamera::Bind_Matrices() if (true == m_bActive) { m_pGameInstance->Set_Transform(D3DTS::VIEW, XMMatrixInverse(nullptr, XMLoadFloat4x4(m_pTransformCom->Get_WorldMatrixPtr()))); m_pGameInstance->Set_Transform(D3DTS::PROJ, XMMatrixPerspectiveFovLH(m_fFovy, m_fAspect, m_fNear, m_fFar)); - Ready_Shadow(); + //Ready_Shadow(); } return S_OK; } diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index 9c3c5fe5c..bfc749398 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -189,12 +189,11 @@ void CChannel::Update_TransformationMatirx( _float dz = XMVectorGetZ(vDeltaAdjusted); _vector vDeltaWorld = vRight * dx + (vUp * dz) + (-vLook * dy); - if (fabsf(dx) < FLT_EPSILON3 && fabsf(dy) < FLT_EPSILON3 && fabsf(dz) < FLT_EPSILON3) { - int a = 0; - } vDeltaWorld *= 0.01f; vDeltaWorld *= m_fAmount; + + vDeltaWorld = XMVectorSetW(vDeltaWorld, 1.f); //pTransform->Set_State(STATE::POSITION,vDeltaWorld); pTransform->AccumulateMomentum(vDeltaWorld); @@ -202,7 +201,7 @@ void CChannel::Update_TransformationMatirx( m_vPrevRootPos = vCurRootPos; vTranslation = XMVectorZero(); - _float4 curRotF4; + _float4 curRotF4; XMStoreFloat4(&curRotF4, vRotation); _vector qCur = XMLoadFloat4(&curRotF4); @@ -227,11 +226,9 @@ void CChannel::Update_TransformationMatirx( _float4 axis; XMStoreFloat4(&axis, axisWorld); + swap(axis.z, axis.y); - - - if (angle > 0 ) - pTransform->TurnAngle(XMLoadFloat4(&axis), angle); + pTransform->TurnAngle(XMLoadFloat4(&axis), angle); } XMStoreFloat4(&m_vPrevRootRot, qCur); diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 07f79843a..eba74dd9a 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -109,20 +109,7 @@ void CGameInstance::Update_Engine(_float fTimeDelta) m_pMouse_Manager->Update(); //m_pSound_Manager->Update(); -#ifdef _DEBUG - - -#ifdef 기무리 - static _bool bPicking = false; - GUI::Checkbox("Picking Enable", &bPicking); - if (bPicking) { - m_pPicking->Update(); - } -#endif // 기무리 -#endif // _DEBUG -#ifndef 기무리 m_pPicking->Update(); -#endif // !기무리 m_pObject_Manager->Priority_Update(fTimeDelta); diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index ccb805b33..018d03268 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -124,9 +124,15 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform) CAnimation* pCurAnim = m_Animations[m_iCurrentAnimIndex]; CAnimation* pPreAnim = m_Animations[m_iPreAnimIndex]; - //_bool bPreFinished = pPreAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount); + _bool bCurFinished; + + if (m_bRatio) { + bCurFinished = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount * fRatio); + } + else { + bCurFinished = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount); + } - _bool bCurFinished = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount); pCurAnim->InterpAnim(pPreAnim, m_Bones, fRatio); @@ -136,6 +142,7 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform) { m_iPreAnimIndex = m_iCurrentAnimIndex; m_fBlendTime = 0.f; + m_bRatio = false; } } else @@ -153,7 +160,7 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform) return m_bIsFinishedAnim; } -void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop,_float fAmount) +void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop,_float fAmount,_bool bRatio) { if (m_iCurrentAnimIndex == iIndex){ return; @@ -163,6 +170,7 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop,_float fAmount) m_iCurrentAnimIndex = iIndex; m_bIsLoop = isLoop; m_fAmount = fAmount; + m_bRatio = bRatio; m_Animations[m_iCurrentAnimIndex]->Depart_Animation(); m_Animations[m_iCurrentAnimIndex]->ResetRootMotion(); } @@ -235,6 +243,18 @@ void CModel::Set_AnimSpeed(_float fSpeed) m_Animations[m_iCurrentAnimIndex]->Set_AnimSpeed(fSpeed); } +HRESULT CModel::Anim_Event(_float fRatio,_uint AnimIndex,function Event) +{ + if (AnimIndex == m_iCurrentAnimIndex) + { + if (m_Animations[m_iCurrentAnimIndex]->Get_CurrentTrackProgressRatio() >= fRatio) + { + Event(); + } + } + return E_FAIL; +} + HRESULT CModel::Render(_uint iMeshIndex) { @@ -1441,51 +1461,41 @@ void CModel::Free() #ifdef _DEBUG void CModel::Describe_Entity() { - //GUI::Begin("Model_Desc"); - //GUI::Text("Lerping : %d\nAnim : %d", m_pLerpAnim->IsLerping(), m_bIsFinishedAnim); - //for (_uint i = 0; i < m_iNumAnimations; ++i) { - // if (GUI::Button(m_Animations[i]->Get_Name().c_str())) { - // Change_AnimationIndex(i, false, 0.25f); - // } - //} - //if (GUI::Button("SaveAnimIndexWithName")) { - // _wstring wstrPath = TEXT("../Bin/AnimIndex.txt"); - // HANDLE hFile = CreateFile(wstrPath.c_str(), - // GENERIC_WRITE, NULL, - // NULL, CREATE_ALWAYS, - // FILE_ATTRIBUTE_NORMAL, NULL - // ); + GUI::Begin("Model_Desc"); + if (GUI::Button("SaveAnimIndexWithName")) { + _wstring wstrPath = TEXT("../Bin/AnimIndex.txt"); + HANDLE hFile = CreateFile(wstrPath.c_str(), + GENERIC_WRITE, NULL, + NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL + ); - // if (hFile == INVALID_HANDLE_VALUE) - // { - // GUI::End(); - // CloseHandle(hFile); - // return; - // } + if (hFile == INVALID_HANDLE_VALUE) + { + GUI::End(); + CloseHandle(hFile); + return; + } - // _string name = {}; - // for (_uint i = 0; i < m_iNumAnimations; ++i) { - // - // name.clear(); - // name.append(to_string(i) + '\t' + m_Animations[i]->Get_Name() + "\n"); - // name.shrink_to_fit(); - // WriteFile(hFile, name.data(),(DWORD) name.length(), nullptr, nullptr); - // } + _string name = {}; + for (_uint i = 0; i < m_iNumAnimations; ++i) { + + name.clear(); + name.append(m_Animations[i]->Get_SZName()); - // CloseHandle(hFile); + size_t pos = name.find_last_of('|'); + if (0 > pos) { pos = 0; } + else { pos++; } + name = name.substr(pos); + name = to_string(i) + '\t' + name + '\n'; + name.shrink_to_fit(); + WriteFile(hFile, name.data(),(DWORD) name.length(), nullptr, nullptr); + } - //} - //GUI::End(); - // - //GUI::Begin("Bone_Desc"); - //_uint iNumBones = (_uint)m_Bones.size(); - //for (_uint i = 0; i < iNumBones; ++i){ - // _float3 vPos = m_Bones[i]->Get_LocalPosition(); - // GUI::PushID(i); - // GUI::DragFloat3(m_Bones[i]->Get_Name(), (_float*)&vPos, 1.f, 0.f, 0.f, "%.3f", ImGuiSliderFlags_NoInput); - // GUI::PopID(); - //} - //GUI::End(); + CloseHandle(hFile); + + } + GUI::End(); } #endif // _DEBUG diff --git a/Jusin154_Team3D/Engine/Private/Picking.cpp b/Jusin154_Team3D/Engine/Private/Picking.cpp index 21dd71c4e..da93f6632 100644 --- a/Jusin154_Team3D/Engine/Private/Picking.cpp +++ b/Jusin154_Team3D/Engine/Private/Picking.cpp @@ -30,15 +30,13 @@ HRESULT CPicking::Initialize(HWND hWnd, _uint iSizeX, _uint iSizeY) TextureDesc.Usage = D3D11_USAGE_STAGING; TextureDesc.BindFlags = 0; - TextureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; + TextureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; TextureDesc.MiscFlags = 0; if (FAILED(m_pDevice->CreateTexture2D(&TextureDesc, nullptr, &m_pTexture2D))){ return E_FAIL; } - m_iNumPixels = iSizeX * iSizeY; - m_pPixels = new _float4[m_iNumPixels]; m_iNumPixelW = iSizeX; m_iNumPixelH = iSizeY; @@ -48,46 +46,48 @@ HRESULT CPicking::Initialize(HWND hWnd, _uint iSizeX, _uint iSizeY) void CPicking::Update() { m_pGameInstance->Copy_RenderTarget(TEXT("Target_Depth"), m_pTexture2D); - - D3D11_MAPPED_SUBRESOURCE SubResource{}; - if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_READ_WRITE, 0, &SubResource))){ - return; - } - - memcpy(m_pPixels, SubResource.pData, sizeof(_float4) * m_iNumPixels); - - m_pContext->Unmap(m_pTexture2D, 0); } - _bool CPicking::isPicking(_float3* pOut) { - POINT ptMouse{}; - + POINT ptMouse{}; GetCursorPos(&ptMouse); ScreenToClient(m_hWnd, &ptMouse); - _uint iMouseIndex = ptMouse.y * m_iNumPixelW + ptMouse.x; - - if (iMouseIndex > m_iNumPixelW * m_iNumPixelH) + if (ptMouse.x < 0 || ptMouse.x >= (LONG)m_iNumPixelW || ptMouse.y < 0 || ptMouse.y >= (LONG)m_iNumPixelH){ return false; + } - if (0.f == m_pPixels[iMouseIndex].w) + D3D11_MAPPED_SUBRESOURCE SubResource{}; + if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_READ, 0, &SubResource))) { return false; - - _float3 vMousePos = _float3(0.f, 0.f, 0.f); + } + BYTE* pRowStart = static_cast(SubResource.pData) + ptMouse.y * SubResource.RowPitch; + _float4* pPixelRow = reinterpret_cast<_float4*>(pRowStart); + _float4 Pixel = pPixelRow[ptMouse.x]; + + m_pContext->Unmap(m_pTexture2D, 0); + + if (0.f == Pixel.w){ + return false; + } + + _float3 vMousePos{}; vMousePos.x = ptMouse.x / (m_iNumPixelW * 0.5f) - 1.f; vMousePos.y = ptMouse.y / (m_iNumPixelH * -0.5f) + 1.f; - vMousePos.z = m_pPixels[iMouseIndex].x; + vMousePos.z = Pixel.x; - XMStoreFloat3(&vMousePos, XMVector3TransformCoord(XMLoadFloat3(&vMousePos), m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ_INV))); - XMStoreFloat3(&vMousePos, XMVector3TransformCoord(XMLoadFloat3(&vMousePos), m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW_INV))); + XMStoreFloat3(&vMousePos, XMVector3TransformCoord(XMLoadFloat3(&vMousePos), + m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ_INV))); + + XMStoreFloat3(&vMousePos, XMVector3TransformCoord(XMLoadFloat3(&vMousePos), + m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW_INV))); *pOut = vMousePos; - return true; } + CPicking* CPicking::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, HWND hWnd, _uint iSizeX, _uint iSizeY) { CPicking* pInstance = new CPicking(pDevice, pContext); @@ -109,5 +109,4 @@ void CPicking::Free() SAFE_RELEASE(m_pContext); SAFE_RELEASE(m_pTexture2D); SAFE_RELEASE(m_pGameInstance); - Safe_Delete_Array(m_pPixels); } diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget.cpp index 524104c85..fd6ca4c26 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget.cpp @@ -101,37 +101,39 @@ void CRenderTarget::Ready_Debug() void CRenderTarget::Describe_Entity(const _char* pName) { - if (GUI::Checkbox(pName, &m_isDraw)) - { - - } + GUI::Selectable(pName, &m_isDraw); } _bool CRenderTarget::Render_Debug(CShader* pShader, CVIBuffer_Rect* pVIBuffer ,_float fX, _float fY, _float fSizeX, _float fSizeY) { - - if (m_isDraw == false) + if (m_isDraw == false) { return false; + } m_WorldMatrix._11 = fSizeX; m_WorldMatrix._22 = fSizeY; m_WorldMatrix._41 = fX - m_ptWindowSize.x * 0.5f; m_WorldMatrix._42 = -fY + m_ptWindowSize.y * 0.5f; - if (FAILED(pShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix))) + if (FAILED(pShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix))){ return false; + } - if (FAILED(pShader->Bind_SRV("g_Texture", m_pSRV))) + if (FAILED(pShader->Bind_SRV("g_Texture", m_pSRV))) { return false; + } - if (FAILED(pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::DEBUG)))) + if (FAILED(pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::DEBUG)))) { return false; + } - if (FAILED(pVIBuffer->Bind_Resources())) + if (FAILED(pVIBuffer->Bind_Resources())) { return false; + } - if (FAILED(pVIBuffer->Render())) + if (FAILED(pVIBuffer->Render())) { return false; + } return true; } diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp index abbe9bb8c..5f9241e67 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp @@ -289,6 +289,11 @@ HRESULT CRenderTarget_Manager::Refit_RenderTarget(CVIBuffer_Rect* pVIBuffer, CSh NewViewport.MinDepth = 0.f; NewViewport.MaxDepth = 1.f; + _float2 vResolution = { NewViewport.Width, NewViewport.Height }; + if (FAILED(pShader->Bind_RawValue("g_vResolution", &vResolution, sizeof(_float2)))) { + assert(false); + } + pOutput->Clear(); { // Bind RTVs @@ -354,6 +359,10 @@ HRESULT CRenderTarget_Manager::Refit_RenderTarget(CVIBuffer_Rect* pVIBuffer, CSh m_pContext->OMSetRenderTargets(1, &m_pBackBufferRTV, m_pOriginalDSV); m_pContext->RSSetViewports(iNumViewPorts, &OriginalViewport); + vResolution = { OriginalViewport.Width, OriginalViewport.Height }; + if (FAILED(pShader->Bind_RawValue("g_vResolution", &vResolution, sizeof(_float2)))) { + assert(false); + } SAFE_RELEASE(m_pBackBufferRTV); SAFE_RELEASE(m_pOriginalDSV); @@ -438,8 +447,9 @@ HRESULT CRenderTarget_Manager::Render_RenderTarget_Debug(CShader* pShader, CVIBu for (auto& pRenderTarget : m_RenderTargets) { - if (pRenderTarget.second->Render_Debug(pShader, pVIBuffer, fX, fY, (_float)m_iSizeX, (_float)m_iSizeY) == false) + if (pRenderTarget.second->Render_Debug(pShader, pVIBuffer, fX, fY, (_float)m_iSizeX, (_float)m_iSizeY) == false){ continue; + } fX += m_iSizeX; @@ -467,12 +477,24 @@ void CRenderTarget_Manager::RenderTarget_Debuger() GUI::DragInt("Target Size X" , &m_iSizeX); GUI::DragInt("Target Size Y", &m_iSizeY); GUI::PopItemWidth(); - - for (auto& pTarget : m_RenderTargets) + ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar; + GUI::BeginChild("RTDebugger", { 120.f, 200.f }, ImGuiChildFlags_None, window_flags); + for (auto& [key, pRenderTarget] : m_RenderTargets) { - pTarget.second->Describe_Entity(CMyTools::ToString(pTarget.first).c_str()); + _string strKey = CMyTools::ToString(key); + _string strTargetName = "NOT_STARTED_WITH_Target_"; + + _string TargetPrefix = "Target_"; + if (size_t pos = strKey.find(TargetPrefix); pos != string::npos) + { + strTargetName = strKey.substr(pos + TargetPrefix.length()); + } + + pRenderTarget->Describe_Entity(strTargetName.c_str()); } + GUI::EndChild(); + GUI::End(); } diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index 248b40f18..e939a0f9a 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -415,13 +415,19 @@ void CRenderer::Render_Bloom() m_bPostProcessing_BLOOM = !m_bPostProcessing_BLOOM; } if(true == m_bPostProcessing_BLOOM) { - { // BackBuffer - ID3D11Texture2D* pBackBuffer = nullptr; - m_pGameInstance->Get_BackBufferPTR(&pBackBuffer); - //m_pGameInstance->Copy_RenderTarget(TEXT("Target_Diffuse"), pBackBuffer); - m_pGameInstance->Paste_RenderTarget(TEXT("Target_Bloom_Input"), pBackBuffer); - SAFE_RELEASE(pBackBuffer); - } + GUI::Begin("PostProcessing_Bloom"); + GUI::PushItemWidth(80); + GUI::DragFloat("g_fThreshold", &m_fThreshold, 0.01f, 0.02f, 100.f, "%.3f"); + GUI::SliderInt("g_iEmbossingPass", &m_iBloomEmbossingPass, 0, 2, "%d"); + GUI::End(); + + //{ // BackBuffer + // ID3D11Texture2D* pBackBuffer = nullptr; + // m_pGameInstance->Get_BackBufferPTR(&pBackBuffer); + // //m_pGameInstance->Copy_RenderTarget(TEXT("Target_Diffuse"), pBackBuffer); + // m_pGameInstance->Paste_RenderTarget(TEXT("Target_Bloom_Input"), pBackBuffer); + // SAFE_RELEASE(pBackBuffer); + //} // "Target_Bloom_Input" // "Target_Bloom" @@ -432,6 +438,29 @@ void CRenderer::Render_Bloom() // "Target_Bloom_8x8_2" // "Target_Bloom_4x4_2" + if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Bloom")))) { + return; + } + + for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::BLOOM)]) + { + if (nullptr != pRenderObject) + if (FAILED(pRenderObject->Render_Bloom())) { + assert(false); + } + + SAFE_RELEASE(pRenderObject); + } + + m_RenderObjects[ENUM_CLASS(RENDER::BLOOM)].clear(); + + if (FAILED(m_pGameInstance->End_MRT())) { + return; + } + + m_pShader->Bind_RawValue("g_fThreshold", &m_fThreshold, sizeof(_float)); + m_pShader->Bind_RawValue("g_iBloomEmbossingPass", &m_iBloomEmbossingPass, sizeof(_int)); + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_Input"), TEXT("Target_Bloom_4x4"), SHADER_PASS_DEFERRED::EMBOSSING); // 2 m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4"), TEXT("Target_Bloom_8x8"), SHADER_PASS_DEFERRED::REFIT); // 3 m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_8x8"), TEXT("Target_Bloom_16x16"), SHADER_PASS_DEFERRED::REFIT); // 4 @@ -748,6 +777,10 @@ HRESULT CRenderer::Initialize() if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Blur"), TEXT("Target_Blur_Weight")))) { return E_FAIL; } + /* MRT_Blur */ + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Bloom"), TEXT("Target_Bloom_Input")))) { + return E_FAIL; + } /* MRT_Blur_X */ if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Blur_X"), TEXT("Target_Blur_X")))) { diff --git a/Jusin154_Team3D/Engine/Private/Transform.cpp b/Jusin154_Team3D/Engine/Private/Transform.cpp index 89b6cf2f8..a467f38ce 100644 --- a/Jusin154_Team3D/Engine/Private/Transform.cpp +++ b/Jusin154_Team3D/Engine/Private/Transform.cpp @@ -230,11 +230,10 @@ void CTransform::TurnAngle(_vector vAxis, _float fAngle) _vector vRight = Get_State(STATE::RIGHT); _vector vUp = Get_State(STATE::UP); _vector vLook = Get_State(STATE::LOOK); - if (vAxis.m128_f32[0] == 0) - return; - if (vAxis.m128_f32[1] == 0) - return; - if (vAxis.m128_f32[2] == 0) + + if (vAxis.m128_f32[0] == 0 && + vAxis.m128_f32[1] == 0 && + vAxis.m128_f32[2] == 0) return; vAxis = XMVector3Normalize(vAxis); diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index 630c2b9d8..9593cbaaa 100644 --- a/Jusin154_Team3D/Engine/Public/Animation.h +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -12,8 +12,7 @@ class ENGINE_DLL CAnimation : public CBase virtual ~CAnimation() = default; public: _bool Update_TransformationMatrices(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta, class CTransform* pTransform = nullptr, _float m_fAmount = 1.f); - void Reset(); - void ProgressAnimation(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, CTransform* pTransform, _float m_fAmount); + void ProgressAnimation(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, CTransform* pTransform, _float m_fAmount); void ResetRootMotion(); void Depart_Animation(); void Set_AnimPause(_bool bValue) { m_bPause = bValue; } diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index a2f0c036c..549785c98 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, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, UI, END }; +enum class RENDER { PRIORITY, SHADOW, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, BLOOM, UI, END }; enum class RAY { LOCAL, WORLD, END }; enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END }; diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 259740ad4..c68ae35ad 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -5,20 +5,22 @@ enum ESTATE : _u64Flag { NOT_DEFINE = 0, IDLE = 1ULL << 0, - MOVE = 1ULL << 1, - WALK = 1ULL << 2, - JOG = 1ULL << 3, - SPRINT = 1ULL << 4, - JUMP = 1ULL << 5, - LAND = 1ULL << 6, - DODGE = 1ULL << 7, - COMBAT = 1ULL << 8, - LIGHT_ATTACK = 1ULL << 9, - SPELL = 1ULL << 10, - SKILL = 1ULL << 11, - SKILL2 = 1ULL << 12, - MAPHELP = 1ULL << 13, - STOP = 1ULL << 14, + IDLE_TURN = 1ULL << 1, + MOVE = 1ULL << 2, + WALK = 1ULL << 3, + JOG = 1ULL << 4, + SPRINT = 1ULL << 5, + JUMP = 1ULL << 6, + LAND = 1ULL << 7, + DODGE = 1ULL << 8, + COMBAT = 1ULL << 9, + LIGHT_ATTACK = 1ULL << 10, + SPELL = 1ULL << 11, + SKILL = 1ULL << 12, + SKILL2 = 1ULL << 13, + ANCIENT_THROW = 1ULL << 14, + MAPHELP = 1ULL << 15, + STOP = 1ULL << 16, END }; NS_END diff --git a/Jusin154_Team3D/Engine/Public/GameObject.h b/Jusin154_Team3D/Engine/Public/GameObject.h index 7cb2635fe..e97b994af 100644 --- a/Jusin154_Team3D/Engine/Public/GameObject.h +++ b/Jusin154_Team3D/Engine/Public/GameObject.h @@ -22,6 +22,7 @@ class ENGINE_DLL CGameObject abstract virtual HRESULT Render(); virtual HRESULT Render_Shadow() { return S_OK; } virtual HRESULT Render_Blur() { return S_OK; } + virtual HRESULT Render_Bloom() { return S_OK; } virtual _float Get_Depth(); // z 소팅 할 때 쓰시면 됨 diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 8a1eb3283..0175e3c39 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -32,8 +32,8 @@ class ENGINE_DLL CModel final : public CComponent virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation); #pragma endregion #pragma region Animation - _bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr); // 애니메이션에 델타타임을 넣어줌 - void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f); + _bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr ); // 애니메이션에 델타타임을 넣어줌 + void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f, _bool bRatio = false); _bool IsFinishedAnim() const { return m_bIsFinishedAnim; } _bool IsLoopAnim() const { return m_bIsLoop; } void Set_CurrentTrackPosition(_float TrackPosition); @@ -47,6 +47,8 @@ class ENGINE_DLL CModel final : public CComponent _int Get_AnimIndex() const { return m_iCurrentAnimIndex; } _float Get_AnimSpeed(); void Set_AnimSpeed(_float fSpeed); + + HRESULT Anim_Event(_float fRatio, _uint AnimIndex, function Event); #pragma endregion #pragma region Mesh const _char* Get_MeshName(_uint iIndex); @@ -111,7 +113,7 @@ void Combined_BoneMatrix(); _bool m_bIsFinishedAnim = { false }; // 대상 애니메이션이 끝났는지 _bool m_bIsFinishedLerp = { false }; // 럴프 애니메이션이 끝났는지 _bool m_bPlayAnim = { true }; - _float m_fAmount = { 1.f }; + _float m_fAmount = { 1.f }; _int m_iPreAnimIndex = { 0 }; _float m_fBlendTime = { 0.f }; @@ -135,6 +137,7 @@ void Combined_BoneMatrix(); // vector<_float4x4> m_BoneMatrix; + _bool m_bRatio = { false }; #pragma region Compute @@ -146,6 +149,7 @@ void Combined_BoneMatrix(); void Create_LocalPosVB(); void Create_Con(); void UpdateAnimationCS(); + _uint m_iNumBuffer = {}; vector m_Parent = {}; diff --git a/Jusin154_Team3D/Engine/Public/Picking.h b/Jusin154_Team3D/Engine/Public/Picking.h index a41197db0..ab11f5cce 100644 --- a/Jusin154_Team3D/Engine/Public/Picking.h +++ b/Jusin154_Team3D/Engine/Public/Picking.h @@ -22,12 +22,9 @@ class CPicking final : public CBase ID3D11Texture2D* m_pTexture2D = { nullptr }; class CGameInstance* m_pGameInstance = { nullptr }; - _uint m_iNumPixels = {}; _uint m_iNumPixelW = {}; _uint m_iNumPixelH = {}; - _float4* m_pPixels = { nullptr }; - public: static CPicking* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, HWND hWnd, _uint iSizeX, _uint iSizeY); virtual void Free(); diff --git a/Jusin154_Team3D/Engine/Public/Renderer.h b/Jusin154_Team3D/Engine/Public/Renderer.h index 83aa33cfe..5bc3f3814 100644 --- a/Jusin154_Team3D/Engine/Public/Renderer.h +++ b/Jusin154_Team3D/Engine/Public/Renderer.h @@ -45,7 +45,8 @@ class CRenderer final : public CBase _float4x4 m_PreShadowMatrices[ENUM_CLASS(D3DTS::END)] = {}; _bool m_bPostProcessing_BLOOM = { false }; - + _int m_iBloomEmbossingPass = { 0 }; + _float m_fThreshold = { 1.26f }; private: void Render_Priority(); diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index 1079da162..06d980fb6 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -7,14 +7,22 @@ enum ESTATE IDLE, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, MOVE, WALK, WALK_FWD, WALK_BWD,WALK_STOP, - JOG,JOG_FWD, JOG_BWD,JOG_STOP, + JOG,JOG_FWD,JOG_RIGHT,JOG_LEFT, JOG_BWD,JOG_STOP, SPRINT, JUMP,JUMP_JOG,JUMP_SPRINT, LAND, - DODGE,DODGE_BLINK, + DODGE,DODGE_BLINK, DODGE_LEFT, DODGE_RIGHT, COMBAT, LIGHT_ATTACK, SPELL, SKILL, SKILL2, - ACCIO,DESCENDO,DIFFINDO,DEPULSO,LUMOS,DISILLUSION_ENTER,DISILLUSION_EXIT, MAPHELP, + ACCIO,DESCENDO,DIFFINDO,DEPULSO,LUMOS,DISILLUSION_ENTER,DISILLUSION_EXIT, ANCIENT_THROW, + HIT, HIT_FWD, HIT_BWD, HIT_BWD2, HIT_BWD3, HIT_BWD4, HIT_L, HIT_R, + KNOCKDOWN, KNOCKDOWN_FWD, KNOCKDOWN_FWD_SPLT, KNOCKDOWN_FWD_SPLT_HOLD, KNOCKDOWN_BWD, KNOCKDOWN_BWD_SPLT, KNOCKDOWN_BWD_SPLT_HOLD, + GETUP, GETUP_BWD, GETUP_FWD, GETUP_L, GETUP_L_FD, GETUP_L_FU, GETUP_R, GETUP_R_FD, GETUP_R_FU, GETUP_SLOUCH, + DEAD, DEAD_FWD, DEAD_FWD2, DEAD_BWD, DEAD_BWD2, DEAD_L, DEAD_L2, DEAD_R, DEAD_R2, + KNOCKBACK, KNOCKBACK2, + TUMBLE, TUMBLE2, + PETRIFICUSED_START, + END }; NS_END