diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 9d4ab8cb3..0f9ebe921 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -193,6 +193,7 @@ call Update_Resources.bat + @@ -494,6 +495,7 @@ call Update_Resources.bat + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index e970fcc8c..dd47c1e6c 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -924,6 +924,9 @@ 02.GameObjects\NPC\Hostile\Monster\Ranrok + + 02.GameObjects\Environment\03.MapElement\Balloon + @@ -1909,6 +1912,9 @@ {c0fdb122-503b-47f0-a544-90d153464c9a} + + {e198ab8c-2452-4f6e-adda-ecea58b44da9} + @@ -2780,6 +2786,9 @@ 04.Mechanic\State\State_Combat\State_Block + + 02.GameObjects\Environment\03.MapElement\Balloon + diff --git a/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp b/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp index 970fd4077..8a1139d74 100644 --- a/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp +++ b/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp @@ -3,11 +3,13 @@ #include "GameInstance.h" #include "RaceRing.h" +#include "MapElement_Balloon.h" #include "Layer.h" #include "BroomRacerAI.h" #include "Player.h" #include "Broom.h" #include "InfoInstance.h" +#include "InstancedProp.h" CBroomRaceManager::CBroomRaceManager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CGameObject(pDevice, pContext) @@ -501,6 +503,26 @@ void CBroomRaceManager::RaceReady() { MSG_BOX("Failed Load RaceRing"); } + + if (FAILED(Load_Balloons())) + { + MSG_BOX("Failed Load Balloons"); + } + + CInstancedProp::INSTANCE_PROP_DESC Instance_Desc = {}; + + /* InstanceProp RouteMarker*/ + Instance_Desc.isShake = false; + Instance_Desc.eShaderPass = SHADER_PASS_WORLDMODLE_INSTANCE::NONCULL; + Instance_Desc.bEnableRigidbody = false; + Instance_Desc.vRadius = _float2(0.f, 0.f); + Instance_Desc.vSpeed = _float2(0.f, 0.f); + Instance_Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SK_BRR_RouteMarker"; + Instance_Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/RouteMarker.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Instance_Desc))) { + return; + } + CBroomRacerAI::RacerDesc Desc = {}; for (_uint i = 1; i < 4; i++) { @@ -658,3 +680,51 @@ HRESULT CBroomRaceManager::Load_RaceRing() return S_OK; } +HRESULT CBroomRaceManager::Load_Balloons() +{ + tinyxml2::XMLDocument xmlDoc; + + string strPath = "../Bin/Resources/Data/Map/Balloon/Ballon_Data.xml"; + + if ((tinyxml2::XML_SUCCESS != xmlDoc.LoadFile(strPath.c_str()))) + return E_FAIL; + + tinyxml2::XMLElement* root = xmlDoc.FirstChildElement("Balloon"); + + if (nullptr == root) + { + MSG_BOX("Failed to Find root"); + return S_OK; + } + + for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object")) + { + CMapElement_Balloon::BALLOON_DESC Desc = {}; + + auto* Value = Object->FirstChildElement("Value"); + Value->QueryBoolAttribute("isFloating", &Desc.isFloating); + Value->QueryUnsignedAttribute("DiffuseIndex", &Desc.iDiffuseIndex); + + /* Transform */ + auto* Rotation = Object->FirstChildElement("Scale"); + Rotation->QueryFloatAttribute("x", &Desc.vScale.x); + Rotation->QueryFloatAttribute("y", &Desc.vScale.y); + Rotation->QueryFloatAttribute("z", &Desc.vScale.z); + + auto* Scale = Object->FirstChildElement("Rotation"); + Scale->QueryFloatAttribute("x", &Desc.vRotation.x); + Scale->QueryFloatAttribute("y", &Desc.vRotation.y); + Scale->QueryFloatAttribute("z", &Desc.vRotation.z); + + auto* Position = Object->FirstChildElement("Position"); + Position->QueryFloatAttribute("x", &Desc.vPosition.x); + Position->QueryFloatAttribute("y", &Desc.vPosition.y); + Position->QueryFloatAttribute("z", &Desc.vPosition.z); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + } + + return S_OK; +} + diff --git a/Jusin154_Team3D/Client/Private/InstancedProp.cpp b/Jusin154_Team3D/Client/Private/InstancedProp.cpp index 0a89ecc4f..a4f8ad00f 100644 --- a/Jusin154_Team3D/Client/Private/InstancedProp.cpp +++ b/Jusin154_Team3D/Client/Private/InstancedProp.cpp @@ -27,7 +27,6 @@ void CInstancedProp::Late_Update(_float fTimeDelta) } m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); - m_pGameInstance->Add_RenderGroup(RENDER::SHADOW_NEAR, this); m_pGameInstance->Add_RenderGroup(RENDER::SHADOW_MIDDLE, this); } @@ -42,7 +41,7 @@ HRESULT CInstancedProp::Render() if (FAILED(m_pVIBufferInstanceCom->Bind_Matrial(m_pShaderCom, i))) return E_FAIL; - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_WORLDMODLE_INSTANCE::DEFAULT)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(m_eShaderPass)))) return E_FAIL; m_pVIBufferInstanceCom->Render(i); @@ -67,7 +66,7 @@ HRESULT CInstancedProp::Render_Shadow(SHADOW eType) if (FAILED(m_pVIBufferInstanceCom->Bind_Matrial(m_pShaderCom, i))) return E_FAIL; - if (FAILED(m_pShaderCom->Begin(3))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_WORLDMODLE_INSTANCE::SHADOW)))) return E_FAIL; m_pVIBufferInstanceCom->Render(i); diff --git a/Jusin154_Team3D/Client/Private/Land.cpp b/Jusin154_Team3D/Client/Private/Land.cpp index aab65132f..f37bd626d 100644 --- a/Jusin154_Team3D/Client/Private/Land.cpp +++ b/Jusin154_Team3D/Client/Private/Land.cpp @@ -2,6 +2,7 @@ #include "Land.h" #include "GameInstance.h" +#include "InstancedProp.h" CLand::CLand(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CGameObject{ pDevice, pContext } @@ -16,16 +17,24 @@ CLand::CLand(const CLand& rhs) void CLand::Priority_Update(_float fTimeDelta) { + for (auto& pInstanceProp : m_InstanceProps) + pInstanceProp->Priority_Update(fTimeDelta); } void CLand::Update(_float fTimeDelta) { + for (auto& pInstanceProp : m_InstanceProps) + pInstanceProp->Update(fTimeDelta); } void CLand::Late_Update(_float fTimeDelta) { if (m_pGameInstance->IsIn_WorldFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_fRaduis)) + { m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + for (auto& pInstanceProp : m_InstanceProps) + pInstanceProp->Late_Update(fTimeDelta); + } } HRESULT CLand::Render() @@ -34,9 +43,6 @@ HRESULT CLand::Render() return E_FAIL; } - //if (FAILED(m_pModelCom->Bind_Material(0, m_pShaderCom))) - // return E_FAIL; - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::LAND)))) { return E_FAIL; } @@ -70,6 +76,11 @@ HRESULT CLand::Render_Shadow(SHADOW eType) return S_OK; } +void CLand::Add_InstanceProp(CInstancedProp* pIntanceProp) +{ + m_InstanceProps.push_back(pIntanceProp); +} + HRESULT CLand::Initialize_Prototype() { m_fUsingSurfaceParams = MRO_PARAMETER; @@ -207,6 +218,9 @@ void CLand::Free() SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pModelCom); + + for (auto& pInstanceProp : m_InstanceProps) + SAFE_RELEASE(pInstanceProp); } #ifdef _DEBUG void CLand::Describe_Entity() diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 9c690eabd..5d18ce973 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -66,7 +66,6 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) #endif // #endif // _DEBUG - if (FAILED(Ready_Lights())) { return E_FAIL; } @@ -83,9 +82,16 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) if (FAILED(Ready_Background())) { return E_FAIL; } - if (FAILED(Ready_Land())) { + + map<_string, CLand*> Lands = {}; + + if (FAILED(Ready_Land(&Lands))) { return E_FAIL; } + + if (FAILED(Ready_IntstanceProp(&Lands))) + return E_FAIL; + if (FAILED(Ready_Markers())) { return E_FAIL; } @@ -296,8 +302,8 @@ HRESULT CLevel_GamePlay::Ready_Background() #ifdef gimch isReady_Background = true; - isReady_Hogsmeade = true; - isReady_Hogwart = false; + isReady_Hogsmeade = false; + isReady_Hogwart = true; #endif // gimch #ifdef Bin isReady_Background = false; @@ -336,7 +342,6 @@ HRESULT CLevel_GamePlay::Ready_Background() #else #endif - if (isReady_Hogsmeade) { if (FAILED(Ready_Layer_Hogsmeade())) @@ -348,131 +353,144 @@ HRESULT CLevel_GamePlay::Ready_Background() if (FAILED(Ready_Layer_Hogwart())) return E_FAIL; } - - - - if (FAILED(Ready_IntstanceProp())) - return E_FAIL; } return S_OK; } -HRESULT CLevel_GamePlay::Ready_Land() +HRESULT CLevel_GamePlay::Ready_Land(map<_string, CLand*>* Lands) { + CLand* pLand = { nullptr }; + CLand::LAND_DESC Land_Desc = {}; - /* South_Hogwart_Land */ + /* HN_BC */ Land_Desc.vPosition = _float3(290.5f, 59.5f, -347.f); Land_Desc.vScale = _float3(1.f, 1.25f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_South_Hogwart_Land_LOD1"; Land_Desc.strAlphaMapTag = L"Land_HN_BC_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_BC", pLand); - /* North_Hogwart_Land */ + /* HN_AV */ Land_Desc.vPosition = _float3(-370.f, -37.5f, -21.4f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_North_Hogwart_Land_LOD1"; Land_Desc.strAlphaMapTag = L"Land_HN_AV_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_AV", pLand); - /* North_Hogwart2_Land */ + + /* HN_AU */ Land_Desc.vPosition = _float3(-378.f, -17.5f, 285.6f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_North_Hogwart2_Land_LOD1"; Land_Desc.strAlphaMapTag = L"Land_HN_AU_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_AU", pLand); - /* West_Hogwart_Land */ + /* HN_AZ */ Land_Desc.vPosition = _float3(-653.f, 20.f, -327.4f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_West_Hogwart_Land_LOD1"; Land_Desc.strAlphaMapTag = L"Land_HN_AZ_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_AZ", pLand); - /* East_Hogsmeade_Land */ + /* HN_AY */ Land_Desc.vPosition = _float3(436.f, 55.f, 60.3f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_East_Hogsmeade_Land_LOD1"; Land_Desc.strAlphaMapTag = L"Land_HN_AY_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_AY", pLand); + /* HN_BA */ Land_Desc.vPosition = _float3(-606.f, 70.f, -647.7f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_Land_HN_BA"; Land_Desc.strAlphaMapTag = L"Land_HN_BA_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_BA", pLand); /* HN_BD */ Land_Desc.vPosition = _float3(201.4f, -22.9f, -650.1f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_Land_HN_BD"; Land_Desc.strAlphaMapTag = L"Land_HN_BD_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_BD", pLand); /* HN_BG */ Land_Desc.vPosition = _float3(-377.8f, 5.f, -1038.49f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_Land_HN_BG"; Land_Desc.strAlphaMapTag = L"Land_HN_BG_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_BG", pLand); /* HN_BH */ Land_Desc.vPosition = _float3(80.1f, -63.f, -908.3f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_Land_HN_BH"; Land_Desc.strAlphaMapTag = L"Land_HN_BH_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_BH", pLand); /* HN_BE */ Land_Desc.vPosition = _float3(431.2f, 100.1f, -658.3f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_Land_HN_BE"; Land_Desc.strAlphaMapTag = L"Land_HN_BE_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_BE", pLand); /* HN_BF */ Land_Desc.vPosition = _float3(-688.9f, 170.7f, -1066.f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_Land_HN_BF"; Land_Desc.strAlphaMapTag = L"Land_HN_BF_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_BF", pLand); /* HN_BI */ Land_Desc.vPosition = _float3(82.7f, -61.f, -1141.6f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_Land_HN_BI"; Land_Desc.strAlphaMapTag = L"Land_HN_BI_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_BI", pLand); /* HN_BJ */ Land_Desc.vPosition = _float3(367.1f, 44.8f, -1016.f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_Land_HN_BJ"; Land_Desc.strAlphaMapTag = L"Land_HN_BJ_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("HN_BJ", pLand); /* TU_BB */ Land_Desc.vPosition = _float3(-829.5f, 58.3f, 112.9f); Land_Desc.vScale = _float3(1.f, 1.2f, 1.f); Land_Desc.strModelComTag = L"Prototype_Component_Land_TU_BB"; Land_Desc.strAlphaMapTag = L"Land_TU_BB_AlphaMap"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Land_Desc, nullptr, &pLand))) return E_FAIL; + Lands->emplace("TU_BB", pLand); return S_OK; } @@ -498,7 +516,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Hogsmeade() /* Chests */ CInfoInstance::GetInstance()->Load_ChestElemet("Element_Chest_Info", LAYER_HOGSMEADE); - /* Hogwart Unified*/ + /* Hogsmeade Unified*/ CUnified::UNIFIED_DESC Desc = {}; Desc.fLodSwitchDistnace = 500.f; Desc.vUnifiedCenterPos = _float4(62.f, 10.f, 93.f, 1.f); @@ -526,8 +544,8 @@ HRESULT CLevel_GamePlay::Ready_Layer_Hogwart() CUnified::UNIFIED_DESC Desc = {}; /* Hogwart Unified*/ - Desc.fLodSwitchDistnace = 400.f; - Desc.vUnifiedCenterPos = _float4(-250.2f, 17.2f, -500.7f, 1.f); + Desc.fLodSwitchDistnace = 500.f; + Desc.vUnifiedCenterPos = _float4(-291.2f, 17.2f, -500.7f, 1.f); Desc.vPosition = _float3(-291.2f, 17.2f, -474.7f); Desc.vRotation = _float3(0.f, 0.f, 0.f); Desc.vScale = _float3(1.f, 1.f, 1.f); @@ -540,26 +558,29 @@ HRESULT CLevel_GamePlay::Ready_Layer_Hogwart() return S_OK; } -HRESULT CLevel_GamePlay::Ready_IntstanceProp() +HRESULT CLevel_GamePlay::Ready_IntstanceProp(map<_string, CLand*>* Lands) { + CInstancedProp* pInstancedProp = { nullptr }; CInstancedProp::INSTANCE_PROP_DESC Desc = {}; /* InstanceProp Oak_Tree*/ Desc.isShake = true; + Desc.eShaderPass = SHADER_PASS_WORLDMODLE_INSTANCE::DEFAULT; Desc.bEnableRigidbody = true; Desc.vRadius = _float2(0.015f, 0.02f); Desc.vSpeed = _float2(0.3f, 1.f); Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OakTree_MedA.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_HOGSMEADE, &Desc))) { return E_FAIL; } Desc.isShake = false; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OakTree_MedA_HN_BB.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_HOGWART, &Desc))) { return E_FAIL; } + /* BearBerry */ Desc.isShake = true; Desc.bEnableRigidbody = false; @@ -567,7 +588,7 @@ HRESULT CLevel_GamePlay::Ready_IntstanceProp() Desc.vSpeed = _float2(0.6f, 1.f); Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_BearBerry_A"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/BearBerry_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_HOGSMEADE, &Desc))) { return E_FAIL; } @@ -682,7 +703,7 @@ HRESULT CLevel_GamePlay::Ready_IntstanceProp() return E_FAIL; Desc.isShake = false; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/BogMyrtle_A_HN_BB.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_HOGWART, &Desc))) return E_FAIL; /* Dogwood_B */ @@ -706,16 +727,16 @@ HRESULT CLevel_GamePlay::Ready_IntstanceProp() return E_FAIL; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/ScotsPine_LargeA_HN_BB.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_HOGWART, &Desc))) return E_FAIL; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/ScotsPine_LargeA_HN_BB_2.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_HOGWART, &Desc))) return E_FAIL; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/ScotsPine_LargeA_HN_AZ.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(Bind_InstanceProp(Lands, m_pGameInstance->Clone_Prototype(g_iStaticLevel, &Desc), "HN_AZ"))) return E_FAIL; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/ScotsPine_LargeA_HN_AV.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(Bind_InstanceProp(Lands, m_pGameInstance->Clone_Prototype(g_iStaticLevel, &Desc), "HN_AV"))) return E_FAIL; /* StratifiedCliff_A1 */ @@ -726,19 +747,19 @@ HRESULT CLevel_GamePlay::Ready_IntstanceProp() Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_StratifiedCliff_A1"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/CliffwallA_HN_BC.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(Bind_InstanceProp(Lands, m_pGameInstance->Clone_Prototype(g_iStaticLevel, &Desc), "HN_BC"))) return E_FAIL; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/CliffwallA_HN_BB.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_HOGWART, &Desc))) return E_FAIL; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/CliffwallA_HN_AZ.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(Bind_InstanceProp(Lands, m_pGameInstance->Clone_Prototype(g_iStaticLevel, &Desc), "HN_AZ"))) return E_FAIL; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/CliffwallA_HN_AV.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(Bind_InstanceProp(Lands, m_pGameInstance->Clone_Prototype(g_iStaticLevel, &Desc), "HN_AV"))) return E_FAIL; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/CliffwallA_HN_AW.bin"; @@ -752,11 +773,11 @@ HRESULT CLevel_GamePlay::Ready_IntstanceProp() Desc.vSpeed = _float2(0.3f, 1.f); Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_StratifiedRock_B"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/StratifiedRock_B_HN_BB.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_HOGWART, &Desc))) return E_FAIL; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/StratifiedRock_B_HN_AZ.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(Bind_InstanceProp(Lands, m_pGameInstance->Clone_Prototype(g_iStaticLevel, &Desc), "HN_AZ"))) return E_FAIL; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/StratifiedRock_B_HN_AW.bin"; @@ -770,7 +791,7 @@ HRESULT CLevel_GamePlay::Ready_IntstanceProp() Desc.vSpeed = _float2(0.3f, 1.f); Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_StratifiedRock_D_B"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/StratifiedRock_D_B_HN_BB.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_HOGWART, &Desc))) return E_FAIL; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/StratifiedRock_D_B_BACK.bin"; @@ -916,8 +937,8 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag) _bool isLoad_RandomNPC = { true }; #ifdef _DEBUG #ifdef gimch - isLoad_NPC = false; - isLoad_RandomNPC = false; + isLoad_NPC = true; + isLoad_RandomNPC = true; #endif // gimch #ifdef 진우 isLoad_RandomNPC = true; @@ -1095,6 +1116,18 @@ HRESULT CLevel_GamePlay::Reday_Layer_EffectPool() return S_OK; } +HRESULT CLevel_GamePlay::Bind_InstanceProp(map<_string, class CLand*>* Lands, CInstancedProp* pInstnace, const _char* LandTag) +{ + auto iter = Lands->find(LandTag); + + if (iter == Lands->end()) + return E_FAIL; + + iter->second->Add_InstanceProp(pInstnace); + + return S_OK; +} + pair> CLevel_GamePlay::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg) { CLevel_GamePlay* pInstance = new CLevel_GamePlay(pDevice, pContext, eLevelID); diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index fe670f06b..a42a2ec55 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -272,6 +272,7 @@ #include "MapElement_Static.h" #include "WorldDecal.h" #include "PointLight.h" +#include "MapElement_Balloon.h" #pragma endregion @@ -417,10 +418,10 @@ HRESULT CLoader::Loading_For_GamePlay() #ifdef _DEBUG #ifdef gimch isLoad_Background = true; - isLoad_Hogwart = false; + isLoad_Hogwart = true; isLoad_UI_SEQUANTIAL = false; - isLoad_NPC = false; - isLoad_DataClassroom = true; + isLoad_NPC = true; + isLoad_DataClassroom = false; #endif // gimch #ifdef 진우 isLoad_Background = false; @@ -1752,6 +1753,25 @@ HRESULT CLoader::Loading_For_GamePlay() TEXT("C:/MeshTable/Game/Environment/Hogsmeade/Common/Textures/LightPosts/T_HM_LampPost_Glass_Dark_D.png"), 0)))) { return E_FAIL; } + + /* Balloon_Diffuse */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Balloon_Diffuse"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_%d.dds"), 4)))) { + return E_FAIL; + } + + /* Balloon_Normal */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Balloon_Normal"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_N.dds"), 0)))) { + return E_FAIL; + } + + /* Balloon_MRO */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Balloon_MRO"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_MRO.dds"), 0)))) { + return E_FAIL; + } + #pragma endregion #pragma region LAKE_TEXTURE /* For.Prototype_Component_Water_Noise_D */ @@ -3497,9 +3517,20 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(Ready_RigidBody_Static(pModel_Instance))) return E_FAIL; } + + + /* For.Prototype_Component_VIBuffer_Model_Instancel_SK_BRR_RouteMarker */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SK_BRR_RouteMarker"), + CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext, + "../Bin/Resources/Models/InstanceProp/SK_BRR_RouteMarker.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml")))) + return E_FAIL; + #pragma endregion - + /* For.Prototype_Component_FloatingBalloon */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, TEXT("Prototype_Component_FloatingBalloon"), + CModel::Create(m_pDevice, m_pContext, MODEL::ENVIRONMENT, "C:/MeshTable/Game/RiggedObjects/Props/FloatingBalloonTarget/SK_FloatingBalloonTarget_.fbx")))) + return E_FAIL; /* For.Prototype_Component_Hogwart_Lake */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, TEXT("Prototype_Component_Hogwart_Lake"), @@ -3714,6 +3745,10 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CRaceRing::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_MapElement_Balloon */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMapElement_Balloon::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Troll_Weapon */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTroll_Weapon::Create(m_pDevice, m_pContext)))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/MapElement_Balloon.cpp b/Jusin154_Team3D/Client/Private/MapElement_Balloon.cpp new file mode 100644 index 000000000..3c901f86e --- /dev/null +++ b/Jusin154_Team3D/Client/Private/MapElement_Balloon.cpp @@ -0,0 +1,210 @@ +#include "pch.h" +#include "MapElement_Balloon.h" + +#include "GameInstance.h" + +CMapElement_Balloon::CMapElement_Balloon(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CMapElement{ pDevice, pContext } +{ +} + +CMapElement_Balloon::CMapElement_Balloon(const CMapElement_Balloon& rhs) + : CMapElement(rhs) + , m_fUsingSurfaceParams(rhs.m_fUsingSurfaceParams) + , m_fTimeAcc(0.f) +{ +} + +HRESULT CMapElement_Balloon::Initialize_Prototype() +{ + m_fUsingSurfaceParams = MRO_PARAMETER; + + return S_OK; +} + +HRESULT CMapElement_Balloon::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + m_isRotate = false; + m_fRadius = 10.f; + + BALLOON_DESC* pDesc = static_cast(pArg); + m_isFloating = pDesc->isFloating; + m_iDiffuseIndex = pDesc->iDiffuseIndex; + + memcpy(&m_vOriginPosition, &pDesc->vPosition, sizeof(_float3)); + + m_pTransformCom->Set_Scale(pDesc->vScale); + m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z)); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f)); + + return S_OK; +} + +void CMapElement_Balloon::Priority_Update(_float fTimeDelta) +{ +} + +void CMapElement_Balloon::Update(_float fTimeDelta) +{ + m_fTimeAcc += fTimeDelta; + + if (m_isFloating) + Floating(); + + if (m_isRotate) + Rotation(); +} + +void CMapElement_Balloon::Late_Update(_float fTimeDelta) +{ + if(m_pGameInstance->IsIn_WorldFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_fRadius)) + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); +} + +HRESULT CMapElement_Balloon::Render() +{ + if (FAILED(Bind_ShaderResources())) + return E_FAIL; + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelComs[0]->Render(0))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CMapElement_Balloon::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + CModel* pModel = { nullptr }; + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(NEXT_LEVEL, TEXT("Prototype_Component_FloatingBalloon"), + 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; + + /* Com_Texture */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Balloon_Diffuse"), + reinterpret_cast(&m_pDiffuseTextureCom)))) + return E_FAIL; + /* Com_Texture */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Balloon_Normal"), + reinterpret_cast(&m_pNormalTextureCom)))) + return E_FAIL; + /* Com_Texture */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Balloon_MRO"), + reinterpret_cast(&m_pMROTextureCom)))) + return E_FAIL; + + return S_OK; +} + +HRESULT CMapElement_Balloon::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_SRV("g_DiffuseTexture", m_pDiffuseTextureCom->Get_SRV(m_iDiffuseIndex)))) + return E_FAIL; + if (FAILED(m_pShaderCom->Bind_SRV("g_NormalTexture", m_pNormalTextureCom->Get_SRV(0)))) + return E_FAIL; + if (FAILED(m_pShaderCom->Bind_SRV("g_SurfaceParamsTexture", m_pMROTextureCom->Get_SRV(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_fUsingSurfaceParams", &m_fUsingSurfaceParams, sizeof(_float)))) { + return E_FAIL; + } + + return S_OK; +} + +void CMapElement_Balloon::Rotation() +{ + +} + +void CMapElement_Balloon::Floating() +{ + _float3 vPosition = m_vOriginPosition; + + vPosition.y = m_vOriginPosition.y + sinf(m_fTimeAcc); + + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&vPosition), 1.f)); +} + +CMapElement_Balloon* CMapElement_Balloon::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMapElement_Balloon* pInstance = new CMapElement_Balloon(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMapElement_Balloon"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CMapElement_Balloon::Clone(void* pArg, CGameObject* pOwner) +{ + CMapElement_Balloon* pInstance = new CMapElement_Balloon(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMapElement_Balloon"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMapElement_Balloon::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pShaderCom); + for (auto& pModel : m_pModelComs) + SAFE_RELEASE(pModel); + + SAFE_RELEASE(m_pDiffuseTextureCom); + SAFE_RELEASE(m_pNormalTextureCom); + SAFE_RELEASE(m_pMROTextureCom); +} + +#ifdef _DEBUG +void CMapElement_Balloon::Describe_Entity() +{ +} +#endif // _DEBUG + + diff --git a/Jusin154_Team3D/Client/Private/Ranrok.cpp b/Jusin154_Team3D/Client/Private/Ranrok.cpp index 0fbae648f..f1971b2d3 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok.cpp @@ -1056,7 +1056,9 @@ void CRanrok::Free() SAFE_RELEASE(m_pTargetableDO[i]); } m_pRanrok_Props.clear(); +#ifdef _DEBUG SAFE_RELEASE(m_pDepthStencilStateNone); +#endif SAFE_RELEASE(m_pMotionTrailCom); SAFE_RELEASE(m_pCharacter_Controller); SAFE_RELEASE(m_pRigidBody); diff --git a/Jusin154_Team3D/Client/Public/BroomRaceManager.h b/Jusin154_Team3D/Client/Public/BroomRaceManager.h index 7d2a46194..24c997402 100644 --- a/Jusin154_Team3D/Client/Public/BroomRaceManager.h +++ b/Jusin154_Team3D/Client/Public/BroomRaceManager.h @@ -43,6 +43,7 @@ class CBroomRaceManager final : public CGameObject _int Get_RaceState() const { return m_eRaceState; } HRESULT Load_RaceRing(); + HRESULT Load_Balloons(); private: CInfoInstance* m_pInfoInstance = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 8d4265ceb..c366f9f10 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -25,7 +25,7 @@ namespace Client ENEMY_DETECTION, INTERACTION_OBJECT, INTERACTION_NPC, BROOMTARGETGATE, END }; enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, UVALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, SPELL_SLOT, SPELL_LOCK, QUEST_SLOT, END }; - enum class SHADER_PASS_WORLDMODLE_INSTANCE { DEFAULT, LIGHT, BLOOM }; + enum class SHADER_PASS_WORLDMODLE_INSTANCE { DEFAULT, LIGHT, BLOOM, SHADOW, NONCULL }; enum class SHADER_PASS_NPC_PBR_ANIM { EYELASH_DAOTHV_ToSRO, TEETH_SRXO_ToSRO, EYE_DN_ToSRO, EYE_OCC, FACIAL_HAIR_DAOTHV_ToSRO, HEAD_HAIR_DAOTHV_ToSRO, HEADwtHAND_DSRXON_ToSRO, LOWER_DSRON_ToSRO, diff --git a/Jusin154_Team3D/Client/Public/InstancedProp.h b/Jusin154_Team3D/Client/Public/InstancedProp.h index a1003cf15..460ed6b0e 100644 --- a/Jusin154_Team3D/Client/Public/InstancedProp.h +++ b/Jusin154_Team3D/Client/Public/InstancedProp.h @@ -16,12 +16,13 @@ class CInstancedProp final : public CGameObject public: typedef struct tagInstancedPropDesc { - _bool isShake; - _bool bEnableRigidbody; - _float2 vRadius; - _float2 vSpeed; - _wstring strPrototypeTag; - _string strInstanceDataPath; + SHADER_PASS_WORLDMODLE_INSTANCE eShaderPass; + _bool isShake; + _bool bEnableRigidbody; + _float2 vRadius; + _float2 vSpeed; + _wstring strPrototypeTag; + _string strInstanceDataPath; }INSTANCE_PROP_DESC; private: CInstancedProp(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -36,13 +37,15 @@ class CInstancedProp final : public CGameObject virtual HRESULT Render_Shadow(SHADOW eType)override; private: - _bool m_isShake = {}; - _uint m_iNumMesh = {}; - _uint m_iNumInstacne = {}; + _bool m_isShake = {}; + _uint m_iNumMesh = {}; + _uint m_iNumInstacne = {}; + SHADER_PASS_WORLDMODLE_INSTANCE m_eShaderPass = {}; - vector m_RigidBody = { nullptr }; - CVIBuffer_Model_Instance* m_pVIBufferInstanceCom = { nullptr }; - CShader* m_pShaderCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Model_Instance* m_pVIBufferInstanceCom = { nullptr }; + + vector m_RigidBody = { nullptr }; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/Land.h b/Jusin154_Team3D/Client/Public/Land.h index 6f8cecada..3f55faf5b 100644 --- a/Jusin154_Team3D/Client/Public/Land.h +++ b/Jusin154_Team3D/Client/Public/Land.h @@ -9,7 +9,7 @@ class CShader; NS_END NS_BEGIN(Client) - +class CInstancedProp; class CLand final : public CGameObject { public: @@ -32,6 +32,7 @@ class CLand final : public CGameObject virtual HRESULT Render() override; virtual HRESULT Render_Shadow(SHADOW eType) override; + void Add_InstanceProp(CInstancedProp* pIntanceProp); private: _float m_fRaduis = {}; _float m_fUsingSurfaceParams = {}; @@ -44,6 +45,7 @@ class CLand final : public CGameObject CTexture* m_pMROTextureCom = { nullptr }; CTexture* m_pMaskTextureCom = { nullptr }; + list m_InstanceProps = {}; private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; diff --git a/Jusin154_Team3D/Client/Public/Level_GamePlay.h b/Jusin154_Team3D/Client/Public/Level_GamePlay.h index 18c4f67c7..a9df049af 100644 --- a/Jusin154_Team3D/Client/Public/Level_GamePlay.h +++ b/Jusin154_Team3D/Client/Public/Level_GamePlay.h @@ -31,10 +31,10 @@ class CLevel_GamePlay final : public CLevel HRESULT Ready_Lights(); HRESULT Ready_Volumetric(); HRESULT Ready_Background(); - HRESULT Ready_Land(); + HRESULT Ready_Land(map<_string, class CLand*>* Lands); HRESULT Ready_Layer_Hogsmeade(); HRESULT Ready_Layer_Hogwart(); - HRESULT Ready_IntstanceProp(); + HRESULT Ready_IntstanceProp(map<_string, class CLand*>* Lands); HRESULT Ready_Markers(); HRESULT Ready_Layer_UI(const _wstring& strLayerTag); HRESULT Ready_Layer_Camera(); @@ -47,6 +47,7 @@ class CLevel_GamePlay final : public CLevel HRESULT Ready_Layer_Manager(const _wstring& strLayerTag); HRESULT Reday_Layer_EffectPool(); + HRESULT Bind_InstanceProp(map<_string, class CLand*>* Lands, class CInstancedProp* pInstnace, const _char* LandTag); public: static pair> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg); virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/MapElement_Balloon.h b/Jusin154_Team3D/Client/Public/MapElement_Balloon.h new file mode 100644 index 000000000..6f3feea91 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/MapElement_Balloon.h @@ -0,0 +1,63 @@ +#pragma once + +#include "Client_Define.h" +#include "MapElement.h" + +NS_BEGIN(Client) + +class CMapElement_Balloon : public CMapElement +{ +public: + typedef struct tagMapElemntBalloonDesc + { + _bool isFloating; + _uint iDiffuseIndex; + _float3 vPosition; + _float3 vRotation; + _float3 vScale; + }BALLOON_DESC; +private: + CMapElement_Balloon(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMapElement_Balloon(const CMapElement_Balloon& rhs); + virtual ~CMapElement_Balloon() = 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: + CTexture* m_pDiffuseTextureCom = { nullptr }; + CTexture* m_pNormalTextureCom = { nullptr }; + CTexture* m_pMROTextureCom = { nullptr }; + + _bool m_isFloating = {}; + _bool m_isRotate = {}; + _uint m_iDiffuseIndex = {}; + + _float m_fTimeAcc = {}; + _float m_fUsingSurfaceParams = {}; + _float m_fRadius = {}; + + _float3 m_vOriginPosition = {}; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Bind_ShaderResources() override; + + void Rotation(); + void Floating(); + +public: + static CMapElement_Balloon* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Ranrok.h b/Jusin154_Team3D/Client/Public/Ranrok.h index 2790e9664..96e109bfb 100644 --- a/Jusin154_Team3D/Client/Public/Ranrok.h +++ b/Jusin154_Team3D/Client/Public/Ranrok.h @@ -162,10 +162,12 @@ class CRanrok final : public CMonster const _float4x4* m_pTail2_BoneMat = { nullptr }; const _float4x4* m_pRanrokCombinedBoneMatrices[ENUM_CLASS(RANROK_ENUM_BONEMATRICES::END)] = { nullptr }; CRigidBody_Dynamic* m_pTargetableDO[ENUM_CLASS(RANROK_ENUM_BONEMATRICES::END)] = { nullptr }; + + #ifdef _DEBUG unique_ptr m_pSubShape = { nullptr }; - ID3D11DepthStencilState* m_pDepthStencilStateNone = { nullptr }; + ID3D11DepthStencilState* m_pDepthStencilStateNone = { nullptr }; _float4 m_vInitialRotQ = {}; _float3 m_vInitialTrans = {}; #endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Balloon/Ballon_Data.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Balloon/Ballon_Data.xml new file mode 100644 index 000000000..201f5b00a --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Balloon/Ballon_Data.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/InstanceMaterial.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/InstanceMaterial.xml index 02b0c9025..26fb4c25c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/InstanceMaterial.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/InstanceMaterial.xml @@ -298,4 +298,18 @@ SRO + + + T_BRR_RouteBanner_D + T_BRR_RouteBanner_N + T_BRR_RouteBanner_MRO + MRO + + + T_BRR_RouteBanner_D + T_BRR_RouteBanner_N + T_BRR_RouteBanner_MRO + MRO + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/RouteMarker.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/RouteMarker.bin new file mode 100644 index 000000000..5d13f8063 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Instance/RouteMarker.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f50f788682fdc8aeb4d855f605cefd3f602bd1d3f56e8cdbfeca16e1fde02df +size 1284 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml index 59eb99718..fa1f5a812 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml @@ -27,7 +27,7 @@ - + @@ -41,8 +41,8 @@ - - + + @@ -52,17 +52,17 @@ - + - + - - + + @@ -71,13 +71,13 @@ - + - - - + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SK_BRR_RouteMarker.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SK_BRR_RouteMarker.bin new file mode 100644 index 000000000..ff61d9727 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SK_BRR_RouteMarker.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09b595a51013f6246e4673e8e944728748cbdbf50b3eda87dd2d5eef2d2e5ba7 +size 577808 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SK_BRR_RouteMarker.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SK_BRR_RouteMarker.fbx new file mode 100644 index 000000000..61a900666 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/SK_BRR_RouteMarker.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f2ff4c2214e02c8c9d2e3cb7d6752f605ac52de8b286d63f8339f6c0dc8a131 +size 280284 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_BRR_RouteBanner_D.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_BRR_RouteBanner_D.dds new file mode 100644 index 000000000..014cccbc6 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_BRR_RouteBanner_D.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_BRR_RouteBanner_MRO.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_BRR_RouteBanner_MRO.dds new file mode 100644 index 000000000..e1dedf98d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_BRR_RouteBanner_MRO.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_BRR_RouteBanner_N.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_BRR_RouteBanner_N.dds new file mode 100644 index 000000000..04286fe55 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/InstanceProp/Textures/T_BRR_RouteBanner_N.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl index 58536a218..34ff9c9a9 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl @@ -235,7 +235,7 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_BLOOM(); } - pass Shadow + pass Shadow // 3 { SetRasterizerState(RS_Shadow); SetDepthStencilState(DSS_ShadowWrite, 0); @@ -243,6 +243,16 @@ technique11 DefaultTechnique VertexShader = compile vs_5_0 VS_SHADOW(); PixelShader = compile ps_5_0 PS_SHADOW(); } + + pass NonCullModel // 4 + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + + PixelShader = compile ps_5_0 PS_MAIN(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_0.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_0.dds new file mode 100644 index 000000000..4513c1874 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_0.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_1.dds new file mode 100644 index 000000000..cd70f3b5f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_1.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_2.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_2.dds new file mode 100644 index 000000000..0fc50c2fd Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_2.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_3.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_3.dds new file mode 100644 index 000000000..f59421ead Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_3.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_MRO.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_MRO.dds new file mode 100644 index 000000000..0ccdae006 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_MRO.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_N.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_N.dds new file mode 100644 index 000000000..63472a38f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_N.dds differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 2b4ed975e..0d380384f 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -200,6 +200,7 @@ call Update_Shaders.bat + @@ -484,6 +485,7 @@ call Update_Shaders.bat + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index ca3a9b068..259675803 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -784,6 +784,9 @@ {b8e8e46c-ec9f-4a89-a970-c9de2ac3f521} + + {6c70f152-f512-4622-b6ef-27931092deed} + @@ -1587,6 +1590,9 @@ 02.GameObjects\Layer_Effect\Effect_Editor\Effect\Magic\08.Protego\Protego_Hit + + 02.GameObjects\Env\03.MapElement\Balloon + @@ -2398,6 +2404,9 @@ 02.GameObjects\Layer_Effect\Effect_Editor\Effect\Magic\08.Protego\Protego_Hit + + 02.GameObjects\Env\03.MapElement\Balloon + diff --git a/Jusin154_Team3D/Editor/Private/InstancedProp.cpp b/Jusin154_Team3D/Editor/Private/InstancedProp.cpp index 54cc13b07..15eacef55 100644 --- a/Jusin154_Team3D/Editor/Private/InstancedProp.cpp +++ b/Jusin154_Team3D/Editor/Private/InstancedProp.cpp @@ -32,8 +32,8 @@ void CInstancedProp::Update(_float fTimeDelta) m_pVIBufferInstanceCom->Add_Instance(m_pTransformCom->Get_XMWorldMatrix()); m_pVIBufferInstanceCom->Update_Instance(); - m_vRotation.y = m_pGameInstance->Real_Random_Float(-360.f, 360.f); - m_vScale.y = m_pGameInstance->Random_Float(0.8f, 1.2f); + //m_vRotation.y = m_pGameInstance->Real_Random_Float(-360.f, 360.f); + //m_vScale.y = m_pGameInstance->Random_Float(0.8f, 1.2f); _float3 vPosition = {}; if (m_pGameInstance->isPicking(&vPosition)) @@ -70,7 +70,7 @@ HRESULT CInstancedProp::Render() if(FAILED(m_pVIBufferInstanceCom->Bind_Matrial(m_pShaderCom, i))) return E_FAIL; - if (FAILED(m_pShaderCom->Begin(0))) + if (FAILED(m_pShaderCom->Begin(m_iShaderPassIndex))) return E_FAIL; m_pVIBufferInstanceCom->Render(i); @@ -94,7 +94,7 @@ HRESULT CInstancedProp::Initialize(void* pArg) m_bEditMode = pDesc->bEditMode; m_isShake = pDesc->isShake; m_strPrototypeTag = pDesc->strPrototypeTag; - + m_iShaderPassIndex = pDesc->iShaderPassIndex; m_iInstanceIndex = 0; if (FAILED(Ready_Components(pArg))) diff --git a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp index cfb950353..ce750c002 100644 --- a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp @@ -64,13 +64,13 @@ HRESULT CLevel_MapViewer::Initialize() return E_FAIL; } - //if (FAILED(Ready_Layer_Land(TEXT("Layer_Land")))) { - // return E_FAIL; - //} + if (FAILED(Ready_Layer_Land(TEXT("Layer_Land")))) { + return E_FAIL; + } - //if (FAILED(Ready_Layer_InstanceProp(TEXT("Layer_InstanceProp")))) { - // return E_FAIL; - //} + if (FAILED(Ready_Layer_InstanceProp(TEXT("Layer_InstanceProp")))) { + return E_FAIL; + } //if (FAILED(Ready_Layer_BuildingContainer(TEXT("Layer_Building")))) { // return E_FAIL; @@ -92,8 +92,8 @@ HRESULT CLevel_MapViewer::Initialize() return E_FAIL; } - m_pGameInstance->Setting_Volumetirc(1.812f, 0.003f, 0.56f, 1.f, 0.031f); - //m_pGameInstance->Setting_Volumetirc(0.f, 0.003f, 0.56f, 1.f, 0.031f); + //m_pGameInstance->Setting_Volumetirc(1.812f, 0.003f, 0.56f, 1.f, 0.031f); + m_pGameInstance->Setting_Volumetirc(0.f, 0.003f, 0.56f, 1.f, 0.031f); return S_OK; } @@ -148,15 +148,15 @@ HRESULT CLevel_MapViewer::Ready_Layer_Terrain(const _wstring& strLayerTag) CTerrain::TERRAIN_DESC Desc = {}; ///* Hogsmeade */ - //Desc.isEdit = false; - //Desc.iAlphaSizeX = 2048; - //Desc.iAlphaSizeY = 2048; - //Desc.vPosition = _float3(-194, 18.5f, -153.f); - //Desc.strAlphaMapTag = "Hogsmeade_AlphaMap.bin"; - //Desc.strHeightMapTag = "Hogsmeade_HeightMap.bin"; - //Desc.strBufferTag = TEXT("Prototype_Component_VIBuffer_Terrain_Hogsmeade"); - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) - // return E_FAIL; + Desc.isEdit = false; + Desc.iAlphaSizeX = 2048; + Desc.iAlphaSizeY = 2048; + Desc.vPosition = _float3(-194, 18.5f, -153.f); + Desc.strAlphaMapTag = "Hogsmeade_AlphaMap.bin"; + Desc.strHeightMapTag = "Hogsmeade_HeightMap.bin"; + Desc.strBufferTag = TEXT("Prototype_Component_VIBuffer_Terrain_Hogsmeade"); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) + return E_FAIL; /* Hogwart */ Desc.isEdit = false; @@ -374,6 +374,7 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) /* Oak_Tree */ Desc.bEditMode = false; Desc.isShake = true; + Desc.iShaderPassIndex = 0; Desc.vRadius = _float2(0.015f, 0.03f); Desc.vSpeed = _float2(0.3f, 1.f); Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"; @@ -633,6 +634,16 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) return E_FAIL; + Desc.bEditMode = true; + Desc.isShake = false; + Desc.iShaderPassIndex = 4; + Desc.vRadius = _float2(0.f, 0.f); + Desc.vSpeed = _float2(0.f, 0.f); + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SK_BRR_RouteMarker"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/RouteMarker.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &Desc))) + return E_FAIL; + CInstancedProp_Light::INSTANCE_PROP_LIGHT_DESC LightDesc = {}; /* LightPost */ diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index e03420d5d..43cd2bd22 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -182,6 +182,7 @@ #include "MapElement_Chest_Lid.h" #include "LightSpawner.h" #include "RaceRing.h" +#include "MapElement_Balloon.h" #pragma endregion @@ -2577,6 +2578,8 @@ future*> CLoader::Deferred_ModelLoad(MODEL eType, const HRESULT CLoader::Loading_For_MapViewer() { +#pragma region EFFECTS + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::MAP), CEditEffect::Create(m_pDevice, m_pContext)))) { return E_FAIL; } @@ -2796,6 +2799,7 @@ HRESULT CLoader::Loading_For_MapViewer() return S_OK; }); +#pragma endregion #pragma region PLAYER_AND_RANROK //if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Ranrok_Model"), @@ -2890,6 +2894,23 @@ HRESULT CLoader::Loading_For_MapViewer() return E_FAIL; } + /* Balloon_Diffuse */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Balloon_Diffuse"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_D_%d.dds"), 4)))) { + return E_FAIL; + } + + /* Balloon_Normal */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Balloon_Normal"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_N.dds"), 0)))) { + return E_FAIL; + } + + /* Balloon_MRO */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Balloon_MRO"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Balloon/T_FloatingBalloonTarget_MRO.dds"), 0)))) { + return E_FAIL; + } /* Terrain_Diffuse */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Diffuse"), @@ -3079,7 +3100,10 @@ HRESULT CLoader::Loading_For_MapViewer() CModel::Create(m_pDevice, m_pContext, MODEL::ENVIRONMENT, "C:/MeshTable/Game/Levels/Overland/HOG/TU_BBLOD/SM_LandscapeStreamingProxy_0_LOD1.bin")))) return E_FAIL; - + /* For.Prototype_Component_FloatingBalloon */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_FloatingBalloon"), + CModel::Create(m_pDevice, m_pContext, MODEL::ENVIRONMENT, "C:/MeshTable/Game/RiggedObjects/Props/FloatingBalloonTarget/SK_FloatingBalloonTarget_.fbx")))) + return E_FAIL; /* For.Prototype_Component_Hogwart_Lake */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_Hogwart_Lake"), @@ -3385,7 +3409,7 @@ _bool bLoadHogsmeade = true; } #pragma region HOGWART -_bool bHogwartLoad = { false }; +_bool bHogwartLoad = { true }; /* Hogwart LOD */ if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Hogwarts/HogwartsLOD", @@ -3610,7 +3634,7 @@ if(bHogwartLoad) #pragma region DUNGEON -_bool bDungeonLoad = { true }; +_bool bDungeonLoad = { false }; if (bDungeonLoad) { @@ -4097,7 +4121,7 @@ if(isLoad_Map) #pragma region INSTANCE_MODEL CVIBuffer_Model_Instance::INSTANCE_DESC InstanceDesc = {}; - InstanceDesc.iNum = 20; + InstanceDesc.iNum = 50; ///* For.Prototype_Component_VIBuffer_Model_Instancel */ //if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel"), @@ -4255,6 +4279,12 @@ if(isLoad_Map) "../Bin/Resources/Models/InstanceProp/SM_HM_Quid_StoneKit_A.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml")))) return E_FAIL; + + /* For.Prototype_Component_VIBuffer_Model_Instancel_SK_BRR_RouteMarker */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SK_BRR_RouteMarker"), + CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext, &InstanceDesc, + "../Bin/Resources/Models/InstanceProp/SK_BRR_RouteMarker.fbx", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml")))) + return E_FAIL; #pragma endregion // INSTANCE_MODEL /* For.Prototype_Component_VIBuffer_Box */ @@ -4313,6 +4343,10 @@ if(isLoad_Map) if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMapElement_Light::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_MapElement_Light */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMapElement_Balloon::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; diff --git a/Jusin154_Team3D/Editor/Private/MainLight.cpp b/Jusin154_Team3D/Editor/Private/MainLight.cpp index 6917fe8fe..1974bf8ed 100644 --- a/Jusin154_Team3D/Editor/Private/MainLight.cpp +++ b/Jusin154_Team3D/Editor/Private/MainLight.cpp @@ -143,10 +143,13 @@ HRESULT CMainLight::Ready_Components() LightDesc.iLevel = NEXT_LEVEL; #ifdef gimch + //LightDesc.vDiffuse = _float4(0.361f, 0.451f, 0.451f, 0.204f); + //LightDesc.vAmbient = _float4(0.161f, 0.161f, 0.161f, 0.0f); LightDesc.vDiffuse = _float4(0.361f, 0.451f, 0.451f, 0.204f); - LightDesc.vAmbient = _float4(0.161f, 0.161f, 0.161f, 0.0f); + LightDesc.vAmbient = _float4(0.8f, 0.8f, 0.8f, 0.0f); #endif // gimch + /* Com_Light*/ if (FAILED(Add_Component(g_iStaticLevel, &m_pLightCom, &LightDesc))) { diff --git a/Jusin154_Team3D/Editor/Private/MapElement_Balloon.cpp b/Jusin154_Team3D/Editor/Private/MapElement_Balloon.cpp new file mode 100644 index 000000000..8749a3521 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/MapElement_Balloon.cpp @@ -0,0 +1,345 @@ +#include "pch.h" +#include "MapElement_Balloon.h" + +#include "GameInstance.h" + +CMapElement_Balloon::CMapElement_Balloon(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CMapElement{ pDevice, pContext } +{ +} + +CMapElement_Balloon::CMapElement_Balloon(const CMapElement_Balloon& rhs) + : CMapElement(rhs) + , m_fUsingSurfaceParams(rhs.m_fUsingSurfaceParams) +{ +} + +HRESULT CMapElement_Balloon::Initialize_Prototype() +{ + m_fUsingSurfaceParams = MRO_PARAMETER; + + return S_OK; +} + +HRESULT CMapElement_Balloon::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + m_isRotate = false; + m_fTimeAcc = 0.f; + +#ifdef _DEBUG + if (nullptr != pArg) + { + BALLOON_DESC* pDesc = static_cast(pArg); + m_isFloating = pDesc->isFloating; + m_iDiffuseIndex = pDesc->iDiffuseIndex; + m_vPosition = pDesc->vPosition; + m_vScale = pDesc->vScale; + m_vRotation = pDesc->vRotation; + } + else + { + m_isFloating = false; + m_iDiffuseIndex = 0; + m_vPosition = _float3(0.f, 0.f, 0.f); + m_vScale = _float3(0.f, 0.f, 0.f); + m_vRotation = _float3(1.f, 1.f, 1.f); + } + + memcpy(&m_vOriginPosition, &m_vPosition, sizeof(_float3)); + + m_bSelected = false; + + m_pTransformCom->Set_Scale(m_vScale); + m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); + m_pTransformCom->Set_Rotation(m_vRotation); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); + +#endif // _DEBUG + + return S_OK; +} + +void CMapElement_Balloon::Priority_Update(_float fTimeDelta) +{ +#ifdef _DEBUG + m_bSelected = false; +#endif +} + +void CMapElement_Balloon::Update(_float fTimeDelta) +{ + m_fTimeAcc += fTimeDelta; + + if (m_isFloating) + Floating(); + + if (m_isRotate) + Rotation(); +} + +void CMapElement_Balloon::Late_Update(_float fTimeDelta) +{ + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); +} + +HRESULT CMapElement_Balloon::Render() +{ + if (FAILED(Bind_ShaderResources())) + 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[0]->Render(0))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CMapElement_Balloon::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + CModel* pModel = { nullptr }; + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_FloatingBalloon"), + 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; + + /* Com_Texture */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Balloon_Diffuse"), + reinterpret_cast(&m_pDiffuseTextureCom)))) + return E_FAIL; + /* Com_Texture */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Balloon_Normal"), + reinterpret_cast(&m_pNormalTextureCom)))) + return E_FAIL; + /* Com_Texture */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Balloon_MRO"), + reinterpret_cast(&m_pMROTextureCom)))) + return E_FAIL; + + return S_OK; +} + +HRESULT CMapElement_Balloon::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_SRV("g_DiffuseTexture", m_pDiffuseTextureCom->Get_SRV(m_iDiffuseIndex)))) + return E_FAIL; + if (FAILED(m_pShaderCom->Bind_SRV("g_NormalTexture", m_pNormalTextureCom->Get_SRV(0)))) + return E_FAIL; + if (FAILED(m_pShaderCom->Bind_SRV("g_SurfaceParamsTexture", m_pMROTextureCom->Get_SRV(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_fUsingSurfaceParams", &m_fUsingSurfaceParams, sizeof(_float)))) { + return E_FAIL; + } + + return S_OK; +} + +void CMapElement_Balloon::Rotation() +{ + +} + +void CMapElement_Balloon::Floating() +{ + _float3 vPosition = m_vOriginPosition; + + vPosition.y = m_vOriginPosition.y + sinf(m_fTimeAcc); + + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&vPosition), 1.f)); +} + +CMapElement_Balloon* CMapElement_Balloon::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMapElement_Balloon* pInstance = new CMapElement_Balloon(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMapElement_Balloon"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CMapElement_Balloon::Clone(void* pArg, CGameObject* pOwner) +{ + CMapElement_Balloon* pInstance = new CMapElement_Balloon(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMapElement_Balloon"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMapElement_Balloon::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pShaderCom); + for (auto& pModel : m_pModelComs) + SAFE_RELEASE(pModel); + + SAFE_RELEASE(m_pDiffuseTextureCom); + SAFE_RELEASE(m_pNormalTextureCom); + SAFE_RELEASE(m_pMROTextureCom); +} + +void CMapElement_Balloon::Describe_Entity() +{ + if (m_bDead) + return; + if (nullptr == m_pGameInstance) + return; + + GUI::Checkbox("isMove", &m_isFloating); + GUI::Checkbox("isRotate", &m_isRotate); + GUI::InputInt("School Index", (_int*)(&m_iDiffuseIndex)); + + m_iDiffuseIndex = max(m_iDiffuseIndex, 0); + m_iDiffuseIndex = min((_int)m_iDiffuseIndex, 3); + + if (GUI::Button("PosCopy")) + { + XMStoreFloat3(&m_vOriginPosition, m_pTransformCom->Get_State(STATE::POSITION)); + } + + m_iLodIndex = max(0, m_iLodIndex); + m_iLodIndex = min(m_iMaxLodLevel, m_iLodIndex); + + _float3 vMove = {}; + GUI::InputFloat("Right", &vMove.x, 0.05f, 0.1f); + GUI::InputFloat("Up", &vMove.y, 0.05f, 0.1f); + GUI::InputFloat("Look", &vMove.z, 0.05f, 0.1f); + + m_pTransformCom->Move_Right(vMove.x); + m_pTransformCom->Move_Up(vMove.y); + m_pTransformCom->Move_Look(vMove.z); + + XMStoreFloat3(&m_vPosition, m_pTransformCom->Get_State(STATE::POSITION)); + + 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); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); + + + if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT)) + { + _float3 vPosition = {}; + if (m_pGameInstance->isPicking(&vPosition)) + { + memcpy(&m_vPosition, &vPosition, sizeof(_float3)); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); + } + } + + GUI::Text("----- Rotation ----"); + GUI::InputFloat("X##Rotation", &m_vRotation.x, 1.f, 15.f); + GUI::InputFloat("Y##Rotation", &m_vRotation.y, 1.f, 15.f); + GUI::InputFloat("Z##Rotation", &m_vRotation.z, 1.f, 15.f); + + m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); + + GUI::Text("----- Scale ----"); + GUI::InputFloat("X##Scale", &m_vScale.x, 0.05f, 0.1f); + GUI::InputFloat("Y##Scale", &m_vScale.y, 0.05f, 0.1f); + GUI::InputFloat("Z##Scale", &m_vScale.z, 0.05f, 0.1f); + + 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); + + m_pTransformCom->Set_Scale(m_vScale); + + if (GUI::Button("Delete")) + m_bDead = true; + + m_bSelected = true; +} + +HRESULT CMapElement_Balloon::Save_XML(tinyxml2::XMLDocument& doc, tinyxml2::XMLElement* root) +{ + tinyxml2::XMLElement* object = doc.NewElement("Object"); + object->SetAttribute("Type", 0); + root->InsertEndChild(object); + + +#pragma region TRANSFORM + _float3 vPosition = {}; + XMStoreFloat3(&vPosition, m_pTransformCom->Get_State(STATE::POSITION)); + _float3 vScale = m_pTransformCom->Get_Scale(); + _float3 vRotation = m_pTransformCom->Get_Rotation(); + + tinyxml2::XMLElement* Position = doc.NewElement("Position"); + Position->SetAttribute("x", vPosition.x); + Position->SetAttribute("y", vPosition.y); + Position->SetAttribute("z", vPosition.z); + object->InsertEndChild(Position); + + tinyxml2::XMLElement* Scale = doc.NewElement("Scale"); + Scale->SetAttribute("x", vScale.x); + Scale->SetAttribute("y", vScale.y); + Scale->SetAttribute("z", vScale.z); + object->InsertEndChild(Scale); + + tinyxml2::XMLElement* Rotation = doc.NewElement("Rotation"); + Rotation->SetAttribute("x", vRotation.x); + Rotation->SetAttribute("y", vRotation.y); + Rotation->SetAttribute("z", vRotation.z); + object->InsertEndChild(Rotation); + + tinyxml2::XMLElement* Value = doc.NewElement("Value"); + Value->SetAttribute("isFloating", m_isFloating); + Value->SetAttribute("DiffuseIndex", m_iDiffuseIndex); + object->InsertEndChild(Value); +#pragma endregion + + return S_OK; +} diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp index f28d44fcb..4632a649f 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp @@ -18,6 +18,7 @@ #include "RaceRing.h" #include "InstancedProp_Light.h" #include "EditEffect.h" +#include "MapElement_Balloon.h" CMapObject_Manager::CMapObject_Manager(ID3D11Device * pDevice, ID3D11DeviceContext * pContext) : CGameObject(pDevice, pContext), m_pInfoInstance{CInfoInstance::GetInstance()} @@ -91,17 +92,17 @@ HRESULT CMapObject_Manager::Initialize(void* pArg) #pragma endregion #pragma region DUNGEON - if (FAILED(Load_MapData("Dungeon_Map_Data", L"LAYER_BACKGOURN"))) + /*if (FAILED(Load_MapData("Dungeon_Map_Data", L"LAYER_BACKGOURN"))) return E_FAIL; m_pInfoInstance->Load_Decal("Duengon_Decal_Data"); - m_pInfoInstance->Load_PointLights("Duengon_PointLight_Data"); + m_pInfoInstance->Load_PointLights("Duengon_PointLight_Data");*/ #pragma endregion #pragma region HOGWART - //if (FAILED(Load_MapData("Hogwart_MapContainer_Data", LAYER_HOGWART))) - // return E_FAIL; - //if (FAILED(Load_MapData("HogwartMap1221", LAYER_HOGWART))) - // return E_FAIL; + if (FAILED(Load_MapData("Hogwart_MapContainer_Data", LAYER_HOGWART))) + return E_FAIL; + if (FAILED(Load_MapData("HogwartMap1221", LAYER_HOGWART))) + return E_FAIL; #pragma endregion #pragma region Light @@ -124,37 +125,43 @@ HRESULT CMapObject_Manager::Initialize(void* pArg) // ->Set_State(STATE::POSITION, XMVectorSet(1000.f, 0.f, 1000.f, 1.f)); #pragma endregion - +#pragma region BROOM_RACE + if (FAILED(Load_RaceRing("RaceRing_Data"))) + return E_FAIL; + + if (FAILED(Load_Balloons("Ballon_Data"))) + return E_FAIL; +#pragma endregion #pragma region EFFECT_PART - if (FAILED(Load_EffectParts("Goo0_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Goo0"))) - return E_FAIL; - if (FAILED(Load_EffectParts("Goo1_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Goo1"))) - return E_FAIL; - if (FAILED(Load_EffectParts("Ranrok_Goo2_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Goo2"))) - return E_FAIL; - if (FAILED(Load_EffectParts("Ranrok_Goo3_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Goo3"))) - return E_FAIL; - if (FAILED(Load_EffectParts("Ranrok_Goo4_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Goo4"))) - return E_FAIL; - if (FAILED(Load_EffectParts("Ranrok_Decal_15_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Decal_15"))) - return E_FAIL; - if (FAILED(Load_EffectParts("Rotate_Rock_Small_Data", "../Bin/Resources/Data/Effect/MapEffect/Rotate_Rock_Small"))) - return E_FAIL; - if (FAILED(Load_EffectParts("Ranrok_Particle_Black_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Particle_Black"))) - return E_FAIL; - if (FAILED(Load_EffectParts("Ranrok_Particle_Red_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Particle_Red"))) - return E_FAIL; - //if (FAILED(Load_EffectParts("Ranrok_Decal_35_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Decal_35"))) - //return E_FAIL; - if (FAILED(Load_EffectParts("Rotate_Rock_Large1_Data", "../Bin/Resources/Data/Effect/MapEffect/Rotate_Rock_Large1"))) - return E_FAIL; - if (FAILED(Load_EffectParts("Rotate_Rock_Large2_Data", "../Bin/Resources/Data/Effect/MapEffect/Rotate_Rock_Large2"))) - return E_FAIL; + //if (FAILED(Load_EffectParts("Goo0_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Goo0"))) + // return E_FAIL; + //if (FAILED(Load_EffectParts("Goo1_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Goo1"))) + // return E_FAIL; + //if (FAILED(Load_EffectParts("Ranrok_Goo2_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Goo2"))) + // return E_FAIL; + //if (FAILED(Load_EffectParts("Ranrok_Goo3_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Goo3"))) + // return E_FAIL; + //if (FAILED(Load_EffectParts("Ranrok_Goo4_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Goo4"))) + // return E_FAIL; + //if (FAILED(Load_EffectParts("Ranrok_Decal_15_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Decal_15"))) + // return E_FAIL; + //if (FAILED(Load_EffectParts("Rotate_Rock_Small_Data", "../Bin/Resources/Data/Effect/MapEffect/Rotate_Rock_Small"))) + // return E_FAIL; + //if (FAILED(Load_EffectParts("Ranrok_Particle_Black_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Particle_Black"))) + // return E_FAIL; + //if (FAILED(Load_EffectParts("Ranrok_Particle_Red_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Particle_Red"))) + // return E_FAIL; + ////if (FAILED(Load_EffectParts("Ranrok_Decal_35_Data", "../Bin/Resources/Data/Effect/MapEffect/Ranrok_Decal_35"))) + // //return E_FAIL; + //if (FAILED(Load_EffectParts("Rotate_Rock_Large1_Data", "../Bin/Resources/Data/Effect/MapEffect/Rotate_Rock_Large1"))) + // return E_FAIL; + //if (FAILED(Load_EffectParts("Rotate_Rock_Large2_Data", "../Bin/Resources/Data/Effect/MapEffect/Rotate_Rock_Large2"))) + // return E_FAIL; - if (FAILED(Load_EffectParts("Bon_Fire_Data", "../Bin/Resources/Data/Effect/MapEffect/Bon_Fire"))) - return E_FAIL; + //if (FAILED(Load_EffectParts("Bon_Fire_Data", "../Bin/Resources/Data/Effect/MapEffect/Bon_Fire"))) + // return E_FAIL; #pragma endregion @@ -271,9 +278,11 @@ void CMapObject_Manager::Update(_float fTimeDelta) //Update_LightSpawer(); //Update_Decal(); //Update_RaceRing(); - Update_EffectParts(); + //Update_Balloon(); + //Update_EffectParts(); + //Update_Balloon(); - //Update_Unified(); + Update_Unified(); if (ADD_TYPE::CONTAINER == m_eType) { @@ -2052,6 +2061,144 @@ HRESULT CMapObject_Manager::Save_RaceRing(const _char* pFileName) return S_OK; } +HRESULT CMapObject_Manager::Load_RaceRing(const _char* pFileName) +{ + tinyxml2::XMLDocument xmlDoc; + + string strPath = "../Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml"; + + if ((tinyxml2::XML_SUCCESS != xmlDoc.LoadFile(strPath.c_str()))) + return E_FAIL; + + tinyxml2::XMLElement* root = xmlDoc.FirstChildElement("Ring"); + + if (nullptr == root) + { + MSG_BOX("Failed to Find root"); + return S_OK; + } + + for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object")) + { + CRaceRing::RACERING_DESC Desc = {}; + + /* Transform */ + auto* Rotation = Object->FirstChildElement("Scale"); + Rotation->QueryFloatAttribute("x", &Desc.vScale.x); + Rotation->QueryFloatAttribute("y", &Desc.vScale.y); + Rotation->QueryFloatAttribute("z", &Desc.vScale.z); + + auto* Scale = Object->FirstChildElement("Rotation"); + Scale->QueryFloatAttribute("x", &Desc.vRotation.x); + Scale->QueryFloatAttribute("y", &Desc.vRotation.y); + Scale->QueryFloatAttribute("z", &Desc.vRotation.z); + + auto* Position = Object->FirstChildElement("Position"); + Position->QueryFloatAttribute("x", &Desc.vPosition.x); + Position->QueryFloatAttribute("y", &Desc.vPosition.y); + Position->QueryFloatAttribute("z", &Desc.vPosition.z); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_RaceRing"), &Desc))) + return E_FAIL; + } + + + return S_OK; +} + +HRESULT CMapObject_Manager::Save_Balloons(const _char* pFileName) +{ + CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Balloon")); + + if (nullptr == pLayer) + return S_OK; + + tinyxml2::XMLDocument doc; + string strPath = "../Bin/Resources/Data/Map/Balloon/" + string(pFileName) + ".xml"; + + tinyxml2::XMLError loadResult = doc.LoadFile(strPath.c_str()); + + doc.Clear(); + doc.InsertFirstChild(doc.NewDeclaration()); + + tinyxml2::XMLElement* root = doc.NewElement("Balloon"); + doc.InsertEndChild(root); + + if (nullptr != pLayer) + { + const list* pList = pLayer->Get_Objects(); + + for (auto pGamObject : *pList) + { + CMapElement_Balloon* pRaceRing = dynamic_cast(pGamObject); + + if (nullptr == pRaceRing) + return E_FAIL; + + if (FAILED(pRaceRing->Save_XML(doc, root))) + return E_FAIL; + } + } + + if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) { + MSG_BOX("Failed to Save File"); + } + else + { + MSG_BOX("Succeed to Save CMapElement_Balloon"); + } + + return S_OK; +} + +HRESULT CMapObject_Manager::Load_Balloons(const _char* pFileName) +{ + tinyxml2::XMLDocument xmlDoc; + + string strPath = "../Bin/Resources/Data/Map/Balloon/Ballon_Data.xml"; + + if ((tinyxml2::XML_SUCCESS != xmlDoc.LoadFile(strPath.c_str()))) + return E_FAIL; + + tinyxml2::XMLElement* root = xmlDoc.FirstChildElement("Balloon"); + + if (nullptr == root) + { + MSG_BOX("Failed to Find root"); + return S_OK; + } + + for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object")) + { + CMapElement_Balloon::BALLOON_DESC Desc = {}; + + auto* Value = Object->FirstChildElement("Value"); + Value->QueryBoolAttribute("isFloating", &Desc.isFloating); + Value->QueryUnsignedAttribute("DiffuseIndex", &Desc.iDiffuseIndex); + + /* Transform */ + auto* Rotation = Object->FirstChildElement("Scale"); + Rotation->QueryFloatAttribute("x", &Desc.vScale.x); + Rotation->QueryFloatAttribute("y", &Desc.vScale.y); + Rotation->QueryFloatAttribute("z", &Desc.vScale.z); + + auto* Scale = Object->FirstChildElement("Rotation"); + Scale->QueryFloatAttribute("x", &Desc.vRotation.x); + Scale->QueryFloatAttribute("y", &Desc.vRotation.y); + Scale->QueryFloatAttribute("z", &Desc.vRotation.z); + + auto* Position = Object->FirstChildElement("Position"); + Position->QueryFloatAttribute("x", &Desc.vPosition.x); + Position->QueryFloatAttribute("y", &Desc.vPosition.y); + Position->QueryFloatAttribute("z", &Desc.vPosition.z); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Balloon"), &Desc))) + return E_FAIL; + } + + return S_OK; +} + HRESULT CMapObject_Manager::Load_DADA_INT() { if (FAILED(Load_MapData("DATA_INT_Data"))) @@ -2529,7 +2676,7 @@ void CMapObject_Manager::Update_RaceRing() } if (GUI::Button("Load Ring")) { - //m_pInfoInstance->Load_Decal("Duengon_Decal_Data"); + Load_RaceRing("RaceRing_Data"); } if (GUI::Button("Add Ring")) { @@ -2598,6 +2745,42 @@ void CMapObject_Manager::Update_EffectParts() GUI::End(); } +void CMapObject_Manager::Update_Balloon() +{ + GUI::Begin("Ballon Editor"); + if (GUI::Button("Save Ballon")) + { + Save_Balloons("Ballon_Data"); + } + if (GUI::Button("Load Ballon")) + { + Load_Balloons("Ballon_Data"); + } + if (GUI::Button("Add Ballon")) + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Balloon")))) + { + } + } + + GUI::InputInt("Index : ", (_int*)&m_iSelectedIndex); + CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Balloon")); + + if (nullptr != pLayer) + { + _uint iIndex = {}; + for (auto& pObject : *pLayer->Get_Objects()) + { + if (m_iSelectedIndex == iIndex) + pObject->Describe_Entity(); + + ++iIndex; + } + } + + GUI::End(); +} + void CMapObject_Manager::Create_PartObject(_wstring& strPrototypeTag) { vector<_uint> LodModelIndices; diff --git a/Jusin154_Team3D/Editor/Private/RaceRing.cpp b/Jusin154_Team3D/Editor/Private/RaceRing.cpp index c84d9945d..41ffab78c 100644 --- a/Jusin154_Team3D/Editor/Private/RaceRing.cpp +++ b/Jusin154_Team3D/Editor/Private/RaceRing.cpp @@ -28,6 +28,15 @@ HRESULT CRaceRing::Initialize(void* pArg) return E_FAIL; } + if(nullptr != pArg) + { + RACERING_DESC* pDesc = static_cast(pArg); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f)); + m_pTransformCom->Set_Scale(pDesc->vScale); + m_pTransformCom->Set_Rotation(pDesc->vRotation); + m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z)); + } + m_iIndex = 0; return S_OK; diff --git a/Jusin154_Team3D/Editor/Private/Unified.cpp b/Jusin154_Team3D/Editor/Private/Unified.cpp index 1da5e5a84..1bde40132 100644 --- a/Jusin154_Team3D/Editor/Private/Unified.cpp +++ b/Jusin154_Team3D/Editor/Private/Unified.cpp @@ -20,18 +20,18 @@ void CUnified::Priority_Update(_float fTimeDelta) void CUnified::Update(_float fTimeDelta) { - //m_fCamDistance = XMVector3Length(XMLoadFloat4(&m_vUnifiedCenterPos) - XMLoadFloat4(m_pGameInstance->Get_CamPosition())).m128_f32[0]; + m_fCamDistance = XMVector3Length(XMLoadFloat4(&m_vUnifiedCenterPos) - XMLoadFloat4(m_pGameInstance->Get_CamPosition())).m128_f32[0]; - //if (true == m_isLayerEnable && m_fLodSwitchDistnace <= m_fCamDistance) - //{ // LOD 전환 - // m_isLayerEnable = false; - // m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), m_srtLayerTag)->Set_LayerEnabled(false); - //} - //else if(false == m_isLayerEnable && m_fLodSwitchDistnace > m_fCamDistance) - //{ // LOD 해제 - // m_isLayerEnable = true; - // m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), m_srtLayerTag)->Set_LayerEnabled(true); - //} + if (true == m_isLayerEnable && m_fLodSwitchDistnace <= m_fCamDistance) + { // LOD 전환 + m_isLayerEnable = false; + m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), m_srtLayerTag)->Set_LayerEnabled(false); + } + else if(false == m_isLayerEnable && m_fLodSwitchDistnace > m_fCamDistance) + { // LOD 해제 + m_isLayerEnable = true; + m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), m_srtLayerTag)->Set_LayerEnabled(true); + } } void CUnified::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Public/InstancedProp.h b/Jusin154_Team3D/Editor/Public/InstancedProp.h index 8b82f705a..5369e111f 100644 --- a/Jusin154_Team3D/Editor/Public/InstancedProp.h +++ b/Jusin154_Team3D/Editor/Public/InstancedProp.h @@ -19,6 +19,7 @@ class CInstancedProp final : public CGameObject _bool bEditMode{}; _bool isAddCollider{}; _bool isShake; + _uint iShaderPassIndex{}; _float2 vRadius; _float2 vSpeed; _wstring strPrototypeTag; @@ -41,6 +42,7 @@ class CInstancedProp final : public CGameObject _uint m_iInstanceIndex = {}; _uint m_iNumInstanceIndex = {}; + _uint m_iShaderPassIndex = {}; CVIBuffer_Model_Instance* m_pVIBufferInstanceCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; diff --git a/Jusin154_Team3D/Editor/Public/MapElement_Balloon.h b/Jusin154_Team3D/Editor/Public/MapElement_Balloon.h new file mode 100644 index 000000000..3ad572a0a --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/MapElement_Balloon.h @@ -0,0 +1,61 @@ +#pragma once + +#include "Editor_Define.h" +#include "MapElement.h" + +NS_BEGIN(Editor) + +class CMapElement_Balloon : public CMapElement +{ +public: + typedef struct tagMapElemntBalloonDesc + { + _bool isFloating; + _uint iDiffuseIndex; + _float3 vPosition; + _float3 vRotation; + _float3 vScale; + }BALLOON_DESC; +private: + CMapElement_Balloon(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMapElement_Balloon(const CMapElement_Balloon& rhs); + virtual ~CMapElement_Balloon() = 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: + CTexture* m_pDiffuseTextureCom = { nullptr }; + CTexture* m_pNormalTextureCom = { nullptr }; + CTexture* m_pMROTextureCom = { nullptr }; + + _bool m_isFloating = {}; + _bool m_isRotate = {}; + _uint m_iDiffuseIndex = {}; + + _float m_fTimeAcc = {}; + _float m_fUsingSurfaceParams = {}; + + _float3 m_vOriginPosition = {}; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Bind_ShaderResources() override; + + void Rotation(); + void Floating(); + +public: + static CMapElement_Balloon* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; + HRESULT Save_XML(tinyxml2::XMLDocument& doc, tinyxml2::XMLElement* root); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/MapObject_Manager.h b/Jusin154_Team3D/Editor/Public/MapObject_Manager.h index 13c0fa695..72757078b 100644 --- a/Jusin154_Team3D/Editor/Public/MapObject_Manager.h +++ b/Jusin154_Team3D/Editor/Public/MapObject_Manager.h @@ -86,6 +86,11 @@ class CMapObject_Manager final : public CGameObject HRESULT Save_Decal(const _char* pFileName); HRESULT Save_RaceRing(const _char* pFileName); + HRESULT Load_RaceRing(const _char* pFileName); + + HRESULT Save_Balloons(const _char* pFileName); + HRESULT Load_Balloons(const _char* pFileName); + HRESULT Load_DADA_INT(); HRESULT Save_EffectParts(const _char* pFileName); @@ -101,6 +106,7 @@ class CMapObject_Manager final : public CGameObject void Update_Decal(); void Update_RaceRing(); void Update_EffectParts(); + void Update_Balloon(); void Create_PartObject(_wstring& strPrototypeTag); void Create_Elemnt(_wstring& strPrototypeTag); diff --git a/Jusin154_Team3D/Editor/Public/RaceRing.h b/Jusin154_Team3D/Editor/Public/RaceRing.h index 445b1a9ac..b8cc9a1d6 100644 --- a/Jusin154_Team3D/Editor/Public/RaceRing.h +++ b/Jusin154_Team3D/Editor/Public/RaceRing.h @@ -7,6 +7,14 @@ NS_BEGIN(Editor) class CRaceRing final : public CGameObject { +public: + typedef struct RaceRingDesc + { + _float3 vPosition{}; + _float3 vRotation{}; + _float3 vScale{}; + }RACERING_DESC; + private: CRaceRing(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CRaceRing(const CRaceRing& Prototype); diff --git a/Jusin154_Team3D/Engine/Public/Transform.h b/Jusin154_Team3D/Engine/Public/Transform.h index bcb69fea0..de040efa4 100644 --- a/Jusin154_Team3D/Engine/Public/Transform.h +++ b/Jusin154_Team3D/Engine/Public/Transform.h @@ -91,7 +91,8 @@ class ENGINE_DLL CTransform final : void Add_SpeedPerSec(_float fSpeedPerSec); #ifdef _DEBUG - _float3& Get_Rotation() { return m_vRotation; } + _float3& Get_Rotation() { return m_vRotation; } + void Set_Rotation(_float3 vRotation) { m_vRotation = vRotation; } #endif // _DEBUG private: