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 b02455a1e..0e42f92b6 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -120,7 +120,7 @@ float Geometry_Smith(float3 vNormal, float3 vFromView, float3 vFromLight, float float NdotL = saturate(dot(vNormal, vFromLight)); // 요철이 골고루 있다고 가정하고 적당히 섞음 - return Geometry_SchlickGGX(NdotV, k) * Geometry_SchlickGGX(NdotL, k); + return Geometry_SchlickGGX(NdotV, k) * Geometry_SchlickGGX(NdotL, k); } // F -> F @@ -134,7 +134,8 @@ PBR_LIGHT_OUT PBR_Lighting( float3 vNormal, float3 vToView, float3 vToLight, float3 vAlbedo, float fMetallic, float fRoughness, float3 vLightColor, float fAttenuation, float3 vFO -) { +) +{ PBR_LIGHT_OUT Out; Out.vShade = 0; Out.vSpecular = 0; @@ -159,7 +160,7 @@ PBR_LIGHT_OUT PBR_Lighting( float3 specularBRDF = vNumerator / fDenominator; float3 kS = F; - float3 kD = (1.f - kS) * (1.f -fMetallic); + float3 kD = (1.f - kS) * (1.f - fMetallic); //Out.vShade = float(1.f, 1.f, 1. 1.f); Out.vShade = (kD / PI) * (NdotL * fAttenuation) * vLightColor; @@ -188,10 +189,10 @@ float4x4 RotateX(float fAngle) float4x4 RotateXMat = { - 1, 0, 0, 0, - 0, fCos, -fSin, 0, - 0, fSin, fCos, 0, - 0, 0, 0, 1, + 1, 0, 0, 0, + 0, fCos, -fSin, 0, + 0, fSin, fCos, 0, + 0, 0, 0, 1, }; return RotateXMat; @@ -204,10 +205,10 @@ float4x4 RotateY(float fAngle) float4x4 RotateYMat = { - fCos , 0, fSin, 0, - 0 , 1, 0, 0, - -fSin , 0, fCos, 0, - 0 , 0, 0, 1 + fCos, 0, fSin, 0, + 0, 1, 0, 0, + -fSin, 0, fCos, 0, + 0, 0, 0, 1 }; return RotateYMat; @@ -220,16 +221,16 @@ float4x4 RotateZ(float fAngle) float4x4 RotateZMat = { - fCos, -fSin, 0, 0, - fSin, fCos, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1, + fCos, -fSin, 0, 0, + fSin, fCos, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1, }; return RotateZMat; } -float4x4 RotateAxis(float4 _vAxis , float fAngle) +float4x4 RotateAxis(float4 _vAxis, float fAngle) { float flenhth = length(_vAxis); if (flenhth < FLT_EPSILON5) @@ -242,7 +243,7 @@ float4x4 RotateAxis(float4 _vAxis , float fAngle) ); } - float3 vAxis = normalize(_vAxis); + float3 vAxis = normalize(_vAxis.xyz); float fCos = cos(radians(fAngle)); float fSin = sin(radians(fAngle)); @@ -254,10 +255,10 @@ float4x4 RotateAxis(float4 _vAxis , float fAngle) //Rodrigues 공식 기반 float4x4 RotateMat = float4x4( - fCos + fX * fX * (1.0 - fCos), fX * fY * (1.0 - fCos) - fZ * fSin, fX * fZ * (1.0 - fCos) + fY * fSin, 0.0, - fY * fX * (1.0 - fCos) + fZ * fSin, fCos + fY * fY * (1.0 - fCos), fY * fZ * (1.0 - fCos) - fX * fSin, 0.0, - fZ * fX * (1.0 - fCos) - fY * fSin, fZ * fY * (1.0 - fCos) + fX * fSin, fCos + fZ * fZ * (1.0 - fCos), 0.0, - 0.0, 0.0, 0.0, 1.0 + fCos + fX * fX * (1.0 - fCos), fX * fY * (1.0 - fCos) - fZ * fSin, fX * fZ * (1.0 - fCos) + fY * fSin, 0.0, + fY * fX * (1.0 - fCos) + fZ * fSin, fCos + fY * fY * (1.0 - fCos), fY * fZ * (1.0 - fCos) - fX * fSin, 0.0, + fZ * fX * (1.0 - fCos) - fY * fSin, fZ * fY * (1.0 - fCos) + fX * fSin, fCos + fZ * fZ * (1.0 - fCos), 0.0, + 0.0, 0.0, 0.0, 1.0 ); return RotateMat; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 067d90c1d..99c3e4ffd 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,6 +29,8 @@ 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; @@ -488,6 +491,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 +537,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 +621,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 +681,74 @@ 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; + + return Out; +} + +PS_OUT PS_Potion(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 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); + + float scale = 1.5; + float2 PotionUV = In.vTexcoord; + + PotionUV = (PotionUV - center) * scale + center; + + float4 tex3 = g_Texture2.Sample(ClampSampler, PotionUV); + Color = lerp(Color, tex3, tex3.a); + + float2 tex2Pos = g_Pos / g_fCurrent_Size; + float2 tex2Size = g_fOrigin_Size / g_fCurrent_Size; + float2 localUV = (In.vTexcoord - tex2Pos) / tex2Size; + bool inside = all(localUV >= 0.0f && localUV <= 1.0f); + + float4 tex4 = g_Texture3.Sample(ClampSampler, localUV); + + if (inside) + Color = lerp(Color, tex4, tex4.a); Color.a *= Alpha; Out.vColor = Color; @@ -856,4 +936,14 @@ 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(); + } + } 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/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_HUD_Enemy_Health_Fill.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/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/Action/UI_T_HUD_Enemy_Health_Fill.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/Private/Action_Panel.cpp b/Jusin154_Team3D/Editor/Private/Action_Panel.cpp index c6a2b9ce9..d8ebaaee4 100644 --- a/Jusin154_Team3D/Editor/Private/Action_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Action_Panel.cpp @@ -9,6 +9,7 @@ #include "Magic_Meter.h" #include "Magic_Icon.h" #include "Spell_UI.h" +#include "Potion.h" CAction_Panel::CAction_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -309,6 +310,11 @@ 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); return S_OK; } 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/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/Potion.cpp b/Jusin154_Team3D/Editor/Private/Potion.cpp index 49ede637d..8693b9633 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 = 74.f; + Desc.fSizeY = 74.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(37.f,37.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,18 @@ 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_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -162,6 +182,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 +203,19 @@ 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_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_WoundCleaning"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_AmountFrame"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) { return E_FAIL; } @@ -213,6 +257,9 @@ 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_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp index efb75a6a9..73c7c6771 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp @@ -170,10 +170,6 @@ HRESULT CSpell_Overlay::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; @@ -239,10 +235,6 @@ HRESULT CSpell_Overlay::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_MagicEffect1"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) - { - return E_FAIL; - } if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Public/Action_Panel.h b/Jusin154_Team3D/Editor/Public/Action_Panel.h index 24b4b938a..e84284198 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_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_pPotion = { 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 0eff2b589..5cf4c3f88 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -25,7 +25,7 @@ namespace Editor 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, 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_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, SPELLTYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, 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/Potion.h b/Jusin154_Team3D/Editor/Public/Potion.h index 604263141..f97bb86ec 100644 --- a/Jusin154_Team3D/Editor/Public/Potion.h +++ b/Jusin154_Team3D/Editor/Public/Potion.h @@ -27,9 +27,14 @@ 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 }; 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;