[add] QcclusionQuery Component 추가
[add] Qcclusion Culling 용 바운딩 박스 버퍼 추가 [add] Qcclusion Culling 적용
This commit is contained in:
@@ -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