[add] BLOOM_Optional

This commit is contained in:
kimnuri
2025-11-26 10:32:36 +09:00
parent 3d92c92eb5
commit eb80b85690
6 changed files with 12 additions and 7 deletions
@@ -171,10 +171,11 @@ PBR_LIGHT_OUT PBR_Lighting(
float GetBloomCurve(float x) float GetBloomCurve(float x)
{ {
float fResult = x; float fResult = x;
float fThreshold = 0.68f * 2.f;
x *= 2.f; x *= 2.f;
fResult = x * 0.05f // 최소 기본값 보장 fResult = x * 0.05f // 최소 기본값 보장
+ max(0, x - 1.26f) // 밝기값 68 이하는 기본값으로하고 초과하면 그 값만큼 더해줌 + max(0, x - fThreshold) // 밝기값 68 이하는 기본값으로하고 초과하면 그 값만큼 더해줌
* 0.5f; // 0~2로 정규화 되어있기 때문에 강조 값 보정해줌 * 0.5f; // 0~2로 정규화 되어있기 때문에 강조 값 보정해줌
return fResult * 0.5f; return fResult * 0.5f;
@@ -471,7 +471,7 @@ PS_OUT_BACKBUFFER PS_MAIN_EMBOSS(PS_IN In)
float3 vColor = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord).xyz; float3 vColor = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord).xyz;
// temp 이거 키면 겁나 빤짞빤짞 빛남 ㄷㄷ // temp 이거 키면 겁나 빤짞빤짞 빛남 ㄷㄷ
// vColor *= 3.f; //vColor *= 3.f;
// temp // temp
//float fIntensity = dot(vColor, float3(0.3333f, 0.3333f, 0.3333f)); // 대략적인 밝기 //float fIntensity = dot(vColor, float3(0.3333f, 0.3333f, 0.3333f)); // 대략적인 밝기
@@ -171,10 +171,11 @@ PBR_LIGHT_OUT PBR_Lighting(
float GetBloomCurve(float x) float GetBloomCurve(float x)
{ {
float fResult = x; float fResult = x;
float fThreshold = 0.68f * 2.f;
x *= 2.f; x *= 2.f;
fResult = x * 0.05f // 최소 기본값 보장 fResult = x * 0.05f // 최소 기본값 보장
+ max(0, x - 1.26f) // 밝기값 68 이하는 기본값으로하고 초과하면 그 값만큼 더해줌 + max(0, x - fThreshold) // 밝기값 68 이하는 기본값으로하고 초과하면 그 값만큼 더해줌
* 0.5f; // 0~2로 정규화 되어있기 때문에 강조 값 보정해줌 * 0.5f; // 0~2로 정규화 되어있기 때문에 강조 값 보정해줌
return fResult * 0.5f; return fResult * 0.5f;
@@ -471,7 +471,7 @@ PS_OUT_BACKBUFFER PS_MAIN_EMBOSS(PS_IN In)
float3 vColor = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord).xyz; float3 vColor = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord).xyz;
// temp 이거 키면 겁나 빤짞빤짞 빛남 ㄷㄷ // temp 이거 키면 겁나 빤짞빤짞 빛남 ㄷㄷ
// vColor *= 3.f; //vColor *= 3.f;
// temp // temp
//float fIntensity = dot(vColor, float3(0.3333f, 0.3333f, 0.3333f)); // 대략적인 밝기 //float fIntensity = dot(vColor, float3(0.3333f, 0.3333f, 0.3333f)); // 대략적인 밝기
+4 -3
View File
@@ -411,8 +411,10 @@ void CRenderer::Render_Blend()
void CRenderer::Render_Bloom() void CRenderer::Render_Bloom()
{ {
#ifdef 기무리 if (m_pGameInstance->Key_Up(DIK_HOME)) {
{ m_bPostProcessing_BLOOM = !m_bPostProcessing_BLOOM;
}
if(true == m_bPostProcessing_BLOOM) {
{ // BackBuffer { // BackBuffer
ID3D11Texture2D* pBackBuffer = nullptr; ID3D11Texture2D* pBackBuffer = nullptr;
m_pGameInstance->Get_BackBufferPTR(&pBackBuffer); m_pGameInstance->Get_BackBufferPTR(&pBackBuffer);
@@ -450,7 +452,6 @@ void CRenderer::Render_Bloom()
m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4_2"), TEXT("Target_Bloom"), SHADER_PASS_DEFERRED::REFIT); m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4_2"), TEXT("Target_Bloom"), SHADER_PASS_DEFERRED::REFIT);
m_pGameInstance->Finish_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_Input"), TEXT("Target_Bloom"), SHADER_PASS_DEFERRED::BLOOM_FINISH); // 9 m_pGameInstance->Finish_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_Input"), TEXT("Target_Bloom"), SHADER_PASS_DEFERRED::BLOOM_FINISH); // 9
} }
#endif // 기무리
} }
void CRenderer::Render_UI() void CRenderer::Render_UI()
+2
View File
@@ -44,6 +44,8 @@ class CRenderer final : public CBase
SHADOW_LIGHT_DESC m_PreShadowDesc = {}; SHADOW_LIGHT_DESC m_PreShadowDesc = {};
_float4x4 m_PreShadowMatrices[ENUM_CLASS(D3DTS::END)] = {}; _float4x4 m_PreShadowMatrices[ENUM_CLASS(D3DTS::END)] = {};
_bool m_bPostProcessing_BLOOM = { false };
private: private:
void Render_Priority(); void Render_Priority();