diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index a9d7fff5f..3ac1e5d5d 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -32,6 +32,7 @@ float g_fHp; float2 g_fViewport; float2 g_fOrigin_Size; float2 g_fCurrent_Size; +float2 g_fPosition; float2 g_fHpBG; float2 g_Pos; float2 g_fImageSize; @@ -45,7 +46,6 @@ float2 g_fItemPosition1; float2 g_fItemImageSizes1; float2 g_fItemPosition2; float2 g_fItemImageSizes2; -float2 g_fPosition[4]; float2 g_fImageSizes[4]; float4 g_fImagesUV[4]; @@ -1774,7 +1774,7 @@ PS_OUT PS_SpellLearn(PS_IN In) Color = tex; tex1 *= 0.95f; - + Color.a = tex1; Color.a *= Alpha; @@ -1783,6 +1783,49 @@ PS_OUT PS_SpellLearn(PS_IN In) return Out; } +PS_OUT PS_SpellLearnColor(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 Color = float4(1.f, 1.f, 1.f, 1.f); + + float4 tex = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float4 tex1 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + Color = tex; + + Color.rgb *= tex1.rgb; + + float2 rectPos = g_fPosition; + float2 rectSize = g_fCurrent_Size; + + float2 itemPos = g_fItemPosition1; + float2 itemSize = g_fItemImageSizes1; + + float x0 = max(rectPos.x, itemPos.x); + float x1 = min(rectPos.x + rectSize.x, itemPos.x + itemSize.x); + float y0 = max(rectPos.y, itemPos.y); + float y1 = min(rectPos.y + rectSize.y, itemPos.y + itemSize.y); + + float uMin = (x0 - rectPos.x) / rectSize.x; + float uMax = (x1 - rectPos.x) / rectSize.x; + float vMin = (y0 - rectPos.y) / rectSize.y; + float vMax = (y1 - rectPos.y) / rectSize.y; + + vMin = 1.0f - vMin; + vMax = 1.0f - vMax; + + if (In.vTexcoord.x >= min(uMin, uMax) && In.vTexcoord.x <= max(uMin, uMax) && + In.vTexcoord.y >= min(vMin, vMax) && In.vTexcoord.y <= max(vMin, vMax)) + { + Color.rgb = float3(0.f, 0.f, 1.f); + } + + Color.a *= Alpha; + Out.vColor = Color; + return Out; +} + struct VS_IN3D { float3 vPosition : POSITION; @@ -2363,6 +2406,16 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_SpellLearn(); } + pass SpellLearnColor + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_SpellLearnColor(); + } + pass Enemy_Detection { SetRasterizerState(RS_Nocull); diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index 9c0112c37..006a3abaf 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -420,6 +420,7 @@ void CInfoInstance::Release_Information() DestroyInstance(); + SAFE_RELEASE(m_pSpellLearn_Data); SAFE_RELEASE(m_pMapInfo); SAFE_RELEASE(m_pPlayerInfo); SAFE_RELEASE(m_pMonsterInfo); diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 2d1352524..c53cc6be1 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -258,7 +258,7 @@ HRESULT CLevel_GamePlay::Ready_Background() isReady_Background = true; #endif // #ifdef 인혁 - isReady_Background = true; + isReady_Background = false; #endif // diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 6fac4fd4c..25f7c8bd3 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -343,7 +343,7 @@ HRESULT CLoader::Loading_For_GamePlay() isLoad_Background = false; #endif // #ifdef 기무리 - isLoad_Background = true; + isLoad_Background = flase; #endif // #ifdef 인혁 isLoad_Background = false; @@ -953,6 +953,7 @@ HRESULT CLoader::Loading_For_GamePlay() #pragma endregion #if 진우 #elif 기무리 +#elif 인혁 #elif Bin #elif gimch #else diff --git a/Jusin154_Team3D/Client/Private/SpellLearn_Data.cpp b/Jusin154_Team3D/Client/Private/SpellLearn_Data.cpp index f343c4a8e..0f4d1a4aa 100644 --- a/Jusin154_Team3D/Client/Private/SpellLearn_Data.cpp +++ b/Jusin154_Team3D/Client/Private/SpellLearn_Data.cpp @@ -101,4 +101,6 @@ CSpellLearn_Data* CSpellLearn_Data::Create(ID3D11Device* pDevice, ID3D11DeviceCo void CSpellLearn_Data::Free() { __super::Free(); + + m_SpellLearnInfos.clear(); } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index a9d7fff5f..3ac1e5d5d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -32,6 +32,7 @@ float g_fHp; float2 g_fViewport; float2 g_fOrigin_Size; float2 g_fCurrent_Size; +float2 g_fPosition; float2 g_fHpBG; float2 g_Pos; float2 g_fImageSize; @@ -45,7 +46,6 @@ float2 g_fItemPosition1; float2 g_fItemImageSizes1; float2 g_fItemPosition2; float2 g_fItemImageSizes2; -float2 g_fPosition[4]; float2 g_fImageSizes[4]; float4 g_fImagesUV[4]; @@ -1774,7 +1774,7 @@ PS_OUT PS_SpellLearn(PS_IN In) Color = tex; tex1 *= 0.95f; - + Color.a = tex1; Color.a *= Alpha; @@ -1783,6 +1783,49 @@ PS_OUT PS_SpellLearn(PS_IN In) return Out; } +PS_OUT PS_SpellLearnColor(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 Color = float4(1.f, 1.f, 1.f, 1.f); + + float4 tex = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float4 tex1 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + Color = tex; + + Color.rgb *= tex1.rgb; + + float2 rectPos = g_fPosition; + float2 rectSize = g_fCurrent_Size; + + float2 itemPos = g_fItemPosition1; + float2 itemSize = g_fItemImageSizes1; + + float x0 = max(rectPos.x, itemPos.x); + float x1 = min(rectPos.x + rectSize.x, itemPos.x + itemSize.x); + float y0 = max(rectPos.y, itemPos.y); + float y1 = min(rectPos.y + rectSize.y, itemPos.y + itemSize.y); + + float uMin = (x0 - rectPos.x) / rectSize.x; + float uMax = (x1 - rectPos.x) / rectSize.x; + float vMin = (y0 - rectPos.y) / rectSize.y; + float vMax = (y1 - rectPos.y) / rectSize.y; + + vMin = 1.0f - vMin; + vMax = 1.0f - vMax; + + if (In.vTexcoord.x >= min(uMin, uMax) && In.vTexcoord.x <= max(uMin, uMax) && + In.vTexcoord.y >= min(vMin, vMax) && In.vTexcoord.y <= max(vMin, vMax)) + { + Color.rgb = float3(0.f, 0.f, 1.f); + } + + Color.a *= Alpha; + Out.vColor = Color; + return Out; +} + struct VS_IN3D { float3 vPosition : POSITION; @@ -2363,6 +2406,16 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_SpellLearn(); } + pass SpellLearnColor + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_SpellLearnColor(); + } + pass Enemy_Detection { SetRasterizerState(RS_Nocull); diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn.cpp index 406e63368..8a0468f02 100644 --- a/Jusin154_Team3D/Editor/Private/SpellLearn.cpp +++ b/Jusin154_Team3D/Editor/Private/SpellLearn.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "SpellLearn.h" #include "GameInstance.h" +#include "SpellLearn_MovePointer.h" CSpellLearn::CSpellLearn(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) @@ -96,6 +97,11 @@ void CSpellLearn::Late_Update(_float fTimeDelta) return; } if (m_bVisible) { + if (m_pPointer != nullptr) + { + m_vPointerPosition = m_pPointer->Get_Position(); + m_vPointerScale = m_pPointer->Get_Current_Size(); + } m_pGameInstance->Add_RenderGroup(RENDER::UI, this); __super::Late_Update(fTimeDelta); } @@ -106,7 +112,7 @@ HRESULT CSpellLearn::Render() if (FAILED(Bind_ShaderResources())) { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::COLOR)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELLLEARNCOLOR)))) { return E_FAIL; } if (FAILED(m_pVIBufferCom->Bind_Resources())) { @@ -166,6 +172,23 @@ HRESULT CSpellLearn::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fItemPosition1", &m_vPointerPosition, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fItemImageSizes1", &m_vPointerScale, sizeof(_float2)))) + { + 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_fPosition", &m_fCurrent_Position, sizeof(_float2)))) + { + return E_FAIL; + } + return S_OK; } @@ -207,6 +230,11 @@ HRESULT CSpellLearn::Change_Image(_int SpellID) return S_OK; } +void CSpellLearn::Set_Pointer(CSpellLearn_MovePointer* Pointer) +{ + m_pPointer = Pointer; +} + CSpellLearn* CSpellLearn::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CSpellLearn* pInstance = new CSpellLearn(pDevice, pContext); diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp index 62eba1f91..928db31af 100644 --- a/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp @@ -45,6 +45,7 @@ HRESULT CSpellLearn_Panel::Initialize(void* pArg) m_fCanvasAlpha = 1.f; m_fSortZ = 0.05f; m_fDelayTime = 1.f; + static_cast(m_pSpellLearn)->Set_Pointer(static_cast(m_pSpellLearn_MovePointer)); Visible(true); ElementAllVisible(true); return S_OK; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index d74bf1448..bf3d4a12a 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -34,7 +34,7 @@ namespace Editor REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, SPELL_DRAG, CAMERA_LOCKON, LODING_SCREEN, ENEMY_HPBAR, BOSS_HPBAR, QUEST_BORDER, QUEST_INFO, QUEST_STATUS, BROOMSTICK, - SPELL_LEARN, + SPELL_LEARN, SPELLLEARNCOLOR, ENEMY_DETECTION, INTERACTION_OBJECT, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, BLUR_NO_EMMISVE, BLUR_NO_WORLD_NO_EMISSIVE, WEIGHTBLEND_FOR_BLEND, DEPTH_STOP, WB_CULLING, SCREEN_FX , DISTORTION ,END }; enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, UVALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, SPELL_SLOT, SPELL_LOCK, QUEST_SLOT, END }; diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn.h b/Jusin154_Team3D/Editor/Public/SpellLearn.h index e5e54bade..d7d9db4b4 100644 --- a/Jusin154_Team3D/Editor/Public/SpellLearn.h +++ b/Jusin154_Team3D/Editor/Public/SpellLearn.h @@ -27,13 +27,17 @@ class CSpellLearn final : public CElementObject public: HRESULT Change_Image(_int SpellID); - + void Set_Pointer(class CSpellLearn_MovePointer* Pointer); private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CTexture* m_pDiffuse_TextureCom1 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + class CSpellLearn_MovePointer* m_pPointer = { nullptr }; + + _float2 m_vPointerPosition{}; + _float3 m_vPointerScale{}; public: static CSpellLearn* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h b/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h index 9adb87aaf..b3c0b4b60 100644 --- a/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h @@ -27,6 +27,7 @@ class CSpellLearn_MovePointer final : public CElementObject public: void Set_SpellLearn(_int Index); + private: void Line(_float fTime); @@ -36,6 +37,7 @@ class CSpellLearn_MovePointer final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + _bool m_bMoveStart = { false }; _int m_iLineIndex{}; diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 99495c23e..6df4aeffa 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -888,10 +888,6 @@ HRESULT CGameInstance::Bind_CS_RenderTarget(_uint iIndex, const _wstring& strTar { return m_pRenderTarget_Manager->Bind_CS_RenderTarget(iIndex, strTargetTag); } -_float2 CGameInstance::Get_RenderTargetSize(const _wstring& wstrTargetKey) -{ - return m_pRenderTarget_Manager->Get_RenderTargetSize(wstrTargetKey); -} #ifdef _DEBUG void CGameInstance::RenderTarget_Debuger() { diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index eab58ba82..cf9262857 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -138,6 +138,11 @@ void CUIObject::Move(_float fX, _float fY) m_fY = fY; } +_float2 CUIObject::Get_Position() +{ + return _float2(m_fX, m_fY); +} + void CUIObject::SizeUpdate(_float fSizeX, _float fSizeY) { m_fSizeX = fSizeX; diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h index f8f42c8af..2da01ffb3 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h @@ -29,7 +29,6 @@ class CRenderTarget_Manager final : public CBase // 랜더 타겟의 크기를 dest로 다시 맞춤 HRESULT Refit_RenderTarget(class CVIBuffer_Rect* pVIBuffer, class CShader* pShader, const _wstring& wstrRenderTargetInput, const _wstring& wstrRenderTargetOutput, SHADER_PASS_DEFERRED ePass); HRESULT Finish_RenderTarget(class CVIBuffer_Rect* pVIBuffer, class CShader* pShader, const _wstring& wstrRenderTargetOriginal, const _wstring& wstrRenderTargetBloomed, SHADER_PASS_DEFERRED ePass); - _float2 Get_RenderTargetSize(const _wstring& wstrRenderTargetOriginal); #ifdef _DEBUG public: diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index c37bd7ca5..b2104dc38 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -99,6 +99,7 @@ typedef struct tagSpellLearnInfo virtual void MoveX(_float fX); virtual void MoveY(_float fY); virtual void Move(_float fX, _float fY); + virtual _float2 Get_Position(); virtual void SizeUpdate(_float fSizeX, _float fSizeY); virtual void SizeUpX(_float fSizeX); virtual void SizeUpY(_float fSizeY);