diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml index 8a7a58cf0..7ef8c42bd 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml @@ -3608,158 +3608,4 @@ - - - - - - Prototype_GameObject_SM_HM_Streets_Hogshead - - - - - - Prototype_GameObject_SM_HM_Streets_A - - - - - - Prototype_GameObject_SM_HM_Streets_B - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_A - Prototype_GameObject_SM_HM_Streets_SideStreet_A_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_B - Prototype_GameObject_SM_HM_Streets_SideStreet_B_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_C - Prototype_GameObject_SM_HM_Streets_SideStreet_C_Lod1 - - - - - - Prototype_GameObject_SM_HM_Stairwalls_3Broomsticks - - - - - - Prototype_GameObject_SM_HM_LowerHiStreet_Zonkos - - - - - - Prototype_GameObject_SM_HM_Streets_AA_COL - Prototype_GameObject_SM_HM_Streets_AA_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_BB_COL - Prototype_GameObject_SM_HM_Streets_BB_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_CC_COL - Prototype_GameObject_SM_HM_Streets_CC_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_DD_COL - Prototype_GameObject_SM_HM_Streets_DD_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_EE_COL - Prototype_GameObject_SM_HM_Streets_EE_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_FF_COL - Prototype_GameObject_SM_HM_Streets_FF_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_GG_COL - Prototype_GameObject_SM_HM_Streets_GG_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_HH_COL - Prototype_GameObject_SM_HM_Streets_HH_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_A_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_A_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_B_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_B_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_C_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_C_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_D_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_D_COL_Lod1 - - - - - - Prototype_GameObject_SM_HW_Streets_SideStreet_E_COL - Prototype_GameObject_SM_HW_Streets_SideStreet_E_COL_Lod1 - - - - - - Prototype_GameObject_SM_HW_Streets_SideStreet_F_COL - Prototype_GameObject_SM_HW_Streets_SideStreet_F_COL_Lod1 - - - - - diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_AlphaMap.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_AlphaMap.bin new file mode 100644 index 000000000..42fda0dc6 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_AlphaMap.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e113d19eac33fe1a0dc66a5ce1d3c50ea75d9d8ade3ec9ac7b00ad858c992663 +size 67108864 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml index a6cde8f76..8ca7f52a6 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml @@ -2010,21 +2010,6 @@ - - Prototype_GameObject_SM_HM_GEN_A_int_Floor - Prototype_GameObject_SM_HM_GEN_A_int_Floor_Lod1 - - - - - - Prototype_GameObject_SM_HM_GEN_A_int_Walls - Prototype_GameObject_SM_HM_GEN_A_int_Walls_Lod1 - Prototype_GameObject_SM_HM_GEN_A_int_Walls_Lod2 - - - - Prototype_GameObject_SM_HM_GEN_A_EXT_APL_COL Prototype_GameObject_SM_HM_GEN_A_EXT_APL_COL_Lod1 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 9413bf7ce..c9e4f582d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -153,7 +153,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) return Out; } - float fDiffuseAOStrength = lerp(1.3f, 2.f, fOcclusion); + float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion); PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl index 261099f7f..bcdd26cb6 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl @@ -9,9 +9,9 @@ float g_fUsingSurfaceParams; Texture2D g_DiffuseTexture; Texture2D g_NormalTexture; Texture2D g_SurfaceParamsTexture; -Texture2D g_DiffuseTextures[2]; -Texture2D g_NormalTextures[2]; -Texture2D g_SurfaceParamsTextures[2]; +Texture2D g_DiffuseTextures[4]; +Texture2D g_NormalTextures[4]; +Texture2D g_SurfaceParamsTextures[4]; Texture2D g_MaskTexture; struct VS_IN @@ -69,24 +69,39 @@ PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; - float2 tileUV = In.vWorldPos.xz / 64.f; + float2 tileUV = In.vWorldPos.xz / 16.f; 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 = lerp(vMtrlDiffuse_0, vMtrlDiffuse_1, vMask.r); + 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(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 = lerp(vSurface_0, vSurface_1, vMask.r); + 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[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 = normalize(lerp(vNormalDecoded_0, vNormalDecoded_1, vMask.r)); + 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)); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds index a38c801b9..c645b3637 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds index d674bd7a3..88834c5e7 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_2.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_2.dds new file mode 100644 index 000000000..2d3f6442e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_2.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 new file mode 100644 index 000000000..36017b3e1 Binary files /dev/null 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_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds index b0c66ea01..568c2ac58 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 new file mode 100644 index 000000000..7eff9329b Binary files /dev/null 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 new file mode 100644 index 000000000..5a76d93a7 Binary files /dev/null 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_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds index 98fe8de42..43e598aa9 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 new file mode 100644 index 000000000..6165e524d Binary files /dev/null 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 new file mode 100644 index 000000000..e862b711c Binary files /dev/null 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 6304f1a99..0b20027ff 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -164,6 +164,7 @@ + @@ -289,6 +290,7 @@ + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 574c2f895..a4e8509b6 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -340,6 +340,9 @@ {7e8b7123-11fb-4946-99fe-3265932d0536} + + {54eef1b7-a5ee-444f-9577-44ffc8c3d8bc} + @@ -666,6 +669,12 @@ 80.State + + 02.GameObjects\Wand + + + 02.GameObjects\Env\05.AlphaMap + @@ -988,6 +997,9 @@ 02.GameObjects\Player + + 02.GameObjects\Env\05.AlphaMap + diff --git a/Jusin154_Team3D/Editor/Private/AlphaMap.cpp b/Jusin154_Team3D/Editor/Private/AlphaMap.cpp new file mode 100644 index 000000000..4f0c92ed5 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/AlphaMap.cpp @@ -0,0 +1,194 @@ +#include "pch.h" +#include "AlphaMap.h" +#include "GameInstance.h" + +CAlphaMap::CAlphaMap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CBase{} + , m_pDevice{ pDevice } + , m_pContext{ pContext } + , m_pGameInstance{ Engine::CGameInstance::GetInstance() } +{ + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + SAFE_ADDREF(m_pGameInstance); +} + +void CAlphaMap::Update(_float3& vPosition, _uint iColorIndex, _float fValue, _uint iRange) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) + return; + + _uint iPixelIndex = {}; + + _uint iStartX = (_uint)(vPosition.x / 0.25f) - (iRange / 2); + _uint iStartZ = (_uint)(vPosition.z / 0.25f) - (iRange / 2); + + for (_uint j = 0; j < iRange; ++j) + { + for (_uint i = 0; i < iRange; ++i) + { + _uint iCurrentX = iStartX + i; + _uint iCurrentZ = iStartZ + j; + + iPixelIndex = (iCurrentZ * m_iNumPixelW) + iCurrentX; + + if (m_iNumPixels <= iPixelIndex) + return; + + if (0 == iColorIndex) + { + m_pPixels[iPixelIndex].x += fValue; + } + else if (1 == iColorIndex) + { + m_pPixels[iPixelIndex].y += fValue; + } + else if (2 == iColorIndex) + { + m_pPixels[iPixelIndex].z += fValue; + } + else if (3 == iColorIndex) + { + m_pPixels[iPixelIndex].w += fValue; + } + else + return; + + _float fWeight = m_pPixels[iPixelIndex].x + m_pPixels[iPixelIndex].y + m_pPixels[iPixelIndex].z + m_pPixels[iPixelIndex].w; + + m_pPixels[iPixelIndex] = _float4(m_pPixels[iPixelIndex].x / fWeight, m_pPixels[iPixelIndex].y / fWeight, m_pPixels[iPixelIndex].z / fWeight, m_pPixels[iPixelIndex].w / fWeight); + } + } + + memcpy(SubResource.pData, m_pPixels, sizeof(_float4) * m_iNumPixels); + + m_pContext->Unmap(m_pTexture2D, 0); + +} + +void CAlphaMap::Save_ToFile(const _char* pFilePath) +{ + string strFilePath = "../Bin/Resources/Data/Map/" + string(pFilePath); + + ofstream out(strFilePath, ios::binary); + + if (false == out.is_open()) + { + MSG_BOX("Failed to Save Binanry File"); + return; + } + for (_uint i = 0; i < m_iNumPixels; ++i) + { + out.write(reinterpret_cast(&m_pPixels[i]), sizeof(_float4)); + } + + out.close(); + + MSG_BOX("Success to Save Binanry File"); +} + +void CAlphaMap::Load_ToFile(const _char* pFilePath) +{ + string strFilePath = "../Bin/Resources/Data/Map/" + string(pFilePath); + + ifstream in(strFilePath, ios::binary); + + if (false == in.is_open()) + { + MSG_BOX("Failed to Load Model Binanry File"); + return; + } + + for (_uint i = 0; i < m_iNumPixels; ++i) + { + in.read(reinterpret_cast<_char*>(&m_pPixels[i]), sizeof(_float4)); + } + + + in.close(); + + D3D11_MAPPED_SUBRESOURCE SubResource{}; + if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) + return; + + MSG_BOX("Success to Load Binanry File"); + + memcpy(SubResource.pData, m_pPixels, sizeof(_float4) * m_iNumPixels); + + m_pContext->Unmap(m_pTexture2D, 0); +} + +HRESULT CAlphaMap::Initialize(_uint iSizeX, _uint iSizeY) +{ + D3D11_TEXTURE2D_DESC TextureDesc{}; + + TextureDesc.Width = iSizeX; + TextureDesc.Height = iSizeY; + TextureDesc.MipLevels = 1; + TextureDesc.ArraySize = 1; + TextureDesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; + + TextureDesc.SampleDesc.Quality = 0; + TextureDesc.SampleDesc.Count = 1; + + + TextureDesc.Usage = D3D11_USAGE_DYNAMIC; + TextureDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + TextureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + TextureDesc.MiscFlags = 0; + + if (FAILED(m_pDevice->CreateTexture2D(&TextureDesc, nullptr, &m_pTexture2D))) + return E_FAIL; + + if (FAILED(m_pDevice->CreateShaderResourceView(m_pTexture2D, nullptr, &m_pSRV))) + return E_FAIL; + + m_iNumPixels = iSizeX * iSizeY; + m_pPixels = new _float4[m_iNumPixels]; + ZeroMemory(m_pPixels, sizeof(_float4) * m_iNumPixels); + + for (_uint i = 0; i < m_iNumPixels; ++i) + { + m_pPixels[i].x = 1.f; + } + + D3D11_MAPPED_SUBRESOURCE SubResource{}; + if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) + return E_FAIL; + + memcpy(SubResource.pData, m_pPixels, sizeof(_float4) * m_iNumPixels); + + m_pContext->Unmap(m_pTexture2D, 0); + + m_iNumPixelW = iSizeX; + m_iNumPixelH = iSizeY; + + return S_OK; +} + +CAlphaMap* CAlphaMap::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, _uint iSizeX, _uint iSizeY) +{ + CAlphaMap* pInstance = new CAlphaMap(pDevice, pContext); + + if (FAILED(pInstance->Initialize(iSizeX, iSizeY))) + { + MSG_BOX("Failed to Created : CAlphaMap"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CAlphaMap::Free() +{ + __super::Free(); + + Safe_Delete_Array(m_pPixels); + + SAFE_RELEASE(m_pSRV); + SAFE_RELEASE(m_pTexture2D); + SAFE_RELEASE(m_pContext); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pGameInstance); +} diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 7dad12d2e..0b7430985 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -1471,17 +1471,17 @@ HRESULT CLoader::Loading_For_MapViewer() } /* Terrain_Diffuse */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Diffuse"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_D_%d.dds"), 2)))) { + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_D_%d.dds"), 4)))) { return E_FAIL; } /* Terrain_Normal */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Normal"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_N_%d.dds"), 2)))) { + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_N_%d.dds"), 4)))) { return E_FAIL; } /* Terrain_MRO */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_MRO"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_MRO_%d.dds"), 2)))) { + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_MRO_%d.dds"), 4)))) { return E_FAIL; } @@ -1506,7 +1506,7 @@ HRESULT CLoader::Loading_For_MapViewer() vector ModelPrototypePath = {}; #pragma region HOGSMEADE - // + ///* Terrain*/ //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", // ".bin", true, ModelPrototypeTags, ModelPrototypePath))) @@ -1695,317 +1695,317 @@ HRESULT CLoader::Loading_For_MapViewer() #ifdef gimch -//vector> jobFutures; -// -//_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; -// } -// } -// -// } -//} +vector> jobFutures; -#endif // 기무리 +_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; + } + } + + } + } + +#endif m_strMessage = TEXT("쉐이더를(을) 로딩 중 입니다."); @@ -2068,12 +2068,12 @@ HRESULT CLoader::Loading_For_MapViewer() m_isFinished = true; - //for (_uint i = 0; i < Contents.size(); ++i) { - // for (_uint j = 0; j < (Contents[i])->size(); ++j) { - // Safe_Delete((*Contents[i])[j]); - // } - // Safe_Delete(Contents[i]); - //} + for (_uint i = 0; i < Contents.size(); ++i) { + for (_uint j = 0; j < (Contents[i])->size(); ++j) { + Safe_Delete((*Contents[i])[j]); + } + Safe_Delete(Contents[i]); + } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/MainLight.cpp b/Jusin154_Team3D/Editor/Private/MainLight.cpp index feab5b2af..6d2c5fb53 100644 --- a/Jusin154_Team3D/Editor/Private/MainLight.cpp +++ b/Jusin154_Team3D/Editor/Private/MainLight.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "MainLight.h" #include "GameInstance.h" @@ -62,7 +62,7 @@ HRESULT CMainLight::Ready_Components() LightDesc.eType = LIGHT::DIRECTIONAL; LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); - LightDesc.vAmbient = _float4(0.6f, 0.6f, 0.6f, 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.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK); LightDesc.iLevel = NEXT_LEVEL; diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp index 66e8e00e8..7a12417b6 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp @@ -219,6 +219,9 @@ void CMapObject_Collision::Free() for (auto& pModel : m_pModelComs) Safe_Release(pModel); m_pModelComs.clear(); + + m_ModelPrototypeTags.clear(); + m_ModelPathIndices.clear(); } void CMapObject_Collision::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp index ecb9744ca..5611c81d2 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp @@ -60,7 +60,7 @@ HRESULT CMapObject_LOD::Initialize(void* pArg) - m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + //m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); //m_pColliderCom->Update(ColliderMatrix); @@ -81,9 +81,9 @@ void CMapObject_LOD::Update(_float fTimeDelta) //if (0 == m_iLodIndex) // m_bSelected = true; - 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)); + //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)); XMStoreFloat4x4(&m_CombinedWorldMatrix, m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix()); @@ -270,6 +270,9 @@ void CMapObject_LOD::Free() for(auto& pModel : m_pModelComs) SAFE_RELEASE(pModel); m_pModelComs.clear(); + + m_ModelPrototypeTags.clear(); + m_ModelPathIndices.clear(); } void CMapObject_LOD::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/Terrain.cpp b/Jusin154_Team3D/Editor/Private/Terrain.cpp index 836219ae5..43f688ae1 100644 --- a/Jusin154_Team3D/Editor/Private/Terrain.cpp +++ b/Jusin154_Team3D/Editor/Private/Terrain.cpp @@ -4,6 +4,7 @@ #include "GameInstance.h" #include "DebugCamera.h" #include "VIBuffer_Terrain.h" +#include "AlphaMap.h" CTerrain::CTerrain(ID3D11Device * pDevice, ID3D11DeviceContext * pContext) : CGameObject(pDevice, pContext) @@ -28,28 +29,60 @@ HRESULT CTerrain::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; + if (FAILED(Ready_AlphaMap())) + return E_FAIL; + m_fUsingSurfaceParams = 15.f / 27.f; m_vRotation = _float3{ 0.f, 0.f, 0.f }; m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-194, 18.5f, -153.f, 1.f)); //m_pVIBufferCom->Set_CullingRadius(0.04f); + m_pAlphaMap->Load_ToFile("Hogsmeade_AlphaMap.bin"); + return S_OK; } void CTerrain::Priority_Update(_float fTimeDelta) { - GUI::Begin("Picking Position"); + GUI::Begin("Terrain"); + +#pragma region ALPHA_MAP + //GUI::InputInt("Color", &m_iColorIndex); + //m_iColorIndex = max(0, min(4, m_iColorIndex)); + + //GUI::InputInt("Rnage", (_int*)(&m_iMaskRange)); + //GUI::DragFloat("Value", &m_fMaskValue, 0.01f, -1.0f, 1.f); + //if (GUI::Button("Save", ImVec2(100.f, 30.f))) + //{ + // m_pAlphaMap->Save_ToFile("Hogsmeade_AlphaMap.bin"); + //} + //if (GUI::Button("Load", ImVec2(100.f, 30.f))) + //{ + // m_pAlphaMap->Load_ToFile("Hogsmeade_AlphaMap.bin"); + //} + + + GUI::DragFloat("Up", &m_fUpValue, 0.01f, -1.0f, 1.f); if (m_pGameInstance->Mouse_Pressing(DIM_LBUTTON)) { - if (m_pVIBufferCom->Picking(m_pTransformCom->Get_XMWorldMatrix(), &m_vPickingPosition)) + if (m_pGameInstance->isPicking(&m_vPickingPosition)) { - if(m_pGameInstance->Key_Pressing(DIK_PERIOD)) - m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), 0.01f); - if(m_pGameInstance->Key_Pressing(DIK_COMMA)) - m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), -0.01f); + if (m_pGameInstance->Key_Pressing(DIK_PERIOD)) + m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), m_fUpValue); + if (m_pGameInstance->Key_Pressing(DIK_COMMA)) + m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), m_fUpValue * -1.f); + + + //XMStoreFloat3(&m_vPickingPosition, XMVector3TransformCoord(XMLoadFloat3(&m_vPickingPosition), m_pTransformCom->Get_WorldMatrixInv())); + + //m_pAlphaMap->Update(m_vPickingPosition, m_iColorIndex, m_fMaskValue, m_iMaskRange); + } } +#pragma endregion + + /*GUI::InputFloat("Height Ratio", &m_fHeightRatio); max(0.01f, m_fHeightRatio); @@ -73,6 +106,7 @@ void CTerrain::Priority_Update(_float fTimeDelta) void CTerrain::Update(_float fTimeDelta) { //m_pVIBufferCom->Culling(XMMatrixIdentity()); + } @@ -164,7 +198,7 @@ HRESULT CTerrain::Bind_ShaderResources() if (FAILED(m_pMROTextureCom->Bind_ShaderResources(m_pShaderCom, "g_SurfaceParamsTextures", 0, m_pMROTextureCom->Get_Size()))){ return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_SRV("g_MaskTexture", m_pMaskTextureCom->Get_SRV(0)))) { + if (FAILED(m_pShaderCom->Bind_SRV("g_MaskTexture", m_pAlphaMap->Get_SRV()))) { return E_FAIL; } @@ -174,6 +208,16 @@ HRESULT CTerrain::Bind_ShaderResources() return S_OK; } +HRESULT CTerrain::Ready_AlphaMap() +{ + m_pAlphaMap = CAlphaMap::Create(m_pDevice, m_pContext, 2048, 2048); + + if(nullptr == m_pAlphaMap) + return E_FAIL; + + return S_OK; +} + CTerrain* CTerrain::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CTerrain* pInstance = new CTerrain(pDevice, pContext); @@ -204,6 +248,7 @@ void CTerrain::Free() { __super::Free(); + SAFE_RELEASE(m_pAlphaMap); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); SAFE_RELEASE(m_pDiffuseTextureCom); diff --git a/Jusin154_Team3D/Editor/Public/AlphaMap.h b/Jusin154_Team3D/Editor/Public/AlphaMap.h new file mode 100644 index 000000000..b172d45c2 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/AlphaMap.h @@ -0,0 +1,43 @@ +#include "Editor_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Editor) + +class CAlphaMap final : public CBase +{ +private: + CAlphaMap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual ~CAlphaMap() = default; + +public: + void Update(_float3& vPosition, _uint iColorIndex, _float fValue, _uint iRange); + ID3D11ShaderResourceView* Get_SRV() { return m_pSRV; } + + void Save_ToFile(const _char* pFilePath); + void Load_ToFile(const _char* pFilePath); +private: + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + ID3D11Texture2D* m_pTexture2D = { nullptr }; + ID3D11ShaderResourceView* m_pSRV = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + + _uint m_iNumPixels = {}; + _uint m_iNumPixelW = {}; + _uint m_iNumPixelH = {}; + + _float4* m_pPixels = { nullptr }; + +private: + HRESULT Initialize( _uint iSizeX, _uint iSizeY); + +public: + static CAlphaMap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, _uint iSizeX, _uint iSizeY); + virtual void Free(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Terrain.h b/Jusin154_Team3D/Editor/Public/Terrain.h index 95f49559c..63fbeb8e1 100644 --- a/Jusin154_Team3D/Editor/Public/Terrain.h +++ b/Jusin154_Team3D/Editor/Public/Terrain.h @@ -42,9 +42,18 @@ class CTerrain final : public CGameObject _uint m_iTextureIndex = {}; + + class CAlphaMap* m_pAlphaMap = { nullptr }; + _uint m_iMaskRange = {1}; + _int m_iColorIndex = {0}; + _float m_fMaskValue = {0.1f}; + + _float m_fUpValue = { 0.01f }; + private: HRESULT Ready_Components(); HRESULT Bind_ShaderResources(); + HRESULT Ready_AlphaMap(); public: static CTerrain* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 9413bf7ce..c9e4f582d 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -153,7 +153,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) return Out; } - float fDiffuseAOStrength = lerp(1.3f, 2.f, fOcclusion); + float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion); PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp index 5f1ade52e..a004650a9 100644 --- a/Jusin154_Team3D/Engine/Private/Material.cpp +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -533,6 +533,9 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const SaveMaterial& _ ID3D11ShaderResourceView* pSRV = nullptr; HRESULT hr = S_OK; + if (!m_SRVs[type].empty()) + continue; + const char* ext = strrchr(szFullPath, '.'); if (ext) { @@ -547,7 +550,6 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const SaveMaterial& _ if (FAILED(hr)){ return E_FAIL; } - m_SRVs[type].push_back(pSRV); } } diff --git a/Jusin154_Team3D/Engine/Private/Texture.cpp b/Jusin154_Team3D/Engine/Private/Texture.cpp index 70dfb754f..eb24d45a6 100644 --- a/Jusin154_Team3D/Engine/Private/Texture.cpp +++ b/Jusin154_Team3D/Engine/Private/Texture.cpp @@ -120,6 +120,7 @@ HRESULT CTexture::Load_SRV(const _char* szPath, ID3D11ShaderResourceView** ppSRV hr = CreateWICTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, ppSRV); } } + return hr; } @@ -142,7 +143,6 @@ HRESULT CTexture::ParseTextureIncrementalToSRVs(_uint iNumTextures, const _tchar if (FAILED(hr)) { return E_FAIL; } - m_SRVs.push_back(pSRV); } return S_OK;