[add] InstanceProp ComputeShader 적용

[fix] OcculsionQuery 수정
This commit is contained in:
Chanbin Kim
2025-12-10 15:42:55 +09:00
parent d9c85d8777
commit a8e80d3c06
32 changed files with 914 additions and 455 deletions
@@ -40,9 +40,8 @@ void CBuildingContainer::Late_Update(_float fTimeDelta)
if (m_pOcclusionQueryCom->isDraw())
__super::Late_Update(fTimeDelta);
}
else{
else
__super::Late_Update(fTimeDelta);
}
m_pGameInstance->Add_RenderGroup(RENDER::OCCLUSION, this);
@@ -50,6 +49,9 @@ void CBuildingContainer::Late_Update(_float fTimeDelta)
pCollisiton->Late_Update(fTimeDelta);
}
}
else
m_pOcclusionQueryCom->Set_PreFrameDraw();
}
HRESULT CBuildingContainer::Render()
@@ -22,6 +22,9 @@ void CInstancedProp::Update(_float fTimeDelta)
void CInstancedProp::Late_Update(_float fTimeDelta)
{
if (m_isShake)
m_pVIBufferInstanceCom->Shake(fTimeDelta);
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
}
@@ -86,6 +89,7 @@ HRESULT CInstancedProp::Initialize(void* pArg)
if (FAILED(Ready_Components(pArg)))
return E_FAIL;
m_iNumMesh = m_pVIBufferInstanceCom->Get_NumMesh();
return S_OK;
@@ -107,6 +111,10 @@ HRESULT CInstancedProp::Ready_Components(void* pArg)
if(FAILED(Load_InstancedProp(pDesc->strInstanceDataPath.c_str())))
return E_FAIL;
m_isShake = pDesc->isShake;
if (m_isShake)
m_pVIBufferInstanceCom->Set_Shake_Value(pDesc->vRadius, pDesc->vSpeed);
/* Com_Shader */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_INSTANCE_PROP_MODEL,
reinterpret_cast<CComponent**>(&m_pShaderCom))))
+109 -77
View File
@@ -222,7 +222,7 @@ HRESULT CLevel_GamePlay::Ready_Background()
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CUnified>(g_iStaticLevel, NEXT_LEVEL, LAYER_UNIFIED)))
return E_FAIL;
CMapElement_Lake::MAPOBJECT_LAKE_DESC Lake_Desc = {};
@@ -244,7 +244,7 @@ HRESULT CLevel_GamePlay::Ready_Background()
_bool isReady_Background = { false };
#ifdef gimch
isReady_Background = false;
isReady_Background = true;
#endif // gimch
#ifdef Bin
isReady_Background = false;
@@ -281,87 +281,119 @@ HRESULT CLevel_GamePlay::Ready_Background()
CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopTable");
CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopChair");
CInstancedProp::INSTANCE_PROP_DESC Desc = {};
/* InstanceProp Oak_Tree*/
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<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) {
if (FAILED(Ready_IntstanceProp()))
return E_FAIL;
}
/* BearBerry */
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<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) {
return E_FAIL;
}
/* SM_HM_OwlPost_Window_A */
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OwlPost_Window.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
///* WA_Rectangle_Double_A */
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Rectangle_Double_A.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
///* WC_Retangle_Double_A */
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Retangle_Double_A.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
///* WA_Square_Double_C */
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WA_Square_Double_C.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* Quid_Window_A */
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Quid_Window_A.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* Ollivanders_Box_Window */
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Ollivanders_Box.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* WC_L_DoubleS_A */
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_L_DoubleS_A.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* WC_Round_Double_A */
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Round_Double_A.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* SM_HM_Door1a */
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door1a.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* SM_HM_Door1a */
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door2b.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
}
return S_OK;
}
HRESULT CLevel_GamePlay::Ready_IntstanceProp()
{
CInstancedProp::INSTANCE_PROP_DESC Desc = {};
/* InstanceProp Oak_Tree*/
Desc.isShake = true;
Desc.vRadius = _float2(0.015f, 0.04f);
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<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) {
return E_FAIL;
}
/* BearBerry */
Desc.isShake = true;
Desc.vRadius = _float2(0.015f, 0.02f);
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<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) {
return E_FAIL;
}
/* SM_HM_OwlPost_Window_A */
Desc.isShake = false;
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OwlPost_Window.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
///* WA_Rectangle_Double_A */
Desc.isShake = false;
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Rectangle_Double_A.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
///* WC_Retangle_Double_A */
Desc.isShake = false;
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Retangle_Double_A.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
///* WA_Square_Double_C */
Desc.isShake = false;
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WA_Square_Double_C.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* Quid_Window_A */
Desc.isShake = false;
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Quid_Window_A.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* Ollivanders_Box_Window */
Desc.isShake = false;
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Ollivanders_Box.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* WC_L_DoubleS_A */
Desc.isShake = false;
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_L_DoubleS_A.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* WC_Round_Double_A */
Desc.isShake = false;
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Round_Double_A.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* SM_HM_Door1a */
Desc.isShake = false;
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door1a.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* SM_HM_Door2b */
Desc.isShake = false;
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door2b.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
/* OakTree_TallA */
Desc.isShake = true;
Desc.vRadius = _float2(0.f, 0.01f);
Desc.vSpeed = _float2(0.01f, 0.1f);
Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_OakTree_TallA";
Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OakTree_TallA.bin";
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
return E_FAIL;
return S_OK;
}
HRESULT CLevel_GamePlay::Ready_Layer_UI(const _wstring& strLayerTag)
{
CInfoInstance::GetInstance()->Load_SpellInfo("../Bin/Resources/Data/UI/Spell/SpellInfo.xml");
+7 -1
View File
@@ -295,7 +295,7 @@ HRESULT CLoader::Loading_For_GamePlay()
_bool isLoad_Background = { false };
#ifdef gimch
isLoad_Background = false;
isLoad_Background = true;
#endif // gimch
#ifdef Bin
isLoad_Background = false;
@@ -1895,6 +1895,12 @@ HRESULT CLoader::Loading_For_GamePlay()
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
"../Bin/Resources/Models/InstanceProp/SM_HM_Door2b.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
return E_FAIL;
/* For.Prototype_Component_VIBuffer_Model_Instancel_OakTree_TallA*/
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_OakTree_TallA"),
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
"../Bin/Resources/Models/InstanceProp/SM_OakTree_TallA.bin", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
return E_FAIL;
#pragma endregion
/* For.Prototype_Component_South_Hogwart_Land_LOD1 */
@@ -108,7 +108,7 @@ HRESULT CMapObject_Render::Render()
return E_FAIL;
}
for (_uint i = 0; i < m_iNumMeshe; i++)
for (_uint i = 0; i < m_iNumMeshe; ++i)
{
if (FAILED(m_pModelComs[0]->Bind_Material(i, m_pShaderCom))) {
return E_FAIL;
@@ -16,8 +16,11 @@ class CInstancedProp final : public CGameObject
public:
typedef struct tagInstancedPropDesc
{
_wstring strPrototypeTag;
_string strInstanceDataPath;
_bool isShake;
_float2 vRadius;
_float2 vSpeed;
_wstring strPrototypeTag;
_string strInstanceDataPath;
}INSTANCE_PROP_DESC;
private:
CInstancedProp(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
@@ -32,7 +35,9 @@ class CInstancedProp final : public CGameObject
virtual HRESULT Render_Shadow()override;
private:
_bool m_isShake = {};
_uint m_iNumMesh = {};
CVIBuffer_Model_Instance* m_pVIBufferInstanceCom = { nullptr };
CShader* m_pShaderCom = { nullptr };
@@ -24,6 +24,7 @@ class CLevel_GamePlay final : public CLevel
HRESULT Initialize(void* pArg);
HRESULT Ready_Lights();
HRESULT Ready_Background();
HRESULT Ready_IntstanceProp();
HRESULT Ready_Markers();
HRESULT Ready_Layer_UI(const _wstring& strLayerTag);
HRESULT Ready_Layer_Camera();