[add] RenderTargetManager_Refitter
This commit is contained in:
@@ -556,4 +556,14 @@ technique11 DefaultTechnique
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_SPOT();
|
||||
}
|
||||
|
||||
pass RefitPass // 6
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_Blend, 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_SPOT();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ void CHair::Describe_Entity()
|
||||
if (!m_pModelCom )
|
||||
return;
|
||||
|
||||
/*for (_uint i = 0; i < dynamic_cast<CTexture*>(m_pTextureCom)->Get_Size(); i++)
|
||||
/*for (_uint i = 0; i < dynamic_cast<CTexture*>(m_pTextureCom)->Get_TextureDesc(); i++)
|
||||
{
|
||||
_char label[128];
|
||||
|
||||
@@ -187,7 +187,7 @@ void CHair::Describe_Entity()
|
||||
iTextureIndex = i;
|
||||
}
|
||||
|
||||
if (i % dynamic_cast<CTexture*>(m_pTextureCom)->Get_Size() != dynamic_cast<CTexture*>(m_pTextureCom)->Get_Size()-1)
|
||||
if (i % dynamic_cast<CTexture*>(m_pTextureCom)->Get_TextureDesc() != dynamic_cast<CTexture*>(m_pTextureCom)->Get_TextureDesc()-1)
|
||||
GUI::SameLine();
|
||||
}*/
|
||||
|
||||
|
||||
@@ -556,4 +556,14 @@ technique11 DefaultTechnique
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_SPOT();
|
||||
}
|
||||
|
||||
pass RefitPass // 6
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_Blend, 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_SPOT();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,6 +541,10 @@ HRESULT CGameInstance::Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Tex
|
||||
{
|
||||
return m_pRenderTarget_Manager->Copy_RenderTarget(strTargetTag, pTexture2D);
|
||||
}
|
||||
HRESULT CGameInstance::Refit_RenderTarget(CShader* pShader, const _wstring& wstrRenderTargetInput, const _wstring& wstrRenderTargetOutput)
|
||||
{
|
||||
return m_pRenderTarget_Manager->Refit_RenderTarget(pShader, wstrRenderTargetInput, wstrRenderTargetOutput);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
void CGameInstance::RenderTarget_Debuger()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "RenderTarget.h"
|
||||
|
||||
#include "Shader.h"
|
||||
@@ -73,12 +73,16 @@ void CRenderTarget::Copy_Resource(ID3D11Texture2D* pTexture2D)
|
||||
{
|
||||
m_pContext->CopyResource(pTexture2D, m_pTexture2D);
|
||||
}
|
||||
void CRenderTarget::Get_TextureDesc(D3D11_TEXTURE2D_DESC& Desc)
|
||||
{
|
||||
m_pTexture2D->GetDesc(&Desc);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CRenderTarget::Ready_Debug()
|
||||
{
|
||||
|
||||
XMStoreFloat4x4(&m_WorldMatrix, XMMatrixIdentity()); // 디버그 월드 메트릭스 초기화
|
||||
XMStoreFloat4x4(&m_WorldMatrix, XMMatrixIdentity()); // 디버그 월드 메트릭스 초기화
|
||||
|
||||
_uint iNumViewports = { 1 };
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "pch.h"
|
||||
#include "RenderTarget_Manager.h"
|
||||
#include "RenderTarget.h"
|
||||
#include "Shader.h"
|
||||
|
||||
CRenderTarget_Manager::CRenderTarget_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CBase(),
|
||||
@@ -153,6 +154,58 @@ HRESULT CRenderTarget_Manager::Copy_RenderTarget(const _wstring& strTargetTag, I
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CRenderTarget_Manager::Refit_RenderTarget(class CShader* pShader, const _wstring& wstrRenderTargetInput, const _wstring& wstrRenderTargetOutput)
|
||||
{
|
||||
CRenderTarget* pInput = Find_RenderTarget(wstrRenderTargetInput);
|
||||
CRenderTarget* pOutput = Find_RenderTarget(wstrRenderTargetOutput);
|
||||
if (nullptr == pInput || nullptr == pOutput) { return E_FAIL; }
|
||||
|
||||
_uint iNumViewPort = 1;
|
||||
D3D11_VIEWPORT vp = {};
|
||||
m_pContext->RSGetViewports(&iNumViewPort, &vp);
|
||||
|
||||
D3D11_TEXTURE2D_DESC OutputDesc = {};
|
||||
vp.Width = (_float)OutputDesc.Width;
|
||||
vp.Height = (_float)OutputDesc.Height;
|
||||
|
||||
pOutput->Get_TextureDesc(OutputDesc);
|
||||
pOutput->Clear();
|
||||
|
||||
|
||||
{ // Bind RTVs
|
||||
_uint iNumRenderTargets = { 1 };
|
||||
ID3D11RenderTargetView* pRenderTargetViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = { pOutput->Get_RTV(), };
|
||||
m_pContext->OMSetRenderTargets(0, nullptr, nullptr);
|
||||
m_pContext->OMSetRenderTargets(1, pRenderTargetViews, nullptr);
|
||||
}
|
||||
|
||||
m_pContext->RSSetViewports(iNumViewPort, &vp);
|
||||
|
||||
{ // Bind const
|
||||
_float4x4 matIdentity = {};
|
||||
XMStoreFloat4x4(&matIdentity, XMMatrixIdentity());
|
||||
if (FAILED(pShader->Bind_Matrix("g_WorldMatrix", &matIdentity))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(pShader->Bind_Matrix("g_ViewMatrix", &matIdentity))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(pShader->Bind_Matrix("g_ProjMatrix", &matIdentity))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(pInput->Bind_ShaderResource(pShader, "g_DiffuseTexture"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (FAILED(pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::REFIT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pContext->PSSetShaderResources(0, 1, nullptr);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CRenderTarget_Manager::End_MRT()
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ enum class NAVI_POINT { A, B, C, END };
|
||||
enum class NAVI_LINE { AB, BC, CA, END };
|
||||
enum class SHADER_PASS_CELL { DEBUG, END };
|
||||
|
||||
enum class SHADER_PASS_DEFERRED { DEBUG, DIRECTIONAL, POINT, COMBINED, BLUR, SPOT, END };
|
||||
enum class SHADER_PASS_DEFERRED { DEBUG, DIRECTIONAL, POINT, COMBINED, BLUR, SPOT, REFIT, END };
|
||||
|
||||
enum class QUESTYPE {MAIN, SUB, END};
|
||||
enum class TEXTURE_MOUNT_SLOT0 { NOT_DEFINED, METALLIC, SPECULAR, HEIGHT, END };
|
||||
|
||||
@@ -157,6 +157,7 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
HRESULT End_MRT();
|
||||
HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName);
|
||||
HRESULT Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D);
|
||||
HRESULT Refit_RenderTarget(class CShader* pShader, const _wstring& wstrRenderTargetInput, const _wstring& wstrRenderTargetOutput);
|
||||
#ifdef _DEBUG
|
||||
void RenderTarget_Debuger();
|
||||
HRESULT Render_RenderTarget_Debug(class CShader* pShader, class CVIBuffer_Rect* pVIBuffer);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Base.h"
|
||||
|
||||
@@ -18,6 +18,8 @@ class CRenderTarget final : public CBase
|
||||
HRESULT Bind_ShaderResource(class CShader* pShader, const _char* pConstantName);
|
||||
void Clear();
|
||||
void Copy_Resource(ID3D11Texture2D* pTexture2D);
|
||||
void Get_TextureDesc(D3D11_TEXTURE2D_DESC& Desc);
|
||||
ID3D11ShaderResourceView* Get_SRV() const { return m_pSRV; }
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
@@ -47,4 +49,4 @@ class CRenderTarget final : public CBase
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -19,6 +19,8 @@ class CRenderTarget_Manager final : public CBase
|
||||
HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName);
|
||||
HRESULT Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D);
|
||||
|
||||
HRESULT Refit_RenderTarget(class CShader* pShader, const _wstring& wstrRenderTargetInput, const _wstring& wstrRenderTargetOutput);
|
||||
|
||||
#ifdef _DEBUG
|
||||
public:
|
||||
HRESULT Render_RenderTarget_Debug(class CShader* pShader, class CVIBuffer_Rect* pVIBuffer);
|
||||
|
||||
Reference in New Issue
Block a user