[add] QcclusionQuery Component 추가
[add] Qcclusion Culling 용 바운딩 박스 버퍼 추가 [add] Qcclusion Culling 적용
This commit is contained in:
@@ -235,6 +235,7 @@ call Update_Resources.bat
|
||||
<ClInclude Include="..\Public\State_Land.h" />
|
||||
<ClInclude Include="..\Public\State_Move.h" />
|
||||
<ClInclude Include="..\Public\State_Root.h" />
|
||||
<ClInclude Include="..\public\StreetContainer.h" />
|
||||
<ClInclude Include="..\public\Terrain.h" />
|
||||
<ClInclude Include="..\Public\TrailObject.h" />
|
||||
<ClInclude Include="..\Public\Wand.h" />
|
||||
@@ -322,6 +323,7 @@ call Update_Resources.bat
|
||||
<ClCompile Include="..\Private\State_Land.cpp" />
|
||||
<ClCompile Include="..\Private\State_Move.cpp" />
|
||||
<ClCompile Include="..\Private\State_Root.cpp" />
|
||||
<ClCompile Include="..\private\StreetContainer.cpp" />
|
||||
<ClCompile Include="..\private\Terrain.cpp" />
|
||||
<ClCompile Include="..\Private\TrailObject.cpp" />
|
||||
<ClCompile Include="..\Private\Wand.cpp" />
|
||||
|
||||
@@ -250,6 +250,9 @@
|
||||
<ClInclude Include="..\Public\Potion.h">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Potion</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\StreetContainer.h">
|
||||
<Filter>02.GameObjects\Environment\00.MapContainer\StreetContainer</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Client.ico">
|
||||
@@ -548,6 +551,9 @@
|
||||
<Filter Include="02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Spell_UI">
|
||||
<UniqueIdentifier>{9914341c-f246-4fdb-b28c-de7a6d2d149b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\00.MapContainer\StreetContainer">
|
||||
<UniqueIdentifier>{e12a4228-0754-4217-b65d-7f962409f85c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Client.cpp">
|
||||
@@ -787,6 +793,9 @@
|
||||
<ClCompile Include="..\Private\Potion.cpp">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Potion</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\StreetContainer.cpp">
|
||||
<Filter>02.GameObjects\Environment\00.MapContainer\StreetContainer</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Client.rc">
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "PartObject.h"
|
||||
//#include "Terrain.h"
|
||||
//#include "Layer.h"
|
||||
//#include "VIBuffer_Terrain.h"
|
||||
|
||||
CBuildingContainer::CBuildingContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CMapContainer(pDevice, pContext)
|
||||
|
||||
@@ -1106,6 +1106,16 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
"../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Box */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"),
|
||||
CVIBuffer_Box::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_OcclusionQuery */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_OcclusionQuery"),
|
||||
COcclusionQuery::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Terrain */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CTerrain>(g_iStaticLevel, CTerrain::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
#include "pch.h"
|
||||
#include "StreetContainer.h"
|
||||
#include "PartObject.h"
|
||||
|
||||
CStreetContainer::CStreetContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CMapContainer(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CStreetContainer::CStreetContainer(const CStreetContainer& rhs)
|
||||
:CMapContainer(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void CStreetContainer::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CStreetContainer::Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
m_fCamDepth = XMVectorGetX(XMVector3Length(XMLoadFloat4(m_pGameInstance->Get_CamPosition()) - XMLoadFloat3(&m_vExtentPosition)));
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CStreetContainer::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pOcclusionQueryCom->isDraw())
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::OCCLUSION, this);
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Render_BoundingBox()
|
||||
{
|
||||
m_pOcclusionQueryCom->Begin_Query();
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", &m_BoundingBoxWorldMatirx))) {
|
||||
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 (m_pGameInstance->Key_Pressing(DIK_Q))
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(1)))
|
||||
return E_FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(0)))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vRadius", &m_vExtentRadius, sizeof(_float3))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Bind_Resources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Render()))
|
||||
return E_FAIL;
|
||||
|
||||
m_pOcclusionQueryCom->End_Query();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
MAP_CONTAINER_DESC* pDesc = static_cast<MAP_CONTAINER_DESC*>(pArg);
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f));
|
||||
m_pTransformCom->Set_Scale(pDesc->vScale);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
///* Com_Shader */
|
||||
//if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_VTXPOS,
|
||||
// reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
// return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"),
|
||||
reinterpret_cast<CComponent**>(&m_pVIBufferCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_OcclusionQuery */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_OcclusionQuery"),
|
||||
reinterpret_cast<CComponent**>(&m_pOcclusionQueryCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStreetContainer::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CStreetContainer* CStreetContainer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CStreetContainer* pInstance = new CStreetContainer(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CStreetContainer");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CStreetContainer::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CStreetContainer* pInstance = new CStreetContainer(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CStreetContainer");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CStreetContainer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pVIBufferCom);
|
||||
SAFE_RELEASE(m_pOcclusionQueryCom);
|
||||
|
||||
for (auto& pCollision : m_ColiisonPartObjects)
|
||||
SAFE_RELEASE(pCollision);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CStreetContainer::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,78 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "MapContainer.h"
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CVIBuffer_Box;
|
||||
class COcclusionQuery;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CStreetContainer final : public CMapContainer
|
||||
{
|
||||
typedef struct tagStreetContainerDesc : public MAP_CONTAINER_DESC
|
||||
{
|
||||
_float3 vExtentRadius = {};
|
||||
_float3 vExtentPosition = {};
|
||||
}STREET_CONTAINER_DESC;
|
||||
|
||||
private:
|
||||
CStreetContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CStreetContainer(const CStreetContainer& rhs);
|
||||
~CStreetContainer() = 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;
|
||||
virtual HRESULT Render_BoundingBox() override;
|
||||
|
||||
public:
|
||||
template<typename T>
|
||||
HRESULT Add_Part(const _string& strPartKey, _uint iPrototypeLevelIndex, T** ppOut, void* pArg = nullptr) {
|
||||
return Add_PartObject<T>(strPartKey, iPrototypeLevelIndex, ppOut, pArg);
|
||||
}
|
||||
template<typename T>
|
||||
HRESULT Add_Collision(_uint iPrototypeLevelIndex, void* pArg = nullptr)
|
||||
{
|
||||
T* pPartObject = m_pGameInstance->Clone_Prototype<T>(iPrototypeLevelIndex, pArg, this);
|
||||
|
||||
if (nullptr == pPartObject) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_ColiisonPartObjects.push_back(pPartObject);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Box* m_pVIBufferCom = { nullptr };
|
||||
COcclusionQuery* m_pOcclusionQueryCom = { nullptr };
|
||||
|
||||
_float3 m_vExtentRadius = {};
|
||||
_float3 m_vExtentPosition = {};
|
||||
_float4x4 m_BoundingBoxWorldMatirx;
|
||||
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Bind_ShaderResources()override;
|
||||
|
||||
public:
|
||||
static CStreetContainer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner = nullptr)override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity()override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -15,6 +15,12 @@ RasterizerState RS_Nocull
|
||||
DepthClipEnable = false;
|
||||
};
|
||||
|
||||
RasterizerState RS_NocullOcclusion
|
||||
{
|
||||
FillMode = Solid;
|
||||
CullMode = None;
|
||||
};
|
||||
|
||||
RasterizerState RS_Nocull_Wireframe
|
||||
{
|
||||
FillMode = Wireframe;
|
||||
@@ -121,6 +127,12 @@ DepthStencilState DSS_Default_OutLine_Read
|
||||
BackFaceStencilFunc = Equal;
|
||||
};
|
||||
|
||||
DepthStencilState DSS_Occlusion
|
||||
{
|
||||
DepthEnable = true;
|
||||
DepthWriteMask = zero;
|
||||
};
|
||||
|
||||
BlendState BS_None
|
||||
{
|
||||
BlendEnable[0] = false;
|
||||
@@ -233,6 +245,28 @@ BlendState BS_WeightBlend
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
BlendState BS_WhiteMask
|
||||
{
|
||||
BlendEnable[0] = false;
|
||||
BlendEnable[1] = false;
|
||||
BlendEnable[2] = false;
|
||||
BlendEnable[3] = false;
|
||||
BlendEnable[4] = false;
|
||||
BlendEnable[5] = false;
|
||||
BlendEnable[6] = false;
|
||||
BlendEnable[7] = false;
|
||||
|
||||
RenderTargetWriteMask[0] = 0;
|
||||
RenderTargetWriteMask[1] = 0;
|
||||
RenderTargetWriteMask[2] = 0;
|
||||
RenderTargetWriteMask[3] = 0;
|
||||
RenderTargetWriteMask[4] = 0;
|
||||
RenderTargetWriteMask[5] = 0;
|
||||
RenderTargetWriteMask[6] = 0;
|
||||
RenderTargetWriteMask[7] = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif // ENGINE_SHADER_STATES_HLSLI
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
|
||||
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
|
||||
float g_fFar;
|
||||
float3 g_vContainerMin;
|
||||
float3 g_vContainerMax;
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
float3 vPosition : POSITION;
|
||||
};
|
||||
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
};
|
||||
|
||||
VS_OUT VS_MAIN(VS_IN In)
|
||||
{
|
||||
VS_OUT Out;
|
||||
|
||||
matrix matWV, matWVP;
|
||||
|
||||
matWV = mul(g_WorldMatrix, g_ViewMatrix);
|
||||
matWVP = mul(matWV, g_ProjMatrix);
|
||||
|
||||
Out.vPosition = mul(float4(In.vPosition, 1.f), matWVP);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_IN
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
};
|
||||
|
||||
struct PS_OUT
|
||||
{
|
||||
float4 vColor : SV_TARGET0;
|
||||
};
|
||||
|
||||
PS_OUT PS_MAIN(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
|
||||
Out.vColor = float4(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_DEBUG(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
|
||||
Out.vColor = float4(1.f, 0.5f, 0.5f, 1.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
technique11 NorTechnique11
|
||||
{
|
||||
pass BoundingBoxPass
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_Occlusion, 0);
|
||||
SetBlendState(BS_WhiteMask, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN();
|
||||
}
|
||||
|
||||
pass BoundingDebugPass
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_DEBUG();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -476,6 +476,7 @@
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Effect</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">5.0</ShaderModel>
|
||||
</FxCompile>
|
||||
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_VtxPos.hlsl" />
|
||||
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_VtxNorTex.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Effect</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">5.0</ShaderModel>
|
||||
|
||||
@@ -1166,5 +1166,8 @@
|
||||
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_VtxWorldModelInstance.hlsl">
|
||||
<Filter>99.Define\SHADER</Filter>
|
||||
</FxCompile>
|
||||
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_VtxPos.hlsl">
|
||||
<Filter>99.Define\SHADER</Filter>
|
||||
</FxCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -4,7 +4,8 @@
|
||||
#include "Terrain.h"
|
||||
#include "Layer.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
#include "PartObject.h"
|
||||
#include "MapObject_LOD.h"
|
||||
#include "Bounding_OBB.h"
|
||||
|
||||
CBuildingContainer::CBuildingContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CMapContainer(pDevice, pContext)
|
||||
@@ -28,10 +29,24 @@ void CBuildingContainer::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CBuildingContainer::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pVIBufferCom->Update(m_vBoxCorners);
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Update(fTimeDelta);
|
||||
|
||||
if (m_bOcclusionPassed)
|
||||
{
|
||||
_vector WorldPosition = XMVector3TransformCoord(
|
||||
XMVectorSetW(XMLoadFloat3(&m_vExtentPosition), 1.f),
|
||||
XMMatrixTranslation(m_vExtentPosition.x, m_vExtentPosition.y, m_vExtentPosition.z) * m_pTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
_vector vCamPosition = XMLoadFloat4(m_pGameInstance->Get_CamPosition());
|
||||
|
||||
// m_fCamDepth = XMVectorGetX(XMVector3LengthSq(vCamPosition - XMVectorSetW(XMLoadFloat3(&m_vExtentPosition), 1.f)));
|
||||
m_fCamDepth = XMVectorGetX(XMVector3Length(vCamPosition - XMLoadFloat3(&m_vExtentPosition)));
|
||||
}
|
||||
}
|
||||
|
||||
void CBuildingContainer::Late_Update(_float fTimeDelta)
|
||||
@@ -46,10 +61,20 @@ void CBuildingContainer::Late_Update(_float fTimeDelta)
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Late_Update(fTimeDelta);
|
||||
|
||||
if (m_bOcclusionPassed)
|
||||
{
|
||||
if (m_pOcclusionQueryCom->isDraw())
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::OCCLUSION, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Render()
|
||||
@@ -57,6 +82,85 @@ HRESULT CBuildingContainer::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Render_BoundingBox()
|
||||
{
|
||||
m_pOcclusionQueryCom->Begin_Query();
|
||||
|
||||
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 (m_pGameInstance->Key_Pressing(DIK_Q))
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(1)))
|
||||
return E_FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(0)))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Bind_Resources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Render()))
|
||||
return E_FAIL;
|
||||
|
||||
m_pOcclusionQueryCom->End_Query();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CBuildingContainer::Set_BoundingBox()
|
||||
{
|
||||
_float3 vCurrentMin = {};
|
||||
_float3 vCurrentMax = {};
|
||||
|
||||
|
||||
for (auto& piar : m_PartObjects)
|
||||
{
|
||||
dynamic_cast<CMapObject_LOD*>(piar.second)->Get_BoundingBox(&vCurrentMin, &vCurrentMax);
|
||||
|
||||
vContainerMin.x = min(vContainerMin.x, vCurrentMin.x);
|
||||
vContainerMin.y = min(vContainerMin.y, vCurrentMin.y);
|
||||
vContainerMin.z = min(vContainerMin.z, vCurrentMin.z);
|
||||
|
||||
vContainerMax.x = max(vContainerMax.x, vCurrentMax.x);
|
||||
vContainerMax.y = max(vContainerMax.y, vCurrentMax.y);
|
||||
vContainerMax.z = max(vContainerMax.z, vCurrentMax.z);
|
||||
}
|
||||
|
||||
m_vExtentRadius.x = (vContainerMax.x - vContainerMin.x) * 0.5f;
|
||||
m_vExtentRadius.y = (vContainerMax.y - vContainerMin.y) * 0.5f;
|
||||
m_vExtentRadius.z = (vContainerMax.z - vContainerMin.z) * 0.5f;
|
||||
|
||||
m_vExtentPosition.x = vContainerMin.x + m_vExtentRadius.x;
|
||||
m_vExtentPosition.y = vContainerMin.y + m_vExtentRadius.y;
|
||||
m_vExtentPosition.z = vContainerMin.z + m_vExtentRadius.z;
|
||||
|
||||
m_vBoxCorners[0] = _float3(vContainerMin.x, vContainerMax.y, vContainerMin.z);
|
||||
m_vBoxCorners[1] = _float3(vContainerMax.x, vContainerMax.y, vContainerMin.z);
|
||||
m_vBoxCorners[2] = _float3(vContainerMax.x, vContainerMin.y, vContainerMin.z);
|
||||
m_vBoxCorners[3] = _float3(vContainerMin.x, vContainerMin.y, vContainerMin.z);
|
||||
m_vBoxCorners[4] = _float3(vContainerMin.x, vContainerMax.y, vContainerMax.z);
|
||||
m_vBoxCorners[5] = _float3(vContainerMax.x, vContainerMax.y, vContainerMax.z);
|
||||
m_vBoxCorners[6] = _float3(vContainerMax.x, vContainerMin.y, vContainerMax.z);
|
||||
m_vBoxCorners[7] = _float3(vContainerMin.x, vContainerMin.y, vContainerMax.z);
|
||||
|
||||
m_pVIBufferCom->Update(m_vBoxCorners);
|
||||
|
||||
//XMStoreFloat4x4(&m_BoundingBoxWorldMatirx, m_pTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
//memcpy(&m_BoundingBoxWorldMatirx.m[3], &m_vExtentPosition, sizeof(_float3));
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
@@ -75,6 +179,10 @@ HRESULT CBuildingContainer::Initialize(void* pArg)
|
||||
MAP_CONTAINER_DESC* pDesc = static_cast<MAP_CONTAINER_DESC*>(pArg);
|
||||
|
||||
m_strName = pDesc->strName;
|
||||
if (string::npos == m_strName.find("Street"))
|
||||
m_bOcclusionPassed = true;
|
||||
else
|
||||
m_bOcclusionPassed = false;
|
||||
|
||||
m_vPosition = pDesc->vPosition;
|
||||
m_vScale = pDesc->vScale;
|
||||
@@ -93,6 +201,21 @@ HRESULT CBuildingContainer::Ready_Components(void* pArg)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_VTXPOS,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"),
|
||||
reinterpret_cast<CComponent**>(&m_pVIBufferCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_OcclusionQuery */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_OcclusionQuery"),
|
||||
reinterpret_cast<CComponent**>(&m_pOcclusionQueryCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -131,6 +254,10 @@ void CBuildingContainer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pVIBufferCom);
|
||||
SAFE_RELEASE(m_pOcclusionQueryCom);
|
||||
|
||||
for (auto& pCollision : m_ColiisonPartObjects)
|
||||
SAFE_RELEASE(pCollision);
|
||||
}
|
||||
@@ -141,6 +268,11 @@ void CBuildingContainer::Describe_Entity()
|
||||
return;
|
||||
if (nullptr == m_pGameInstance)
|
||||
return;
|
||||
if (GUI::Button("BoundingBox"))
|
||||
{
|
||||
Set_BoundingBox();
|
||||
}
|
||||
|
||||
|
||||
GUI::Text(m_strName.c_str());
|
||||
GUI::Text("----- Transfrom ----");
|
||||
@@ -170,6 +302,9 @@ void CBuildingContainer::Describe_Entity()
|
||||
m_vScale.z = max(0.01f, m_vScale.z);
|
||||
|
||||
|
||||
GUI::InputFloat3("Extent Radius", &m_vExtentRadius.x);
|
||||
GUI::InputFloat3("Extent Position", &m_vExtentPosition.x);
|
||||
|
||||
if (GUI::Button("Delete"))
|
||||
m_bDead = true;
|
||||
|
||||
|
||||
@@ -73,6 +73,8 @@
|
||||
|
||||
#pragma region MAP_HEADER
|
||||
#include "VIBuffer_Terrain.h"
|
||||
#include "VIBuffer_Box.h"
|
||||
#include "OcclusionQuery.h"
|
||||
#include "Terrain.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "MapObject_Collision.h"
|
||||
@@ -2290,6 +2292,12 @@ vector<vector<FOLDER_LOAD*>*> Contents(iLoadCount);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_VTXPOS,
|
||||
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxPos.hlsl"),
|
||||
VTXPOS::Elements, VTXPOS::iNumElements)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
|
||||
|
||||
|
||||
@@ -2303,6 +2311,7 @@ vector<vector<FOLDER_LOAD*>*> Contents(iLoadCount);
|
||||
CVIBuffer_Terrain::Create(m_pDevice, m_pContext, "../Bin/Resources/Data/Map/T_LandscapeStreamingProxy_0_LOD1_D.png"))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
CVIBuffer_Model_Instance::INSTANCE_DESC InstanceDesc = {};
|
||||
|
||||
InstanceDesc.iNum = 200;
|
||||
@@ -2325,6 +2334,16 @@ vector<vector<FOLDER_LOAD*>*> Contents(iLoadCount);
|
||||
"../Bin/Resources/Models/InstanceProp/SM_BearBerry_A.fbx", "../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Box */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"),
|
||||
CVIBuffer_Box::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_OcclusionQuery */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_OcclusionQuery"),
|
||||
COcclusionQuery::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_SkyBox */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummySkyBox>(g_iStaticLevel, CDummySkyBox::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
|
||||
@@ -67,7 +67,7 @@ HRESULT CMapObject_LOD::Initialize(void* pArg)
|
||||
_matrix ColliderMatrix = XMMatrixTranslation(vOffset.x, vOffset.y, vOffset.z) * XMLoadFloat4x4(&m_CombinedWorldMatrix);
|
||||
XMStoreFloat4(&m_vExtentPosition, ColliderMatrix.r[3]);
|
||||
|
||||
|
||||
XMStoreFloat3(&m_CombinedExtendPosition, XMVector3TransformCoord(XMLoadFloat3(&vOffset), XMLoadFloat4x4(&m_CombinedWorldMatrix)));
|
||||
|
||||
//m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
|
||||
@@ -111,6 +111,8 @@ void CMapObject_LOD::Late_Update(_float fTimeDelta)
|
||||
_matrix ColliderMatrix = XMMatrixTranslation(vOffset.x, vOffset.y, vOffset.z) * XMLoadFloat4x4(&m_CombinedWorldMatrix);
|
||||
XMStoreFloat4(&m_vExtentPosition, ColliderMatrix.r[3]);
|
||||
|
||||
|
||||
|
||||
_float fRaius = m_pModelComs[0]->Get_Radius();
|
||||
if (m_pGameInstance->isIn_WorldFrustum(XMLoadFloat4(&m_vExtentPosition), fRaius)) {
|
||||
|
||||
@@ -184,6 +186,24 @@ _wstring CMapObject_LOD::Get_PrototypeTag(_uint iLodIndex)
|
||||
return m_ModelPrototypeTags[iLodIndex];
|
||||
}
|
||||
|
||||
void CMapObject_LOD::Get_BoundingBox(_float3* pMinPosition, _float3* pMaxPosition)
|
||||
{
|
||||
_float fRadius = m_pModelComs[0]->Get_Radius() / 2.f;
|
||||
_float3 vOffset = m_pModelComs[0]->Get_RadiusOffset();
|
||||
|
||||
_float3 vPosition = {};
|
||||
|
||||
XMStoreFloat3(&vPosition, XMVector3TransformCoord(XMLoadFloat3(&vOffset), m_pTransformCom->Get_XMWorldMatrix()));
|
||||
|
||||
pMinPosition->x = vPosition.x - fRadius;
|
||||
pMinPosition->y = vPosition.y - fRadius;
|
||||
pMinPosition->z = vPosition.z - fRadius;
|
||||
|
||||
pMaxPosition->x = vPosition.x + fRadius;
|
||||
pMaxPosition->y = vPosition.y + fRadius;
|
||||
pMaxPosition->z = vPosition.z + fRadius;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_LOD::Add_LodModel(const _tchar* pModelPrototypeTag)
|
||||
{
|
||||
CModel* pModel = { nullptr };
|
||||
|
||||
@@ -259,6 +259,32 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
|
||||
container->InsertEndChild(Rotation);
|
||||
#pragma endregion
|
||||
|
||||
#pragma region BOUNDING_BOX
|
||||
tinyxml2::XMLElement* MapContainerType = doc.NewElement("MapContainerType");
|
||||
if(pContainerObject->Is_OcclusionPassed())
|
||||
MapContainerType->SetAttribute("type", 0); // Building
|
||||
else
|
||||
MapContainerType->SetAttribute("type", 1); // Road
|
||||
|
||||
container->InsertEndChild(MapContainerType);
|
||||
|
||||
_float3 vMinPosition = dynamic_cast<CBuildingContainer*>(pGamObject)->Get_BoundingBox_Min();
|
||||
_float3 vMaxPosition = dynamic_cast<CBuildingContainer*>(pGamObject)->Get_BoundingBox_Max();
|
||||
|
||||
tinyxml2::XMLElement* BoundingBox_Min = doc.NewElement("BoundingBox_Min");
|
||||
BoundingBox_Min->SetAttribute("x", vMinPosition.x);
|
||||
BoundingBox_Min->SetAttribute("y", vMinPosition.y);
|
||||
BoundingBox_Min->SetAttribute("z", vMinPosition.z);
|
||||
container->InsertEndChild(BoundingBox_Min);
|
||||
|
||||
tinyxml2::XMLElement* BoundingBox_Max = doc.NewElement("BoundingBox_Max");
|
||||
BoundingBox_Max->SetAttribute("x", vMaxPosition.x);
|
||||
BoundingBox_Max->SetAttribute("y", vMaxPosition.y);
|
||||
BoundingBox_Max->SetAttribute("z", vMaxPosition.z);
|
||||
container->InsertEndChild(BoundingBox_Max);
|
||||
#pragma endregion
|
||||
|
||||
|
||||
#pragma region SAVE_PARTOBJECT
|
||||
|
||||
if (FAILED(pContainerObject->Save_PartObjects(doc, container)))
|
||||
@@ -710,6 +736,8 @@ HRESULT CMapObject_Manager::Load_MapData(const _char* pFileName)
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
pContainerObject->Set_BoundingBox();
|
||||
|
||||
#pragma region ADD_COLLISION
|
||||
for (auto* Collision = Container->FirstChildElement("Collision"); Collision; Collision = Collision->NextSiblingElement("Collision"))
|
||||
{
|
||||
@@ -1342,6 +1370,17 @@ void CMapObject_Manager::Update_ContainerObject()
|
||||
|
||||
_uint iIndex = {};
|
||||
|
||||
if (GUI::Button("Set Box"))
|
||||
{
|
||||
if (false == (*pList).empty())
|
||||
{
|
||||
for (auto& pObject : (*pList))
|
||||
{
|
||||
dynamic_cast<CBuildingContainer*>(pObject)->Set_BoundingBox();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (false == (*pList).empty())
|
||||
{
|
||||
CGameObject* pSelectObject = { nullptr };
|
||||
|
||||
@@ -34,7 +34,7 @@ HRESULT CTerrain::Initialize(void* pArg)
|
||||
|
||||
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_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-194, 18.5f, -153.f, 1.f));
|
||||
|
||||
//m_pVIBufferCom->Set_CullingRadius(0.04f);
|
||||
|
||||
@@ -109,7 +109,7 @@ void CTerrain::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CTerrain::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pVIBufferCom->Culling(XMMatrixIdentity());
|
||||
//m_pVIBufferCom->Culling(XMMatrixIdentity());
|
||||
|
||||
if(m_pGameInstance->Key_Down(DIK_LSHIFT) && m_pGameInstance->Key_Down(DIK_W))
|
||||
{
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
#include "Editor_Define.h"
|
||||
#include "MapContainer.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CVIBuffer_Box;
|
||||
class COcclusionQuery;
|
||||
class CCollider;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CBuildingContainer final : public CMapContainer
|
||||
@@ -17,7 +24,12 @@ class CBuildingContainer final : public CMapContainer
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_BoundingBox() override;
|
||||
|
||||
_float3 Get_BoundingBox_Min() { return vContainerMin; }
|
||||
_float3 Get_BoundingBox_Max() { return vContainerMax; }
|
||||
void Set_BoundingBox();
|
||||
_bool Is_OcclusionPassed() { return m_bOcclusionPassed; }
|
||||
public:
|
||||
template<typename T>
|
||||
HRESULT Add_Part(const _string& strPartKey, _uint iPrototypeLevelIndex, T** ppOut, void* pArg = nullptr) {
|
||||
@@ -39,7 +51,20 @@ class CBuildingContainer final : public CMapContainer
|
||||
|
||||
vector<class CPartObject*>* Get_Collision() { return &m_ColiisonPartObjects; }
|
||||
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Box* m_pVIBufferCom = { nullptr };
|
||||
COcclusionQuery* m_pOcclusionQueryCom = { nullptr };
|
||||
CCollider* m_pCollider = { nullptr };
|
||||
|
||||
_bool m_bOcclusionPassed = { true };
|
||||
_float4x4 m_BoundingBoxWorldMatirx = {};
|
||||
_float3 m_vBoxCorners[8] = {};
|
||||
|
||||
_float3 m_vExtentPosition = {};
|
||||
_float3 m_vExtentRadius = {};
|
||||
_float3 vContainerMin = { 999.f, 999.f, 999.f };
|
||||
_float3 vContainerMax = { -999.f, -999.f, -999.f };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Editor {
|
||||
#define FX_INSTANCE_PROP_MODEL TEXT("FX_INSTANCE_PROP_MODEL")
|
||||
#define FX_UIEDITOR TEXT("FX_UIEDITOR")
|
||||
#define FX_UIINSTANCE TEXT("FX_UIINSTANCE")
|
||||
|
||||
#define FX_VTXPOS TEXT("FX_VTXPOS")
|
||||
|
||||
#pragma endregion
|
||||
#pragma region MACRO_PROTOTYPE
|
||||
|
||||
@@ -25,6 +25,7 @@ class CMapContainer abstract : public CContainerObject
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
|
||||
virtual _string& Get_Name() { return m_strName; }
|
||||
virtual HRESULT Save_PartObjects(tinyxml2::XMLDocument& Doc, tinyxml2::XMLElement* Container);
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ class CMapObject_LOD final : public CMapObject // LOD 있는 애들
|
||||
|
||||
public:
|
||||
virtual _wstring Get_PrototypeTag(_uint iLodIndex = 0);
|
||||
void Get_BoundingBox(_float3* pMinPosition, _float3* pMaxPosition);
|
||||
HRESULT Add_LodModel(const _tchar* pModelPrototypeTag);
|
||||
void Set_KeyIndex(_uint iIndex) {
|
||||
m_iKeyIndex = iIndex;
|
||||
@@ -41,6 +42,8 @@ class CMapObject_LOD final : public CMapObject // LOD 있는 애들
|
||||
|
||||
vector<_wstring> m_ModelPrototypeTags;
|
||||
vector<_uint> m_ModelPathIndices = { };
|
||||
_float3 m_CombinedExtendPosition = {};
|
||||
|
||||
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
|
||||
@@ -15,6 +15,12 @@ RasterizerState RS_Nocull
|
||||
DepthClipEnable = false;
|
||||
};
|
||||
|
||||
RasterizerState RS_NocullOcclusion
|
||||
{
|
||||
FillMode = Solid;
|
||||
CullMode = None;
|
||||
};
|
||||
|
||||
RasterizerState RS_Nocull_Wireframe
|
||||
{
|
||||
FillMode = Wireframe;
|
||||
@@ -121,6 +127,12 @@ DepthStencilState DSS_Default_OutLine_Read
|
||||
BackFaceStencilFunc = Equal;
|
||||
};
|
||||
|
||||
DepthStencilState DSS_Occlusion
|
||||
{
|
||||
DepthEnable = true;
|
||||
DepthWriteMask = zero;
|
||||
};
|
||||
|
||||
BlendState BS_None
|
||||
{
|
||||
BlendEnable[0] = false;
|
||||
@@ -233,6 +245,28 @@ BlendState BS_WeightBlend
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
BlendState BS_WhiteMask
|
||||
{
|
||||
BlendEnable[0] = false;
|
||||
BlendEnable[1] = false;
|
||||
BlendEnable[2] = false;
|
||||
BlendEnable[3] = false;
|
||||
BlendEnable[4] = false;
|
||||
BlendEnable[5] = false;
|
||||
BlendEnable[6] = false;
|
||||
BlendEnable[7] = false;
|
||||
|
||||
RenderTargetWriteMask[0] = 0;
|
||||
RenderTargetWriteMask[1] = 0;
|
||||
RenderTargetWriteMask[2] = 0;
|
||||
RenderTargetWriteMask[3] = 0;
|
||||
RenderTargetWriteMask[4] = 0;
|
||||
RenderTargetWriteMask[5] = 0;
|
||||
RenderTargetWriteMask[6] = 0;
|
||||
RenderTargetWriteMask[7] = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif // ENGINE_SHADER_STATES_HLSLI
|
||||
|
||||
@@ -208,6 +208,7 @@ call Update_Lib.bat
|
||||
<ClCompile Include="..\Private\ContainerObject.cpp" />
|
||||
<ClCompile Include="..\Private\DebugDraw.cpp" />
|
||||
<ClCompile Include="..\private\QuadTree.cpp" />
|
||||
<ClCompile Include="..\private\OcclusionQuery.cpp" />
|
||||
<ClCompile Include="..\Private\RigidBody_Dynamic_Joint.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
@@ -311,6 +312,7 @@ call Update_Lib.bat
|
||||
<ClCompile Include="..\private\UIObject.cpp" />
|
||||
<ClCompile Include="..\Private\Unit.cpp" />
|
||||
<ClCompile Include="..\Private\VIBuffer.cpp" />
|
||||
<ClCompile Include="..\private\VIBuffer_Box.cpp" />
|
||||
<ClCompile Include="..\Private\VIBuffer_Cell.cpp" />
|
||||
<ClCompile Include="..\Private\VIBuffer_Cube.cpp" />
|
||||
<ClCompile Include="..\Private\Instance_Model.cpp" />
|
||||
@@ -423,6 +425,7 @@ call Update_Lib.bat
|
||||
<ClInclude Include="..\Public\Bounding_Sphere.h" />
|
||||
<ClInclude Include="..\public\FSM.h" />
|
||||
<ClInclude Include="..\public\QuadTree.h" />
|
||||
<ClInclude Include="..\public\OcclusionQuery.h" />
|
||||
<ClInclude Include="..\Public\RigidBody_Dynamic_Joint.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
@@ -556,6 +559,7 @@ call Update_Lib.bat
|
||||
<ClInclude Include="..\public\UIObject.h" />
|
||||
<ClInclude Include="..\Public\Unit.h" />
|
||||
<ClInclude Include="..\Public\VIBuffer.h" />
|
||||
<ClInclude Include="..\public\VIBuffer_Box.h" />
|
||||
<ClInclude Include="..\Public\VIBuffer_Cell.h" />
|
||||
<ClInclude Include="..\Public\VIBuffer_Cube.h" />
|
||||
<ClInclude Include="..\Public\Instance_Model.h" />
|
||||
|
||||
@@ -289,6 +289,12 @@
|
||||
<Filter Include="99.Define\99.THIRDPARTY\PHYSX">
|
||||
<UniqueIdentifier>{5948985e-f67e-4627-aca4-09b8e9edc359}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\02.VIBuffer\Box">
|
||||
<UniqueIdentifier>{f1ac53f8-59f6-4371-a48c-c331f337ebe7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\11.Query">
|
||||
<UniqueIdentifier>{432b36d5-fdf6-456a-bc71-8bf793a42314}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Private\Base.cpp">
|
||||
@@ -546,6 +552,12 @@
|
||||
<ClCompile Include="..\Private\VIBuffer_Model_Instance.cpp">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Instance\Model_Instance</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\OcclusionQuery.cpp">
|
||||
<Filter>02.Element\02.Component\11.Query</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\VIBuffer_Box.cpp">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Box</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Base.h">
|
||||
@@ -1172,6 +1184,12 @@
|
||||
<ClInclude Include="..\Public\VIBuffer_Model_Instance.h">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Instance\Model_Instance</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\OcclusionQuery.h">
|
||||
<Filter>02.Element\02.Component\11.Query</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\VIBuffer_Box.h">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Box</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Public\Assimp\color4.inl">
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
#include "pch.h"
|
||||
#include "OcclusionQuery.h"
|
||||
|
||||
COcclusionQuery::COcclusionQuery(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CComponent(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
COcclusionQuery::COcclusionQuery(const COcclusionQuery& rhs)
|
||||
:CComponent(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void COcclusionQuery::Begin_Query()
|
||||
{
|
||||
m_pContext->Begin(m_pQuery);
|
||||
}
|
||||
|
||||
_bool COcclusionQuery::isDraw()
|
||||
{
|
||||
UINT64 iNumSample;
|
||||
|
||||
if (m_pContext->GetData(m_pQuery, &iNumSample, sizeof(UINT64), 0) != S_OK)
|
||||
return m_bPreFrameDraw;
|
||||
|
||||
0 < iNumSample ? m_bThisFrameDraw = true : m_bThisFrameDraw = false;
|
||||
|
||||
_bool bDraw = { false };
|
||||
|
||||
if(true == m_bThisFrameDraw)
|
||||
m_NumCullFrame = 0;
|
||||
else
|
||||
{
|
||||
if(m_NumCullFrame < 5)
|
||||
++m_NumCullFrame;
|
||||
}
|
||||
|
||||
m_bPreFrameDraw = m_bThisFrameDraw;
|
||||
|
||||
return m_NumCullFrame < 5;
|
||||
}
|
||||
|
||||
void COcclusionQuery::End_Query()
|
||||
{
|
||||
m_pContext->End(m_pQuery);
|
||||
}
|
||||
|
||||
HRESULT COcclusionQuery::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT COcclusionQuery::Initialize(void* pArg)
|
||||
{
|
||||
D3D11_QUERY_DESC queryDesc = {};
|
||||
|
||||
queryDesc.Query = D3D11_QUERY_OCCLUSION;
|
||||
queryDesc.MiscFlags = 0;
|
||||
|
||||
if (FAILED(m_pDevice->CreateQuery(&queryDesc, &m_pQuery)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : ID3D11Query");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_bPreFrameDraw = m_bThisFrameDraw = true;
|
||||
m_NumCullFrame = 0;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
COcclusionQuery* COcclusionQuery::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
COcclusionQuery* pInstance = new COcclusionQuery(pDevice, pContext);
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : COcclusionQuery");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CComponent* COcclusionQuery::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
COcclusionQuery* pInstance = new COcclusionQuery(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : COcclusionQuery");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void COcclusionQuery::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pQuery);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void COcclusionQuery::Describe_Entity()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -57,13 +57,13 @@ void CRenderer::Render()
|
||||
if (FAILED(m_pShader->Bind_RawValue("g_vResolution", &vResolution, sizeof(_float2)))) {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
Render_Priority();
|
||||
Render_Shadow();
|
||||
Render_NonBlend();
|
||||
Render_LightAcc();
|
||||
Render_Blur();
|
||||
Render_Combined();
|
||||
Render_Occlusion();
|
||||
Render_Effect();
|
||||
Render_NonLight();
|
||||
Render_Blend();
|
||||
@@ -81,6 +81,26 @@ void CRenderer::Render()
|
||||
#endif
|
||||
}
|
||||
|
||||
void CRenderer::Render_Occlusion()
|
||||
{
|
||||
m_RenderObjects[ENUM_CLASS(RENDER::OCCLUSION)].sort([](CGameObject* pSour, CGameObject* pDest)->_bool {
|
||||
return pSour->Get_Depth() < pDest->Get_Depth();
|
||||
});
|
||||
|
||||
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::OCCLUSION)])
|
||||
{
|
||||
if (nullptr != pRenderObject) {
|
||||
if (FAILED(pRenderObject->Render_BoundingBox())) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
SAFE_RELEASE(pRenderObject);
|
||||
}
|
||||
|
||||
m_RenderObjects[ENUM_CLASS(RENDER::OCCLUSION)].clear();
|
||||
}
|
||||
|
||||
void CRenderer::Render_Priority()
|
||||
{
|
||||
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::PRIORITY)])
|
||||
@@ -808,8 +828,6 @@ HRESULT CRenderer::Initialize()
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_WB"), TEXT("Target_Color")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
m_pShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, FX_DEFERRED, nullptr, nullptr);
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
#include "pch.h"
|
||||
#include "VIBuffer_Box.h"
|
||||
|
||||
CVIBuffer_Box::CVIBuffer_Box(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CVIBuffer(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CVIBuffer_Box::CVIBuffer_Box(const CVIBuffer_Box& rhs)
|
||||
: CVIBuffer(rhs)
|
||||
{
|
||||
}
|
||||
#ifdef EDITOR_PROJECT
|
||||
HRESULT CVIBuffer_Box::Initialize_Prototype()
|
||||
{
|
||||
m_iNumVertexBuffers = 1;
|
||||
m_iNumVertices = 8;
|
||||
m_iVertexStride = sizeof(VTXPOS);
|
||||
|
||||
m_iIndexStride = 2;
|
||||
m_iNumIndices = 36;
|
||||
|
||||
m_eIndexFormat = DXGI_FORMAT_R16_UINT;
|
||||
m_ePrimitive = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
|
||||
|
||||
#pragma region IB_BUFFER
|
||||
D3D11_BUFFER_DESC IBDesc{};
|
||||
IBDesc.ByteWidth = m_iIndexStride * m_iNumIndices;
|
||||
IBDesc.Usage = D3D11_USAGE_DEFAULT;
|
||||
IBDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
|
||||
IBDesc.StructureByteStride = m_iIndexStride;
|
||||
IBDesc.CPUAccessFlags = 0;
|
||||
IBDesc.MiscFlags = 0;
|
||||
|
||||
|
||||
_ushort* pIndices = new _ushort[m_iNumIndices];
|
||||
ZeroMemory(pIndices, sizeof(_ushort) * m_iNumIndices);
|
||||
|
||||
/* + x */
|
||||
pIndices[0] = 1; pIndices[1] = 5; pIndices[2] = 6;
|
||||
pIndices[3] = 1; pIndices[4] = 6; pIndices[5] = 2;
|
||||
|
||||
/* - x */
|
||||
pIndices[6] = 4; pIndices[7] = 0; pIndices[8] = 3;
|
||||
pIndices[9] = 4; pIndices[10] = 3; pIndices[11] = 7;
|
||||
|
||||
/* + y */
|
||||
pIndices[12] = 4; pIndices[13] = 5; pIndices[14] = 1;
|
||||
pIndices[15] = 4; pIndices[16] = 1; pIndices[17] = 0;
|
||||
|
||||
/* - y */
|
||||
pIndices[18] = 3; pIndices[19] = 2; pIndices[20] = 6;
|
||||
pIndices[21] = 3; pIndices[22] = 6; pIndices[23] = 7;
|
||||
|
||||
/* + z */
|
||||
pIndices[24] = 5; pIndices[25] = 4; pIndices[26] = 7;
|
||||
pIndices[27] = 5; pIndices[28] = 7; pIndices[29] = 6;
|
||||
|
||||
/* - z */
|
||||
pIndices[30] = 0; pIndices[31] = 1; pIndices[32] = 2;
|
||||
pIndices[33] = 0; pIndices[34] = 2; pIndices[35] = 3;
|
||||
|
||||
|
||||
D3D11_SUBRESOURCE_DATA IBRes{};
|
||||
IBRes.pSysMem = pIndices;
|
||||
|
||||
if (FAILED(m_pDevice->CreateBuffer(&IBDesc, &IBRes, &m_pIB))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
Safe_Delete_Array(pIndices);
|
||||
#pragma endregion
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CVIBuffer_Box::Initialize(void* pArg)
|
||||
{
|
||||
#pragma region VTX_BUFFER
|
||||
D3D11_BUFFER_DESC VBDesc{};
|
||||
VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices;
|
||||
VBDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
|
||||
VBDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
VBDesc.MiscFlags = 0;
|
||||
VBDesc.StructureByteStride = m_iVertexStride;
|
||||
|
||||
VTXPOS* pVertices = new VTXPOS[m_iNumVertices];
|
||||
memset(pVertices, 0, sizeof(VTXPOS) * m_iNumVertices);
|
||||
|
||||
pVertices[0].vPosition = _float3(-0.5f, 0.5f, -0.5f);
|
||||
pVertices[1].vPosition = _float3(0.5f, 0.5f, -0.5f);
|
||||
pVertices[2].vPosition = _float3(0.5f, -0.5f, -0.5f);
|
||||
pVertices[3].vPosition = _float3(-0.5f, -0.5f, -0.5f);
|
||||
pVertices[4].vPosition = _float3(-0.5f, 0.5f, 0.5f);
|
||||
pVertices[5].vPosition = _float3(0.5f, 0.5f, 0.5f);
|
||||
pVertices[6].vPosition = _float3(0.5f, -0.5f, 0.5f);
|
||||
pVertices[7].vPosition = _float3(-0.5f, -0.5f, 0.5f);
|
||||
|
||||
D3D11_SUBRESOURCE_DATA VBRes{};
|
||||
VBRes.pSysMem = pVertices;
|
||||
|
||||
if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &VBRes, &m_pVB))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
Safe_Delete_Array(pVertices);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CVIBuffer_Box::Update(_float3* pVertexDatas)
|
||||
{
|
||||
D3D11_MAPPED_SUBRESOURCE SubResource{};
|
||||
m_pContext->Map(m_pVB, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource);
|
||||
|
||||
VTXPOS* pVertices = static_cast<VTXPOS*>(SubResource.pData);
|
||||
|
||||
for (_uint i = 0; i < m_iNumVertices; ++i)
|
||||
{
|
||||
memcpy(&pVertices[i].vPosition, &pVertexDatas[i], sizeof(_float3));
|
||||
}
|
||||
|
||||
m_pContext->Unmap(m_pVB, 0);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#else
|
||||
HRESULT CVIBuffer_Box::Initialize(void* pArg)
|
||||
{
|
||||
_float3* pCorners = static_cast<_float3*>(pArg);
|
||||
|
||||
#pragma region VTX_BUFFER
|
||||
D3D11_BUFFER_DESC VBDesc{};
|
||||
VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices;
|
||||
VBDesc.Usage = D3D11_USAGE_DEFAULT;
|
||||
VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
|
||||
VBDesc.CPUAccessFlags = 0;
|
||||
VBDesc.MiscFlags = 0;
|
||||
VBDesc.StructureByteStride = m_iVertexStride;
|
||||
|
||||
VTXPOS* pVertices = new VTXPOS[m_iNumVertices];
|
||||
memset(pVertices, 0, sizeof(VTXPOS) * m_iNumVertices);
|
||||
|
||||
pVertices[0].vPosition = pCorners[0];
|
||||
pVertices[1].vPosition = pCorners[1];
|
||||
pVertices[2].vPosition = pCorners[2];
|
||||
pVertices[3].vPosition = pCorners[3];
|
||||
pVertices[4].vPosition = pCorners[4];
|
||||
pVertices[5].vPosition = pCorners[5];
|
||||
pVertices[6].vPosition = pCorners[6];
|
||||
pVertices[7].vPosition = pCorners[7];
|
||||
|
||||
D3D11_SUBRESOURCE_DATA VBRes{};
|
||||
VBRes.pSysMem = pVertices;
|
||||
|
||||
if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &VBRes, &m_pVB))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
Safe_Delete_Array(pVertices);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
CVIBuffer_Box* CVIBuffer_Box::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CVIBuffer_Box* pInstance = new CVIBuffer_Box(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CVIBuffer_Rect");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CVIBuffer_Box* CVIBuffer_Box::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CVIBuffer_Box* pInstance = new CVIBuffer_Box(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CVIBuffer_Box");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CVIBuffer_Box::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CVIBuffer_Box::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
@@ -5,7 +5,7 @@ NS_BEGIN(Engine)
|
||||
enum class STATE { RIGHT, UP, LOOK, POSITION, END };
|
||||
enum class LIGHT { DIRECTIONAL, POINT, SPOT, END };
|
||||
enum class COLLIDER { AABB, OBB, SPHERE, END };
|
||||
enum class RENDER { PRIORITY, SHADOW, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, BLOOM, UI, END };
|
||||
enum class RENDER { OCCLUSION, PRIORITY, SHADOW, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, BLOOM, UI, END };
|
||||
enum class RAY { LOCAL, WORLD, END };
|
||||
enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END };
|
||||
|
||||
|
||||
@@ -240,6 +240,18 @@ typedef struct tagVertexPositionTexcoord {
|
||||
|
||||
}VTXPOSTEX;
|
||||
|
||||
typedef struct tagVertexPositionNormal {
|
||||
_float3 vPosition = {};
|
||||
_float3 vNormal = {};
|
||||
|
||||
static constexpr _uint iNumElements = { 2 };
|
||||
static constexpr D3D11_INPUT_ELEMENT_DESC Elements[] = {
|
||||
{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }
|
||||
};
|
||||
|
||||
}VTXPOSNOR;
|
||||
|
||||
typedef struct tagVertexPositionNormalTexcoord {
|
||||
_float3 vPosition = {};
|
||||
_float3 vNormal = {};
|
||||
|
||||
@@ -255,6 +255,7 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
class CPhysX_Manager* m_pPhysX_Manager = { nullptr };
|
||||
class CPicking* m_pPicking = { nullptr };
|
||||
class CThreadHolder* m_pThreadHolder = { nullptr };
|
||||
class COcclusionQuery* m_pOcclusionQuery = { nullptr };
|
||||
|
||||
#ifdef _DEBUG
|
||||
private:
|
||||
|
||||
@@ -24,6 +24,7 @@ class ENGINE_DLL CGameObject abstract
|
||||
virtual HRESULT Render_Blur() { return S_OK; }
|
||||
virtual HRESULT Render_Bloom() { return S_OK; }
|
||||
virtual HRESULT Render_OutLine() { return S_OK; }
|
||||
virtual HRESULT Render_BoundingBox() { return S_OK; }
|
||||
|
||||
virtual _float Get_Depth(); // z 소팅 할 때 쓰시면 됨
|
||||
|
||||
@@ -37,6 +38,7 @@ class ENGINE_DLL CGameObject abstract
|
||||
|
||||
_bool isDead() const { return m_bDead; }
|
||||
void Set_Dead() { m_bDead = true; }
|
||||
void Set_Draw(_bool bDraw) { m_bDraw = bDraw; }
|
||||
|
||||
_uint Get_ObjectTag() const { return m_iObjectTag; }
|
||||
_uint Get_CollisionID() const { return m_iCollisionID; }
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include "Component.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
|
||||
class ENGINE_DLL COcclusionQuery final : public CComponent
|
||||
{
|
||||
private:
|
||||
COcclusionQuery(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
COcclusionQuery(const COcclusionQuery& rhs);
|
||||
virtual ~COcclusionQuery() = default;
|
||||
|
||||
public:
|
||||
void Begin_Query();
|
||||
_bool isDraw();
|
||||
void End_Query();
|
||||
|
||||
private:
|
||||
ID3D11Query* m_pQuery = { nullptr };
|
||||
|
||||
_bool m_bPreFrameDraw = {};
|
||||
_bool m_bThisFrameDraw = {};
|
||||
_uint m_NumCullFrame = {};
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
public:
|
||||
static COcclusionQuery* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -16,7 +16,9 @@
|
||||
#include "FSM.h"
|
||||
#include "State.h"
|
||||
#include "VIBuffer_UI_Instance.h"
|
||||
#include "VIBuffer_Box.h"
|
||||
#include "Trail.h"
|
||||
#include "OcclusionQuery.h"
|
||||
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
|
||||
@@ -40,6 +40,7 @@ class CRenderer final : public CBase
|
||||
_float4x4 m_ProjMatrix = {};
|
||||
|
||||
ID3D11DepthStencilView* m_pShadowDSV = { nullptr };
|
||||
ID3D11DepthStencilView* m_pOcclusionDSV = { nullptr };
|
||||
|
||||
SHADOW_LIGHT_DESC m_PreShadowDesc = {};
|
||||
_float4x4 m_PreShadowMatrices[ENUM_CLASS(D3DTS::END)] = {};
|
||||
@@ -49,6 +50,7 @@ class CRenderer final : public CBase
|
||||
_float m_fThreshold = { 1.26f };
|
||||
|
||||
private:
|
||||
void Render_Occlusion();
|
||||
void Render_Priority();
|
||||
void Render_Shadow();
|
||||
void Render_NonBlend();
|
||||
@@ -71,6 +73,7 @@ class CRenderer final : public CBase
|
||||
|
||||
private:
|
||||
HRESULT Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY);
|
||||
HRESULT Ready_OcclusionDepthStencilView(_uint iSizeX, _uint iSizeY);
|
||||
|
||||
private:
|
||||
HRESULT Initialize();
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include "VIBuffer.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
|
||||
class ENGINE_DLL CVIBuffer_Box final :
|
||||
public CVIBuffer
|
||||
{
|
||||
private:
|
||||
CVIBuffer_Box(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CVIBuffer_Box(const CVIBuffer_Box& rhs);
|
||||
virtual ~CVIBuffer_Box() = default;
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
#ifdef EDITOR_PROJECT
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
public:
|
||||
virtual HRESULT Update(_float3* pVertices);
|
||||
|
||||
#else
|
||||
private:
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
#endif // EDITOR_PROJECT
|
||||
|
||||
|
||||
public:
|
||||
static CVIBuffer_Box* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CVIBuffer_Box* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
Reference in New Issue
Block a user