diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 1aee12e67..14c08945d 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1,3 +1,4 @@ + #include "Engine_Shader_Defines.hlsli" matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; @@ -9,7 +10,7 @@ int g_iImageCountY; uint g_iIndexU; uint g_iIndexV; uint g_iQuestType; -uint g_iSpellType; +int g_iSpellType; float g_fPI; float g_fFar; @@ -505,22 +506,22 @@ PS_OUT PS_SpellAnim(PS_IN In) switch (g_iSpellType) { case 0: - BGColor = float3(208.f, 179.f, 54.f) / 255.f; + BGColor = float3(255.f, 255.f, 0.f) / 255.f; break; case 1: - BGColor = float3(89.f, 32.f, 215.f) / 255.f; + BGColor = float3(150.f, 120.f, 240.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; + BGColor = float3(24.f, 190.f, 255.f) / 255.f; break; case 4: - BGColor = float3(134.f, 171.f, 78.f) / 255.f; + BGColor = float3(200.f, 220.f, 150.f) / 255.f; break; case 5: - BGColor = float3(0.f, 80.f, 55.f) / 255.f; + BGColor = float3(50.f, 150.f, 110.f) / 255.f; break; case 6: BGColor = float3(0.f, 0.f, 0.f); @@ -541,11 +542,11 @@ PS_OUT PS_SpellAnim(PS_IN In) color1 = tex3; - float wave1 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; - float wave2 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; + float wave1 = sin(OverrayUV.x * 10.f + g_fTime) * 0.01f; + float wave2 = sin(OverrayUV.x * 10.f + g_fTime) * 0.01f; float waveThreshold1 = CoolTime + wave1; float waveThreshold2 = CoolTime2 + wave2; - float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f , waveUV.y = (OverrayUV.y - waveThreshold1) /(waveThreshold2 - waveThreshold1)); + float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f, waveUV.y = (OverrayUV.y - waveThreshold1) / (waveThreshold2 - waveThreshold1)); waveUV = saturate(waveUV); float tex5 = g_Texture3.Sample(DefaultSampler, waveUV).r; @@ -895,7 +896,7 @@ PS_OUT PS_Magic_Item(PS_IN In) float2 OverrayUV = In.vTexcoord; float CoolTime = 0.f + g_fDeltaV; - float CoolTime2 = 0.f + g_fDeltaV + 0.05; + float CoolTime2 = 0.f + g_fDeltaV + 0.1f; atlasUV = startUV + In.vTexcoord * (endUV - startUV); float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); tex3.rgb *= BGColor; @@ -913,16 +914,20 @@ PS_OUT PS_Magic_Item(PS_IN In) float waveThreshold1 = CoolTime + wave1; float waveThreshold2 = CoolTime2 + wave2; - + float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f, waveUV.y = (OverrayUV.y - waveThreshold1) / (waveThreshold2 - waveThreshold1)); + waveUV = saturate(waveUV); + float Mask = g_MaskingTexture.Sample(DefaultSampler, waveUV).r; if (g_fDeltaV <= 1.f) { if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) { - color1.rgb = float3(1.f, 1.f, 1.f); + color1.rgb += float3(1.f, 1.f, 1.f) * Mask * 1.f; } } - if (OverrayUV.y <= CoolTime) + float waveThreshold = CoolTime + wave1; + + if (OverrayUV.y <= waveThreshold) { color1.a = 0.f; } @@ -961,6 +966,187 @@ PS_OUT PS_Magic_Item(PS_IN In) return Out; } +PS_OUT PS_Spell_Preview(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 uv = In.vTexcoord; + float2 CurrentPixelPosition = uv * g_fCurrent_Size; + float OriginLeft = g_fNine_Slice.x; + float OriginRight = g_fNine_Slice.y; + float OriginTop = g_fNine_Slice.z; + float OriginBottom = g_fNine_Slice.w; + + float CurrentLeft = OriginLeft; + float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); + float CurrentTop = OriginTop; + float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); + + float2 Finaluv = In.vTexcoord; + + if (CurrentPixelPosition.x < CurrentLeft) + { + Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; + } + else if (CurrentPixelPosition.x > CurrentRight) + { + float dist = CurrentPixelPosition.x - CurrentRight; + Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; + } + else + { + float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); + Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); + } + + if (CurrentPixelPosition.y < CurrentTop) + { + Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; + } + else if (CurrentPixelPosition.y > CurrentBottom) + { + float dist = CurrentPixelPosition.y - CurrentBottom; + Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; + } + else + { + float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); + Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + float4 tex3 = g_Texture2.Sample(DefaultSampler, Finaluv); + Color = tex1; + + tex3.rgb = tex2.rgb; + + Color = lerp(Color, tex3, tex3.a); + + float2 Imagetexpos1 = g_fImageSipos1.xy / g_fCurrent_Size; + float2 Imagetexsize1 = g_fImageSipos1.zw / g_fCurrent_Size; + float2 Imagelocal = (In.vTexcoord - Imagetexpos1) / Imagetexsize1; + bool inside1 = all(Imagelocal >= 0.0f && Imagelocal <= 1.0f); + float4 tex4 = g_Texture3.Sample(DefaultSampler, Finaluv); + if (inside1) + { + Color = lerp(Color, tex4, tex4.a); + } + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Spell_Header(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); + + float3 BGColor= float3(1.f, 1.f, 1.f); + + switch (g_iSpellType) + { + case 0: + BGColor = float3(255.f, 255.f, 0.f) / 255.f; + break; + case 1: + BGColor = float3(150.f, 120.f, 240.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(24.f, 190.f, 255.f) / 255.f; + break; + case 4: + BGColor = float3(200.f, 220.f, 150.f) / 255.f; + break; + case 5: + BGColor = float3(50.f, 150.f, 110.f) / 255.f; + break; + case 6: + BGColor = float3(0.f, 0.f, 0.f); + break; + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + Color.rgb *= BGColor; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} +PS_OUT PS_Spell_Header_Line(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 uv = In.vTexcoord; + float2 CurrentPixelPosition = uv * g_fCurrent_Size; + float OriginLeft = g_fNine_Slice.x; + float OriginRight = g_fNine_Slice.y; + float OriginTop = g_fNine_Slice.z; + float OriginBottom = g_fNine_Slice.w; + + float CurrentLeft = OriginLeft; + float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); + float CurrentTop = OriginTop; + float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); + + float2 Finaluv = In.vTexcoord; + + if (CurrentPixelPosition.x < CurrentLeft) + { + Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; + } + else if (CurrentPixelPosition.x > CurrentRight) + { + float dist = CurrentPixelPosition.x - CurrentRight; + Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; + } + else + { + float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); + Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); + } + + if (CurrentPixelPosition.y < CurrentTop) + { + Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; + } + else if (CurrentPixelPosition.y > CurrentBottom) + { + float dist = CurrentPixelPosition.y - CurrentBottom; + Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; + } + else + { + float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); + Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + //Color.rgb = tex2.rgb; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -1161,4 +1347,34 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Magic_Item(); } + pass Spell_Preview + { + 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_Spell_Preview(); + } + + pass Spell_Header + { + 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_Spell_Header(); + } + + pass Spell_Header_Line + { + 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_Spell_Header_Line(); + } + } diff --git a/Jusin154_Team3D/Client/Private/Bombard.cpp b/Jusin154_Team3D/Client/Private/Bombard.cpp index 8cab71f85..0d6897a7b 100644 --- a/Jusin154_Team3D/Client/Private/Bombard.cpp +++ b/Jusin154_Team3D/Client/Private/Bombard.cpp @@ -25,15 +25,18 @@ HRESULT CBombard::Initialize_Prototype() HRESULT CBombard::Initialize(void* pArg) { - if (FAILED(__super::Initialize(pArg))) + if (FAILED(__super::Initialize(pArg))){ return E_FAIL; + } - if (FAILED(Ready_Components(pArg))) + if (FAILED(Ready_Components(pArg))) { return E_FAIL; + } - if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Bombard"))) + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Bombard"))) { return E_FAIL; + } m_wstrEffectName = L"Bombard"; @@ -78,13 +81,15 @@ void CBombard::Late_Update(_float fTimeDelta) HRESULT CBombard::Pre_Setting(CGameObject* pObject) { - if (pObject == nullptr) + if (pObject == nullptr) { return E_FAIL; + } m_pOwner = pObject; - if (FAILED(Ready_Child())) + if (FAILED(Ready_Child())) { return E_FAIL; + } Reset_EffectParts(); @@ -141,7 +146,7 @@ HRESULT CBombard::Ready_Child() XMStoreFloat3(&vDir, vOwnerLook * 2.f); Desc.vRotRPY = { 0.f, 0.f, 0.f }; - Desc.iSubKind = 70; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::SKILL_BOMBARD_STRIKE); Desc.vDeltaPos = vDir; Desc.vLifeTime = { 0.f, 2.f }; diff --git a/Jusin154_Team3D/Client/Private/Broom.cpp b/Jusin154_Team3D/Client/Private/Broom.cpp index 1548dd0e0..f6cb448d4 100644 --- a/Jusin154_Team3D/Client/Private/Broom.cpp +++ b/Jusin154_Team3D/Client/Private/Broom.cpp @@ -20,12 +20,14 @@ HRESULT CBroom::Initialize_Prototype() HRESULT CBroom::Initialize(void* pArg) { - if (FAILED(__super::Initialize(pArg))) + if (FAILED(__super::Initialize(pArg))) { return E_FAIL; + } - if (FAILED(Ready_Components())) + if (FAILED(Ready_Components())) { return E_FAIL; + } Add_FSM(); @@ -105,8 +107,9 @@ HRESULT CBroom::Ready_Components() /* Com_Model */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Broom_Model"), - reinterpret_cast(&m_pModelCom)))) + reinterpret_cast(&m_pModelCom)))) { return E_FAIL; + } /* Com_Shader */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH, diff --git a/Jusin154_Team3D/Client/Private/BuildingContainer.cpp b/Jusin154_Team3D/Client/Private/BuildingContainer.cpp index 788f6ba07..a0724e7a9 100644 --- a/Jusin154_Team3D/Client/Private/BuildingContainer.cpp +++ b/Jusin154_Team3D/Client/Private/BuildingContainer.cpp @@ -64,14 +64,17 @@ HRESULT CBuildingContainer::Render_BoundingBox() return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(0))) + if (FAILED(m_pShaderCom->Begin(0))) { return E_FAIL; + } - if (FAILED(m_pVIBufferCom->Bind_Resources())) + if (FAILED(m_pVIBufferCom->Bind_Resources())) { return E_FAIL; + } - if (FAILED(m_pVIBufferCom->Render())) + if (FAILED(m_pVIBufferCom->Render())) { return E_FAIL; + } m_pOcclusionQueryCom->End_Query(); @@ -112,8 +115,9 @@ HRESULT CBuildingContainer::Ready_Components(void* pArg) /* Com_Shader */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_VTXPOS, - reinterpret_cast(&m_pShaderCom)))) - return E_FAIL; + reinterpret_cast(&m_pShaderCom)))) { + return E_FAIL; + } MAP_CONTAINER_DESC* pDesc = static_cast(pArg); @@ -140,13 +144,15 @@ HRESULT CBuildingContainer::Ready_Components(void* pArg) /* Com_VIBuffer */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"), - reinterpret_cast(&m_pVIBufferCom), &vBoxCorners))) + reinterpret_cast(&m_pVIBufferCom), &vBoxCorners))) { return E_FAIL; + } /* Com_OcclusionQuery */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_OcclusionQuery"), - reinterpret_cast(&m_pOcclusionQueryCom)))) + reinterpret_cast(&m_pOcclusionQueryCom)))) { return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Decendo.cpp b/Jusin154_Team3D/Client/Private/Decendo.cpp index 767872bc0..0f2d27a51 100644 --- a/Jusin154_Team3D/Client/Private/Decendo.cpp +++ b/Jusin154_Team3D/Client/Private/Decendo.cpp @@ -26,14 +26,17 @@ HRESULT CDecendo::Initialize_Prototype() HRESULT CDecendo::Initialize(void* pArg) { - if (FAILED(__super::Initialize(pArg))) + if (FAILED(__super::Initialize(pArg))) { return E_FAIL; + } - if (FAILED(Ready_Components(pArg))) + if (FAILED(Ready_Components(pArg))) { return E_FAIL; + } - if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Decendo"))) + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Decendo"))) { return E_FAIL; + } m_wstrEffectName = L"Decendo"; @@ -62,8 +65,9 @@ void CDecendo::Priority_Update(_float fTimeDelta) void CDecendo::Update(_float fTimeDelta) { - if (m_bVisible == false) + if (m_bVisible == false){ return; + } __super::Update(fTimeDelta); @@ -103,15 +107,17 @@ void CDecendo::Late_Update(_float fTimeDelta) HRESULT CDecendo::Pre_Setting(CGameObject* pObject) { - if (pObject == nullptr) + if (pObject == nullptr) { return E_FAIL; + } /* 부모 할당 */ m_pOwner = pObject; /* 피직스 생성*/ - if (FAILED(Ready_Child())) + if (FAILED(Ready_Child())) { return E_FAIL; + } /* 초기 셋팅 초기화 */ Reset_EffectParts(); @@ -171,6 +177,7 @@ HRESULT CDecendo::Ready_Child() Desc.vRotRPY = { 0.f, 0.f, 0.f }; + Desc.iSubKind = 70; Desc.vDeltaPos = _float3(0.f, 0.f, 0.f); Desc.vLifeTime = { 0.f, 1.f }; @@ -249,14 +256,15 @@ void CDecendo::Free() { __super::Free(); - if (m_pPhysHitBox != nullptr) + if (m_pPhysHitBox != nullptr){ SAFE_RELEASE(m_pPhysHitBox); + } SAFE_RELEASE(m_pProjectile_Blur); SAFE_RELEASE(m_pProjectile); } - +#ifdef _DEBUG void CDecendo::Describe_Entity() { GUI::Begin("VALUE"); @@ -270,6 +278,9 @@ void CDecendo::Describe_Entity() GUI::End(); } +#endif // _DEBUG + + HRESULT CDecendo::Bind_ShaderResources() { return S_OK; diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 9521d742f..2c0cb6115 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -148,7 +148,7 @@ HRESULT CGoblin::Ready_Components() { // CCT CCharacter_Controller::Character_Controller_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::MONSTER); + Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR); Desc.pTransform = m_pTransformCom; Desc.eBodyType = ACTOR::CAPSULE; Desc.fContactOffset = 0.1f; @@ -167,7 +167,7 @@ HRESULT CGoblin::Ready_Components() m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION)); { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::MONSTER); + Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR); if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index c69baa289..5e955fb4d 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -26,6 +26,16 @@ void CInfoInstance::Change_Level() m_pMapInfo->Change_Level(); } +void CInfoInstance::Update_CameraCoordinateSystem(_float3& vLook, _float3& vRight) +{ + m_pPlayerInfo->Update_CameraCoordinateSystem(vLook, vRight); +} + +pair<_float3, _float3> CInfoInstance::Get_CameraCoordinateSystem() +{ + return m_pPlayerInfo->Get_CameraCoordinateSystem(); +} + #pragma region MONSTER_INFO HRESULT CInfoInstance::Regist_PlayerAlly(CUnit* pUnit) { diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 44d2071ff..fc65df560 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -204,7 +204,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag) CDummy_PhysXWall::PHYSXDUMMY_DESC Desc{}; Desc.vPos = { 0.f, 0.f, 0.f }; Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f }; - Desc.iSubKind = 23; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::WALL); if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 1266932d8..b514c45cf 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -263,21 +263,6 @@ HRESULT CLoader::Loading_For_GamePlay() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, wstrFileName, - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { - return E_FAIL; - } - - return S_OK; - - }); - Asset_FileLoad("../Bin/Resources/Textures/HUD", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) - { - - _string strFilePath = pFilePath; - _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index 185f88cb0..a57e8d4ab 100644 --- a/Jusin154_Team3D/Client/Private/MainApp.cpp +++ b/Jusin154_Team3D/Client/Private/MainApp.cpp @@ -28,7 +28,7 @@ HRESULT CMainApp::Initialize() EngineDesc.iWinSizeY = g_iWinSizeY; EngineDesc.iStaticLevel = g_iStaticLevel; EngineDesc.iNumLevels = ENUM_CLASS(LEVEL::END); - EngineDesc.iNumCollidableGroup = ENUM_CLASS(COLLIDABLEOBJECT::END); + EngineDesc.iNumCollidableGroup = ENUM_CLASS(COLLIDABLEOBJECT_KIND::END); //ShowCursor(false); diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp index 3c3a4bd3d..bdb9ccdd2 100644 --- a/Jusin154_Team3D/Client/Private/Monster.cpp +++ b/Jusin154_Team3D/Client/Private/Monster.cpp @@ -66,7 +66,7 @@ HRESULT CMonster::Render_OutLine() GUI::SetNextItemWidth(80.f); static _float3 vOutLineColor = _float3(1.f, 0.960784376f, 0.933333397f); - static _float fOutLineThickness = { 1.f }; // 카메라로부터 거리가 멀어지면 늘어나게끔 바꾸는걸 추천함 + static _float fOutLineThickness = { 2.f }; // 카메라로부터 거리가 멀어지면 늘어나게끔 바꾸는걸 추천함 static _float fOutLineScale = { 1.f }; static _float fOutLinePower = { 1.f }; GUI::ColorPicker3("vOutLineColor", (_float*)&vOutLineColor); diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp index 7d9d54370..288e74f50 100644 --- a/Jusin154_Team3D/Client/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp @@ -36,8 +36,9 @@ HRESULT CNomalJap::Initialize(void* pArg) m_wstrEffectName = L"Nomal_Jap"; - if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Jap"))) + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Jap"))){ return E_FAIL; + } m_pProjectile_Side = Get_PartObject("JapProjSide"); @@ -114,8 +115,9 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) m_pOwner = pObject; /* 피직스 생성*/ - if (FAILED(Ready_Child())) + if (FAILED(Ready_Child())){ return E_FAIL; + } /* 초기 셋팅 초기화 */ Reset_EffectParts(); @@ -137,12 +139,10 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) Get_PartObject()->Get_Component()->Reset_Trail(); - //나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬 m_vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); - _vector vQuaternion = XMQuaternionRotationAxis(m_vOwnerLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); m_vRotateUp = XMVector3Rotate(vUp, vQuaternion); @@ -172,7 +172,7 @@ HRESULT CNomalJap::Ready_Child() XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); Desc.vRotRPY = { 0.f, 0.f, 0.f }; - Desc.iSubKind = 70; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::SKILL_NORMALJAP); Desc.vDeltaPos = _float3(0.f, 0.f, 0.f); Desc.vLifeTime = { 0.f, 1.f }; @@ -249,12 +249,15 @@ void CNomalJap::Free() Safe_Release(m_pProjectile_Side); } +#ifdef _DEBUG void CNomalJap::Describe_Entity() { } +#endif // _DEBUG + HRESULT CNomalJap::Bind_ShaderResources() { return S_OK; diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 6b33f2f0b..5454bdc4f 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -103,7 +103,7 @@ HRESULT CPlayer::Initialize(void* pArg) void CPlayer::Priority_Update(_float fTimeDelta) { ReLockOnTarget(); - + SetGravity(); m_pTransformCom->RewindMomentum(); __super::Priority_Update(fTimeDelta); @@ -197,15 +197,16 @@ void CPlayer::Render_CameraCoordinateSystem() GUI::Text("S : %.2f, %.2f, %.2f", -m_vCameraLookDir.x, 0.f, -m_vCameraLookDir.z); GUI::Text("D : %.2f, %.2f, %.2f", m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z); - GUI::Button("##0", { 100.f, 100.f }); GUI::SameLine(); - GUI::Button(("W : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraLookDir.x , m_vCameraLookDir.z })))).c_str(), {100.f, 100.f}); GUI::SameLine(); - GUI::Button("##2", {100.f, 100.f}); - GUI::Button(("A : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraRightDir.x , -m_vCameraRightDir.z })))).c_str(), { 100.f, 100.f }); GUI::SameLine(); - GUI::Button("##4", { 100.f, 100.f }); GUI::SameLine(); - GUI::Button(("D : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraRightDir.x , m_vCameraRightDir.z })))).c_str(), { 100.f, 100.f }); - GUI::Button("##6", {100.f, 100.f}); GUI::SameLine(); - GUI::Button(("S : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraLookDir.x , -m_vCameraLookDir.z })))).c_str(), { 100.f, 100.f }); GUI::SameLine(); - GUI::Button("##8", {100.f, 100.f}); + _float fButtonSize = 25.f; + GUI::Button("##0", { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button(("W : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraLookDir.x , m_vCameraLookDir.z })))).c_str(), { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button("##2", { fButtonSize, fButtonSize }); + GUI::Button(("A : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraRightDir.x , -m_vCameraRightDir.z })))).c_str(), { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button("##4", { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button(("D : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraRightDir.x , m_vCameraRightDir.z })))).c_str(), { fButtonSize, fButtonSize }); + GUI::Button("##6", { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button(("S : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraLookDir.x , -m_vCameraLookDir.z })))).c_str(), { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button("##8", { fButtonSize, fButtonSize }); //W CMyTools::Get_Direction2D(vLook, { m_vCameraLookDir.x , m_vCameraLookDir.z }) //A CMyTools::Get_Direction2D(vLook, { -m_vCameraRightDir.x , - m_vCameraRightDir.z }) //S CMyTools::Get_Direction2D(vLook, { m_vCameraRightDir.x , m_vCameraRightDir.z }) @@ -256,12 +257,12 @@ HRESULT CPlayer::Ready_Components() { // CCT CCharacter_Controller::Character_Controller_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::PLAYER); + Desc.iSubKind = ENUM_CLASS(PXOBJECT::PLAYER); Desc.pTransform = m_pTransformCom; Desc.eBodyType = ACTOR::CAPSULE; Desc.fContactOffset = 0.17f; Desc.fMaterial = { 0.5f, 0.5f, 0.6f }; - Desc.bAutoStepping = { false }; + Desc.bAutoStepping = { true }; Desc.fStepOffset = { 0.05f }; Desc.fRadius = 0.5f; Desc.fHeight = 1.0f; @@ -271,11 +272,12 @@ HRESULT CPlayer::Ready_Components() if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { return E_FAIL; } + m_pCharacter_Controller->SetGravity(false); } { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::PLAYER); + Desc.iSubKind = ENUM_CLASS(PXOBJECT::PLAYER); if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { return E_FAIL; } @@ -340,6 +342,23 @@ void CPlayer::ReLockOnTarget() } } +void CPlayer::SetGravity() +{ + PSX::PxControllerCollisionFlags eCollisionFlags = m_pCharacter_Controller->Get_CollisionFlags(); + eCollisionFlags; + if ( false == eCollisionFlags.isSet(PSX::PxControllerCollisionFlag::Enum::eCOLLISION_DOWN) + && false == eCollisionFlags.isSet(PSX::PxControllerCollisionFlag::Enum::eCOLLISION_SIDES)) { + if (false == m_pFSM->IsEnable(STATEANIM::JUMP)) { // 벽에 닿지 않았는데 점프 중이 아닐 땐 중력 on + m_pCharacter_Controller->SetGravity(true); + } + else { // 점프 중일 땐 off + m_pCharacter_Controller->SetGravity(false); + } + } + else { // 벽에 닿는중일 땐 항상 중력 off + m_pCharacter_Controller->SetGravity(false); + } +} void CPlayer::Update_CameraCoordinateSystem() { @@ -347,6 +366,7 @@ void CPlayer::Update_CameraCoordinateSystem() _vector xmvUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); XMStoreFloat3(&m_vCameraRightDir, XMVector3Normalize(XMVector3Cross(xmvUp, xmvCameraLook))); XMStoreFloat3(&m_vCameraLookDir, xmvCameraLook); + m_pInfoInstance->Update_CameraCoordinateSystem(m_vCameraLookDir, m_vRimLightColor); } _matrix CPlayer::Get_WandPos() diff --git a/Jusin154_Team3D/Client/Private/PlayerInfo.cpp b/Jusin154_Team3D/Client/Private/PlayerInfo.cpp index a923b62a7..57d8fe77a 100644 --- a/Jusin154_Team3D/Client/Private/PlayerInfo.cpp +++ b/Jusin154_Team3D/Client/Private/PlayerInfo.cpp @@ -11,6 +11,17 @@ void CPlayerInfo::Update(_float fTimeDelta) { } +void CPlayerInfo::Update_CameraCoordinateSystem(_float3& vLook, _float3& vRight) +{ + m_vCameraLookDir = vLook; + m_vCameraRightDir = vRight; +} + +pair<_float3, _float3> CPlayerInfo::Get_CameraCoordinateSystem() +{ + return { m_vCameraLookDir, m_vCameraRightDir }; +} + void CPlayerInfo::Change_Level() { } diff --git a/Jusin154_Team3D/Client/Private/Slot_Number.cpp b/Jusin154_Team3D/Client/Private/Slot_Number.cpp index 675349f6b..0e7a0d043 100644 --- a/Jusin154_Team3D/Client/Private/Slot_Number.cpp +++ b/Jusin154_Team3D/Client/Private/Slot_Number.cpp @@ -211,17 +211,13 @@ HRESULT CSlot_Number::Ready_Components(void* pArg) void CSlot_Number::UV() { - pUVDesc[0].fUVStart = Meter_Index(1); - pUVDesc[0].fUVEnd = Compute_UVY(1); - pUVDesc[1].fUVStart = Meter_Index(2); - pUVDesc[1].fUVEnd = Compute_UVY(2); - pUVDesc[2].fUVStart = Meter_Index(3); - pUVDesc[2].fUVEnd = Compute_UVY(3); - pUVDesc[3].fUVStart = Meter_Index(4); - pUVDesc[3].fUVEnd = Compute_UVY(4); + pUVDesc[0].fUV = Meter_Index(1); + pUVDesc[1].fUV = Meter_Index(2); + pUVDesc[2].fUV = Meter_Index(3); + pUVDesc[3].fUV = Meter_Index(4); } -_float2 CSlot_Number::Meter_Index(_uint Number) +_float4 CSlot_Number::Meter_Index(_uint Number) { m_fIamge_Size = { 320.f, 128.f }; @@ -234,29 +230,15 @@ _float2 CSlot_Number::Meter_Index(_uint Number) _uint frameX = Number % iXCount; _uint frameY = Number / iXCount; - _float2 UVStart; - UVStart.x = frameX * frameWidth / m_fIamge_Size.x; - UVStart.y = frameY * frameHeight / m_fIamge_Size.y; + _float4 UV; + UV.x = frameX * frameWidth / m_fIamge_Size.x; + UV.y = frameY * frameHeight / m_fIamge_Size.y; + UV.z = UV.x + (frameWidth / m_fIamge_Size.x); + UV.w = UV.y + (frameHeight / m_fIamge_Size.y); - return UVStart; + return UV; } -_float2 CSlot_Number::Compute_UVY(_uint Number) -{ - m_fIamge_Size = { 320.f, 128.f }; - - _float frameWidth = 64.f; - _float frameHeight = 64.f; - - // Start 구함 - _float2 UVStart = Meter_Index(Number); - - _float2 UVEnd; - UVEnd.x = UVStart.x + (frameWidth / m_fIamge_Size.x); - UVEnd.y = UVStart.y + (frameHeight / m_fIamge_Size.y); - - return UVEnd; -} CSlot_Number* CSlot_Number::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { diff --git a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp index d7335caec..d86062901 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp @@ -44,10 +44,11 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) m_fAngle = XMConvertToRadians(-135.f); m_fAlpha = 1.f; m_fAlphaTime = 1.f; + m_vUVScale.x = 1.f; m_vUVScale.y = 1.f; m_fCoolTime = 5.f; m_fSortZ = 0.01f; - m_iSkillType = ENUM_CLASS(SKILLTYPE::CONTROL); + m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); Compute_UI(5); m_bActive = true; return S_OK; @@ -55,7 +56,7 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) void CSpell_Overlay::Compute_UI(_uint SpellID) { - _float2 fImage_Size = { 1024.f, 1536.f }; + _float2 fImage_Size = { 1024.f, 1536.f}; _uint iCountX = 4; _uint iCountY = 6; @@ -154,7 +155,7 @@ HRESULT CSpell_Overlay::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELLTYPE)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::TYPE)))) { return E_FAIL; } @@ -201,6 +202,10 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { 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; @@ -221,7 +226,7 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSkillType, sizeof(_float)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) { return E_FAIL; } @@ -241,6 +246,10 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDeltaU", &m_vUVScale.x, sizeof(_float)))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fDeltaV", &m_vUVScale.y, sizeof(_float)))) { return E_FAIL; @@ -274,6 +283,10 @@ HRESULT CSpell_Overlay::Ready_Components(void* pArg) { return E_FAIL; } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_tillingSmokes"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) { return E_FAIL; @@ -315,6 +328,7 @@ void CSpell_Overlay::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/Client/Private/Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp index cb57aa16d..6fed41de8 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp @@ -39,7 +39,7 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_fAlpha = 1.f; m_fTimeMult = 3.f; - m_fAngle = XMConvertToRadians(45); + m_fAngle = XMConvertToRadians(-135); m_fAlphaTime = 1.f; m_fOffSetX = 101.f; m_fOffSetY = 101.f; @@ -47,7 +47,6 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(380.f, -30.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Terrain.cpp b/Jusin154_Team3D/Client/Private/Terrain.cpp index 89d7a3cae..107408e01 100644 --- a/Jusin154_Team3D/Client/Private/Terrain.cpp +++ b/Jusin154_Team3D/Client/Private/Terrain.cpp @@ -37,7 +37,7 @@ HRESULT CTerrain::Initialize(void* pArg) CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc{}; Desc.pMeshName = TEXT("Hogsmeade_HeightMap"); - Desc.iSubKind = 998; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN); /* Com_RigidBody */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_RigidBody_Static_Terrain_Hogsmeade"), reinterpret_cast(&m_pRigidBody), &Desc))) { @@ -74,10 +74,31 @@ HRESULT CTerrain::Render() if (FAILED(Bind_ShaderResources())) { return E_FAIL; } +#ifdef _DEBUG + static _int iValue1 = 16; + static _int iValue2 = 16; + static _int iValue3 = 16; + GUI::SliderInt("DSN1", (_int*)&iValue1, 1, 1024); + GUI::SliderInt("DSN2", (_int*)&iValue2, 1, 1024); + GUI::SliderInt("DSN3", (_int*)&iValue3, 1, 1024); + m_vDRN.x = 1.f / (_float)iValue1; + m_vDRN.y = 1.f / (_float)iValue2; + m_vDRN.z = 1.f / (_float)iValue3; +#endif // _DEBUG + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDiffuseMultiplier", &m_vDRN.x, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fSurfaceMultiplier", &m_vDRN.y, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fNormalMultiplier", &m_vDRN.z, sizeof(_float)))) { + return E_FAIL; + } #ifdef _DEBUG if (m_bWasWireFrame) { - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::TERRAIN)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::ENV_TERRAIN_ANISO)))) { return E_FAIL; } } @@ -87,14 +108,11 @@ HRESULT CTerrain::Render() return E_FAIL; } } -#else - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::DEFAULT)))) { +#endif // _DEBUG + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::ENV_TERRAIN_ANISO)))) { return E_FAIL; } -#endif // _DEBUG - - if (FAILED(m_pVIBufferCom->Bind_Resources())) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index c6661df09..9b8ff21c8 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -3,23 +3,129 @@ namespace Client { enum class LEVEL { STATIC, LOADING, LOGO, INTRO, GAMEPLAY, FIELD, RESTART, END }; - enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END }; enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT }; enum class MAPOBJECT_RENDER_TYPE { NORMAL, DECAL, GLASS }; enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, HAIR, EYELASH, OUTLINE_WRITE, OUTLINE_READ, END }; enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END }; enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, OUTLINE_WRITE, OUTLINE_READ, END }; - enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END }; + enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, ENV_TERRAIN_ANISO, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR, TRAIL_BLOOM, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, BLOOM, 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_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, END }; enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, END }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; enum class SKILL_TYPE { JAP, BOMBARD, DESCENDO, PROTEGO, END }; enum class BLOOM_TYPE { NONE, BASIC, MULTIPLY, END }; - +} + + +namespace Client { + enum class COLLIDABLEOBJECT_KIND { + NOT_DEFINE, + PLAYER, + MONSTER, + HOSTILE_HITBOX, + ALLY_HITBOX, + NEUTRAL_HITBOX, + ENVIRONMENT, + NPC, + ITEM, + TRIGGERBOX, + REGION, + NOCOLLIDE, + END, + }; + enum class PXOBJECT : _uint { +#pragma region NOT_DEFINE + NOT_DEFINE = 000, +#pragma endregion +#pragma region PLAYER + PLAYER = 010, +#pragma endregion +#pragma region MONSTER + MONSTER = 030, + GOBLIN_WARRIOR, // 031 + GOBLIN_MAGICIAN, + GOBLIN_THEIF, + TROLL, + PENSIVE_GUARDIAN, + +#pragma endregion +#pragma region HOSTILE_HITBOX + HOSTILE_HITBOX = 100, + GOBLIN_SMASH, + GOBLIN_DAGGER, + GOBLIN_SHIELD_BREAK_MELEE, + GOBLIN_SHIELD_BREAK_MAGIC, + GOBLIN_NORMAL_MAGIC, + +#pragma endregion +#pragma region ALLY_HITBOX + ALLY_HITBOX = 200, + SKILL_REVAILIO, + SKILL_ACCIO, + SKILL_DEPULSO, + SKILL_DEPULSO_OBSTACLE, + SKILL_DEPULSO_OBSTACLE_FLAMED, + SKILL_NORMALJAP, + SKILL_NORMALJAP_FINAL, + SKILL_BOMBARD_STRIKE, + SKILL_BOMBARD_FLAME, + SKILL_INCENDIO_STRIKE, + SKILL_INCENDIO_SPREAD, + +#pragma endregion +#pragma region NEUTRAL_HITBOX + NEUTRAL_HITBOX = 300, + FLAMED_FLOOR, + +#pragma endregion +#pragma region ENVIRIONMENT + ENVIRIONMENT = 400, + TERRAIN, + WATER, + WALL, + WALL_BREAKABLE, + WALL_CLIMBABLE, + DOOR, + BUILDING, + BOX, +#pragma endregion +#pragma region NPC + NPC = 500, + +#pragma endregion +#pragma region ITEM + ITEM = 600, + DROPITEM = 630, + TRAP = 660, + +#pragma endregion +#pragma region TRIGGERBOX + TRIGGERBOX = 700, + + + CINEMATIC = 770, + CINEMATIC_INTRO, + CINEMATIC_HOGSMEADE_ENTER, + CINEMATIC_TROLL_ENCOUNTER, + CINEMATIC_TROLL_DEAD, +#pragma endregion +#pragma region REGION + REGION = 800, + HOGWARTS, + HOGSMEADE, + +#pragma endregion +#pragma region NOCOLLIDE + NOCOLLIDE = 900, + GAIL, + +#pragma endregion + END = 999 + }; } diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h index fff89ab5c..5c631300c 100644 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -15,4 +15,15 @@ namespace Client vector<_wstring> pRigidBodyTags; vector LoadedRigidBody; }FOLDER_LOAD; + + typedef struct tagSpellInfo + { + _uint iSpell_ID{}; + _wstring pSpell_Name{}; + _uint iSpell_Type{}; + _uint iSpell_CoolTime{}; + _bool bSpell_Lock = false; + _bool bEquip_Spell = false; + + }SPELLINFO; }; diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index 982be5a56..0f7adec6e 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -25,6 +25,10 @@ class CInfoInstance final : public CBase void Update(_float fTimeDelta); void Change_Level(); +#pragma region PLAYER_INFO + void Update_CameraCoordinateSystem(_float3& vLook, _float3& vRight); + pair<_float3, _float3> Get_CameraCoordinateSystem(); +#pragma endregion #pragma region MONSTER_INFO HRESULT Regist_PlayerAlly(CUnit* pUnit); HRESULT Deregist_PlayerAlly(CUnit* pUnit); diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 05ab85ca0..c0f2fe22f 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -60,6 +60,7 @@ class CPlayer final : public CUnit HRESULT Ready_Parts(); HRESULT Bind_ShaderResources(); void ReLockOnTarget(); + void SetGravity(); void Update_CameraCoordinateSystem(); #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Public/PlayerInfo.h b/Jusin154_Team3D/Client/Public/PlayerInfo.h index 01ebcd01b..3a4fa0654 100644 --- a/Jusin154_Team3D/Client/Public/PlayerInfo.h +++ b/Jusin154_Team3D/Client/Public/PlayerInfo.h @@ -19,6 +19,8 @@ class CPlayerInfo final : public CBase void Update(_float fTimeDelta); void Change_Level(); + void Update_CameraCoordinateSystem(_float3& vLook, _float3& vRight); + pair<_float3, _float3> Get_CameraCoordinateSystem(); private: CGameInstance* m_pGameInstance = { nullptr }; class CInfoInstance* m_pInfoInstance = { nullptr }; @@ -27,6 +29,8 @@ class CPlayerInfo final : public CBase private: CTransform* m_pTransform = { nullptr }; + _float3 m_vCameraLookDir = { 0.f, 0.f, 1.f, }; + _float3 m_vCameraRightDir = { 1.f, 0.f, 0.f }; private: diff --git a/Jusin154_Team3D/Client/Public/Slot_Number.h b/Jusin154_Team3D/Client/Public/Slot_Number.h index 0d30e7301..7b4ad290b 100644 --- a/Jusin154_Team3D/Client/Public/Slot_Number.h +++ b/Jusin154_Team3D/Client/Public/Slot_Number.h @@ -33,8 +33,7 @@ class CSlot_Number final : public CElementObject virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; void UV(); - _float2 Meter_Index(_uint Numver); - _float2 Compute_UVY(_uint Numver); + _float4 Meter_Index(_uint Numver); virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; diff --git a/Jusin154_Team3D/Client/Public/Spell_Overlay.h b/Jusin154_Team3D/Client/Public/Spell_Overlay.h index ae3ce440e..2b889685c 100644 --- a/Jusin154_Team3D/Client/Public/Spell_Overlay.h +++ b/Jusin154_Team3D/Client/Public/Spell_Overlay.h @@ -39,6 +39,7 @@ class CSpell_Overlay final : public CElementObject 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 }; diff --git a/Jusin154_Team3D/Client/Public/Terrain.h b/Jusin154_Team3D/Client/Public/Terrain.h index ac2349963..9374c0217 100644 --- a/Jusin154_Team3D/Client/Public/Terrain.h +++ b/Jusin154_Team3D/Client/Public/Terrain.h @@ -44,6 +44,8 @@ class CTerrain final : public CGameObject CTexture* m_pMROTextureCom = { nullptr }; CTexture* m_pAlphaMapTextureCom = { nullptr }; + _float3 m_vDRN = { (1.f / 16.f), (1.f / 16.f), (1.f / 16.f) }; + _float m_fUsingSurfaceParams = {}; _float3 m_vPickingPosition = {}; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli index 7b7ec1a3b..fc1fa297c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli @@ -7,6 +7,18 @@ sampler DefaultSampler = sampler_state AddressU = wrap; AddressV = wrap; }; +sampler AnisoTropy_BLUR_Sampler = sampler_state // 밉맵이 있어야 의미가 있음 +{ + Filter = AnisoTropic; + MaxAnisotropy = 16; + AddressU = wrap; + AddressV = wrap; + AddressW = wrap; + MipLodBias = 0.5f; // 밉맵 레벨 +1시켜서 의도적으로 뭉갬 + MinLOD = 0; + MaxLOD = 0xFFFFFFFF; + ComparisonFunc = ALWAYS; +}; sampler ClampSampler = sampler_state { 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 e327a741b..916fcb483 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli @@ -85,7 +85,7 @@ DepthStencilState DSS_Effect StencilEnable = false; }; -DepthStencilState DSS_Default_OutLine_Write +DepthStencilState DSS_Default_Environment_SWrite { DepthEnable = true; DepthWriteMask = true; @@ -105,8 +105,49 @@ DepthStencilState DSS_Default_OutLine_Write BackFaceStencilPass = Replace; BackFaceStencilFunc = Always; }; +DepthStencilState DSS_Default_Environment_SRead +{ + DepthEnable = true; + DepthWriteMask = false; + DepthFunc = less_equal; -DepthStencilState DSS_Default_OutLine_Read + StencilEnable = true; + StencilReadMask = 0xff; // <-- ff -> 1111 1111 씀 + StencilWriteMask = 0x00; // <-- 00 -> 0000 0000 안씀 + + FrontFaceStencilFail = Keep; + FrontFaceStencilDepthFail = Keep; + FrontFaceStencilPass = Keep; + FrontFaceStencilFunc = Equal; + + BackFaceStencilFail = Keep; + BackFaceStencilDepthFail = Keep; + BackFaceStencilPass = Keep; + BackFaceStencilFunc = NOT_Equal; +}; + +DepthStencilState DSS_Default_OutLine_SWrite +{ + DepthEnable = true; + DepthWriteMask = zero; + DepthFunc = less_equal; + + StencilEnable = true; + StencilReadMask = 0xff; + StencilWriteMask = 0xff; + + FrontFaceStencilFail = Keep; + FrontFaceStencilDepthFail = Keep; + FrontFaceStencilPass = Replace; + FrontFaceStencilFunc = Always; + + BackFaceStencilFail = Keep; + BackFaceStencilDepthFail = Keep; + BackFaceStencilPass = Replace; + BackFaceStencilFunc = Always; +}; + +DepthStencilState DSS_Default_OutLine_SRead { DepthEnable = true; DepthWriteMask = zero; @@ -124,7 +165,7 @@ DepthStencilState DSS_Default_OutLine_Read BackFaceStencilFail = Keep; BackFaceStencilDepthFail = Keep; BackFaceStencilPass = Keep; - BackFaceStencilFunc = Equal; + BackFaceStencilFunc = NOT_Equal; }; DepthStencilState DSS_Occlusion diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 917c9ed38..db13bce76 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -13,6 +13,11 @@ float2 g_vResolution; uint g_iBloomEmbossingPass; float g_fThreshold; +float g_fDepthThreshold; +float g_fFocusDistance; +float g_fFarBlurStart; +float g_fFarBlurEnd; +float g_fDOFBlurMultiplier; Texture2D g_Texture; @@ -41,12 +46,17 @@ Texture2D g_BlurWeightTexture; Texture2D g_BlurWeightXTexture; Texture2D g_SurfaceTexture; +Texture2D g_OriginalTexture; vector g_vLightDiffuse; vector g_vLightAmbient; vector g_vLightSpecular; +float g_fFogDensity; +float g_fFogPow; +vector g_vFogColor; + struct VS_IN { float3 vPosition : POSITION; @@ -92,8 +102,8 @@ struct PS_IN struct PS_OUT_BACKBUFFER { - float4 vBackBuffer : SV_TARGET0; - float4 vBloomBuffer : SV_Target1; + float4 vBackBuffer : SV_TARGET0; + float4 vEnvironment : SV_Target1; }; PS_OUT_BACKBUFFER PS_MAIN_DEBUG(PS_IN In) @@ -101,7 +111,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); + Out.vEnvironment = float4(0.f, 0.f, 0.f, 0.f); return Out; } @@ -123,7 +133,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float fViewZ = vDepth.y * g_fFar; - float4 vWorldPosition; + float4 vWorldPosition; // 월드 복원 { vWorldPosition.x = uv.x * 2 - 1; vWorldPosition.y = uv.y * -2 + 1; @@ -140,6 +150,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float fOcclusion = 1.f; float fAttenuation = 1.f; + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 float3 vToLight = normalize(-g_vLightDir.xyz); // 픽셀에서 라이트로 @@ -158,9 +169,9 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) fMetallic = 0.f; float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; - vF0 = vSRO.rrr; - fRoughness = vSRO.g; - fOcclusion = vSRO.b; + vF0 = vSRO.rrr; + fRoughness = vSRO.g; + fOcclusion = vSRO.b; } else // basic Lighting(phong blinn) // if you were here, you miss some assets. { @@ -170,7 +181,14 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) return Out; } - float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion); + float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); + { // 수치조정 // 디렉셔널 + float fMinRoughness = 0.05f; + fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + vF0 = min(vF0, 0.9f); // 메탈릭 상한선 + } + PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); @@ -208,31 +226,35 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) float3 vF0 = float3(0.04f, 0.04f, 0.04f); float fMetallic = 0.f; float fRoughness = 0.5f; - float fOcclusion = 1.f; float fAttenuation = 1.f; - float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 - float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); + float fLightDistance = length(g_vLightPos.xyz - vWorldPosition.xyz); + float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 + float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + fAttenuation = saturate((g_fLightRange - fLightDistance) / g_fLightRange); + if (fAttenuation <= 0.f) { - float fDistance = length(vToLight); - fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange); - if (fAttenuation <= 0.f) { discard; } + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; } - + if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_METALNESS)) // Metallic { float3 vMRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; 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 { fMetallic = 0.f; + float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; vF0 = vSRO.rrr; fRoughness = vSRO.g; @@ -246,8 +268,18 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) return Out; } + float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); + { // 수치조정 // 점광원 + float fMinRoughness = 0.05f; + fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + vF0 = min(vF0, 0.9f); // 메탈릭 상한선 + } + PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); + PBR_Out.vShade *= fDiffuseAOStrength; + Out.vShade = float4(PBR_Out.vShade, 1.f); Out.vSpecular = float4(PBR_Out.vSpecular, 1.f); @@ -266,7 +298,7 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float fViewZ = vDepth.y * g_fFar; - float4 vWorldPosition; + float4 vWorldPosition; // 월드 복원 { vWorldPosition.x = uv.x * 2 - 1; vWorldPosition.y = uv.y * -2 + 1; @@ -283,16 +315,26 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float fOcclusion = 1.f; float fAttenuation = 1.f; + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); + float fLightDistance = length(g_vLightPos.xyz - vWorldPosition.xyz); float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + fAttenuation = saturate((g_fLightRange - fLightDistance) / g_fLightRange); + if (fAttenuation <= 0.f) { - float fDistance = length(vToLight); - fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange); - if (fAttenuation <= 0.f) { discard; } + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; } + float fCosAngle = dot(vToView, g_vLightDir.xyz); - if (fCosAngle < g_fSpotOuterAngle) { discard; } + if (fCosAngle < g_fSpotOuterAngle) + { + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; + } float fSpotAttenenuation = saturate((fCosAngle - g_fSpotInnerAngle) / (g_fSpotInnerAngle - g_fSpotOuterAngle)); fAttenuation *= fSpotAttenenuation; @@ -303,12 +345,13 @@ PS_OUT_LIGHT PS_MAIN_SPOT(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 { fMetallic = 0.f; + float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; vF0 = vSRO.rrr; fRoughness = vSRO.g; @@ -322,23 +365,33 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) return Out; } + float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); + { // 수치조정 // 점광원 + float fMinRoughness = 0.05f; + fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + vF0 = min(vF0, 0.9f); // 메탈릭 상한선 + } + PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); + PBR_Out.vShade *= fDiffuseAOStrength; + Out.vShade = float4(PBR_Out.vShade, 1.f); Out.vSpecular = float4(PBR_Out.vSpecular, 1.f); return Out; } -//float g_fWeights[32] = -//{ -// 0.000400, 0.000700, 0.001200, 0.002000, 0.003200, 0.005000, 0.007500, 0.011000, -// 0.015700, 0.021700, 0.029000, 0.037300, 0.046200, 0.055200, 0.063600, 0.070800, -// 0.075900, 0.078500, 0.078500, 0.075900, 0.070800, 0.063600, 0.055200, 0.046200, -// 0.037300, 0.029000, 0.021700, 0.015700, 0.011000, 0.007500, 0.005000, 0.003200 -//}; +float g_fWeights_32[32] = +{ + 0.000477, 0.000888, 0.001585, 0.002720, 0.004485, 0.007105, 0.010814, 0.015813, + 0.022216, 0.029988, 0.038893, 0.048463, 0.058021, 0.066740, 0.073759, 0.078320, + 0.079902, 0.078320, 0.073759, 0.066740, 0.058021, 0.048463, 0.038893, 0.029988, + 0.022216, 0.015813, 0.010814, 0.007105, 0.004485, 0.002720, 0.001585, 0.000888 +}; -float g_fWeights[128] = +float g_fWeights_128[128] = { 0.000209902, 0.000241594, 0.000277451, 0.000317919, 0.000363477, 0.000414637, 0.000471944, 0.000535974, 0.000607333, 0.000686659, 0.000774615, 0.000871889, 0.00097919, 0.00109725, 0.00122679, 0.00136858, @@ -423,11 +476,11 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) vTexcoord.x = In.vTexcoord.x; vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y; - vColor += g_fWeights[i + 63] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); + vColor += g_fWeights_128[i + 63] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); } Out.vBackBuffer += vColor; - Out.vBloomBuffer; + Out.vEnvironment = Out.vBackBuffer; return Out; } @@ -520,7 +573,6 @@ PS_OUT_FLT4_SINGLE PS_MAIN_BLOOM_FINISH(PS_IN In) return Out; } - PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) { PS_OUT_BLUR_X Out; @@ -533,7 +585,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x; vTexcoord.y = In.vTexcoord.y; - vColor += g_fWeights[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); + vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; @@ -542,6 +594,172 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) return Out; } +PS_OUT_BLUR_X PS_MAIN_BLUR_X_ENV(PS_IN In) +{ + PS_OUT_BLUR_X Out; + + vector vDepthDesc; + float2 vTexcoord; + float fSampleViewZ; + float4 vColor = 0.f; + float fBlurAmount = 0.0f; + + float4 vCenter = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord); + float4 vOriginal = g_BlurTexture.Sample(ClampSampler, In.vTexcoord); + float fCenterViewZ = vCenter.y * g_fFar; + + float fTerrain = (1.f / 255.f); + if (false == AlmostEqual3(vCenter.a, fTerrain)) + { // 터레인셀이 아니면 스킵 + Out.vBlurX = vOriginal; + Out.vBlurWeight = 0.0f; + return Out; + } + + if (fCenterViewZ > g_fFocusDistance) + { + // 현재 셀이 초점거리보다 멀면 블러 + // 블러되는 양은 (현재 셀의 거리가 얼마나 더 멀리 있냐) // END보다 멀면 최대치이므로 saturate + float fValue = saturate((fCenterViewZ - g_fFarBlurStart) / (g_fFarBlurEnd - g_fFarBlurStart)); + fBlurAmount = fValue; // 0~1 + } + + if (fBlurAmount <= FLT_EPSILON3) { + // 최소치 이내면 블러 안함 + Out.vBlurX = vOriginal; + Out.vBlurWeight = 0.0f; + return Out; + } + + float fAcc = 0.f; + for (int i = -16; i < 16; ++i) + { + vTexcoord.x = In.vTexcoord.x + ((float) i / g_vResolution.x) * fBlurAmount * g_fDOFBlurMultiplier; + vTexcoord.y = In.vTexcoord.y; + + vDepthDesc = g_DepthTexture.Sample(DefaultSampler, vTexcoord); + + if (false == AlmostEqual3(vDepthDesc.a, fTerrain)) + { // 터레인셀이 아니면 스킵 + continue; + } + fSampleViewZ = vDepthDesc.y * g_fFar; + if (abs(fCenterViewZ - fSampleViewZ) > g_fDepthThreshold) + { // 센터 위치와 z값이 너무 많이 차이나면 샘플링 스킵 + continue; + } + + vColor += g_fWeights_32[i + 16] * g_BlurTexture.Sample(ClampSampler, vTexcoord); + fAcc += g_fWeights_32[i + 16]; + } + + if (fAcc <= FLT_EPSILON3) + { // 블러 실패하면 원본값 씀 + Out.vBlurX = vOriginal; + Out.vBlurWeight = 0.0f; + return Out; + } + else + { + vColor.xyz /= fAcc; + } + + Out.vBlurX = vColor; + Out.vBlurWeight = fAcc; + + return Out; +} + +PS_OUT_BACKBUFFER PS_MAIN_POSTCOMBINED(PS_IN In) +{ + PS_OUT_BACKBUFFER Out; + + vector vDepthDesc; + float2 vTexcoord; + float fSampleViewZ; + float4 vColor = 0.f; + float fBlurAmount = 0.0f; + + float4 vOriginal = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + float4 vCenter = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord); + float fCenterViewZ = vCenter.y * g_fFar; + + float fTerrain = (1.f / 255.f); + if (false == AlmostEqual3(vCenter.a, fTerrain)) + { // 터레인셀이 아니면 스킵 + Out.vBackBuffer = vOriginal; + Out.vEnvironment = 0.0f; + return Out; + } + + if (fCenterViewZ > g_fFocusDistance) + { + // 현재 셀이 초점거리보다 멀면 블러 + // 블러되는 양은 (현재 셀의 거리가 얼마나 더 멀리 있냐) // END보다 멀면 최대치이므로 saturate + float fValue = saturate((fCenterViewZ - g_fFarBlurStart) / (g_fFarBlurEnd - g_fFarBlurStart)); + fBlurAmount = fValue; // 0~1 + } + + if (fBlurAmount <= FLT_EPSILON3) + { + // 최소치 이내면 블러 스킵 + Out.vBackBuffer = vOriginal; + Out.vEnvironment = 0.0f; + return Out; + } + + float fAcc = 0.f; + for (int i = -16; i < 16; ++i) + { + vTexcoord.x = In.vTexcoord.x; + vTexcoord.y = In.vTexcoord.y + ((float) i / g_vResolution.y) * fBlurAmount * g_fDOFBlurMultiplier; + + vDepthDesc = g_DepthTexture.Sample(DefaultSampler, vTexcoord); + + if (false == AlmostEqual3(vDepthDesc.a, fTerrain)) + { // 터레인셀이 아니면 스킵 + continue; + } + fSampleViewZ = vDepthDesc.y * g_fFar; + if (abs(fCenterViewZ - fSampleViewZ) > g_fDepthThreshold) + { // 센터 위치와 z값이 너무 많이 차이나면 샘플링 스킵 + continue; + } + + vColor += g_fWeights_32[i + 16] * g_BlurTexture.Sample(ClampSampler, vTexcoord); + fAcc += g_fWeights_32[i + 16]; + } + if (fAcc <= FLT_EPSILON3) + { // 블러 실패하면 원본값 씀 + Out.vBackBuffer = vOriginal; + Out.vEnvironment = 0.0f; + return Out; + return Out; + } + else + { + vColor.xyz /= fAcc; + } + + float fOriginalLumen = length(vOriginal.rgb); + float fBlurLumen = length(vColor.rgb); + + float fLumenScale = 1.0f; + if (fBlurLumen > 1e-4f) + { + fLumenScale = fOriginalLumen / fBlurLumen; + } + float3 vBlurMatched = vColor.rgb * fLumenScale; + + float fBlendAmount = saturate(fBlurAmount * g_fDOFBlurMultiplier); + float3 finalColor = lerp(vOriginal.rgb, vBlurMatched, fBlendAmount); + + Out.vBackBuffer = float4(vColor.xyz, vOriginal.a); + Out.vEnvironment = 0.f; + + return Out; +} + PS_OUT_BLUR_X PS_MAIN_BLUR_Y(PS_IN In) { PS_OUT_BLUR_X Out; @@ -554,7 +772,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_Y(PS_IN In) vTexcoord.x = In.vTexcoord.x; vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y; - vColor += g_fWeights[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); + vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; @@ -563,6 +781,31 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_Y(PS_IN In) return Out; } +PS_OUT_FLT4_SINGLE PS_MAIN_FOG(PS_IN In) +{ + PS_OUT_FLT4_SINGLE Out; + + vector vColor = g_OriginalTexture.Sample(DefaultSampler, In.vTexcoord); + vector vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord); + + vector vFinalColor; + float fViewZ = vDepthDesc.y * g_fFar; + + float fRatio; + + fRatio = clamp(pow(exp(-(g_fFogDensity * fViewZ)), g_fFogPow), 0.f, 1.f); + + vFinalColor = lerp(g_vFogColor, vColor, max(fRatio, 0.2f)); + vFinalColor.a = 1.f; + + if (1.f == vDepthDesc.y) + vFinalColor = float4(g_vFogColor); + + Out.vSingleTarget = vFinalColor; + + return Out; +} + technique11 DefaultTechnique { @@ -685,4 +928,32 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN_BLOOM_FINISH(); } + pass BlurX_ENV_Pass // 12 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_BLUR_X_ENV(); + } + pass PostCombinedPass // 13 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default_Environment_SRead, 1); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_POSTCOMBINED(); + } + + pass FogPass // 14 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 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_MAIN_FOG(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 1aee12e67..14c08945d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1,3 +1,4 @@ + #include "Engine_Shader_Defines.hlsli" matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; @@ -9,7 +10,7 @@ int g_iImageCountY; uint g_iIndexU; uint g_iIndexV; uint g_iQuestType; -uint g_iSpellType; +int g_iSpellType; float g_fPI; float g_fFar; @@ -505,22 +506,22 @@ PS_OUT PS_SpellAnim(PS_IN In) switch (g_iSpellType) { case 0: - BGColor = float3(208.f, 179.f, 54.f) / 255.f; + BGColor = float3(255.f, 255.f, 0.f) / 255.f; break; case 1: - BGColor = float3(89.f, 32.f, 215.f) / 255.f; + BGColor = float3(150.f, 120.f, 240.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; + BGColor = float3(24.f, 190.f, 255.f) / 255.f; break; case 4: - BGColor = float3(134.f, 171.f, 78.f) / 255.f; + BGColor = float3(200.f, 220.f, 150.f) / 255.f; break; case 5: - BGColor = float3(0.f, 80.f, 55.f) / 255.f; + BGColor = float3(50.f, 150.f, 110.f) / 255.f; break; case 6: BGColor = float3(0.f, 0.f, 0.f); @@ -541,11 +542,11 @@ PS_OUT PS_SpellAnim(PS_IN In) color1 = tex3; - float wave1 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; - float wave2 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; + float wave1 = sin(OverrayUV.x * 10.f + g_fTime) * 0.01f; + float wave2 = sin(OverrayUV.x * 10.f + g_fTime) * 0.01f; float waveThreshold1 = CoolTime + wave1; float waveThreshold2 = CoolTime2 + wave2; - float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f , waveUV.y = (OverrayUV.y - waveThreshold1) /(waveThreshold2 - waveThreshold1)); + float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f, waveUV.y = (OverrayUV.y - waveThreshold1) / (waveThreshold2 - waveThreshold1)); waveUV = saturate(waveUV); float tex5 = g_Texture3.Sample(DefaultSampler, waveUV).r; @@ -895,7 +896,7 @@ PS_OUT PS_Magic_Item(PS_IN In) float2 OverrayUV = In.vTexcoord; float CoolTime = 0.f + g_fDeltaV; - float CoolTime2 = 0.f + g_fDeltaV + 0.05; + float CoolTime2 = 0.f + g_fDeltaV + 0.1f; atlasUV = startUV + In.vTexcoord * (endUV - startUV); float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); tex3.rgb *= BGColor; @@ -913,16 +914,20 @@ PS_OUT PS_Magic_Item(PS_IN In) float waveThreshold1 = CoolTime + wave1; float waveThreshold2 = CoolTime2 + wave2; - + float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f, waveUV.y = (OverrayUV.y - waveThreshold1) / (waveThreshold2 - waveThreshold1)); + waveUV = saturate(waveUV); + float Mask = g_MaskingTexture.Sample(DefaultSampler, waveUV).r; if (g_fDeltaV <= 1.f) { if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) { - color1.rgb = float3(1.f, 1.f, 1.f); + color1.rgb += float3(1.f, 1.f, 1.f) * Mask * 1.f; } } - if (OverrayUV.y <= CoolTime) + float waveThreshold = CoolTime + wave1; + + if (OverrayUV.y <= waveThreshold) { color1.a = 0.f; } @@ -961,6 +966,187 @@ PS_OUT PS_Magic_Item(PS_IN In) return Out; } +PS_OUT PS_Spell_Preview(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 uv = In.vTexcoord; + float2 CurrentPixelPosition = uv * g_fCurrent_Size; + float OriginLeft = g_fNine_Slice.x; + float OriginRight = g_fNine_Slice.y; + float OriginTop = g_fNine_Slice.z; + float OriginBottom = g_fNine_Slice.w; + + float CurrentLeft = OriginLeft; + float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); + float CurrentTop = OriginTop; + float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); + + float2 Finaluv = In.vTexcoord; + + if (CurrentPixelPosition.x < CurrentLeft) + { + Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; + } + else if (CurrentPixelPosition.x > CurrentRight) + { + float dist = CurrentPixelPosition.x - CurrentRight; + Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; + } + else + { + float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); + Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); + } + + if (CurrentPixelPosition.y < CurrentTop) + { + Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; + } + else if (CurrentPixelPosition.y > CurrentBottom) + { + float dist = CurrentPixelPosition.y - CurrentBottom; + Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; + } + else + { + float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); + Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + float4 tex3 = g_Texture2.Sample(DefaultSampler, Finaluv); + Color = tex1; + + tex3.rgb = tex2.rgb; + + Color = lerp(Color, tex3, tex3.a); + + float2 Imagetexpos1 = g_fImageSipos1.xy / g_fCurrent_Size; + float2 Imagetexsize1 = g_fImageSipos1.zw / g_fCurrent_Size; + float2 Imagelocal = (In.vTexcoord - Imagetexpos1) / Imagetexsize1; + bool inside1 = all(Imagelocal >= 0.0f && Imagelocal <= 1.0f); + float4 tex4 = g_Texture3.Sample(DefaultSampler, Finaluv); + if (inside1) + { + Color = lerp(Color, tex4, tex4.a); + } + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Spell_Header(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); + + float3 BGColor= float3(1.f, 1.f, 1.f); + + switch (g_iSpellType) + { + case 0: + BGColor = float3(255.f, 255.f, 0.f) / 255.f; + break; + case 1: + BGColor = float3(150.f, 120.f, 240.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(24.f, 190.f, 255.f) / 255.f; + break; + case 4: + BGColor = float3(200.f, 220.f, 150.f) / 255.f; + break; + case 5: + BGColor = float3(50.f, 150.f, 110.f) / 255.f; + break; + case 6: + BGColor = float3(0.f, 0.f, 0.f); + break; + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + Color.rgb *= BGColor; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} +PS_OUT PS_Spell_Header_Line(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 uv = In.vTexcoord; + float2 CurrentPixelPosition = uv * g_fCurrent_Size; + float OriginLeft = g_fNine_Slice.x; + float OriginRight = g_fNine_Slice.y; + float OriginTop = g_fNine_Slice.z; + float OriginBottom = g_fNine_Slice.w; + + float CurrentLeft = OriginLeft; + float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); + float CurrentTop = OriginTop; + float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); + + float2 Finaluv = In.vTexcoord; + + if (CurrentPixelPosition.x < CurrentLeft) + { + Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; + } + else if (CurrentPixelPosition.x > CurrentRight) + { + float dist = CurrentPixelPosition.x - CurrentRight; + Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; + } + else + { + float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); + Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); + } + + if (CurrentPixelPosition.y < CurrentTop) + { + Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; + } + else if (CurrentPixelPosition.y > CurrentBottom) + { + float dist = CurrentPixelPosition.y - CurrentBottom; + Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; + } + else + { + float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); + Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + //Color.rgb = tex2.rgb; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -1161,4 +1347,34 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Magic_Item(); } + pass Spell_Preview + { + 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_Spell_Preview(); + } + + pass Spell_Header + { + 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_Spell_Header(); + } + + pass Spell_Header_Line + { + 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_Spell_Header_Line(); + } + } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl index d6b238656..5b35a6cf9 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl @@ -4,12 +4,18 @@ matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; Texture2D g_Texture; Texture2D g_Texture1; +Texture2D g_Texture2; +Texture2D g_Texture3; +Texture2D g_Texture4; +Texture2D g_Texture5; +Texture2D g_MaskTexture; float g_fAlpha; float g_fOwnerAlpha; float g_fCanvasAlpha; float g_fAngle; float g_fFar; +float g_fTime; struct VS_IN { @@ -18,14 +24,17 @@ struct VS_IN float2 vSize : TEXCOORD1; float2 vPos : TEXCOORD2; - float2 vUVStart : TEXCOORD3; - float2 vUVEnd: TEXCOORD4; + float4 vUV : TEXCOORD3; + float4 vColor : TEXCOORD4; + float bHover : TEXCOORD5; }; struct VS_OUT { float4 vPosition : SV_POSITION; float2 vTexcoord : TEXCOORD0; + float4 vColor : TEXCOORD1; + float bHover : TEXCOORD2; }; VS_OUT VS_MAIN(VS_IN In) @@ -34,17 +43,21 @@ VS_OUT VS_MAIN(VS_IN In) matrix matVP = mul(g_ViewMatrix, g_ProjMatrix); float3 vLocalPos = In.vPosition; - vLocalPos.xy *= In.vSize; - vLocalPos.xy += In.vPos; - float2 StartUV = In.vUVStart; - float2 EndUV = In.vUVEnd; + if (In.bHover != 0) + vLocalPos.xy *= In.vSize * 1.1f; + else + vLocalPos.xy *= In.vSize; + + vLocalPos.xy += In.vPos; + float4 UV = In.vUV; float3 vParentPos = float3(g_WorldMatrix._41, g_WorldMatrix._42, g_WorldMatrix._43); float3 vFinalWorldPos = vLocalPos + vParentPos; - + Out.vPosition = mul(float4(vFinalWorldPos, 1.f), matVP); - Out.vTexcoord = StartUV + In.vTexcoord * (EndUV - StartUV); - + Out.vTexcoord = UV.xy + In.vTexcoord * (UV.zw - UV.xy); + Out.vColor = In.vColor; + Out.bHover = In.bHover; return Out; } @@ -52,6 +65,8 @@ struct PS_IN { float4 vPosition : SV_POSITION; float2 vTexcoord : TEXCOORD0; + float4 vColor : TEXCOORD1; + float bHover : TEXCOORD2; }; struct PS_OUT @@ -88,7 +103,7 @@ PS_OUT PS_Alpha_Blend(PS_IN In) float4 color = g_Texture.Sample(ClampSampler, In.vTexcoord); - if(color.a <= 0.4f) + if (color.a <= 0.4f) discard; color.a *= Alpha; @@ -124,6 +139,172 @@ PS_OUT PS_Megic_Meter(PS_IN In) return Out; } +PS_OUT PS_Spell_List(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float3 Blue = float3(41.f, 165.f, 255.f) / 255.f; + + float4 color = float4(1.f, 1.f, 1.f, 1.f); + float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); + float4 tex2 = g_Texture1.Sample(ClampSampler, In.vTexcoord); + + color = tex1; + tex2.rgb *= Blue * 1.5f; + + if (all(color.rgb >= float3(65.f / 255.f, 65.f / 255.f, 65.f / 255.f))) + color = tex2; + + //if(color.a <= 0.4f) + // discard; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Eessential_Spell_Slot(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 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); + float4 tex2 = g_Texture1.Sample(ClampSampler, In.vTexcoord); + + color = tex1; + + color = lerp(tex1, tex2, tex2.a); + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Eessential_Spell(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 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); + + color = tex1; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Color_Image(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 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); + color = tex1; + color *= In.vColor; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Spell_Hover(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float3 HoverOff = g_Texture2.Sample(DefaultSampler, In.vTexcoord).rgb; + float3 HoverOn = g_Texture3.Sample(DefaultSampler, In.vTexcoord).rgb; + + float4 color = float4(1.f, 1.f, 1.f, 1.f); + + if (In.bHover != 0) + { + float tex1 = g_Texture5.Sample(DefaultSampler, In.vTexcoord).r; + color.r *= tex1.r; + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + color = lerp(tex1, tex2, tex2.a); + color.rgb = HoverOn; + } + else + { + float tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord).r; + color.r *= tex1.r; + float4 tex2 = g_Texture4.Sample(DefaultSampler, In.vTexcoord); + color = lerp(tex1, tex2, tex2.a); + color.rgb = HoverOff; + color.a *= 0.5f; + } + + + color *= In.vColor; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Spell_Effect(PS_IN In) +{ + PS_OUT Out; + + if (In.bHover == 0) + discard; + + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 color = float4(1.f, 1.f, 1.f, 1.f); + float2 maskUV = In.vTexcoord + g_fTime * float2(0.2f, 0.0f); + + //float2 center = float2(0.5, 0.5); + //float2 uv = In.vTexcoord - center; + //float angle = -g_fTime; + //float s = sin(angle); + //float c = cos(angle); + //float2 rotUV = float2( + //uv.x * c - uv.y * s, + //uv.x * s + uv.y * c + //) + center; + + //float2 maskUV = In.vTexcoord; + + //maskUV.x += g_fTime * float2(0.05, 0.02); // 속도 조절 가능 + + //float2 center = float2(0.5, 0.0); + //float2 uv = In.vTexcoord - center; + + //float scale = 0.5 + sin(g_fTime * 20) * 0.5; + //uv.x *= scale; + + //uv += center; + + float tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord).r; + float mask = g_MaskTexture.Sample(DefaultSampler, maskUV).r; + + color.a *= tex1; + color.a *= mask; + color.a *= Alpha; + + color *= In.vColor; + + Out.vColor = color; + + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -158,4 +339,70 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Megic_Meter(); } + + pass Spell_List + { + 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_Spell_List(); + } + + pass Eessential_Spell_Slot + { + 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_Eessential_Spell_Slot(); + } + + pass Eessential_Spell + { + 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_Eessential_Spell(); + } + + pass Color_Image + { + 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_Color_Image(); + } + + pass Spell_Hover + { + 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_Spell_Hover(); + } + + pass Spell_Effect + { + 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_Spell_Effect(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index 7fe1aa38a..8bd5438ef 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -249,14 +249,14 @@ PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; - vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - vector vSurface = g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord); + vector vMtrlDiffuse = g_DiffuseTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + vector vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); if (vMtrlDiffuse.a < 0.2f) { discard; } - float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, DefaultSampler, In.vTexcoord); + float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, AnisoTropy_BLUR_Sampler, In.vTexcoord); float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); float3 vNormal = normalize(mul(vNormalDecoded, WorldMatrix)); @@ -513,7 +513,7 @@ technique11 DefaultTechnique pass OutLine_Write_Pass // 6 { SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_Write, 1); + SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_MAIN(); GeometryShader = NULL; @@ -523,7 +523,7 @@ technique11 DefaultTechnique pass OutLine_Read_Pass // 7 { SetRasterizerState(RS_Front); - SetDepthStencilState(DSS_Default_OutLine_Read, 0); + SetDepthStencilState(DSS_Default_OutLine_SRead, 2); SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_MAIN_OUTLINE(); GeometryShader = NULL; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl index 7faeb056e..ffc997c7c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl @@ -207,11 +207,11 @@ PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; - vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - vector vSurface = g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord); + vector vMtrlDiffuse = g_DiffuseTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + vector vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); if (vMtrlDiffuse.a < 0.2f) { discard; } - float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, DefaultSampler, In.vTexcoord); + float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, AnisoTropy_BLUR_Sampler, In.vTexcoord); float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); float3 vNormal = normalize(mul(vNormalDecoded, WorldMatrix)); @@ -573,7 +573,7 @@ technique11 MeshTechnique11 pass OutLine_Write_Pass // 13 { SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_Write, 1); + SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_MAIN(); GeometryShader = NULL; @@ -583,7 +583,7 @@ technique11 MeshTechnique11 pass OutLine_Read_Pass // 14 { SetRasterizerState(RS_Front); - SetDepthStencilState(DSS_Default_OutLine_Read, 0); + SetDepthStencilState(DSS_Default_OutLine_SRead, 2); SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_MAIN_OUTLINE(); GeometryShader = NULL; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl index bcdd26cb6..3f6083a9e 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl @@ -5,6 +5,9 @@ matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; float g_fFar; float g_fUsingSurfaceParams; +float g_fDiffuseMultiplier; +float g_fSurfaceMultiplier; +float g_fNormalMultiplier; Texture2D g_DiffuseTexture; Texture2D g_NormalTexture; @@ -73,35 +76,35 @@ PS_OUT PS_MAIN(PS_IN In) vector vMask = g_MaskTexture.Sample(DefaultSampler, In.vTexcoord); - vector vMtrlDiffuse_0 = g_DiffuseTextures[0].Sample(DefaultSampler, tileUV); - vector vMtrlDiffuse_1 = g_DiffuseTextures[1].Sample(DefaultSampler, tileUV); - vector vMtrlDiffuse_2 = g_DiffuseTextures[2].Sample(DefaultSampler, tileUV); - vector vMtrlDiffuse_3 = g_DiffuseTextures[3].Sample(DefaultSampler, tileUV); + vector vMtrlDiffuse_0 = g_DiffuseTextures[0].Sample(DefaultSampler, In.vWorldPos.xz * g_fDiffuseMultiplier); + vector vMtrlDiffuse_1 = g_DiffuseTextures[1].Sample(DefaultSampler, In.vWorldPos.xz * g_fDiffuseMultiplier); + vector vMtrlDiffuse_2 = g_DiffuseTextures[2].Sample(DefaultSampler, In.vWorldPos.xz * g_fDiffuseMultiplier); + vector vMtrlDiffuse_3 = g_DiffuseTextures[3].Sample(DefaultSampler, In.vWorldPos.xz * g_fDiffuseMultiplier); vector vMtrlDiffuse = float4(float3(vMtrlDiffuse_0.xyz * vMask.r + - vMtrlDiffuse_1.xyz * vMask.g + - vMtrlDiffuse_2.xyz * vMask.b + - vMtrlDiffuse_3.xyz * vMask.a), 1.f); + vMtrlDiffuse_1.xyz * vMask.g + + vMtrlDiffuse_2.xyz * vMask.b + + vMtrlDiffuse_3.xyz * vMask.a), 1.f); - vector vSurface_0 = g_SurfaceParamsTextures[0].Sample(DefaultSampler, tileUV); - vector vSurface_1 = g_SurfaceParamsTextures[1].Sample(DefaultSampler, tileUV); - vector vSurface_2 = g_SurfaceParamsTextures[2].Sample(DefaultSampler, tileUV); - vector vSurface_3 = g_SurfaceParamsTextures[3].Sample(DefaultSampler, tileUV); + vector vSurface_0 = g_SurfaceParamsTextures[0].Sample(DefaultSampler, In.vWorldPos.xz * g_fSurfaceMultiplier); + vector vSurface_1 = g_SurfaceParamsTextures[1].Sample(DefaultSampler, In.vWorldPos.xz * g_fSurfaceMultiplier); + vector vSurface_2 = g_SurfaceParamsTextures[2].Sample(DefaultSampler, In.vWorldPos.xz * g_fSurfaceMultiplier); + vector vSurface_3 = g_SurfaceParamsTextures[3].Sample(DefaultSampler, In.vWorldPos.xz * g_fSurfaceMultiplier); vector vSurface = (vSurface_0 * vMask.r + vSurface_1 * vMask.g + vSurface_2 * vMask.b + vSurface_3 * vMask.a); - float3 vNormalDecoded_0 = DecodeNormalFromRG(g_NormalTextures[0], DefaultSampler, tileUV); - float3 vNormalDecoded_1 = DecodeNormalFromRG(g_NormalTextures[1], DefaultSampler, tileUV); - float3 vNormalDecoded_2 = DecodeNormalFromRG(g_NormalTextures[2], DefaultSampler, tileUV); - float3 vNormalDecoded_3 = DecodeNormalFromRG(g_NormalTextures[3], DefaultSampler, tileUV); + float3 vNormalDecoded_0 = DecodeNormalFromRG(g_NormalTextures[0], DefaultSampler, In.vWorldPos.xz * g_fNormalMultiplier); + float3 vNormalDecoded_1 = DecodeNormalFromRG(g_NormalTextures[1], DefaultSampler, In.vWorldPos.xz * g_fNormalMultiplier); + float3 vNormalDecoded_2 = DecodeNormalFromRG(g_NormalTextures[2], DefaultSampler, In.vWorldPos.xz * g_fNormalMultiplier); + float3 vNormalDecoded_3 = DecodeNormalFromRG(g_NormalTextures[3], DefaultSampler, In.vWorldPos.xz * g_fNormalMultiplier); float3 vNormalDecoded = normalize(vNormalDecoded_0.xyz * vMask.r + - vNormalDecoded_1.xyz * vMask.g + - vNormalDecoded_1.xyz * vMask.b + - vNormalDecoded_1.xyz * vMask.a); + vNormalDecoded_1.xyz * vMask.g + + vNormalDecoded_1.xyz * vMask.b + + vNormalDecoded_1.xyz * vMask.a); float3 vBinormal = cross(In.vNormal.xyz, float3(1.f, 0.f, 0.f)); @@ -123,9 +126,67 @@ PS_OUT PS_MAIN(PS_IN In) return Out; } +PS_OUT PS_MAIN_TERRAIN_ANISO(PS_IN In) +{ + PS_OUT Out; + + float2 tileUV = In.vWorldPos.xz / 16.f; + + vector vMask = g_MaskTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + + vector vMtrlDiffuse_0 = g_DiffuseTextures[0].Sample(AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fDiffuseMultiplier); + vector vMtrlDiffuse_1 = g_DiffuseTextures[1].Sample(AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fDiffuseMultiplier); + vector vMtrlDiffuse_2 = g_DiffuseTextures[2].Sample(AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fDiffuseMultiplier); + vector vMtrlDiffuse_3 = g_DiffuseTextures[3].Sample(AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fDiffuseMultiplier); + + vector vMtrlDiffuse = float4(float3(vMtrlDiffuse_0.xyz * vMask.r + + vMtrlDiffuse_1.xyz * vMask.g + + vMtrlDiffuse_2.xyz * vMask.b + + vMtrlDiffuse_3.xyz * vMask.a), 1.f); + + vector vSurface_0 = g_SurfaceParamsTextures[0].Sample(AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fSurfaceMultiplier); + vector vSurface_1 = g_SurfaceParamsTextures[1].Sample(AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fSurfaceMultiplier); + vector vSurface_2 = g_SurfaceParamsTextures[2].Sample(AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fSurfaceMultiplier); + vector vSurface_3 = g_SurfaceParamsTextures[3].Sample(AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fSurfaceMultiplier); + + vector vSurface = (vSurface_0 * vMask.r + + vSurface_1 * vMask.g + + vSurface_2 * vMask.b + + vSurface_3 * vMask.a); + + float3 vNormalDecoded_0 = DecodeNormalFromRG(g_NormalTextures[0], AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fNormalMultiplier); + float3 vNormalDecoded_1 = DecodeNormalFromRG(g_NormalTextures[1], AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fNormalMultiplier); + float3 vNormalDecoded_2 = DecodeNormalFromRG(g_NormalTextures[2], AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fNormalMultiplier); + float3 vNormalDecoded_3 = DecodeNormalFromRG(g_NormalTextures[3], AnisoTropy_BLUR_Sampler, In.vWorldPos.xz * g_fNormalMultiplier); + + float3 vNormalDecoded = normalize(vNormalDecoded_0.xyz * vMask.r + + vNormalDecoded_1.xyz * vMask.g + + vNormalDecoded_1.xyz * vMask.b + + vNormalDecoded_1.xyz * vMask.a); + + float3 vBinormal = cross(In.vNormal.xyz, float3(1.f, 0.f, 0.f)); + + float3 vTangent = cross(vBinormal, In.vNormal.xyz); + + float3x3 WorldMatrix = float3x3(vTangent, vBinormal, In.vNormal.xyz); + + float3 vNormal = normalize(mul(vNormalDecoded, WorldMatrix)); + + Out.vAlbedo = vMtrlDiffuse; + Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); + Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 깊이 ( 0~ 1) + (In.vProjPos.w / g_fFar), // 뷰 스페이스 Z + g_fUsingSurfaceParams, // 서페이스 파라미터 + (1.f / 255.f)); // 지형은 1 + Out.vColor = float4(0.f, 0.f, 0.f, 1.f); + Out.vSurface = vSurface; + + return Out; +} + technique11 NorTexTechnique11 { - pass NorTexPass + pass NorTexPass // 0 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -134,7 +195,7 @@ technique11 NorTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN(); } - pass TerrainPass + pass TerrainPass // 1 { SetRasterizerState(RS_Nocull_Wireframe); SetDepthStencilState(DSS_Default, 0); @@ -143,5 +204,13 @@ technique11 NorTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN(); } - + pass Environment_Terrain_Pass // 2 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default_Environment_SWrite, 1); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_TERRAIN_ANISO(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoFlyIcon.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoFlyIcon.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoFlyIcon.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoFlyIcon.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoMountIcon.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoMountIcon.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoMountIcon.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoMountIcon.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Lock.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Lock.png new file mode 100644 index 000000000..5e3716df2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Lock.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/SpellWidgetPanelBack.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/SpellWidgetPanelBack.png new file mode 100644 index 000000000..7a7da21f3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/SpellWidgetPanelBack.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png index bd3c9cea3..f8ec4801b 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_GoldLeaf.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_GoldLeaf.png new file mode 100644 index 000000000..10b0bed15 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_GoldLeaf.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Goldleaf_Large.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Goldleaf_Large.png new file mode 100644 index 000000000..d6d761b05 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Goldleaf_Large.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Header_Line.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Header_Line.png new file mode 100644 index 000000000..3d6fffb31 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Header_Line.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButton.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButton.png new file mode 100644 index 000000000..d350d3d8b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButton.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonHighlight.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonHighlight.png new file mode 100644 index 000000000..867ef1d40 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonHighlight.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonOutline.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonOutline.png new file mode 100644 index 000000000..cc1dffe78 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonOutline.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_LighthouseHeaderBack.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_LighthouseHeaderBack.png new file mode 100644 index 000000000..ab94ead0f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_LighthouseHeaderBack.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png new file mode 100644 index 000000000..18e940838 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderMask.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderMask.png new file mode 100644 index 000000000..833a8ab61 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderMask.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedPresetBorder.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedPresetBorder.png new file mode 100644 index 000000000..a75f3ae17 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedPresetBorder.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_Generic.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SpellType_Generic.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_Generic.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SpellType_Generic.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentTree_TreeBack.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentTree_TreeBack.png new file mode 100644 index 000000000..fa79e0ed1 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentTree_TreeBack.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentVideoBorder.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentVideoBorder.png new file mode 100644 index 000000000..b12972394 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentVideoBorder.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TooltipBorder_4K.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TooltipBorder_4K.png new file mode 100644 index 000000000..8310c6dd5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TooltipBorder_4K.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Crucio_Decal_Emiss_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Crucio_Decal_Emiss_D.png new file mode 100644 index 000000000..3f857f63b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Crucio_Decal_Emiss_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Cursed_X_Outer_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Cursed_X_Outer_D.png new file mode 100644 index 000000000..f667ecabd Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Cursed_X_Outer_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_FlameTileGrey_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_FlameTileGrey_D.png new file mode 100644 index 000000000..b1a59d625 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_FlameTileGrey_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flare02_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flare02_D.png new file mode 100644 index 000000000..83ac7e0ee Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flare02_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flippendo_ScorchMark2_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flippendo_ScorchMark2_D.png new file mode 100644 index 000000000..41450a0b7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flippendo_ScorchMark2_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Inky_Smoke_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Inky_Smoke_D.png new file mode 100644 index 000000000..eebd2001f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Inky_Smoke_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Noise08_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Noise08_D.png new file mode 100644 index 000000000..7c1ae0e40 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Noise08_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Repairo_Wisp_04_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Repairo_Wisp_04_D.png new file mode 100644 index 000000000..d8ef663c4 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Repairo_Wisp_04_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_RingFlare_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_RingFlare_D.png new file mode 100644 index 000000000..5b2e570ee Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_RingFlare_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_SwirlNoise_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_SwirlNoise_01_D.png new file mode 100644 index 000000000..bf956b0cf Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_SwirlNoise_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WhispLine_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WhispLine_D.png new file mode 100644 index 000000000..47abb63ce Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WhispLine_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WindNoise_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WindNoise_D.png new file mode 100644 index 000000000..6f434b183 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WindNoise_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WispyNoise_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WispyNoise_D.png new file mode 100644 index 000000000..77c43e314 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WispyNoise_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Altas_Eessential.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Altas_Eessential.dds new file mode 100644 index 000000000..0a0543a48 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Altas_Eessential.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Atlas_Widget_Spell.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Atlas_Widget_Spell.dds new file mode 100644 index 000000000..66d912ed0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Atlas_Widget_Spell.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Conjuration.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Conjuration.png deleted file mode 100644 index e865c8647..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Conjuration.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Descendo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Descendo.png deleted file mode 100644 index 23163f45e..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Descendo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_InnerShadow.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_InnerShadow.png deleted file mode 100644 index b505584cc..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_InnerShadow.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_reparo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_reparo.png deleted file mode 100644 index 7b0f22d55..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_reparo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_Crucio.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_Crucio.png deleted file mode 100644 index 61cdd37f4..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_Crucio.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformation_4K.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformation_4K.png deleted file mode 100644 index a0bba2153..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformation_4K.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformationoverland.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformationoverland.png deleted file mode 100644 index 6c0797351..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformationoverland.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_wingardium.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_wingardium.png deleted file mode 100644 index 4196a09cf..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_wingardium.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/accio.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/accio.png deleted file mode 100644 index 2bce2fb55..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/accio.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/arrestomomentum.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/arrestomomentum.png deleted file mode 100644 index 62cb4c8a5..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/arrestomomentum.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/avadakedavra.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/avadakedavra.png deleted file mode 100644 index 1d0cb34a1..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/avadakedavra.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/confringo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/confringo.png deleted file mode 100644 index fe2968523..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/confringo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/depulso.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/depulso.png deleted file mode 100644 index ed98ea5d7..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/depulso.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/diffindo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/diffindo.png deleted file mode 100644 index 919119ab1..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/diffindo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expelliarmus.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expelliarmus.png deleted file mode 100644 index b272c4fa8..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expelliarmus.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expulso.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expulso.png deleted file mode 100644 index 91a3a6b73..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expulso.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/glacius.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/glacius.png deleted file mode 100644 index 06f10cee2..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/glacius.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/imperius.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/imperius.png deleted file mode 100644 index b4315b7a6..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/imperius.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/incendio.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/incendio.png deleted file mode 100644 index d9ce34549..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/incendio.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/levioso.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/levioso.png deleted file mode 100644 index e5b078558..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/levioso.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Hogsmeade_AlphaMap.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Hogsmeade_AlphaMap.dds index 95887abf3..43b3daae8 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Hogsmeade_AlphaMap.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Hogsmeade_AlphaMap.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_3.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_3.dds index 36017b3e1..b8b2bf6e2 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_3.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_3.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_0.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_0.dds index a8a0ca4df..913507c39 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_0.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_0.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds index 568c2ac58..805d50143 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_2.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_2.dds index 125314b46..487f16d3a 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_2.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_2.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_3.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_3.dds index 5a76d93a7..28d5481c2 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_3.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_3.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_0.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_0.dds index 61fbdcc36..40d8c1c6a 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_0.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_0.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds index 43e598aa9..968f20815 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_2.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_2.dds index 91751a6cf..dcef50b49 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_2.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_2.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_3.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_3.dds index e862b711c..d30c889ea 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_3.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_3.dds differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index fe6803c13..2066d1f43 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -208,6 +208,9 @@ + + + @@ -215,6 +218,7 @@ + @@ -252,9 +256,18 @@ + + + + + + + + + @@ -347,6 +360,9 @@ + + + @@ -355,6 +371,7 @@ + @@ -393,9 +410,18 @@ + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 0a58bca2a..c6cd1d72c 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -205,9 +205,6 @@ {3131278b-18f5-4b84-ba85-73104998e9c9} - - {9c21aba5-00c1-4b4c-8a82-dac7a156fd9b} - {680910fd-aee2-4f69-b644-12b36b0f635b} @@ -298,30 +295,6 @@ {c81350c7-0edb-4e51-babf-09bf627414f1} - - {a56502cb-b0b8-4ea7-bc5e-5482b416fef9} - - - {8a70232d-f917-4ff6-b617-302e325996ae} - - - {dac78c4e-b898-45dc-8740-794899de0c69} - - - {d5681f71-af29-4418-bf3a-a1486c6ba171} - - - {029a22c4-ab06-4db0-9527-4e3cfa1a2e0d} - - - {b017e167-f48d-4417-a924-765ab802cff5} - - - {904a7ae5-33fe-49a1-9f31-27443acc9e1a} - - - {0b8cac41-419f-48ce-87bc-805b8962b4df} - {7e8b7123-11fb-4946-99fe-3265932d0536} @@ -378,7 +351,7 @@ {8bb21e5b-933f-4930-8d49-1093e0c3ea77} - + {a54567fa-e528-4c98-a605-289d7d300029} @@ -391,6 +364,72 @@ {c7b1ffc6-548f-464c-8f19-8b6ff5913b06} + + {8d15e456-f0d7-45b6-b725-7f1a8c0f6b0f} + + + {bae34bc2-3b69-40c0-8c9a-278dba07c8aa} + + + {1700ba11-4e28-4934-b757-bfed96b74503} + + + {da710064-ef45-41e1-8fc5-1fc544cb4cb8} + + + {78ffbbbe-930a-4770-93fc-ec46f7ff2c8d} + + + {d5815cd9-96d2-4364-b0d6-be0bb10b02db} + + + {62f1bdfb-9162-434a-a462-b63f5e763277} + + + {9c21aba5-00c1-4b4c-8a82-dac7a156fd9b} + + + {a56502cb-b0b8-4ea7-bc5e-5482b416fef9} + + + {8a70232d-f917-4ff6-b617-302e325996ae} + + + {dac78c4e-b898-45dc-8740-794899de0c69} + + + {d5681f71-af29-4418-bf3a-a1486c6ba171} + + + {029a22c4-ab06-4db0-9527-4e3cfa1a2e0d} + + + {b017e167-f48d-4417-a924-765ab802cff5} + + + {904a7ae5-33fe-49a1-9f31-27443acc9e1a} + + + {0b8cac41-419f-48ce-87bc-805b8962b4df} + + + {99125f58-acb9-4e9c-af15-87bf4e09c9b1} + + + {261e2297-e48d-4e42-b57e-12b0c0e633a3} + + + {754c2260-5073-4489-9fa8-0df8da6d0255} + + + {9d80f32a-aaca-490e-babf-3a7fe4cc0600} + + + {cf446efa-94e5-4fd2-83e1-dba2149eddc8} + + + {99652c97-4011-4d1f-84fb-7e6aa9f6ec1a} + @@ -749,7 +788,7 @@ 02.GameObjects\Layer_Effect\Effect\08.Protego - + 50.UI\GamePlay_Canvas\Mission_Panel\MissionBanner_Border @@ -762,6 +801,45 @@ 50.UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell_Slot + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List_Image + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_State + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hober + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hover_Effect + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header_Line + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Vidio_Border + + + 03.GameTime + + + 02.GameObjects\Env\03.MapElement\Light + @@ -1119,7 +1197,7 @@ 02.GameObjects\Layer_Effect\Effect\08.Protego - + 50.UI\GamePlay_Canvas\Mission_Panel\MissionBanner_Border @@ -1132,6 +1210,45 @@ 50.UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell_Slot + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List_Image + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_State + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hober + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hover_Effect + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header_Line + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Vidio_Border + + + 03.GameTime + + + 02.GameObjects\Env\03.MapElement\Light + diff --git a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp index 5e22856f8..ceee66aaa 100644 --- a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp @@ -39,15 +39,14 @@ HRESULT CCurrent_Spell_Slot::Initialize(void* pArg) m_fAlpha = 1.f; m_fTimeMult = 3.f; - m_fAngle = XMConvertToRadians(45); + m_fAngle = XMConvertToRadians(-135); m_fAlphaTime = 1.f; m_fOffSetX = 105.f; m_fOffSetY = 150.f; m_iCols = 4; m_pVIBufferCom->Set_Cloned(true); - m_pVIBufferCom->Set_Pos(-780.f, -110.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Pos(-780.f, 340.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); return S_OK; } @@ -113,7 +112,7 @@ HRESULT CCurrent_Spell_Slot::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::DEFAULT)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Eessential_Spell.cpp b/Jusin154_Team3D/Editor/Private/Eessential_Spell.cpp new file mode 100644 index 000000000..ab66cc828 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Eessential_Spell.cpp @@ -0,0 +1,283 @@ +#include "pch.h" +#include "Eessential_Spell.h" +#include "GameInstance.h" + +CEessential_Spell::CEessential_Spell(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CEessential_Spell::CEessential_Spell(const CEessential_Spell& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CEessential_Spell::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEessential_Spell::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 40.f; + Desc.fSizeY = 40.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 = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 80.f; + m_fOffSetY = 80.f; + m_iCols = 4; + UV(); + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-731.f, -300.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(pUVDesc); + return S_OK; +} + +void CEessential_Spell::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CEessential_Spell::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 CEessential_Spell::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CEessential_Spell::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::EESSENTIAL_SPELL)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CEessential_Spell::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CEessential_Spell::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CEessential_Spell::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CEessential_Spell::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CEessential_Spell::UV() +{ + for (_uint i = 0; i < 8; ++i) + { + pUVDesc[i].fUV = Meter_Index(i); + } +} + +_float4 CEessential_Spell::Meter_Index(_uint Number) +{ + _float2 fImage_Size = _float2{ 512.f, 256.f}; + + _uint iXCount = 4; + _uint iYCount = 2; + + _float frameWidth = 128.f; + _float frameHeight = 128.f; + + _uint frameX = Number % iXCount; + _uint frameY = Number / iXCount; + + _float4 UV{}; + UV.x = frameX * frameWidth / fImage_Size.x; + UV.y = frameY * frameHeight / fImage_Size.y; + UV.z = UV.x + (frameWidth / fImage_Size.x); + UV.w = UV.y + (frameHeight / fImage_Size.y); + + return UV; +} + +HRESULT CEessential_Spell::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_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 CEessential_Spell::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Altas_Eessential"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CEessential_Spell* CEessential_Spell::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CEessential_Spell* pInstance = new CEessential_Spell(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CEessential_Spell"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CEessential_Spell::Clone(void* pArg, CGameObject* pOwner) +{ + CEessential_Spell* pInstance = new CEessential_Spell(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CEessential_Spell"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CEessential_Spell::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CEessential_Spell::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp new file mode 100644 index 000000000..923cc1afb --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp @@ -0,0 +1,278 @@ +#include "pch.h" +#include "Eessential_Spell_Slot.h" +#include "GameInstance.h" + +CEessential_Spell_Slot::CEessential_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CEessential_Spell_Slot::CEessential_Spell_Slot(const CEessential_Spell_Slot& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CEessential_Spell_Slot::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEessential_Spell_Slot::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 65.f; + Desc.fSizeY = 65.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 = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 80.f; + m_fOffSetY = 80.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos( -731.f, -300.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + return S_OK; +} + +void CEessential_Spell_Slot::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CEessential_Spell_Slot::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; + Hover(); + __super::Update(fTimeDelta); +} + +void CEessential_Spell_Slot::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CEessential_Spell_Slot::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::EESSENTIAL_SPELL_SOLT)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CEessential_Spell_Slot::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CEessential_Spell_Slot::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CEessential_Spell_Slot::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CEessential_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CEessential_Spell_Slot::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_pVIBufferCom->Set_Mouse_Hover(fMouse); + +} + +HRESULT CEessential_Spell_Slot::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_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 CEessential_Spell_Slot::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell_Slot"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemBG"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionDiamondTriggerBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CEessential_Spell_Slot* CEessential_Spell_Slot::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CEessential_Spell_Slot* pInstance = new CEessential_Spell_Slot(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CEessential_Spell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CEessential_Spell_Slot::Clone(void* pArg, CGameObject* pOwner) +{ + CEessential_Spell_Slot* pInstance = new CEessential_Spell_Slot(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CEessential_Spell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CEessential_Spell_Slot::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CEessential_Spell_Slot::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/GameTime.cpp b/Jusin154_Team3D/Editor/Private/GameTime.cpp new file mode 100644 index 000000000..fb874c02b --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/GameTime.cpp @@ -0,0 +1,47 @@ +#include "pch.h" +#include "GameTime.h" +#include "GameInstance.h" + +CGameTime::CGameTime() + : m_pGameInstance(CGameInstance::GetInstance()) +{ + SAFE_ADDREF(m_pGameInstance); +} + +HRESULT CGameTime::Initialize() +{ + return S_OK; +} + +void CGameTime::Update_GameTime(_float fTiemDelta) +{ + m_fGameTime += fTiemDelta; + m_fDayTime += fTiemDelta; + + if (SECONDS_PER_GAME_DAY <= m_fDayTime) + { + m_fDayTime = 0.f; + } + + +} + +CGameTime* CGameTime::Create() +{ + CGameTime* pInstance = new CGameTime(); + + if (FAILED(pInstance->Initialize())) + { + MSG_BOX("Failed to Created : CGameTime"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CGameTime::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pGameInstance); +} diff --git a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp index 42977a5f6..e25650f18 100644 --- a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp +++ b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp @@ -153,7 +153,7 @@ void CIMGUIUI::Update(_float fTimeDelta) m_fLerpY = static_cast(m_pElementObject)->Get_Lerp_Pos().m128_f32[1]; m_fMoveSpeed = static_cast(m_pElementObject)->Get_Speed(); m_fAngle = static_cast(m_pElementObject)->Get_Angle(); - m_iSkillType = static_cast(m_pElementObject)->Get_SkillType(); + m_iSpellType = static_cast(m_pElementObject)->Get_SkillType(); m_fCoolTime = static_cast(m_pElementObject)->Get_CoolTime(); } GUI::Begin("Current_PanelObject_Info"); @@ -436,10 +436,10 @@ void CIMGUIUI::Update(_float fTimeDelta) static_cast(m_pElementObject)->Set_Angle(m_fAngle); } - GUI::Text("SkillType %d", m_iSkillType); - if (GUI::Combo("SkillType", &m_iSkillType, SpellTypeNames, itemCount)) + GUI::Text("SkillType %d", m_iSpellType); + if (GUI::Combo("SkillType", &m_iSpellType, SpellTypeNames, itemCount)) { - static_cast(m_pElementObject)->Set_SkillType(m_iSkillType); + static_cast(m_pElementObject)->Set_SkillType(m_iSpellType); } GUI::Text("CoolTime %.1f", m_fCoolTime); diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 38d2e4c5b..2eb0d395a 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -66,6 +66,17 @@ #include "Spell_Canvas.h" #include "Spell_Panel.h" #include "Current_Spell_Slot.h" +#include "Spell_List.h" +#include "Eessential_Spell_Slot.h" +#include "Eessential_Spell.h" +#include "Spell_List_Image.h" +#include "Spell_State.h" +#include "Spell_Hover.h" +#include "Spell_Hover_Effect.h" +#include "Spell_Preview.h" +#include "Spell_Header.h" +#include "Spell_Header_Line.h" +#include "Spell_Vidio_Border.h" #include "IMGUIUI.h" @@ -82,6 +93,7 @@ #include "MapObject_Manager.h" #include "MapElement_Interactable.h" #include "MapElement_Static.h" +#include "MapElement_Light.h" #include "Land.h" #include "Collider.h" #include "VIBuffer_Model_Instance.h" @@ -386,22 +398,6 @@ HRESULT CLoader::Loading_For_UI() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { - return E_FAIL; - } - - return S_OK; - - }); - - Asset_FileLoad("../Bin/Resources/Textures/HUD", 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; @@ -482,6 +478,22 @@ HRESULT CLoader::Loading_For_UI() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/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; @@ -516,6 +528,42 @@ HRESULT CLoader::Loading_For_UI() return E_FAIL; } + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Spell_List{}; + + Spell_List.iNum = 26; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Spell_List)))) { + return E_FAIL; + } + + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Eessential_Spell_Slot{}; + + Eessential_Spell_Slot.iNum = 8; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell_Slot"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Eessential_Spell_Slot)))) { + return E_FAIL; + } + + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Eessential_Spell{}; + + Eessential_Spell.iNum = 8; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Eessential_Spell)))) { + return E_FAIL; + } + + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Spell_List_Image{}; + + Spell_List_Image.iNum = 26; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List_Image"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Spell_List_Image)))) { + return E_FAIL; + } + CVIBuffer_UI_Instance::UI_INSTANCE_DESC SlotNumberUIDesc{}; SlotNumberUIDesc.iNum = 4; @@ -667,6 +715,50 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_List::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CEessential_Spell_Slot::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CEessential_Spell::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_List_Image::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_State::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Hover::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Hover_Effect::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Preview::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Header::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Header_Line::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Vidio_Border::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CIMGUIUI::Create(m_pDevice, m_pContext)))) { @@ -1969,320 +2061,325 @@ HRESULT CLoader::Loading_For_MapViewer() //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; + + /* Light */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\LightPosts", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; #pragma endregion #ifdef gimch -vector> jobFutures; +//vector> jobFutures; +// +//_uint iLoadCount = 46; +//vector*> Contents(iLoadCount); -_uint iLoadCount = 46; -vector*> Contents(iLoadCount); - -{ - { /* Terrain */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* TScrolls */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Collisions", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* 3BroomStick*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* Ollivanders*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* Gatehouse*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Gatehouse\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_QuidditchShop */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_HogsheadInn */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Honeydukes */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_OwlPost */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_TeaShop */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Zonkos */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_DB_GR */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Potions */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Collisions", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Salon */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* Hengist_Tree */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Vegetation\\Hengist_Tree", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Vegetation", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN A*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN B*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN C*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN E*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN F*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN G*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN H*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN J*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } -} - - 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 (true == pContents->bLoadTags) { - ModelPrototypeTags.push_back(pContents->pModelTag); - ModelPrototypePath.push_back(pContents->pathModel); - } - - 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; - } - } - - } - } +//{ +// { /* Terrain */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* TScrolls */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Collisions", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* 3BroomStick*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* Ollivanders*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* Gatehouse*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Gatehouse\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_QuidditchShop */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_HogsheadInn */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Honeydukes */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_OwlPost */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_TeaShop */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Zonkos */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_DB_GR */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Potions */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Collisions", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Salon */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* Hengist_Tree */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Vegetation\\Hengist_Tree", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Vegetation", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN A*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN B*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN C*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN E*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN F*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN G*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN H*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN J*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +//} +// +// 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 (true == pContents->bLoadTags) { +// ModelPrototypeTags.push_back(pContents->pModelTag); +// ModelPrototypePath.push_back(pContents->pathModel); +// } +// +// 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; +// } +// } +// +// } +// } m_strMessage = TEXT("쉐이더를(을) 로딩 중 입니다."); @@ -2374,6 +2471,10 @@ vector*> Contents(iLoadCount); if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMapElement_Static::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_MapElement_Light */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMapElement_Light::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Terrain */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTerrain::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -2393,12 +2494,12 @@ vector*> Contents(iLoadCount); m_isFinished = true; - for (_uint i = 0; i < Contents.size(); ++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]); - } + }*/ #endif return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Magic_Item.cpp b/Jusin154_Team3D/Editor/Private/Magic_Item.cpp index b2a9664e9..beefb262a 100644 --- a/Jusin154_Team3D/Editor/Private/Magic_Item.cpp +++ b/Jusin154_Team3D/Editor/Private/Magic_Item.cpp @@ -219,6 +219,10 @@ HRESULT CMagic_Item::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pDiffuse_TextureCom6->Bind_ShaderResource(m_pShaderCom, "g_MaskingTexture", 0))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -316,6 +320,10 @@ HRESULT CMagic_Item::Ready_Components(void* pArg) { return E_FAIL; } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_tillingSmokes"), reinterpret_cast(&m_pDiffuse_TextureCom6), nullptr))) + { + return E_FAIL; + } if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) { return E_FAIL; @@ -360,6 +368,7 @@ void CMagic_Item::Free() SAFE_RELEASE(m_pDiffuse_TextureCom3); SAFE_RELEASE(m_pDiffuse_TextureCom4); SAFE_RELEASE(m_pDiffuse_TextureCom5); + SAFE_RELEASE(m_pDiffuse_TextureCom6); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/MainLight.cpp b/Jusin154_Team3D/Editor/Private/MainLight.cpp index a950ae69a..6e1ef1be7 100644 --- a/Jusin154_Team3D/Editor/Private/MainLight.cpp +++ b/Jusin154_Team3D/Editor/Private/MainLight.cpp @@ -3,6 +3,7 @@ #include "GameInstance.h" #include "Camera_Debug.h" +#include "GameTime.h" CMainLight::CMainLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CGameObject(pDevice, pContext) @@ -30,17 +31,84 @@ HRESULT CMainLight::Initialize(void* pArg) m_pTransformCom->Set_State(STATE::LOOK, XMVectorSet(1.f, -1.f, 1.f, 0.f)); + m_pGameTime = CGameTime::Create(); + + // --- m_Diffuse_Colors 초기화 (주요 색상) --- + m_Diffuse_Colors[ENUM_CLASS(DAY_PHASE::DAWN)] = { 0.8f, 0.6f, 0.4f, 1.0f }; // 따뜻한 새벽 햇살 + m_Diffuse_Colors[ENUM_CLASS(DAY_PHASE::DAY)] = { 1.0f, 1.0f, 1.0f, 1.0f }; // 순백색 주광 + m_Diffuse_Colors[ENUM_CLASS(DAY_PHASE::DUSK)] = { 0.9f, 0.4f, 0.2f, 1.0f }; // 붉은 석양 + m_Diffuse_Colors[ENUM_CLASS(DAY_PHASE::NIGHT)] = { 0.2f, 0.2f, 0.4f, 1.0f }; // 푸른 달빛 + + // --- m_Ambient_Colors 초기화 (그림자 및 전체적인 밝기) --- + m_Ambient_Colors[ENUM_CLASS(DAY_PHASE::DAWN)] = { 0.3f, 0.3f, 0.4f, 1.0f }; // 그림자도 약간 푸른빛 + m_Ambient_Colors[ENUM_CLASS(DAY_PHASE::DAY)] = { 0.4f, 0.4f, 0.4f, 1.0f }; // 밝은 환경광 + m_Ambient_Colors[ENUM_CLASS(DAY_PHASE::DUSK)] = { 0.2f, 0.2f, 0.3f, 1.0f }; // 환경광 감소 + m_Ambient_Colors[ENUM_CLASS(DAY_PHASE::NIGHT)] = { 0.1f, 0.1f, 0.2f, 1.0f }; // 최소한의 어두운 환경광 + + // --- m_Specular_Colors 초기화 (반짝이는 하이라이트) --- + m_Specular_Colors[ENUM_CLASS(DAY_PHASE::DAWN)] = { 0.7f, 0.7f, 0.7f, 1.0f }; + m_Specular_Colors[ENUM_CLASS(DAY_PHASE::DAY)] = { 1.0f, 1.0f, 1.0f, 1.0f }; // 가장 선명한 반사 + m_Specular_Colors[ENUM_CLASS(DAY_PHASE::DUSK)] = { 0.8f, 0.6f, 0.4f, 1.0f }; // 석양 색이 입혀진 반사 + m_Specular_Colors[ENUM_CLASS(DAY_PHASE::NIGHT)] = { 0.3f, 0.3f, 0.5f, 1.0f }; + + if (nullptr == m_pGameTime) + return E_FAIL; + return S_OK; } void CMainLight::Priority_Update(_float fTimeDelta) { - + m_pGameTime->Update_GameTime(fTimeDelta); } void CMainLight::Update(_float fTimeDelta) { + _float fProgress = m_pGameTime->Get_DayTime() / SECONDS_PER_GAME_DAY; + _float fStartProgress = {}; + + if (0.25f > fProgress) + { + m_eCurPhase = DAY_PHASE::DAWN; + m_eNextPhase = DAY_PHASE::DAY; + fStartProgress = 0.f; + } + else if (0.25f <= fProgress && 0.5f > fProgress) + { + m_eCurPhase = DAY_PHASE::DAY; + m_eNextPhase = DAY_PHASE::DUSK; + fStartProgress = 0.25f; + } + else if (0.5f <= fProgress && 0.75f > fProgress) + { + m_eCurPhase = DAY_PHASE::DUSK; + m_eNextPhase = DAY_PHASE::NIGHT; + fStartProgress = 0.5f; + } + else if (0.75f <= fProgress) + { + m_eCurPhase = DAY_PHASE::NIGHT; + m_eNextPhase = DAY_PHASE::DAWN; + fStartProgress = 0.75f; + } + _float fRatio = (fProgress - fStartProgress) / 0.25f; + + XMStoreFloat4(&m_vCurDiffuse, XMVectorLerp( + XMLoadFloat4(&m_Diffuse_Colors[ENUM_CLASS(m_eCurPhase)]), + XMLoadFloat4(&m_Diffuse_Colors[ENUM_CLASS(m_eNextPhase)]), fRatio)); + + XMStoreFloat4(&m_vAmbient, XMVectorLerp( + XMLoadFloat4(&m_Ambient_Colors[ENUM_CLASS(m_eCurPhase)]), + XMLoadFloat4(&m_Ambient_Colors[ENUM_CLASS(m_eNextPhase)]), fRatio)); + + XMStoreFloat4(&m_vSpecular, XMVectorLerp( + XMLoadFloat4(&m_Specular_Colors[ENUM_CLASS(m_eCurPhase)]), + XMLoadFloat4(&m_Specular_Colors[ENUM_CLASS(m_eNextPhase)]), fRatio)); + + m_pLightCom->Set_Color(m_vCurDiffuse, m_vAmbient, m_vSpecular); + + //m_pLightCom->Describe_Entity(); } void CMainLight::Late_Update(_float fTimeDelta) @@ -116,7 +184,8 @@ void CMainLight::Free() { __super::Free(); - Safe_Release(m_pLightCom); + SAFE_RELEASE(m_pLightCom); + SAFE_RELEASE(m_pGameTime); } void CMainLight::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/MapElement_Light.cpp b/Jusin154_Team3D/Editor/Private/MapElement_Light.cpp new file mode 100644 index 000000000..504db6bd8 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/MapElement_Light.cpp @@ -0,0 +1,263 @@ +#include "pch.h" +#include "MapElement_Light.h" + +#include "GameInstance.h" + +#include "Terrain.h" +#include "Layer.h" +#include "VIBuffer_Terrain.h" + +CMapElement_Light::CMapElement_Light(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CMapElement{ pDevice, pContext } +{ +} + +CMapElement_Light::CMapElement_Light(const CMapElement_Light& rhs) + : CMapElement(rhs) +{ +} + +HRESULT CMapElement_Light::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMapElement_Light::Initialize(void* pArg) +{ + MAPOBJECT_LOD_DESC* pDesc = static_cast(pArg); + + m_iMaxLodLevel = pDesc->iMaxLodLevel; + + for (_uint i = 0; i < m_iMaxLodLevel + 1; i++) + { + m_ModelPrototypeTags.push_back(pDesc->ModelPrototypeTags[i]); + //m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[i]); + } + + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + +#ifdef _DEBUG + m_bSelected = false; + m_vPosition = pDesc->vPosition; + m_vScale = pDesc->vScale; + m_vRotation = pDesc->vRotation; + + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); + m_pTransformCom->Set_Scale(m_vScale); + m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); +#endif // _DEBUG + + return S_OK; +} + +void CMapElement_Light::Priority_Update(_float fTimeDelta) +{ +#ifdef _DEBUG + m_bSelected = false; +#endif +} + +void CMapElement_Light::Update(_float fTimeDelta) +{ + m_pLightCom->Describe_Entity(); +} + +void CMapElement_Light::Late_Update(_float fTimeDelta) +{ +#ifdef _DEBUG + if (m_bSelected) + { + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); + m_pTransformCom->Set_Scale(m_vScale); + m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); + } +#endif + + if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + } +} + +HRESULT CMapElement_Light::Render() +{ + if (FAILED(Bind_ShaderResources())) + return E_FAIL; + + _uint iNumMeshes = m_pModelComs[m_iLodIndex]->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelComs[0]->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + if (m_bSelected) + { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::MAPTOOL)))) { + return E_FAIL; + } + } + else + { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + return E_FAIL; + } + } + + if (FAILED(m_pModelComs[m_iLodIndex]->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CMapElement_Light::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + for (_uint i = 0; i < m_iMaxLodLevel + 1; ++i) + { + CModel* pModel = { nullptr }; + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_ModelPrototypeTags[i], + reinterpret_cast(&pModel)))) + return E_FAIL; + + m_pModelComs.push_back(pModel); + } + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + LIGHT_DESC LightDesc{}; + + LightDesc.eType = LIGHT::POINT; + LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); + LightDesc.vAmbient = _float4(0.8f, 0.8f, 0.8f, 0.f); + LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); + LightDesc.fRange = 5.f; + LightDesc.iLevel = NEXT_LEVEL; + + /* Com_Light*/ + if (FAILED(Add_Component(g_iStaticLevel, &m_pLightCom, &LightDesc))) + { + return E_FAIL; + } + + + + return S_OK; +} + +HRESULT CMapElement_Light::Bind_ShaderResources() +{ + if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + 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; + } + + return S_OK; +} + +CMapElement_Light* CMapElement_Light::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMapElement_Light* pInstance = new CMapElement_Light(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMapElement_Light"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CMapElement_Light::Clone(void* pArg, CGameObject* pOwner) +{ + CMapElement_Light* pInstance = new CMapElement_Light(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMapElement_Light"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMapElement_Light::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pLightCom); + + SAFE_RELEASE(m_pShaderCom); + for (auto& pModel : m_pModelComs) + SAFE_RELEASE(pModel); +} + +void CMapElement_Light::Describe_Entity() +{ + if (m_bDead) + return; + if (nullptr == m_pGameInstance) + return; + + GUI::Text(CMyTools::ToString(m_ModelPrototypeTags[m_iLodIndex]).c_str()); + GUI::InputInt("Lod Level", (_int*)(&m_iLodIndex)); + m_iLodIndex = max(0, m_iLodIndex); + m_iLodIndex = min(m_iMaxLodLevel, m_iLodIndex); + GUI::Text("----- Transfrom ----"); + GUI::InputFloat("X##Position", &m_vPosition.x, 0.1f, 1.f); + GUI::InputFloat("Y##Position", &m_vPosition.y, 0.1f, 1.f); + GUI::InputFloat("Z##Position", &m_vPosition.z, 0.1f, 1.f); + + if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT)) + { + CTerrain* pTerrain = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Terrain"))->Get_Object(); + if (nullptr != pTerrain) + { + pTerrain->Get_Component()->Picking(pTerrain->Get_Component()->Get_XMWorldMatrix(), &m_vPosition); + } + + } + + GUI::Text("----- Rotation ----"); + GUI::InputFloat("X##Rotation", &m_vRotation.x, 10.f, 45.f); + GUI::InputFloat("Y##Rotation", &m_vRotation.y, 10.f, 45.f); + GUI::InputFloat("Z##Rotation", &m_vRotation.z, 10.f, 45.f); + + GUI::Text("----- Scale ----"); + GUI::InputFloat("X##Scale", &m_vScale.x, 0.1f, 1.f); + GUI::InputFloat("Y##Scale", &m_vScale.y, 0.1f, 1.f); + GUI::InputFloat("Z##Scale", &m_vScale.z, 0.1f, 1.f); + + m_vScale.x = max(0.01f, m_vScale.x); + m_vScale.y = max(0.01f, m_vScale.y); + m_vScale.z = max(0.01f, m_vScale.z); + + if (GUI::Button("Delete")) + m_bDead = true; + + + + m_bSelected = true; +} diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp index 9b53b0049..476220b99 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp @@ -10,6 +10,7 @@ #include "BuildingContainer.h" #include "MapElement_Static.h" #include "MapElement_Interactable.h" +#include "MapElement_Light.h" CMapObject_Manager::CMapObject_Manager(ID3D11Device * pDevice, ID3D11DeviceContext * pContext) @@ -28,7 +29,7 @@ CMapObject_Manager::CMapObject_Manager(const CMapObject_Manager& rhs) HRESULT CMapObject_Manager::Initialize_Prototype(vector<_wstring>& ModelPrototypeTags, vector& ModelPrototypePaths) { - /*for (_uint i = 0 ; i < ModelPrototypeTags.size(); ++i) + for (_uint i = 0 ; i < ModelPrototypeTags.size(); ++i) { if (_wstring::npos != ModelPrototypeTags[i].find(L"Lod")) { @@ -41,7 +42,7 @@ HRESULT CMapObject_Manager::Initialize_Prototype(vector<_wstring>& ModelPrototyp m_ModelPrototypeTags.push_back(ModelPrototypeTags[i]); m_ModelPrototypePaths.push_back(ModelPrototypePaths[i]); - }*/ + } return S_OK; } @@ -75,11 +76,12 @@ void CMapObject_Manager::Priority_Update(_float fTimeDelta) void CMapObject_Manager::Update(_float fTimeDelta) { GUI::Begin("File"); - const char* ModeNames[3] = + const char* ModeNames[4] = { "CONTAINER", "ELEMENT_STATIC", - "ELEMENT_INTERACT" + "ELEMENT_INTERACT", + "ELEMENT_LIGHT" }; GUI::Combo("MODE", (_int*)(&m_eType), ModeNames, IM_ARRAYSIZE(ModeNames)); GUI::Checkbox("Model View", &m_bModelVisable); @@ -1156,23 +1158,10 @@ void CMapObject_Manager::Update_PrototypeList() if (ImGui::Button(CMyTools::ToString(Tag).c_str())) { - switch (m_eType) - { - case Editor::CMapObject_Manager::ADD_TYPE::CONTAINER: + if (ADD_TYPE::CONTAINER == m_eType) Create_PartObject(Tag); - break; - - case Editor::CMapObject_Manager::ADD_TYPE::ELEMENT_STATIC: - Create_Elemnt_Static(Tag); - break; - - case Editor::CMapObject_Manager::ADD_TYPE::ELEMENT_INTERACT: - Create_Elemnt_Interact(Tag); - break; - default: - break; - } - + else + Create_Elemnt(Tag); } } GUI::End(); @@ -1291,6 +1280,8 @@ void CMapObject_Manager::Update_ObjectList() pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Element_Static")); else if (ADD_TYPE::ELEMENT_INTERACT == m_eType) pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Element_Interact")); + else if (ADD_TYPE::ELEMENT_LIGHT == m_eType) + pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Element_Light")); if (nullptr == pLayer) { @@ -1440,13 +1431,12 @@ void CMapObject_Manager::Create_PartObject(_wstring& strPrototypeTag) m_MapObjects.push_back(pMapObject); } -void CMapObject_Manager::Create_Elemnt_Static(_wstring& strPrototypeTag) +void CMapObject_Manager::Create_Elemnt(_wstring& strPrototypeTag) { - vector<_uint> LodModelIndices; - MAPOBJECT_LOD_DESC Desc = {}; vector<_wstring> PrototypeTags; + vector<_uint> LodModelIndices; Find_Lod_Prototype(strPrototypeTag, LodModelIndices); @@ -1466,42 +1456,19 @@ void CMapObject_Manager::Create_Elemnt_Static(_wstring& strPrototypeTag) Desc.vScale = _float3(1.f, 1.f, 1.f); Desc.pModelPathIndices = &LodModelIndices; - CMapElement_Static* pMapObject = { nullptr }; - const string strKey = CMyTools::ToString(strPrototypeTag); - - m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Static"), &Desc); -} - -void CMapObject_Manager::Create_Elemnt_Interact(_wstring& strPrototypeTag) -{ - vector<_uint> LodModelIndices; - - MAPOBJECT_LOD_DESC Desc = {}; - - vector<_wstring> PrototypeTags; - - Find_Lod_Prototype(strPrototypeTag, LodModelIndices); - - PrototypeTags.push_back(strPrototypeTag); - - for (_uint i = 0; i < LodModelIndices.size(); ++i) + if (ADD_TYPE::ELEMENT_STATIC == m_eType) { - _wstring strLodTag = strPrototypeTag + L"_Lod" + to_wstring(i + 1); - PrototypeTags.push_back(strLodTag); + m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Static"), &Desc); } - - Desc.iMaxLodLevel = (_uint)LodModelIndices.size() - 1; - Desc.ModelPrototypeTags = PrototypeTags; - Desc.pParentTransform = m_pTransformCom; - Desc.vPosition = _float3(0.f, 0.f, 0.f); - Desc.vRotation = _float3(0.f, 0.f, 0.f); - Desc.vScale = _float3(1.f, 1.f, 1.f); - Desc.pModelPathIndices = &LodModelIndices; - - CMapElement_Interactable* pMapObject = { nullptr }; - const string strKey = CMyTools::ToString(strPrototypeTag); - - m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Interact"), &Desc); + else if (ADD_TYPE::ELEMENT_INTERACT == m_eType) + { + m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Interact"), &Desc); + } + else if (ADD_TYPE::ELEMENT_LIGHT == m_eType) + { + m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Light"), &Desc); + } + } _bool CMapObject_Manager::Find_Lod_Prototype(_wstring strPrototypeTag, vector<_uint>& LodModelIndices) @@ -1566,6 +1533,11 @@ void CMapObject_Manager::Free() { __super::Free(); + m_ModelPrototypeTags.clear(); + m_PartObjectKeyCount.clear(); + m_LODModelPrototypeTags.clear(); + m_ModelPrototypePaths.clear(); + for (auto& pObject : m_MapObjects) { SAFE_RELEASE(pObject); diff --git a/Jusin154_Team3D/Editor/Private/Slot_Number.cpp b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp index 3099589bb..11ddde33b 100644 --- a/Jusin154_Team3D/Editor/Private/Slot_Number.cpp +++ b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp @@ -210,17 +210,13 @@ HRESULT CSlot_Number::Ready_Components(void* pArg) void CSlot_Number::UV() { - pUVDesc[0].fUVStart = Meter_Index(1); - pUVDesc[0].fUVEnd = Compute_UVY(1); - pUVDesc[1].fUVStart = Meter_Index(2); - pUVDesc[1].fUVEnd = Compute_UVY(2); - pUVDesc[2].fUVStart = Meter_Index(3); - pUVDesc[2].fUVEnd = Compute_UVY(3); - pUVDesc[3].fUVStart = Meter_Index(4); - pUVDesc[3].fUVEnd = Compute_UVY(4); + pUVDesc[0].fUV = Meter_Index(1); + pUVDesc[1].fUV = Meter_Index(2); + pUVDesc[2].fUV = Meter_Index(3); + pUVDesc[3].fUV = Meter_Index(4); } -_float2 CSlot_Number::Meter_Index(_uint Number) +_float4 CSlot_Number::Meter_Index(_uint Number) { m_fIamge_Size = { 320.f, 128.f }; @@ -233,28 +229,13 @@ _float2 CSlot_Number::Meter_Index(_uint Number) _uint frameX = Number % iXCount; _uint frameY = Number / iXCount; - _float2 UVStart; - UVStart.x = frameX * frameWidth / m_fIamge_Size.x; - UVStart.y = frameY * frameHeight / m_fIamge_Size.y; + _float4 UV; + UV.x = frameX * frameWidth / m_fIamge_Size.x; + UV.y = frameY * frameHeight / m_fIamge_Size.y; + UV.z = UV.x + (frameWidth / m_fIamge_Size.x); + UV.w = UV.y + (frameHeight / m_fIamge_Size.y); - return UVStart; -} - -_float2 CSlot_Number::Compute_UVY(_uint Number) -{ - m_fIamge_Size = { 320.f, 128.f }; - - _float frameWidth = 64.f; - _float frameHeight = 64.f; - - // Start 구함 - _float2 UVStart = Meter_Index(Number); - - _float2 UVEnd; - UVEnd.x = UVStart.x + (frameWidth / m_fIamge_Size.x); - UVEnd.y = UVStart.y + (frameHeight / m_fIamge_Size.y); - - return UVEnd; + return UV; } CSlot_Number* CSlot_Number::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) diff --git a/Jusin154_Team3D/Editor/Private/Spell_Header.cpp b/Jusin154_Team3D/Editor/Private/Spell_Header.cpp new file mode 100644 index 000000000..284be9ad9 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Header.cpp @@ -0,0 +1,221 @@ +#include "pch.h" +#include "Spell_Header.h" +#include "GameInstance.h" + +CSpell_Header::CSpell_Header(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Header::CSpell_Header(const CSpell_Header& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Header::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Header::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = -20.f; + Desc.fSizeX = 512.f; + Desc.fSizeY = 64.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.f; + m_fMoveSpeed = 5.f; + m_fLerpX = m_fX; + m_fLerpY = 45; + return S_OK; +} + +void CSpell_Header::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Header::Update(_float fTimeDelta) +{ + 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_Header::Late_Update(_float fTimeDelta) +{ + if (m_bVisible) { + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpell_Header::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_HEADER)))) { + 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_Header::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Header::MoveY(_float fY) +{ + m_fY += fY; +} + +HRESULT CSpell_Header::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Header::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_LighthouseHeaderBack"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Header* CSpell_Header::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Header* pInstance = new CSpell_Header(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Header::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Header* pInstance = new CSpell_Header(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Header::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Header::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp b/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp new file mode 100644 index 000000000..dbd3bdaf5 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp @@ -0,0 +1,214 @@ +#include "pch.h" +#include "Spell_Header_Line.h" +#include "GameInstance.h" + +CSpell_Header_Line::CSpell_Header_Line(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Header_Line::CSpell_Header_Line(const CSpell_Header_Line& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Header_Line::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Header_Line::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 20.f; + Desc.fSizeX = 487.f; + Desc.fSizeY = 18.f; + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.f; + m_fMoveSpeed = 5.f; + return S_OK; +} + +void CSpell_Header_Line::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Header_Line::Update(_float fTimeDelta) +{ + 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_Header_Line::Late_Update(_float fTimeDelta) +{ + if (m_bVisible) { + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpell_Header_Line::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) { + 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_Header_Line::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Header_Line::MoveY(_float fY) +{ + m_fY += fY; +} + +HRESULT CSpell_Header_Line::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Header_Line::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_Header_Line"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Header_Line* CSpell_Header_Line::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Header_Line* pInstance = new CSpell_Header_Line(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Header_Line"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Header_Line::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Header_Line* pInstance = new CSpell_Header_Line(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Header_Line::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Header_Line::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp new file mode 100644 index 000000000..86a4e1685 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp @@ -0,0 +1,313 @@ +#include "pch.h" +#include "Spell_Hover.h" +#include "GameInstance.h" + +CSpell_Hover::CSpell_Hover(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Hover::CSpell_Hover(const CSpell_Hover& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Hover::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Hover::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.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 = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + return S_OK; +} + +void CSpell_Hover::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Hover::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; + } + } + Hover(); + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Hover::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_Hover::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::SPELL_HOVER)))) + { + 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_Hover::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Hover::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_Hover::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_Hover::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_Hover::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY* 0.5f)); + + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_pVIBufferCom->Set_Mouse_Hover(fMouse); + +} + +HRESULT CSpell_Hover::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_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_Hover::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_IconButtonOutline"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_IconButtonHighlight"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_GoldLeaf"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_Goldleaf_Large"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_IconButton"), reinterpret_cast(&m_pDiffuse_TextureCom4), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SelectedPresetBorder"), reinterpret_cast(&m_pDiffuse_TextureCom5), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Hover* CSpell_Hover::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Hover* pInstance = new CSpell_Hover(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Hover"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Hover::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Hover* pInstance = new CSpell_Hover(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Hover"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Hover::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 CSpell_Hover::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp new file mode 100644 index 000000000..f336f09d1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp @@ -0,0 +1,279 @@ +#include "pch.h" +#include "Spell_Hover_Effect.h" +#include "GameInstance.h" + +CSpell_Hover_Effect::CSpell_Hover_Effect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Hover_Effect::CSpell_Hover_Effect(const CSpell_Hover_Effect& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Hover_Effect::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Hover_Effect::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.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 = 1.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + m_fSortZ = 0.02f; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + return S_OK; +} + +void CSpell_Hover_Effect::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Hover_Effect::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; + } + } + Hover(); + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Hover_Effect::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_Hover_Effect::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::SPELL_SLOT_EFFECT)))) + { + 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_Hover_Effect::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Hover_Effect::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_Hover_Effect::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_Hover_Effect::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_Hover_Effect::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_pVIBufferCom->Set_Mouse_Hover(fMouse); + +} + +HRESULT CSpell_Hover_Effect::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_MaskTexture", 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_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_Hover_Effect::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SelectedBorderMask"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_VFX_T_WhispLine_D"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Hover_Effect* CSpell_Hover_Effect::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Hover_Effect* pInstance = new CSpell_Hover_Effect(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Hover_Effect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Hover_Effect::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Hover_Effect* pInstance = new CSpell_Hover_Effect(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Hover_Effect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Hover_Effect::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Hover_Effect::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_List.cpp b/Jusin154_Team3D/Editor/Private/Spell_List.cpp new file mode 100644 index 000000000..2f93ffc37 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_List.cpp @@ -0,0 +1,286 @@ +#include "pch.h" +#include "Spell_List.h" +#include "GameInstance.h" + +CSpell_List::CSpell_List(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_List::CSpell_List(const CSpell_List& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_List::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_List::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.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 = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + Color(); + return S_OK; +} + +void CSpell_List::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_List::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; + Hover(); + __super::Update(fTimeDelta); +} + +void CSpell_List::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_List::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::COLOR)))) + { + 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_List::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_List::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_List::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_List::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_List::Color() +{ + m_pVIBufferCom->Set_Index_Renge_Color(0, 3, _float4(255.f / 255.f, 255.f / 255.f, 0.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(4, 7, _float4(150.f / 255.f, 120.f / 255.f, 240.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(8, 12, _float4(190.f / 255.f, 46.f / 255.f, 34.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(13, 16, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(17, 19, _float4(200.f / 255.f, 220.f / 255.f, 150.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(20, 22, _float4(50.f / 255.f, 150.f / 255.f, 110.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(23, 25, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); +} + +void CSpell_List::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_pVIBufferCom->Set_Mouse_Hover(fMouse); + +} + +HRESULT CSpell_List::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_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_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpell_List::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SpellType_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_List* CSpell_List::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_List* pInstance = new CSpell_List(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_List"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_List::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_List* pInstance = new CSpell_List(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_List"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_List::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_List::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_List_Image.cpp b/Jusin154_Team3D/Editor/Private/Spell_List_Image.cpp new file mode 100644 index 000000000..b263f0576 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_List_Image.cpp @@ -0,0 +1,286 @@ +#include "pch.h" +#include "Spell_List_Image.h" +#include "GameInstance.h" + +CSpell_List_Image::CSpell_List_Image(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_List_Image::CSpell_List_Image(const CSpell_List_Image& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_List_Image::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_List_Image::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeY = 90.f; + Desc.fSizeX = 90.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 = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + UV(); + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(pUVDesc); + return S_OK; +} + +void CSpell_List_Image::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_List_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_List_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_List_Image::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::EESSENTIAL_SPELL)))) + { + 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_List_Image::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_List_Image::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_List_Image::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_List_Image::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_List_Image::UV() +{ + for (_uint i = 0; i < 26; ++i) + { + pUVDesc[i].fUV = Meter_Index(i); + } +} + +_float4 CSpell_List_Image::Meter_Index(_uint Number) +{ + _float2 fImage_Size = { 1024.f, 1792.f }; + + _uint iCountX = 4; + _uint iCountY = 7; + + _float iImageX = 256.f; + _float iImageY = 256.f; + + _uint iframeX = Number % iCountX; + _uint iframeY = Number / 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 }; + return UV; +} + +HRESULT CSpell_List_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_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), 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_List_Image::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List_Image"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Widget_Spell"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_List_Image* CSpell_List_Image::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_List_Image* pInstance = new CSpell_List_Image(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_List_Image"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_List_Image::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_List_Image* pInstance = new CSpell_List_Image(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_List_Image"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_List_Image::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_List_Image::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp index 0b657c26f..566519b20 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp @@ -48,7 +48,7 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) m_vUVScale.y = 1.f; m_fCoolTime = 5.f; m_fSortZ = 1.f; - m_iSkillType = ENUM_CLASS(SKILLTYPE::CONTROL); + m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); Compute_UI(5); return S_OK; } @@ -154,7 +154,7 @@ HRESULT CSpell_Overlay::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELLTYPE)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::TYPE)))) { return E_FAIL; } @@ -225,7 +225,7 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSkillType, sizeof(_float)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp index 40ad30251..7a9613978 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp @@ -2,6 +2,15 @@ #include "Spell_Panel.h" #include "GameInstance.h" #include "Current_Spell_Slot.h" +#include "Spell_List.h" +#include "Eessential_Spell_Slot.h" +#include "Eessential_Spell.h" +#include "Spell_List_Image.h" +#include "Spell_State.h" +#include "Spell_Hover.h" +#include "Spell_Hover_Effect.h" +#include "Spell_Preview.h" +#include "Spell_Vidio_Border.h" CSpell_Panel::CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -161,6 +170,60 @@ HRESULT CSpell_Panel::Ready_Element(void* pArg) } Add_Element(TEXT("Current_Spell_Slot"), m_pCurrent_Spell_Slot); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_List)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_List"), m_pSpell_List); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pEessential_Spell_Slot)))) + { + return E_FAIL; + } + Add_Element(TEXT("Eessential_Spell_Slot"), m_pEessential_Spell_Slot); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pEessential_Spell)))) + { + return E_FAIL; + } + Add_Element(TEXT("Eessential_Spell"), m_pEessential_Spell); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_List_Image)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_List_Image"), m_pSpell_List_Image); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_State)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_State"), m_pSpell_State); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Hover)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Hover"), m_pSpell_Hover); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Hover_Effect)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Hover_Effect"), m_pSpell_Hover_Effect); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Preview)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Preview"), m_pSpell_Preview); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Vidio_Border)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Vidio_Border"), m_pSpell_Vidio_Border); + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp b/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp new file mode 100644 index 000000000..3d187563a --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp @@ -0,0 +1,296 @@ +#include "pch.h" +#include "Spell_Preview.h" +#include "GameInstance.h" +#include "Spell_Header.h" +#include "Spell_Header_Line.h" + +CSpell_Preview::CSpell_Preview(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Preview::CSpell_Preview(const CSpell_Preview& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Preview::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Preview::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 400.f; + Desc.fY = -365.f; + Desc.fSizeX = 128.f; + Desc.fSizeY = 128.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; + } + // y값 최소 270 최대 410 + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.f; + m_vNine_Slice = _float4(50.f, 75.f, 30.f, 96.f); + m_fTopY = m_fY - m_vScale.y * 0.5f; + SizeUpX(512.f); + SizeUpY(270.f); + m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); + return S_OK; +} + +void CSpell_Preview::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Preview::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; + } + } + static_cast(m_pSpell_Header)->Set_SkillType(ENUM_CLASS(m_iSpellType)); + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Preview::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_Preview::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_PREVIEW)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + m_pSpell_Header->Render(); + m_pSpell_Header_Line->Render(); + return S_OK; +} + +_vector CSpell_Preview::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Preview::SizeUpX(_float fSizeX) +{ + _float fX = (fSizeX - m_vScale.x) * 0.5f; + m_fSizeX = fSizeX; + m_fX += fX; + m_fLerpX += fX; + +} + +void CSpell_Preview::SizeUpY(_float fSizeY) +{ + _float prevY = m_fY; + m_fSizeY = fSizeY; + m_fY = m_fTopY + fSizeY * 0.5f; + + _float deltaY = m_fY - prevY; + + static_cast(m_pSpell_Header_Line)->MoveY(-deltaY); + static_cast(m_pSpell_Header)->MoveY(-deltaY); +} + +HRESULT CSpell_Preview::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_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fNine_Slice", &m_vNine_Slice, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_fOrigin_Size, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageSipos1", &m_vHeaderBack, sizeof(_float4)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Preview::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_SpellWidgetPanelBack"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_Goldleaf_Large"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_TooltipBorder_4K"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_LighthouseHeaderBack"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header_Line)))) + { + return E_FAIL; + } + return S_OK; +} + +CSpell_Preview* CSpell_Preview::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Preview* pInstance = new CSpell_Preview(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Preview"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Preview::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Preview* pInstance = new CSpell_Preview(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Preview"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Preview::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); +} + +void CSpell_Preview::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp index ebe541b3d..3e7fb4cfe 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp @@ -39,7 +39,7 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_fAlpha = 1.f; m_fTimeMult = 3.f; - m_fAngle = XMConvertToRadians(45); + m_fAngle = XMConvertToRadians(-135); m_fAlphaTime = 1.f; m_fOffSetX = 101.f; m_fOffSetY = 101.f; @@ -47,7 +47,6 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(380.f, -30.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp b/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp index 2a4986416..979927f06 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp @@ -44,7 +44,6 @@ HRESULT CSpell_Slot_Preview::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); //m_pVIBufferCom->Set_Pos(0.f, 0.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_State.cpp b/Jusin154_Team3D/Editor/Private/Spell_State.cpp new file mode 100644 index 000000000..44fdf495c --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_State.cpp @@ -0,0 +1,269 @@ +#include "pch.h" +#include "Spell_State.h" +#include "GameInstance.h" + +CSpell_State::CSpell_State(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_State::CSpell_State(const CSpell_State& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_State::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_State::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.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 = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + return S_OK; +} + +void CSpell_State::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_State::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; + Hover(); + __super::Update(fTimeDelta); +} + +void CSpell_State::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_State::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::ALPHABLEND)))) + { + 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_State::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_State::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_State::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_State::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_State::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_pVIBufferCom->Set_Mouse_Hover(fMouse); + +} + +HRESULT CSpell_State::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_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_State::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_NewLock"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_State* CSpell_State::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_State* pInstance = new CSpell_State(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_State"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_State::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_State* pInstance = new CSpell_State(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_State"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_State::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_State::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp new file mode 100644 index 000000000..094e65afd --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp @@ -0,0 +1,229 @@ +#include "pch.h" +#include "Spell_Vidio_Border.h" +#include "GameInstance.h" + +CSpell_Vidio_Border::CSpell_Vidio_Border(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Vidio_Border::CSpell_Vidio_Border(const CSpell_Vidio_Border& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Vidio_Border::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Vidio_Border::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 590.f; + Desc.fY = -100.f; + Desc.fSizeX = 520.f; + Desc.fSizeY = 275.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.f; + m_fMoveSpeed = 5.f; + m_fLerpX = m_fX; + m_fLerpY = 45; + return S_OK; +} + +void CSpell_Vidio_Border::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Vidio_Border::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_Vidio_Border::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_Vidio_Border::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + { + 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_Vidio_Border::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpell_Vidio_Border::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Vidio_Border::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_TalentVideoBorder"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Vidio_Border* CSpell_Vidio_Border::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Vidio_Border* pInstance = new CSpell_Vidio_Border(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Vidio_Border"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Vidio_Border::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Vidio_Border* pInstance = new CSpell_Vidio_Border(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Vidio_Border"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Vidio_Border::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Vidio_Border::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Terrain.cpp b/Jusin154_Team3D/Editor/Private/Terrain.cpp index bba59e573..9cb5a4222 100644 --- a/Jusin154_Team3D/Editor/Private/Terrain.cpp +++ b/Jusin154_Team3D/Editor/Private/Terrain.cpp @@ -138,7 +138,7 @@ HRESULT CTerrain::Render() } else { - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::DEFAULT)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::ENV_TERRAIN_ANISO)))) { return E_FAIL; } } @@ -191,6 +191,15 @@ HRESULT CTerrain::Ready_Components() HRESULT CTerrain::Bind_ShaderResources() { + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDiffuseMultiplier", &m_vDRN.x, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fSurfaceMultiplier", &m_vDRN.y, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fNormalMultiplier", &m_vDRN.z, sizeof(_float)))) { + return E_FAIL; + } if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index 0d4fa1520..e26924901 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -16,19 +16,21 @@ namespace Editor enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT, MAP, UI, EFFECT, PHYSX, BLOOM, END }; enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END }; enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT }; - enum class MAPOBJECT_RENDER_TYPE {NORMAL, DECAL, GLASS}; + enum class MAPOBJECT_RENDER_TYPE { NORMAL, DECAL, GLASS }; enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, HAIR, EYELASH, OUTLINE_WRITE, OUTLINE_READ, END }; enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END }; enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, OUTLINE_WRITE, OUTLINE_READ, END }; - enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END }; + enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, ENV_TERRAIN_ANISO, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; + enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR , TRAIL_BLOOM, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, BLOOM, END }; + enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, END }; + enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, 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 }; enum class SKILL_TYPE{ JAP , BOMBARD , DECENDO , PROTEGO , END }; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Macro.h b/Jusin154_Team3D/Editor/Public/Editor_Macro.h index 7d99927b5..4f18a9b2d 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Macro.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Macro.h @@ -58,6 +58,11 @@ namespace Editor { #define LAYER_MAPOBJECTMANAGER TEXT("Layer_MapObjectManager") +#pragma region TIME +#define SECONDS_PER_GAME_DAY 30.f +#pragma endregion + + #pragma endregion #pragma region MACRO_TEXTURE diff --git a/Jusin154_Team3D/Editor/Public/Eessential_Spell.h b/Jusin154_Team3D/Editor/Public/Eessential_Spell.h new file mode 100644 index 000000000..3a793d636 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Eessential_Spell.h @@ -0,0 +1,53 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CEessential_Spell final : public CElementObject +{ +private: + CEessential_Spell(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEessential_Spell(const CEessential_Spell& rhs); + virtual ~CEessential_Spell() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +public: + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + + void UV(); + _float4 Meter_Index(_uint Number); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + CVIBuffer_UI_Instance::UI_ATLAS_DESC pUVDesc[8]; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CEessential_Spell* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h new file mode 100644 index 000000000..7aadab096 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h @@ -0,0 +1,53 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CEessential_Spell_Slot final : public CElementObject +{ +private: + CEessential_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEessential_Spell_Slot(const CEessential_Spell_Slot& rhs); + virtual ~CEessential_Spell_Slot() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + + +private: + void Hover(); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CEessential_Spell_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/GameTime.h b/Jusin154_Team3D/Editor/Public/GameTime.h new file mode 100644 index 000000000..c152d526f --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/GameTime.h @@ -0,0 +1,39 @@ +#pragma once + +#include "Editor_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Editor) + +class CGameTime : public CBase +{ +private: + CGameTime(); + virtual ~CGameTime() = default; + +public: + _float Get_DayTime() const { return m_fDayTime; } + +public: + void Update_GameTime(_float fTiemDelta); + +private: + CGameInstance* m_pGameInstance = { nullptr }; + + _float m_PerDayTime = { 24.f }; + _float m_fGameTime = { 0.f }; + _float m_fDayTime = { 0.f }; + +private: + HRESULT Initialize(); + +public: + static CGameTime* Create(); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/IMGUIUI.h b/Jusin154_Team3D/Editor/Public/IMGUIUI.h index 3b8461faf..77f8ef5fe 100644 --- a/Jusin154_Team3D/Editor/Public/IMGUIUI.h +++ b/Jusin154_Team3D/Editor/Public/IMGUIUI.h @@ -48,7 +48,7 @@ class CIMGUIUI final : public CGameObject _float m_fAlpha{}; _float2 m_UV{}; - _int m_iSkillType{}; + _int m_iSpellType{}; _vector m_vLerpPosition{}; _float m_fLerpX{}; diff --git a/Jusin154_Team3D/Editor/Public/Magic_Item.h b/Jusin154_Team3D/Editor/Public/Magic_Item.h index 83cf77f0c..18df03ef7 100644 --- a/Jusin154_Team3D/Editor/Public/Magic_Item.h +++ b/Jusin154_Team3D/Editor/Public/Magic_Item.h @@ -35,6 +35,7 @@ class CMagic_Item final : public CElementObject CTexture* m_pDiffuse_TextureCom3 = { nullptr }; CTexture* m_pDiffuse_TextureCom4 = { nullptr }; CTexture* m_pDiffuse_TextureCom5 = { nullptr }; + CTexture* m_pDiffuse_TextureCom6 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; diff --git a/Jusin154_Team3D/Editor/Public/MainLight.h b/Jusin154_Team3D/Editor/Public/MainLight.h index 87a3e8dad..111f7be96 100644 --- a/Jusin154_Team3D/Editor/Public/MainLight.h +++ b/Jusin154_Team3D/Editor/Public/MainLight.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" @@ -11,6 +11,8 @@ NS_BEGIN(Editor) class CMainLight final : public CGameObject { +public: + enum class DAY_PHASE { DAWN, DAY, DUSK, NIGHT, END }; private: CMainLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -26,7 +28,19 @@ class CMainLight final : public CGameObject virtual HRESULT Render() override; private: - CLight* m_pLightCom = { nullptr }; + CLight* m_pLightCom = { nullptr }; + class CGameTime* m_pGameTime = { nullptr }; + _float4 m_vCurDiffuse = {}; + _float4 m_vAmbient = {}; + _float4 m_vSpecular = {}; + + DAY_PHASE m_eCurPhase = { DAY_PHASE::END}; + DAY_PHASE m_eNextPhase = { DAY_PHASE::END }; + + _float4 m_Diffuse_Colors[ENUM_CLASS(DAY_PHASE::END)] = {}; + _float4 m_Ambient_Colors[ENUM_CLASS(DAY_PHASE::END)] = {}; + _float4 m_Specular_Colors[ENUM_CLASS(DAY_PHASE::END)] = {}; + private: HRESULT Ready_Components(); @@ -39,4 +53,4 @@ class CMainLight final : public CGameObject virtual void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/MapElement.h b/Jusin154_Team3D/Editor/Public/MapElement.h index d88aa7df9..c903efc46 100644 --- a/Jusin154_Team3D/Editor/Public/MapElement.h +++ b/Jusin154_Team3D/Editor/Public/MapElement.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" @@ -43,7 +43,6 @@ class CMapElement abstract : public CGameObject _float3 m_vScale = {}; #endif // _DEBUG - protected: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; @@ -56,4 +55,4 @@ class CMapElement abstract : public CGameObject void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/MapElement_Light.h b/Jusin154_Team3D/Editor/Public/MapElement_Light.h new file mode 100644 index 000000000..89be70ebe --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/MapElement_Light.h @@ -0,0 +1,41 @@ +#pragma once + +#include "Editor_Define.h" +#include "MapElement.h" + +NS_BEGIN(Engine) +class CLight; +NS_END + +NS_BEGIN(Editor) + +class CMapElement_Light : public CMapElement +{ +private: + CMapElement_Light(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMapElement_Light(const CMapElement_Light& rhs); + virtual ~CMapElement_Light() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + CLight* m_pLightCom = { nullptr }; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Bind_ShaderResources() override; + +public: + static CMapElement_Light* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/MapObject_Manager.h b/Jusin154_Team3D/Editor/Public/MapObject_Manager.h index 05a238d2e..571f456d3 100644 --- a/Jusin154_Team3D/Editor/Public/MapObject_Manager.h +++ b/Jusin154_Team3D/Editor/Public/MapObject_Manager.h @@ -12,7 +12,7 @@ NS_BEGIN(Editor) class CMapObject_Manager final : public CGameObject { - enum class ADD_TYPE {CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT}; + enum class ADD_TYPE {CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT, ELEMENT_LIGHT }; private: CMapObject_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -68,8 +68,7 @@ class CMapObject_Manager final : public CGameObject void Update_ContainerObject(); void Create_PartObject(_wstring& strPrototypeTag); - void Create_Elemnt_Static(_wstring& strPrototypeTag); - void Create_Elemnt_Interact(_wstring& strPrototypeTag); + void Create_Elemnt(_wstring& strPrototypeTag); _bool Find_Lod_Prototype(_wstring strPrototypeTag, vector<_uint>& LodModelIndices); _uint Get_KeyCount(_wstring strPrototypeTag); diff --git a/Jusin154_Team3D/Editor/Public/Slot_Number.h b/Jusin154_Team3D/Editor/Public/Slot_Number.h index 340b9b872..a419eee42 100644 --- a/Jusin154_Team3D/Editor/Public/Slot_Number.h +++ b/Jusin154_Team3D/Editor/Public/Slot_Number.h @@ -27,8 +27,7 @@ class CSlot_Number final : public CElementObject virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; void UV(); - _float2 Meter_Index(_uint Numver); - _float2 Compute_UVY(_uint Numver); + _float4 Meter_Index(_uint Numver); virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Header.h b/Jusin154_Team3D/Editor/Public/Spell_Header.h new file mode 100644 index 000000000..41fb41913 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Header.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Header final : public CElementObject +{ +private: + CSpell_Header(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Header(const CSpell_Header& rhs); + virtual ~CSpell_Header() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual void MoveY(_float fY) override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpell_Header* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h b/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h new file mode 100644 index 000000000..d8062f7ec --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Header_Line final : public CElementObject +{ +private: + CSpell_Header_Line(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Header_Line(const CSpell_Header_Line& rhs); + virtual ~CSpell_Header_Line() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual void MoveY(_float fY) override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpell_Header_Line* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Hover.h b/Jusin154_Team3D/Editor/Public/Spell_Hover.h new file mode 100644 index 000000000..496588411 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover.h @@ -0,0 +1,60 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_Hover final : public CElementObject +{ +private: + CSpell_Hover(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Hover(const CSpell_Hover& rhs); + virtual ~CSpell_Hover() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + +private: + void Hover(); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + 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_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_Hover* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h new file mode 100644 index 000000000..433d74719 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h @@ -0,0 +1,56 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_Hover_Effect final : public CElementObject +{ +private: + CSpell_Hover_Effect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Hover_Effect(const CSpell_Hover_Effect& rhs); + virtual ~CSpell_Hover_Effect() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + +private: + void Hover(); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_Hover_Effect* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_List.h b/Jusin154_Team3D/Editor/Public/Spell_List.h new file mode 100644 index 000000000..e4a085e4b --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_List.h @@ -0,0 +1,57 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_List final : public CElementObject +{ +private: + CSpell_List(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_List(const CSpell_List& rhs); + virtual ~CSpell_List() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + +private: + void Color(); + void Hover(); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_List* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_List_Image.h b/Jusin154_Team3D/Editor/Public/Spell_List_Image.h new file mode 100644 index 000000000..2a8a3ba0b --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_List_Image.h @@ -0,0 +1,57 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_List_Image final : public CElementObject +{ +private: + CSpell_List_Image(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_List_Image(const CSpell_List_Image& rhs); + virtual ~CSpell_List_Image() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +public: + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + + void UV(); + _float4 Meter_Index(_uint Number); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + CVIBuffer_UI_Instance::UI_ATLAS_DESC pUVDesc[26]; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_List_Image* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Panel.h b/Jusin154_Team3D/Editor/Public/Spell_Panel.h index 4d7ebe882..fc3e3dcc6 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Panel.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Panel.h @@ -36,6 +36,15 @@ class CSpell_Panel final : public CPanelObject CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pCurrent_Spell_Slot = { nullptr }; + CGameObject* m_pSpell_List = { nullptr }; + CGameObject* m_pEessential_Spell_Slot = { nullptr }; + CGameObject* m_pEessential_Spell = { nullptr }; + CGameObject* m_pSpell_List_Image = { nullptr }; + CGameObject* m_pSpell_State = { nullptr }; + CGameObject* m_pSpell_Hover = { nullptr }; + CGameObject* m_pSpell_Hover_Effect = { nullptr }; + CGameObject* m_pSpell_Preview = { nullptr }; + CGameObject* m_pSpell_Vidio_Border = { nullptr }; public: static CSpell_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Public/Spell_Preview.h b/Jusin154_Team3D/Editor/Public/Spell_Preview.h new file mode 100644 index 000000000..6f3dcd134 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Preview.h @@ -0,0 +1,51 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Preview final : public CElementObject +{ +private: + CSpell_Preview(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Preview(const CSpell_Preview& rhs); + virtual ~CSpell_Preview() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + CGameObject* m_pSpell_Header = { nullptr }; + CGameObject* m_pSpell_Header_Line = { nullptr }; + + _float4 m_vHeaderBack{}; + +public: + static CSpell_Preview* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_State.h b/Jusin154_Team3D/Editor/Public/Spell_State.h new file mode 100644 index 000000000..ae6d7a509 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_State.h @@ -0,0 +1,55 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_State final : public CElementObject +{ +private: + CSpell_State(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_State(const CSpell_State& rhs); + virtual ~CSpell_State() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + +private: + void Hover(); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_State* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h new file mode 100644 index 000000000..d447cc059 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h @@ -0,0 +1,40 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Vidio_Border final : public CElementObject +{ +private: + CSpell_Vidio_Border(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Vidio_Border(const CSpell_Vidio_Border& rhs); + virtual ~CSpell_Vidio_Border() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpell_Vidio_Border* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Terrain.h b/Jusin154_Team3D/Editor/Public/Terrain.h index b1ca26178..bf82379b1 100644 --- a/Jusin154_Team3D/Editor/Public/Terrain.h +++ b/Jusin154_Team3D/Editor/Public/Terrain.h @@ -43,6 +43,9 @@ class CTerrain final : public CGameObject _uint m_iTextureIndex = {}; + _float3 m_vDRN = { (1.f / 16.f), (1.f / 16.f), (1.f / 16.f) }; + + class CAlphaMap* m_pAlphaMap = { nullptr }; _uint m_iMaskRange = {1}; _int m_iColorIndex = {0}; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli index 7b7ec1a3b..fc1fa297c 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli @@ -7,6 +7,18 @@ sampler DefaultSampler = sampler_state AddressU = wrap; AddressV = wrap; }; +sampler AnisoTropy_BLUR_Sampler = sampler_state // 밉맵이 있어야 의미가 있음 +{ + Filter = AnisoTropic; + MaxAnisotropy = 16; + AddressU = wrap; + AddressV = wrap; + AddressW = wrap; + MipLodBias = 0.5f; // 밉맵 레벨 +1시켜서 의도적으로 뭉갬 + MinLOD = 0; + MaxLOD = 0xFFFFFFFF; + ComparisonFunc = ALWAYS; +}; sampler ClampSampler = sampler_state { 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 e327a741b..916fcb483 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli @@ -85,7 +85,7 @@ DepthStencilState DSS_Effect StencilEnable = false; }; -DepthStencilState DSS_Default_OutLine_Write +DepthStencilState DSS_Default_Environment_SWrite { DepthEnable = true; DepthWriteMask = true; @@ -105,8 +105,49 @@ DepthStencilState DSS_Default_OutLine_Write BackFaceStencilPass = Replace; BackFaceStencilFunc = Always; }; +DepthStencilState DSS_Default_Environment_SRead +{ + DepthEnable = true; + DepthWriteMask = false; + DepthFunc = less_equal; -DepthStencilState DSS_Default_OutLine_Read + StencilEnable = true; + StencilReadMask = 0xff; // <-- ff -> 1111 1111 씀 + StencilWriteMask = 0x00; // <-- 00 -> 0000 0000 안씀 + + FrontFaceStencilFail = Keep; + FrontFaceStencilDepthFail = Keep; + FrontFaceStencilPass = Keep; + FrontFaceStencilFunc = Equal; + + BackFaceStencilFail = Keep; + BackFaceStencilDepthFail = Keep; + BackFaceStencilPass = Keep; + BackFaceStencilFunc = NOT_Equal; +}; + +DepthStencilState DSS_Default_OutLine_SWrite +{ + DepthEnable = true; + DepthWriteMask = zero; + DepthFunc = less_equal; + + StencilEnable = true; + StencilReadMask = 0xff; + StencilWriteMask = 0xff; + + FrontFaceStencilFail = Keep; + FrontFaceStencilDepthFail = Keep; + FrontFaceStencilPass = Replace; + FrontFaceStencilFunc = Always; + + BackFaceStencilFail = Keep; + BackFaceStencilDepthFail = Keep; + BackFaceStencilPass = Replace; + BackFaceStencilFunc = Always; +}; + +DepthStencilState DSS_Default_OutLine_SRead { DepthEnable = true; DepthWriteMask = zero; @@ -124,7 +165,7 @@ DepthStencilState DSS_Default_OutLine_Read BackFaceStencilFail = Keep; BackFaceStencilDepthFail = Keep; BackFaceStencilPass = Keep; - BackFaceStencilFunc = Equal; + BackFaceStencilFunc = NOT_Equal; }; DepthStencilState DSS_Occlusion diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 917c9ed38..db13bce76 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -13,6 +13,11 @@ float2 g_vResolution; uint g_iBloomEmbossingPass; float g_fThreshold; +float g_fDepthThreshold; +float g_fFocusDistance; +float g_fFarBlurStart; +float g_fFarBlurEnd; +float g_fDOFBlurMultiplier; Texture2D g_Texture; @@ -41,12 +46,17 @@ Texture2D g_BlurWeightTexture; Texture2D g_BlurWeightXTexture; Texture2D g_SurfaceTexture; +Texture2D g_OriginalTexture; vector g_vLightDiffuse; vector g_vLightAmbient; vector g_vLightSpecular; +float g_fFogDensity; +float g_fFogPow; +vector g_vFogColor; + struct VS_IN { float3 vPosition : POSITION; @@ -92,8 +102,8 @@ struct PS_IN struct PS_OUT_BACKBUFFER { - float4 vBackBuffer : SV_TARGET0; - float4 vBloomBuffer : SV_Target1; + float4 vBackBuffer : SV_TARGET0; + float4 vEnvironment : SV_Target1; }; PS_OUT_BACKBUFFER PS_MAIN_DEBUG(PS_IN In) @@ -101,7 +111,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); + Out.vEnvironment = float4(0.f, 0.f, 0.f, 0.f); return Out; } @@ -123,7 +133,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float fViewZ = vDepth.y * g_fFar; - float4 vWorldPosition; + float4 vWorldPosition; // 월드 복원 { vWorldPosition.x = uv.x * 2 - 1; vWorldPosition.y = uv.y * -2 + 1; @@ -140,6 +150,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float fOcclusion = 1.f; float fAttenuation = 1.f; + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 float3 vToLight = normalize(-g_vLightDir.xyz); // 픽셀에서 라이트로 @@ -158,9 +169,9 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) fMetallic = 0.f; float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; - vF0 = vSRO.rrr; - fRoughness = vSRO.g; - fOcclusion = vSRO.b; + vF0 = vSRO.rrr; + fRoughness = vSRO.g; + fOcclusion = vSRO.b; } else // basic Lighting(phong blinn) // if you were here, you miss some assets. { @@ -170,7 +181,14 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) return Out; } - float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion); + float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); + { // 수치조정 // 디렉셔널 + float fMinRoughness = 0.05f; + fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + vF0 = min(vF0, 0.9f); // 메탈릭 상한선 + } + PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); @@ -208,31 +226,35 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) float3 vF0 = float3(0.04f, 0.04f, 0.04f); float fMetallic = 0.f; float fRoughness = 0.5f; - float fOcclusion = 1.f; float fAttenuation = 1.f; - float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 - float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); + float fLightDistance = length(g_vLightPos.xyz - vWorldPosition.xyz); + float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 + float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + fAttenuation = saturate((g_fLightRange - fLightDistance) / g_fLightRange); + if (fAttenuation <= 0.f) { - float fDistance = length(vToLight); - fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange); - if (fAttenuation <= 0.f) { discard; } + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; } - + if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_METALNESS)) // Metallic { float3 vMRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; 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 { fMetallic = 0.f; + float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; vF0 = vSRO.rrr; fRoughness = vSRO.g; @@ -246,8 +268,18 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) return Out; } + float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); + { // 수치조정 // 점광원 + float fMinRoughness = 0.05f; + fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + vF0 = min(vF0, 0.9f); // 메탈릭 상한선 + } + PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); + PBR_Out.vShade *= fDiffuseAOStrength; + Out.vShade = float4(PBR_Out.vShade, 1.f); Out.vSpecular = float4(PBR_Out.vSpecular, 1.f); @@ -266,7 +298,7 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float fViewZ = vDepth.y * g_fFar; - float4 vWorldPosition; + float4 vWorldPosition; // 월드 복원 { vWorldPosition.x = uv.x * 2 - 1; vWorldPosition.y = uv.y * -2 + 1; @@ -283,16 +315,26 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float fOcclusion = 1.f; float fAttenuation = 1.f; + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); + float fLightDistance = length(g_vLightPos.xyz - vWorldPosition.xyz); float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + fAttenuation = saturate((g_fLightRange - fLightDistance) / g_fLightRange); + if (fAttenuation <= 0.f) { - float fDistance = length(vToLight); - fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange); - if (fAttenuation <= 0.f) { discard; } + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; } + float fCosAngle = dot(vToView, g_vLightDir.xyz); - if (fCosAngle < g_fSpotOuterAngle) { discard; } + if (fCosAngle < g_fSpotOuterAngle) + { + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; + } float fSpotAttenenuation = saturate((fCosAngle - g_fSpotInnerAngle) / (g_fSpotInnerAngle - g_fSpotOuterAngle)); fAttenuation *= fSpotAttenenuation; @@ -303,12 +345,13 @@ PS_OUT_LIGHT PS_MAIN_SPOT(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 { fMetallic = 0.f; + float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; vF0 = vSRO.rrr; fRoughness = vSRO.g; @@ -322,23 +365,33 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) return Out; } + float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); + { // 수치조정 // 점광원 + float fMinRoughness = 0.05f; + fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + vF0 = min(vF0, 0.9f); // 메탈릭 상한선 + } + PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); + PBR_Out.vShade *= fDiffuseAOStrength; + Out.vShade = float4(PBR_Out.vShade, 1.f); Out.vSpecular = float4(PBR_Out.vSpecular, 1.f); return Out; } -//float g_fWeights[32] = -//{ -// 0.000400, 0.000700, 0.001200, 0.002000, 0.003200, 0.005000, 0.007500, 0.011000, -// 0.015700, 0.021700, 0.029000, 0.037300, 0.046200, 0.055200, 0.063600, 0.070800, -// 0.075900, 0.078500, 0.078500, 0.075900, 0.070800, 0.063600, 0.055200, 0.046200, -// 0.037300, 0.029000, 0.021700, 0.015700, 0.011000, 0.007500, 0.005000, 0.003200 -//}; +float g_fWeights_32[32] = +{ + 0.000477, 0.000888, 0.001585, 0.002720, 0.004485, 0.007105, 0.010814, 0.015813, + 0.022216, 0.029988, 0.038893, 0.048463, 0.058021, 0.066740, 0.073759, 0.078320, + 0.079902, 0.078320, 0.073759, 0.066740, 0.058021, 0.048463, 0.038893, 0.029988, + 0.022216, 0.015813, 0.010814, 0.007105, 0.004485, 0.002720, 0.001585, 0.000888 +}; -float g_fWeights[128] = +float g_fWeights_128[128] = { 0.000209902, 0.000241594, 0.000277451, 0.000317919, 0.000363477, 0.000414637, 0.000471944, 0.000535974, 0.000607333, 0.000686659, 0.000774615, 0.000871889, 0.00097919, 0.00109725, 0.00122679, 0.00136858, @@ -423,11 +476,11 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) vTexcoord.x = In.vTexcoord.x; vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y; - vColor += g_fWeights[i + 63] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); + vColor += g_fWeights_128[i + 63] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); } Out.vBackBuffer += vColor; - Out.vBloomBuffer; + Out.vEnvironment = Out.vBackBuffer; return Out; } @@ -520,7 +573,6 @@ PS_OUT_FLT4_SINGLE PS_MAIN_BLOOM_FINISH(PS_IN In) return Out; } - PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) { PS_OUT_BLUR_X Out; @@ -533,7 +585,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x; vTexcoord.y = In.vTexcoord.y; - vColor += g_fWeights[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); + vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; @@ -542,6 +594,172 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) return Out; } +PS_OUT_BLUR_X PS_MAIN_BLUR_X_ENV(PS_IN In) +{ + PS_OUT_BLUR_X Out; + + vector vDepthDesc; + float2 vTexcoord; + float fSampleViewZ; + float4 vColor = 0.f; + float fBlurAmount = 0.0f; + + float4 vCenter = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord); + float4 vOriginal = g_BlurTexture.Sample(ClampSampler, In.vTexcoord); + float fCenterViewZ = vCenter.y * g_fFar; + + float fTerrain = (1.f / 255.f); + if (false == AlmostEqual3(vCenter.a, fTerrain)) + { // 터레인셀이 아니면 스킵 + Out.vBlurX = vOriginal; + Out.vBlurWeight = 0.0f; + return Out; + } + + if (fCenterViewZ > g_fFocusDistance) + { + // 현재 셀이 초점거리보다 멀면 블러 + // 블러되는 양은 (현재 셀의 거리가 얼마나 더 멀리 있냐) // END보다 멀면 최대치이므로 saturate + float fValue = saturate((fCenterViewZ - g_fFarBlurStart) / (g_fFarBlurEnd - g_fFarBlurStart)); + fBlurAmount = fValue; // 0~1 + } + + if (fBlurAmount <= FLT_EPSILON3) { + // 최소치 이내면 블러 안함 + Out.vBlurX = vOriginal; + Out.vBlurWeight = 0.0f; + return Out; + } + + float fAcc = 0.f; + for (int i = -16; i < 16; ++i) + { + vTexcoord.x = In.vTexcoord.x + ((float) i / g_vResolution.x) * fBlurAmount * g_fDOFBlurMultiplier; + vTexcoord.y = In.vTexcoord.y; + + vDepthDesc = g_DepthTexture.Sample(DefaultSampler, vTexcoord); + + if (false == AlmostEqual3(vDepthDesc.a, fTerrain)) + { // 터레인셀이 아니면 스킵 + continue; + } + fSampleViewZ = vDepthDesc.y * g_fFar; + if (abs(fCenterViewZ - fSampleViewZ) > g_fDepthThreshold) + { // 센터 위치와 z값이 너무 많이 차이나면 샘플링 스킵 + continue; + } + + vColor += g_fWeights_32[i + 16] * g_BlurTexture.Sample(ClampSampler, vTexcoord); + fAcc += g_fWeights_32[i + 16]; + } + + if (fAcc <= FLT_EPSILON3) + { // 블러 실패하면 원본값 씀 + Out.vBlurX = vOriginal; + Out.vBlurWeight = 0.0f; + return Out; + } + else + { + vColor.xyz /= fAcc; + } + + Out.vBlurX = vColor; + Out.vBlurWeight = fAcc; + + return Out; +} + +PS_OUT_BACKBUFFER PS_MAIN_POSTCOMBINED(PS_IN In) +{ + PS_OUT_BACKBUFFER Out; + + vector vDepthDesc; + float2 vTexcoord; + float fSampleViewZ; + float4 vColor = 0.f; + float fBlurAmount = 0.0f; + + float4 vOriginal = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + float4 vCenter = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord); + float fCenterViewZ = vCenter.y * g_fFar; + + float fTerrain = (1.f / 255.f); + if (false == AlmostEqual3(vCenter.a, fTerrain)) + { // 터레인셀이 아니면 스킵 + Out.vBackBuffer = vOriginal; + Out.vEnvironment = 0.0f; + return Out; + } + + if (fCenterViewZ > g_fFocusDistance) + { + // 현재 셀이 초점거리보다 멀면 블러 + // 블러되는 양은 (현재 셀의 거리가 얼마나 더 멀리 있냐) // END보다 멀면 최대치이므로 saturate + float fValue = saturate((fCenterViewZ - g_fFarBlurStart) / (g_fFarBlurEnd - g_fFarBlurStart)); + fBlurAmount = fValue; // 0~1 + } + + if (fBlurAmount <= FLT_EPSILON3) + { + // 최소치 이내면 블러 스킵 + Out.vBackBuffer = vOriginal; + Out.vEnvironment = 0.0f; + return Out; + } + + float fAcc = 0.f; + for (int i = -16; i < 16; ++i) + { + vTexcoord.x = In.vTexcoord.x; + vTexcoord.y = In.vTexcoord.y + ((float) i / g_vResolution.y) * fBlurAmount * g_fDOFBlurMultiplier; + + vDepthDesc = g_DepthTexture.Sample(DefaultSampler, vTexcoord); + + if (false == AlmostEqual3(vDepthDesc.a, fTerrain)) + { // 터레인셀이 아니면 스킵 + continue; + } + fSampleViewZ = vDepthDesc.y * g_fFar; + if (abs(fCenterViewZ - fSampleViewZ) > g_fDepthThreshold) + { // 센터 위치와 z값이 너무 많이 차이나면 샘플링 스킵 + continue; + } + + vColor += g_fWeights_32[i + 16] * g_BlurTexture.Sample(ClampSampler, vTexcoord); + fAcc += g_fWeights_32[i + 16]; + } + if (fAcc <= FLT_EPSILON3) + { // 블러 실패하면 원본값 씀 + Out.vBackBuffer = vOriginal; + Out.vEnvironment = 0.0f; + return Out; + return Out; + } + else + { + vColor.xyz /= fAcc; + } + + float fOriginalLumen = length(vOriginal.rgb); + float fBlurLumen = length(vColor.rgb); + + float fLumenScale = 1.0f; + if (fBlurLumen > 1e-4f) + { + fLumenScale = fOriginalLumen / fBlurLumen; + } + float3 vBlurMatched = vColor.rgb * fLumenScale; + + float fBlendAmount = saturate(fBlurAmount * g_fDOFBlurMultiplier); + float3 finalColor = lerp(vOriginal.rgb, vBlurMatched, fBlendAmount); + + Out.vBackBuffer = float4(vColor.xyz, vOriginal.a); + Out.vEnvironment = 0.f; + + return Out; +} + PS_OUT_BLUR_X PS_MAIN_BLUR_Y(PS_IN In) { PS_OUT_BLUR_X Out; @@ -554,7 +772,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_Y(PS_IN In) vTexcoord.x = In.vTexcoord.x; vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y; - vColor += g_fWeights[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); + vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; @@ -563,6 +781,31 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_Y(PS_IN In) return Out; } +PS_OUT_FLT4_SINGLE PS_MAIN_FOG(PS_IN In) +{ + PS_OUT_FLT4_SINGLE Out; + + vector vColor = g_OriginalTexture.Sample(DefaultSampler, In.vTexcoord); + vector vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord); + + vector vFinalColor; + float fViewZ = vDepthDesc.y * g_fFar; + + float fRatio; + + fRatio = clamp(pow(exp(-(g_fFogDensity * fViewZ)), g_fFogPow), 0.f, 1.f); + + vFinalColor = lerp(g_vFogColor, vColor, max(fRatio, 0.2f)); + vFinalColor.a = 1.f; + + if (1.f == vDepthDesc.y) + vFinalColor = float4(g_vFogColor); + + Out.vSingleTarget = vFinalColor; + + return Out; +} + technique11 DefaultTechnique { @@ -685,4 +928,32 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN_BLOOM_FINISH(); } + pass BlurX_ENV_Pass // 12 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_BLUR_X_ENV(); + } + pass PostCombinedPass // 13 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default_Environment_SRead, 1); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_POSTCOMBINED(); + } + + pass FogPass // 14 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 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_MAIN_FOG(); + } } diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index f92ffb8d6..a884dc4a7 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -207,6 +207,7 @@ call Update_Lib.bat + @@ -423,6 +424,7 @@ call Update_Lib.bat + diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index bf933498c..1240a0667 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -295,6 +295,9 @@ {432b36d5-fdf6-456a-bc71-8bf793a42314} + + {d566d9e6-6183-48dc-a196-25fd47a10c48} + @@ -558,6 +561,9 @@ 02.Element\02.Component\02.VIBuffer\Box + + 01.Utility\07. Fog + @@ -1190,6 +1196,9 @@ 02.Element\02.Component\02.VIBuffer\Box + + 01.Utility\07. Fog + diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp index 1fff47315..bbe400cdf 100644 --- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp +++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp @@ -69,6 +69,11 @@ PSX::PxController* CCharacter_Controller::Get_Controller() return m_pController; } +PSX::PxControllerCollisionFlags CCharacter_Controller::Get_CollisionFlags() +{ + return m_eBeforeCollisionFlags; +} + void CCharacter_Controller::Resize_Volume(_float fHeight) { m_pController->resize(fHeight); @@ -326,6 +331,7 @@ void CCharacter_Controller::Free() void CCharacter_Controller::Describe_Entity() { GUI::Begin("Character_Controller"); + GUI::Text("Gravity : %d ", m_bGravity); m_pTransform->Describe_Entity(); GUI::TextLinkOpenURL("More details here", "https://dev-treadmill.tistory.com/158"); _float fContact = m_pController->getContactOffset(); diff --git a/Jusin154_Team3D/Engine/Private/Fog.cpp b/Jusin154_Team3D/Engine/Private/Fog.cpp new file mode 100644 index 000000000..39fefeaa3 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/Fog.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "Fog.h" +#include "Shader.h" + +CFog::CFog() + : m_bVisible{ true } +{ +} + +void CFog::Set_FogDensity(_float fFogDensity) +{ + m_fFogDensity = fFogDensity; +} + +void CFog::Set_FogColor(_float4& vFogColor) +{ + memcpy(&m_vFogColor, &vFogColor, sizeof(_float4)); +} + +HRESULT CFog::Bind_FogValue(CShader* pShader) +{ +#ifdef _DEBUG + if (m_bVisible) { + pShader->Bind_RawValue("g_fFogDensity", &m_fFogDensity, sizeof(_float)); + pShader->Bind_RawValue("g_fFogPow", &m_fFogPow, sizeof(_float)); + pShader->Bind_RawValue("g_vFogColor", &m_vFogColor, sizeof(_float4)); + } + else + { + _float fValue = 0.f; + _float4 vColor = { 0.f, 0.f,0.f,0.f }; + pShader->Bind_RawValue("g_fFogDensity", &fValue, sizeof(_float)); + pShader->Bind_RawValue("g_fFogDensity", &fValue, sizeof(_float)); + pShader->Bind_RawValue("g_vFogColor", &vColor, sizeof(_float4)); + } +#else + pShader->Bind_RawValue("g_fFogDensity", &m_fFogDensity, sizeof(_float)); + pShader->Bind_RawValue("g_vFogColor", &m_vFogColor, sizeof(_float4)); +#endif // _DEBUG + + return S_OK; +} + +#ifdef _DEBUG +void CFog::Update_Fog() +{ + GUI::Begin("Fog Edit"); + GUI::Checkbox("Fog ON / OFF", &m_bVisible); + GUI::InputFloat("g_fFogDensity", &m_fFogDensity, 0.001f); + GUI::InputFloat("g_fFogPow", &m_fFogPow, 0.1f); + GUI::ColorEdit4("Fog Color", (_float*)(&m_vFogColor), ImGuiColorEditFlags_NoInputs); + GUI::End(); +} +#endif // _DEBUG + +CFog* CFog::Create() +{ + return new CFog(); +} + +void CFog::Free() +{ + __super::Free(); +} diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 00b5db128..7539f7c80 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -17,6 +17,7 @@ #include "Picking.h" #include "PhysX_Manager.h" #include "ThreadHolder.h" +#include "Fog.h" IMPLEMENT_SINGLETON(CGameInstance) @@ -100,6 +101,11 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De return E_FAIL; } + m_pFog = CFog::Create(); + if (nullptr == m_pFog) { + return E_FAIL; + } + return S_OK; } @@ -108,7 +114,9 @@ void CGameInstance::Update_Engine(_float fTimeDelta) m_pKey_Manager->Update(); m_pMouse_Manager->Update(); //m_pSound_Manager->Update(); - +#ifdef _DEBUG + m_pFog->Update_Fog(); +#endif // _DEBUG m_pPicking->Update(); m_pObject_Manager->Priority_Update(fTimeDelta); @@ -285,6 +293,7 @@ void CGameInstance::Present_TimeCost() const + m_fTimer_DrawCall + m_fTimer_Present; + GUI::PushItemWidth(80); GUI::Begin("Previous_Frame_Timer"); { GUI::ProgressBar(m_fTimer_PriorityUpdate / fTotal, ImVec2(200.f, 0.f)); @@ -513,6 +522,11 @@ HRESULT CGameInstance::Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilVi return m_pRenderTarget_Manager->Begin_MRT(strMRTTag, pDSV); } +HRESULT CGameInstance::Begin_MRT_NonClear(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV) +{ + return m_pRenderTarget_Manager->Begin_MRT_NonClear(strMRTTag, pDSV); +} + HRESULT CGameInstance::Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV) { return m_pRenderTarget_Manager->Begin_MRT_Include_BackBuffer(strMRTTag, pDSV); @@ -622,6 +636,7 @@ _bool CGameInstance::SaveAssimpModel(const _char* filename) auto iter = m_ModelMap.find(filename); return iter->second->SaveAssimpModel(filename); } + void CGameInstance::Add_ModelToMap(const _char* filePath, CModel* pModel) { m_ModelMap[filePath] = pModel; @@ -714,6 +729,22 @@ HRESULT CGameInstance::LoadTriMeshes(const _char* pPath, vectorSet_FogDensity(fFogDensity); +} +void CGameInstance::Set_FogColor(_float4& vFogColor) +{ + m_pFog->Set_FogColor(vFogColor); +} + +HRESULT CGameInstance::Bind_FogValue(class CShader* pShader) +{ + return m_pFog->Bind_FogValue(pShader); +} +#pragma endregion // FOG + bool CGameInstance::Key_Pressing(int _iKey) { //if (false == (GUI::IsWindowFocused(ImGuiFocusedFlags_AnyWindow))) { @@ -823,6 +854,7 @@ void CGameInstance::Release_Engine() DestroyInstance(); + SAFE_RELEASE(m_pFog); SAFE_RELEASE(m_pPicking); SAFE_RELEASE(m_pCollider_Manager); SAFE_RELEASE(m_pShadow); diff --git a/Jusin154_Team3D/Engine/Private/Light.cpp b/Jusin154_Team3D/Engine/Private/Light.cpp index 4a77afd55..b18672ef2 100644 --- a/Jusin154_Team3D/Engine/Private/Light.cpp +++ b/Jusin154_Team3D/Engine/Private/Light.cpp @@ -57,6 +57,13 @@ HRESULT CLight::Initialize(void* pArg) return S_OK; } +void CLight::Set_Color(_float4& vDiffuse, _float4& vAmbient, _float4& vSpecular) +{ + memcpy(&m_LightDesc.vDiffuse, &vDiffuse, sizeof(_float4)); + memcpy(&m_LightDesc.vAmbient, &vAmbient, sizeof(_float4)); + memcpy(&m_LightDesc.vSpecular, &vSpecular, sizeof(_float4)); +} + HRESULT CLight::Render(CShader* pShader, CVIBuffer* pVIBuffer) const { _uint iPassIndex = { 0 }; diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp index f3a866683..fb0294ef9 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp @@ -58,8 +58,9 @@ HRESULT CRenderTarget_Manager::Begin_MRT(const _wstring& strMultiRenderTargetKey list* pMRTList = Find_MRT(strMultiRenderTargetKey); - if (nullptr == pMRTList) + if (nullptr == pMRTList){ return E_FAIL; + } _uint iNumRenderTargets = { 0 }; ID3D11RenderTargetView* pRenderTargetViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = {}; @@ -83,6 +84,37 @@ HRESULT CRenderTarget_Manager::Begin_MRT(const _wstring& strMultiRenderTargetKey return S_OK; } +HRESULT CRenderTarget_Manager::Begin_MRT_NonClear(const _wstring& strMultiRenderTargetKey, ID3D11DepthStencilView* pDSV) +{ + m_pContext->OMGetRenderTargets(1, &m_pBackBufferRTV, &m_pOriginalDSV); + + list* pMRTList = Find_MRT(strMultiRenderTargetKey); + + if (nullptr == pMRTList) { + return E_FAIL; + } + + _uint iNumRenderTargets = { 0 }; + ID3D11RenderTargetView* pRenderTargetViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = {}; + + m_pContext->OMSetRenderTargets(0, nullptr, nullptr); + + if (nullptr != pDSV) { + m_pContext->ClearDepthStencilView(pDSV, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.f, 0); + } + + for (auto& pRenderTarget : *pMRTList) + { + pRenderTargetViews[iNumRenderTargets++] = pRenderTarget->Get_RTV(); + } + if (0 == iNumRenderTargets) { + return E_FAIL; + } + + m_pContext->OMSetRenderTargets(iNumRenderTargets, pRenderTargetViews, (nullptr == pDSV) ? m_pOriginalDSV : pDSV); + + return S_OK; +} HRESULT CRenderTarget_Manager::Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV) { m_pContext->OMGetRenderTargets(1, &m_pBackBufferRTV, &m_pOriginalDSV); diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index 578af60d3..0d47c79da 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -64,6 +64,8 @@ void CRenderer::Render() Render_Blur(); Render_Combined(); Render_Occlusion(); + Render_EnvironmentPostProcess(); + Render_Fog(); Render_Effect(); Render_NonLight(); Render_Blend(); @@ -73,6 +75,7 @@ void CRenderer::Render() Render_UI(); #ifdef _DEBUG + Describe_Entitiy(); m_pGameInstance->RenderTarget_Debuger(); if(m_pGameInstance->Key_Pressing(DIK_F10)){ @@ -115,6 +118,7 @@ void CRenderer::Render_Priority() } m_RenderObjects[ENUM_CLASS(RENDER::PRIORITY)].clear(); + } void CRenderer::Render_Shadow() @@ -225,6 +229,9 @@ void CRenderer::Render_LightAcc() void CRenderer::Render_Combined() { + if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Combined")))) { + return; + } { // Bind_Resorces @@ -296,6 +303,104 @@ void CRenderer::Render_Combined() m_pVIBuffer->Bind_Resources(); m_pVIBuffer->Render(); + if (FAILED(m_pGameInstance->End_MRT())) { + return; + } +} + +void CRenderer::Render_EnvironmentPostProcess() +{ + if (m_pGameInstance->Key_Up(DIK_END)) { + m_bDOF_ENV = !m_bDOF_ENV; + } + if (false == m_bDOF_ENV) { + return; + } + if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Blur_X")))) { + return; + } + + m_pShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix); + m_pShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix); + m_pShader->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix); + m_pShader->Bind_Matrix("g_invMatView", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW_INV)); + m_pShader->Bind_Matrix("g_invmatProj", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ_INV)); + m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)); + m_pShader->Bind_RawValue("g_fDepthThreshold", &m_fDOF_ENV_CutThreshold, sizeof(_float)); + m_pShader->Bind_RawValue("g_fFocusDistance", &m_fDOF_ENV_FocusDistance, sizeof(_float)); + m_pShader->Bind_RawValue("g_fFarBlurStart", &m_fDOF_ENV_StartDistance, sizeof(_float)); + m_pShader->Bind_RawValue("g_fFarBlurEnd", &m_fDOF_ENV_MaxEnd, sizeof(_float)); + m_pShader->Bind_RawValue("g_fDOFBlurMultiplier", &m_fDOF_ENV_AmountRadius, sizeof(_float)); + + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Depth"), m_pShader, "g_DepthTexture"))) { + return; + } + + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_AfterCombined"), m_pShader, "g_BlurTexture"))) { + return; + } + m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::BLURX_ENVIRONMENT)); + + m_pVIBuffer->Bind_Resources(); + m_pVIBuffer->Render(); + if (FAILED(m_pGameInstance->End_MRT())) { + return; + } + + if (FAILED(m_pGameInstance->Begin_MRT_NonClear(TEXT("MRT_Fog")))) { + return; + } + + m_pShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix); + m_pShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix); + m_pShader->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix); + m_pShader->Bind_Matrix("g_invMatView", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW_INV)); + m_pShader->Bind_Matrix("g_invmatProj", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ_INV)); + m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)); + m_pShader->Bind_RawValue("g_fDepthThreshold", &m_fDOF_ENV_CutThreshold, sizeof(_float)); + m_pShader->Bind_RawValue("g_fFocusDistance", &m_fDOF_ENV_FocusDistance, sizeof(_float)); + m_pShader->Bind_RawValue("g_fFarBlurStart", &m_fDOF_ENV_StartDistance, sizeof(_float)); + m_pShader->Bind_RawValue("g_fFarBlurEnd", &m_fDOF_ENV_MaxEnd, sizeof(_float)); + m_pShader->Bind_RawValue("g_fDOFBlurMultiplier", &m_fDOF_ENV_AmountRadius, sizeof(_float)); + + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Depth"), m_pShader, "g_DepthTexture"))) { + return; + } + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_X"), m_pShader, "g_BlurTexture"))) { + return; + } + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_AfterCombined"), m_pShader, "g_DiffuseTexture"))) { + return; + } + m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::POSTCOMBINED)); + + m_pVIBuffer->Bind_Resources(); + m_pVIBuffer->Render(); + + if (FAILED(m_pGameInstance->End_MRT())) { + return; + } +} + +void CRenderer::Render_Fog() +{ + m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)); + + m_pGameInstance->Bind_FogValue(m_pShader); + + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Fog"), m_pShader, "g_OriginalTexture"))) { + return; + } + + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Depth"), m_pShader, "g_DepthTexture"))) { + return; + } + + m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::FOG)); + + m_pVIBuffer->Bind_Resources(); + m_pVIBuffer->Render(); + } void CRenderer::Render_Effect() @@ -304,7 +409,6 @@ void CRenderer::Render_Effect() return; } - for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::EFFECT)]) { if (nullptr != pRenderObject) @@ -315,7 +419,6 @@ void CRenderer::Render_Effect() m_RenderObjects[ENUM_CLASS(RENDER::EFFECT)].clear(); - if (FAILED(m_pGameInstance->End_MRT())) { return; } @@ -370,7 +473,7 @@ void CRenderer::Render_Blur() if (nullptr != pRenderObject) if (FAILED(pRenderObject->Render_Blur())) { assert(false); - } + } SAFE_RELEASE(pRenderObject); } @@ -435,12 +538,6 @@ void CRenderer::Render_Bloom() m_bPostProcessing_BLOOM = !m_bPostProcessing_BLOOM; } if(true == m_bPostProcessing_BLOOM) { - 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); @@ -640,6 +737,12 @@ HRESULT CRenderer::Initialize() return E_FAIL; } + /* Target_Depth */ + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Terrain_Depth"), (_uint)Viewport.Width, (_uint)Viewport.Height, + DXGI_FORMAT_R32G32B32A32_FLOAT, _float4(0.0f, 1.f, 0.f, 0.f)))) { + return E_FAIL; + } + /* Target_Surface */ if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Surface"), (_uint)Viewport.Width, (_uint)Viewport.Height, DXGI_FORMAT_R32G32B32A32_FLOAT, _float4(0.0f, 0.f, 0.f, 0.f)))) { @@ -726,6 +829,11 @@ HRESULT CRenderer::Initialize() return E_FAIL; } + /* Target_AfterCombined */ + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_AfterCombined"), (_uint)Viewport.Width, (_uint)Viewport.Height, + DXGI_FORMAT_R8G8B8A8_UNORM, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) { + return E_FAIL; + } /* Target_Color*/ @@ -748,6 +856,11 @@ HRESULT CRenderer::Initialize() return E_FAIL; } + /* Target_Diffuse */ + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Fog"), (_uint)Viewport.Width, (_uint)Viewport.Height, + DXGI_FORMAT_R8G8B8A8_UNORM, _float4(0.0f, 0.f, 0.f, 0.f)))) { + return E_FAIL; + } if (FAILED(Ready_ShadowDepthStencilView(g_iMaxShadowWidth, g_iMaxShadowHeight))) { @@ -773,6 +886,14 @@ HRESULT CRenderer::Initialize() return E_FAIL; } + /* MRT_Combined */ + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Combined"), TEXT("Target_Fog")))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Combined"), TEXT("Target_AfterCombined")))) { + return E_FAIL; + } + /* MRT_LightAcc */ if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_LightAcc"), TEXT("Target_Shade")))) { return E_FAIL; @@ -828,6 +949,11 @@ HRESULT CRenderer::Initialize() if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_WB"), TEXT("Target_Color")))) { return E_FAIL; } + + /* MRT_Fog */ + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Fog"), TEXT("Target_Fog")))) { + return E_FAIL; + } } m_pShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, FX_DEFERRED, nullptr, nullptr); @@ -902,3 +1028,49 @@ void CRenderer::Free() SAFE_RELEASE(m_pContext); SAFE_RELEASE(m_pGameInstance); } +#ifdef _DEBUG +void CRenderer::Describe_Entitiy() +{ + GUI::Begin("Renderer"); + GUI::PushItemWidth(80); + if (GUI::CollapsingHeader("PostProcessing_Bloom")) + { + GUI::BeginChild("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::PopItemWidth(); + GUI::EndChild(); + } + if (GUI::CollapsingHeader("Environment DOF")) + { + GUI::BeginChild("DOF_ENV", ImVec2(0, 0), true); + GUI::PushItemWidth(80.0f); + + GUI::Text("Far DOF (Environment)"); + GUI::Separator(); + + GUI::DragFloat("Depth Cut", &m_fDOF_ENV_CutThreshold, 0.001f, 0.0f, 20.0f, "%.4f"); + + GUI::DragFloat("Focus Dist", &m_fDOF_ENV_FocusDistance, 1.0f, 0.1f, 125.f, "%.1f"); + + GUI::DragFloat("Blur Start", &m_fDOF_ENV_StartDistance, 1.0f, 0.1f, 250.f, "%.1f"); + + GUI::DragFloat("Blur End", &m_fDOF_ENV_MaxEnd, 1.0f, 1.0f, 500.f, "%.1f"); + + GUI::DragFloat("Max Radius", &m_fDOF_ENV_AmountRadius, 0.1f, 0.0f, 10.0f, "%.2f"); + + if (m_fDOF_ENV_StartDistance < m_fDOF_ENV_FocusDistance){ + m_fDOF_ENV_StartDistance = m_fDOF_ENV_FocusDistance; + } + + if (m_fDOF_ENV_MaxEnd < m_fDOF_ENV_StartDistance + 1.0f){ + m_fDOF_ENV_MaxEnd = m_fDOF_ENV_StartDistance + 1.0f; + } + + GUI::PopItemWidth(); + GUI::EndChild(); + } + GUI::End(); +} +#endif diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index 8549335bc..c3824772e 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -441,12 +441,12 @@ _float CUIObject::Get_Angle() void CUIObject::Set_SkillType(_int eType) { - m_iSkillType = eType; + m_iSpellType = eType; } _int CUIObject::Get_SkillType() { - return m_iSkillType; + return m_iSpellType; } void CUIObject::Set_CoolTime(_float CoolTime) diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp index 110a22c4f..357a5a182 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp @@ -114,6 +114,14 @@ HRESULT CVIBuffer_UI_Instance::Initialize_Prototype(const INSTANCE_DESC* pInstan m_fPosition = new _float2[m_iNumInstance]; ZeroMemory(m_fPosition, sizeof(_float2) * m_iNumInstance); + for (_uint i = 0; i < m_iNumInstance; ++i) + { + m_pInstanceVertices[i].fSize = _float2(1.f, 1.f); // 기본 크기 + m_pInstanceVertices[i].fPos = _float2(0.f, 0.f); // 기본 위치 + m_pInstanceVertices[i].fUV = _float4(0.f, 0.f, 1.f, 1.f); // 전체 텍스처 영역 + m_pInstanceVertices[i].vColor = _float4(1.f, 1.f, 1.f, 1.f); // 기본 흰색 + m_pInstanceVertices[i].bHover = 0; + } m_InstanceInitialDesc.pSysMem = m_pInstanceVertices; @@ -140,7 +148,6 @@ void CVIBuffer_UI_Instance::Set_Index_Position(_uint iIndex, _float fX, _float f pVertices[iIndex].fPos.x = fX; pVertices[iIndex].fPos.y = fY; - m_pContext->Unmap(m_pVBInstance, 0); } @@ -171,7 +178,7 @@ void CVIBuffer_UI_Instance::Set_Pos(_float fX, _float fY, _float OffSetX, _float _uint row = i / iCols; // 세로 인덱스 pVertices[i].fPos.x = fX + col * OffSetX; - pVertices[i].fPos.y = fY + row * OffSetY; + pVertices[i].fPos.y = fY - row * OffSetY; } m_pContext->Unmap(m_pVBInstance, 0); @@ -236,21 +243,67 @@ void CVIBuffer_UI_Instance::Set_ImageUV(UI_ATLAS_DESC* AtlasUV) for (size_t i = 0; i < m_iNumInstance; i++) { - if (AtlasUV == nullptr) - { - pVertices[i].fUVStart = _float2(0.f, 0.f); - pVertices[i].fUVStart = _float2(1.f, 1.f); - } - else - { - pVertices[i].fUVStart = AtlasUV[i].fUVStart; - pVertices[i].fUVEnd = AtlasUV[i].fUVEnd; - } + pVertices[i].fUV = AtlasUV[i].fUV; } m_pContext->Unmap(m_pVBInstance, 0); } +void CVIBuffer_UI_Instance::Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float4 vColor) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + for (size_t i = StartIndex; i <= EndIndex; i++) + { + pVertices[i].vColor = vColor; + } + + m_pContext->Unmap(m_pVBInstance, 0); +} + +_uint CVIBuffer_UI_Instance::Set_Mouse_Hover(_float2 fMousePos) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + _uint hoveredIndex = (_uint)-1; + for (_uint i = 0; i < m_iNumInstance; i++) + { + _float2 pos = pVertices[i].fPos; + _float2 size = pVertices[i].fSize; + + RECT rcInstance{}; + rcInstance.left = LONG(pos.x - size.x * 0.5f); + rcInstance.right = LONG(pos.x + size.x * 0.5f); + rcInstance.top = LONG(pos.y - size.y * 0.5f); + rcInstance.bottom = LONG(pos.y + size.y * 0.5f); + + POINT pt{}; + pt.x = LONG(fMousePos.x); + pt.y = LONG(fMousePos.y); + + if (PtInRect(&rcInstance, pt)) + { + pVertices[i].bHover = 1.f; + hoveredIndex = i; // ✅ 인덱스 저장 + } + else + { + pVertices[i].bHover = 0.f; + } + } + + m_pContext->Unmap(m_pVBInstance, 0); + return hoveredIndex; +} + CVIBuffer_UI_Instance* CVIBuffer_UI_Instance::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const INSTANCE_DESC* pInstanceDesc) { CVIBuffer_UI_Instance* pInstance = new CVIBuffer_UI_Instance(pDevice, pContext); diff --git a/Jusin154_Team3D/Engine/Public/Character_Controller.h b/Jusin154_Team3D/Engine/Public/Character_Controller.h index 44f4fe536..119755fd4 100644 --- a/Jusin154_Team3D/Engine/Public/Character_Controller.h +++ b/Jusin154_Team3D/Engine/Public/Character_Controller.h @@ -55,7 +55,8 @@ class ENGINE_DLL CCharacter_Controller final : void Set_Position(_fvector vNewPos); // 순간이동 _vector Get_Position(); _vector Get_FootPosition(); // ContactOffset이 고려된 발바닥 위치( 실제보다 바닥 위치가 더 아래에 위치한다는 뜻 ) - + + PSX::PxControllerCollisionFlags Get_CollisionFlags(); void Resize_Volume(_float fHeight); // 높이를 수정하고 바닥에 붙임 void Modify_Volume(_float3 fVolume); _float3 Get_Volume(); @@ -71,8 +72,8 @@ class ENGINE_DLL CCharacter_Controller final : PSX::PxController* m_pController = { nullptr }; CTransform* m_pTransform = { nullptr }; _bool m_bAutoStepping = { false }; - _float m_fGravity = { 0.129f }; - _float m_fSlopeLimit = { 0.69f/*0~1*/}; // cosf각도, 오르막 경사각 제한. ( 추가설정 필요함 ) + _float m_fGravity = { 0.094f }; + _float m_fSlopeLimit = { 0.302f/*0~1*/}; // cosf각도, 오르막 경사각 제한. ( 추가설정 필요함 ) PhsXUserData m_tagData = {}; PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {}; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index f6f748c1e..538c8fbe3 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -35,7 +35,7 @@ enum class NAVI_POINT { A, B, C, END }; enum class NAVI_LINE { AB, BC, CA, END }; enum class SHADER_PASS_CELL { DEBUG, END }; -enum class SHADER_PASS_DEFERRED { DEBUG, DIRECTIONAL, POINT, COMBINED, BLUR, SPOT, REFIT, EMBOSSING, BLOOM_BLURX, BLOOM_BLURY, BLOOM_ACCUM, BLOOM_FINISH, END }; +enum class SHADER_PASS_DEFERRED { DEBUG, DIRECTIONAL, POINT, COMBINED, BLUR, SPOT, REFIT, EMBOSSING, BLOOM_BLURX, BLOOM_BLURY, BLOOM_ACCUM, BLOOM_FINISH, BLURX_ENVIRONMENT, POSTCOMBINED, FOG, END }; enum class QUESTYPE {MAIN, SUB, END}; enum class TEXTURE_MOUNT_SLOT0 { NOT_DEFINED, METALLIC, SPECULAR, HEIGHT, END }; @@ -91,6 +91,14 @@ enum class PHYSX_KIND { NS_END + +/* +// 스텐실 버퍼 마스크 +// 0000 0001 -> 아웃라인 +// 0000 0010 -> 터레인 및 지형 및 건물 등등 + +*/ + //enum PxRigidBodyFlag::Enum // createBody에 들어감 //{ // // 해당 바디는 키네마틱 모드가 됨. diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index a3f05288f..cae318eb1 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -200,8 +200,9 @@ typedef struct tagVertexInstance_UI { _float2 fSize = {}; _float2 fPos = {}; - _float2 fUVStart = {}; - _float2 fUVEnd = {}; + _float4 fUV = _float4(0.f, 0.f, 1.f, 1.f); + _float4 vColor = _float4(1.f, 1.f, 1.f, 1.f); + _float bHover = 0; }VTX_INSTANCE_UI; typedef struct tagVertexBlock @@ -361,22 +362,23 @@ typedef struct tagVertexModelInstanceModelDesc typedef struct tagVertexInstance_UIDesc { - static constexpr unsigned int iNumElements = {6}; + static constexpr unsigned int iNumElements = { 7 }; static constexpr D3D11_INPUT_ELEMENT_DESC Elements[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0}, { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT, 1, 0, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, { "TEXCOORD", 2, DXGI_FORMAT_R32G32_FLOAT, 1, 8, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, - { "TEXCOORD", 3, DXGI_FORMAT_R32G32_FLOAT, 1, 16, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, - { "TEXCOORD", 4, DXGI_FORMAT_R32G32_FLOAT, 1, 24, D3D11_INPUT_PER_INSTANCE_DATA, 1 } + { "TEXCOORD", 3, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 16, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 4, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 32, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 5, DXGI_FORMAT_R32_FLOAT, 1, 48, D3D11_INPUT_PER_INSTANCE_DATA, 1 } }; }VTX_POSTEX_INSTANCE_UI; typedef struct tagPhsXUserData { - PHYSX_KIND eKind = PHYSX_KIND::NOT_DEFINED; + PHYSX_KIND eKind = PHYSX_KIND::NOT_DEFINED; class CGameObject* pOwner = { nullptr }; _float4x4 BeforeMatrix = { }; @@ -410,7 +412,7 @@ typedef struct tagKeyFrameDesc typedef struct tagChannelDesc { - _uint StartIndex; + _uint StartIndex; _uint KeyCount; _uint BoneIndex; //_uint Padding; diff --git a/Jusin154_Team3D/Engine/Public/Fog.h b/Jusin154_Team3D/Engine/Public/Fog.h new file mode 100644 index 000000000..4548b9122 --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/Fog.h @@ -0,0 +1,35 @@ +#pragma once + +#include "Base.h" + +NS_BEGIN(Engine) + +class CFog final : public CBase +{ +private: + CFog(); + virtual ~CFog() = default; + +public: + void Set_FogDensity(_float fFogDensity); + void Set_FogColor(_float4& vFogColor); + + HRESULT Bind_FogValue(class CShader* pShader); + +#ifdef _DEBUG + void Update_Fog(); +#endif // _DEBUG + + +private: + _bool m_bVisible = {}; + _float m_fFogDensity = { 0.04f }; + _float m_fFogPow = { 0.1f }; + _float4 m_vFogColor = { 0.906f, 0.812f, 0.745f, 0.5f }; + +public: + static CFog* Create(); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 0449f0134..c6a45d9a4 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -153,6 +153,7 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Add_RenderTarget(const _wstring& strRenderTargetKey, _uint iSizeX, _uint iSizeY, DXGI_FORMAT ePixelFormat, const _float4& vClearColor); HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey); HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr); + HRESULT Begin_MRT_NonClear(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr); HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr); HRESULT Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag); HRESULT End_MRT(); @@ -222,6 +223,14 @@ class ENGINE_DLL CGameInstance final : public CBase } #pragma endregion +#pragma region FOG + void Set_FogDensity(_float fFogDensity); + void Set_FogColor(_float4& vFogColor); + + HRESULT Bind_FogValue(class CShader* pShader); +#pragma endregion + + public: void Add_ModelToMap(const _char* filePath, CModel* pModel); @@ -255,7 +264,8 @@ class ENGINE_DLL CGameInstance final : public CBase class CPhysX_Manager* m_pPhysX_Manager = { nullptr }; class CPicking* m_pPicking = { nullptr }; class CThreadHolder* m_pThreadHolder = { nullptr }; - class COcclusionQuery* m_pOcclusionQuery = { nullptr }; + class CFog* m_pFog = { nullptr }; + #ifdef _DEBUG private: diff --git a/Jusin154_Team3D/Engine/Public/Light.h b/Jusin154_Team3D/Engine/Public/Light.h index ac5562130..ad0f232c2 100644 --- a/Jusin154_Team3D/Engine/Public/Light.h +++ b/Jusin154_Team3D/Engine/Public/Light.h @@ -20,6 +20,7 @@ class ENGINE_DLL CLight final : public CComponent virtual HRESULT Initialize(void* pArg) override; public: const LIGHT_DESC* Get_LightDesc() { return &m_LightDesc; } + void Set_Color(_float4& vDiffuse, _float4& vAmbient, _float4& vSpecular); public: HRESULT Render(class CShader* pShader, class CVIBuffer* pVIBuffer) const; diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h index 72de0e6d5..4a90b57e5 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h @@ -13,6 +13,7 @@ class CRenderTarget_Manager final : public CBase HRESULT Add_RenderTarget(const _wstring& strRenderTargetKey, _uint iSizeX, _uint iSizeY, DXGI_FORMAT ePixelFormat, const _float4& vClearColor); HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey); HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV); + HRESULT Begin_MRT_NonClear(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV); HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV); HRESULT Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag); HRESULT End_MRT(); diff --git a/Jusin154_Team3D/Engine/Public/Renderer.h b/Jusin154_Team3D/Engine/Public/Renderer.h index 6ea9f2924..4d07aa396 100644 --- a/Jusin154_Team3D/Engine/Public/Renderer.h +++ b/Jusin154_Team3D/Engine/Public/Renderer.h @@ -40,14 +40,19 @@ class CRenderer final : public CBase _float4x4 m_ProjMatrix = {}; ID3D11DepthStencilView* m_pShadowDSV = { nullptr }; - ID3D11DepthStencilView* m_pOcclusionDSV = { nullptr }; SHADOW_LIGHT_DESC m_PreShadowDesc = {}; _float4x4 m_PreShadowMatrices[ENUM_CLASS(D3DTS::END)] = {}; _bool m_bPostProcessing_BLOOM = { false }; + _bool m_bDOF_ENV = { false }; _int m_iBloomEmbossingPass = { 0 }; _float m_fThreshold = { 1.26f }; + _float m_fDOF_ENV_CutThreshold = { 0.1350f }; + _float m_fDOF_ENV_FocusDistance = { 31.1f }; + _float m_fDOF_ENV_StartDistance = { 53.1f }; + _float m_fDOF_ENV_MaxEnd = { 360.f }; + _float m_fDOF_ENV_AmountRadius = { 1.f }; private: void Render_Occlusion(); @@ -57,6 +62,8 @@ class CRenderer final : public CBase void Render_LightAcc(); void Render_Blur(); void Render_Combined(); + void Render_EnvironmentPostProcess(); + void Render_Fog(); void Render_Effect(); void Render_WeightBlend(); void Render_NonLight(); @@ -73,13 +80,16 @@ class CRenderer final : public CBase private: HRESULT Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY); - HRESULT Ready_OcclusionDepthStencilView(_uint iSizeX, _uint iSizeY); private: HRESULT Initialize(); public: static CRenderer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free(); +#ifdef _DEBUG + virtual void Describe_Entitiy(); +#endif // _DEBUG + }; NS_END diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index cc24b14a3..1564d510c 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -7,7 +7,7 @@ NS_BEGIN(Engine) class ENGINE_DLL CUIObject abstract : public CGameObject { public: - enum class SKILLTYPE { + enum class SPELLTYPE { CONTROL, POWER, DAMAGE, UTILITY ,TRANSFORM, CURSE, ESSENTIAL }; @@ -151,12 +151,14 @@ typedef struct tagUIObjectDesc RECT m_pRect{}; - _int m_iSkillType{}; + _int m_iSpellType{}; _float m_fSortZ{}; _float m_fMoveSpeed{}; _float4 m_vNine_Slice{}; + _float m_fTopY{}; + protected: virtual HRESULT Initialize_Prototype(); virtual HRESULT Initialize(void* pArg); diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h index 6c65232a6..2ad90c4aa 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h @@ -12,8 +12,7 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance }UI_INSTANCE_DESC; typedef struct tagUIAtlasDesc { - _float2 fUVStart{}; - _float2 fUVEnd{}; + _float4 fUV{}; }UI_ATLAS_DESC; private: CVIBuffer_UI_Instance(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -32,7 +31,9 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance void Set_SizeX(_float fSizeX); void Set_SizeY(_float fSizeY); void Set_Cloned(_bool isCloned) { m_isCloned = isCloned; } - void Set_ImageUV(UI_ATLAS_DESC* AtlasUV = nullptr); + void Set_ImageUV(UI_ATLAS_DESC* AtlasUV); + void Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float4 vColor); + _uint Set_Mouse_Hover(_float2 fMousePos); private: VTX_INSTANCE_UI* m_pInstanceVertices = { nullptr };