[fix] SSAO Radius

This commit is contained in:
kimnuri
2025-12-14 10:56:57 +09:00
parent 061eac7f6a
commit ee9550c83d
7 changed files with 101 additions and 111 deletions
+25 -3
View File
@@ -57,9 +57,8 @@ HRESULT CEffectPool::Initialize(void* pArg)
if (FAILED(Ready_Components())) {
return E_FAIL;
}
// 디버그 모드일 때
#ifdef _DEBUG
#ifdef gimch
m_isActiveEffectCreate = false;
m_isActiveMonsterEffectCreate = false;
@@ -80,8 +79,31 @@ HRESULT CEffectPool::Initialize(void* pArg)
m_isActiveEffectCreate = false;
m_isActiveMonsterEffectCreate = false;
#endif //
#endif
//// 디버그 모드가 아닐 때, 릴리즈모드에
#ifndef _DEBUG
#ifdef gimch
m_isActiveEffectCreate = true;
m_isActiveMonsterEffectCreate = true;
#endif // gimch
#ifdef Bin
m_isActiveEffectCreate = true;
m_isActiveMonsterEffectCreate = true;
#endif //
#ifdef 진우
m_isActiveEffectCreate = true;
m_isActiveMonsterEffectCreate = true;
#endif //
#ifdef 기무리
m_isActiveEffectCreate = false;
m_isActiveMonsterEffectCreate = false;
#endif //
#ifdef 인혁
m_isActiveEffectCreate = true;
m_isActiveMonsterEffectCreate = true;
#endif //
#endif // !_DEBUG
if (m_isActiveEffectCreate)
{
+19 -61
View File
@@ -44,17 +44,22 @@ HRESULT CLoding_Panel::Initialize(void* pArg)
Visible(true);
m_bActive = true;
//m_vImageposSi = _float4(0.f, 0.f, 1792.f, 1024.f);
#ifdef _DEBUG
INHYUK = true;
human = 0;
#endif // DEBUG
m_iToolTip_Count = 0;
ToolTipSetting();
return S_OK;
}
void CLoding_Panel::Set_Image(_int Index)
{
m_iImageNum = Index;
}
void CLoding_Panel::ToolTipSetting()
{
ToolTip[0] = TEXT("알고 계셨나요?\nF9를 눌러 브레이크포인트를 설정할 수 있습니다.");
ToolTip[1] = TEXT("알고 계셨나요?\nF12를 눌러 정의로 바로 이동할 수 있습니다!.");
ToolTip[2] = TEXT("알고 계셨나요?\n디버깅 중에도 핫 리로드로 코드를 수정할 수 있습니다.");
ToolTip[3] = TEXT("알고 계셨나요?\nCtrl + R, R로 변수 또는 함수 이름을 프로젝트 전체에서 일괄 변경할 수 있습니다.");
ToolTip[4] = TEXT("알고 계셨나요?\n디버깅 중 변수에 마우스를 올리면 현재 값을 확인할 수 있습니다.");
}
void CLoding_Panel::Priority_Update(_float fTimeDelta)
{
}
@@ -63,54 +68,17 @@ void CLoding_Panel::Update(_float fTimeDelta)
{
if (m_pGameInstance->Key_Down(DIK_M))
{
human++;
if (human > 4) // 4보다 크면 0으로
human = 0;
m_iToolTip_Count++;
if (m_iToolTip_Count > 4) // 4보다 크면 0으로
m_iToolTip_Count = 0;
}
if (m_pGameInstance->Key_Down(DIK_N))
{
human--;
if (human < 0) // 0보다 작으면 4로
human = 4;
}
switch (human)
{
case 0:
INHYUK = true;
JINHO = false;
HYUNBIN = false;
NURI = false;
JINWOO = false;
break;
case 1:
INHYUK = false;
JINHO = true;
HYUNBIN = false;
NURI = false;
JINWOO = false;
break;
case 2:
INHYUK = false;
JINHO = false;
HYUNBIN = true;
NURI = false;
JINWOO = false;
break;
case 3:
INHYUK = false;
JINHO = false;
HYUNBIN = false;
NURI = true;
JINWOO = false;
break;
case 4:
INHYUK = false;
JINHO = false;
HYUNBIN = false;
NURI = false;
JINWOO = true;
break;
m_iToolTip_Count--;
if (m_iToolTip_Count < 0) // 0보다 작으면 4로
m_iToolTip_Count = 4;
}
__super::Update(fTimeDelta);
}
@@ -133,20 +101,10 @@ HRESULT CLoding_Panel::Render()
if (FAILED(m_pVIBufferCom->Render())) {
return E_FAIL;
}
#ifdef _DEBUG
m_pGameInstance->Render_Text(TEXT("Font_size20"), TEXT("<- N M ->."), _float2(100.f, 750.f));
if (INHYUK == true)
m_pGameInstance->Render_Text(TEXT("Font_size20"), TEXT("알고 계셨나요?\nF9를 눌러 브레이크포인트를 설정할 수 있습니다."), _float2(100.f, 800.f));
if (JINHO == true)
m_pGameInstance->Render_Text(TEXT("Font_size20"), TEXT("알고 계셨나요?\nF12를 눌러 정의로 바로 이동할 수 있습니다!."), _float2(100.f, 800.f));
if (HYUNBIN == true)
m_pGameInstance->Render_Text(TEXT("Font_size20"), TEXT("알고 계셨나요?\n디버깅 중에도 핫 리로드로 코드를 수정할 수 있습니다."), _float2(100.f, 800.f));
if (NURI == true)
m_pGameInstance->Render_Text(TEXT("Font_size20"), TEXT("알고 계셨나요?\nCtrl + R, R로 변수 또는 함수 이름을 프로젝트 전체에서 일괄 변경할 수 있습니다."), _float2(100.f, 800.f));
if (JINWOO == true)
m_pGameInstance->Render_Text(TEXT("Font_size20"), TEXT("알고 계셨나요?\n디버깅 중 변수에 마우스를 올리면 현재 값을 확인할 수 있습니다."), _float2(100.f, 800.f));
#endif // DEBUG
m_pGameInstance->Render_Text(TEXT("Font_size20"), ToolTip[m_iToolTip_Count].c_str(), _float2(100.f, 800.f));
return S_OK;
}
+35 -31
View File
@@ -15,55 +15,59 @@ class CLoding_Panel final : public CUIObject
{
private:
CLoding_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CLoding_Panel(const CLoding_Panel& rhs);
virtual ~CLoding_Panel() = default;
CLoding_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CLoding_Panel(const CLoding_Panel& rhs);
virtual ~CLoding_Panel() = default;
public:
virtual void Priority_Update(_float fTimeDelta);
virtual void Update(_float fTimeDelta);
virtual void Late_Update(_float fTimeDelta);
virtual HRESULT Render() override;
virtual _vector Get_WorldPostion() override;
virtual void Priority_Update(_float fTimeDelta);
virtual void Update(_float fTimeDelta);
virtual void Late_Update(_float fTimeDelta);
virtual HRESULT Render() override;
virtual _vector Get_WorldPostion() override;
private:
virtual HRESULT Bind_ShaderResources() override;
virtual HRESULT Ready_Components(void* pArg) override;
virtual HRESULT Initialize_Prototype() override;
virtual HRESULT Initialize(void* pArg) override;
virtual HRESULT Bind_ShaderResources() override;
virtual HRESULT Ready_Components(void* pArg) override;
virtual HRESULT Initialize_Prototype() override;
virtual HRESULT Initialize(void* pArg) override;
public:
void Set_Image(_int Index);
void Set_Image(_int Index);
void ToolTipSetting();
private:
CTexture* m_pDiffuse_TextureCom = { nullptr };
CTexture* m_pDiffuse_TextureCom1 = { nullptr };
CShader* m_pShaderCom = { nullptr };
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
CTexture* m_pDiffuse_TextureCom = { nullptr };
CTexture* m_pDiffuse_TextureCom1 = { nullptr };
CShader* m_pShaderCom = { nullptr };
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
CGameObject* m_pCurrent_Spell_Slot = { nullptr };
CGameObject* m_pLoadingWidget = { nullptr };
CGameObject* m_pCurrent_Spell_Slot = { nullptr };
CGameObject* m_pLoadingWidget = { nullptr };
_int m_iImageNum{};
_float4 m_vImageposSi{};
_int m_iImageNum{};
_float4 m_vImageposSi{};
_wstring ToolTip[5];
_int m_iToolTip_Count{};
#ifdef _DEBUG
_bool INHYUK = { false };
_bool JINHO = { false };
_bool HYUNBIN = { false };
_bool NURI = { false };
_bool JINWOO = { false };
_int human{};
_bool INHYUK = { false };
_bool JINHO = { false };
_bool HYUNBIN = { false };
_bool NURI = { false };
_bool JINWOO = { false };
_int human{};
#endif
public:
static CLoding_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
virtual void Free() override;
static CLoding_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
virtual void Free() override;
#ifdef _DEBUG
void Describe_Entity() override;
void Describe_Entity() override;
#endif // _DEBUG
@@ -940,9 +940,9 @@ PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In)
float4 vDepthDesc = g_DepthTexture.Sample(PointSampler, uv);
float fCenterViewSpaceZ = vDepthDesc.y * g_fFar; // n ~ f
float fRatio = lerp(0.f, 1.f, (g_fFar - fCenterViewSpaceZ) / g_fFar);
if (fRatio <= 0.f)
{
float fRatio = saturate(smoothstep(0.f, 1.f, (g_fFar - fCenterViewSpaceZ) / g_fFar)); // 멀어지면 너무 반짝거려서 스무딩
if (fRatio <= 0.f) {
Out.fOcclusion = 1.f;
return Out;
}
@@ -1007,7 +1007,7 @@ PS_OUT_SSAO_BLUR PS_SSAO_BLUR(PS_IN In)
for (int y = -2; y < 2; ++y)
{
float2 vOffset = float2((float) x, (float) y) * vTexelSize;
fResult += g_SSAOInputTexture.Sample(DefaultSampler, In.vTexcoord + vOffset).r;
fResult += g_SSAOInputTexture.Sample(BorderZeroSampler, In.vTexcoord + vOffset).r;
}
}
@@ -940,9 +940,9 @@ PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In)
float4 vDepthDesc = g_DepthTexture.Sample(PointSampler, uv);
float fCenterViewSpaceZ = vDepthDesc.y * g_fFar; // n ~ f
float fRatio = lerp(0.f, 1.f, (g_fFar - fCenterViewSpaceZ) / g_fFar);
if (fRatio <= 0.f)
{
float fRatio = saturate(smoothstep(0.f, 1.f, (g_fFar - fCenterViewSpaceZ) / g_fFar)); // 멀어지면 너무 반짝거려서 스무딩
if (fRatio <= 0.f) {
Out.fOcclusion = 1.f;
return Out;
}
@@ -1007,7 +1007,7 @@ PS_OUT_SSAO_BLUR PS_SSAO_BLUR(PS_IN In)
for (int y = -2; y < 2; ++y)
{
float2 vOffset = float2((float) x, (float) y) * vTexelSize;
fResult += g_SSAOInputTexture.Sample(DefaultSampler, In.vTexcoord + vOffset).r;
fResult += g_SSAOInputTexture.Sample(BorderZeroSampler, In.vTexcoord + vOffset).r;
}
}
+8 -5
View File
@@ -35,6 +35,7 @@ HRESULT CFog::Bind_FogValue(CShader* pShader)
}
#else
pShader->Bind_RawValue("g_fFogDensity", &m_fFogDensity, sizeof(_float));
pShader->Bind_RawValue("g_fFogPow", &m_fFogPow, sizeof(_float));
pShader->Bind_RawValue("g_vFogColor", &m_vFogColor, sizeof(_float4));
#endif // _DEBUG
@@ -44,11 +45,13 @@ HRESULT CFog::Bind_FogValue(CShader* pShader)
#ifdef _DEBUG
void CFog::Update_Fog()
{
GUI::Begin("Fog Edit");
GUI::Checkbox("Fog ON / OFF", &m_bVisible);
GUI::InputFloat("g_fFogDensity", &m_fFogDensity, 0.001f);
GUI::InputFloat("g_fFogPow", &m_fFogPow, 0.1f);
GUI::ColorEdit4("Fog Color", (_float*)(&m_vFogColor), ImGuiColorEditFlags_NoInputs);
GUI::Begin("Renderer");
if (GUI::CollapsingHeader("FOG")) {
GUI::Checkbox("Fog ON / OFF", &m_bVisible);
GUI::InputFloat("g_fFogDensity", &m_fFogDensity, 0.001f);
GUI::InputFloat("g_fFogPow", &m_fFogPow, 0.1f);
GUI::ColorEdit4("Fog Color", (_float*)(&m_vFogColor), ImGuiColorEditFlags_NoInputs);
}
GUI::End();
}
#endif // _DEBUG
+6 -3
View File
@@ -53,17 +53,20 @@ class CRenderer final : public CBase
_int m_iToneMappingType = { 2 };
_float m_fExposure = { 0.7f };
// Bloom
_int m_iBloomEmbossingPass = { 0 };
_float m_fBloomThreshold = { 1.26f };
// DOF Environment
_float m_fDOF_ENV_CutThreshold = { 0.1350f };
_float m_fDOF_ENV_FocusDistance = { 31.1f };
_float m_fDOF_ENV_StartDistance = { 53.1f };
_float m_fDOF_ENV_MaxEnd = { 360.f };
_float m_fDOF_ENV_AmountRadius = { 1.f };
_float m_fSSAO_Radius = { 0.812f };
_float m_fSSAO_BIAS = { 0.042f };
// SSAO
_float m_fSSAO_Radius = { 1.6300f };
_float m_fSSAO_BIAS = { 0.234f };
SSAO_GEOMETRY_HEMISPHERE m_tagSSAOGeometry = {};
SSAO_GEOMETRYDIRECTIONS_RANDOM_REAL m_tagSSAOGeometryDirections = {};