[fix] BLOOM Resrore Alpha

This commit is contained in:
kimnuri
2025-12-17 21:01:22 +09:00
parent c7bdb8d917
commit c471c27c4d
2 changed files with 12 additions and 11 deletions
@@ -830,10 +830,10 @@ PS_OUT_FLT4_SINGLE PS_MAIN_BLOOM_ACCUM(PS_IN In)
{
PS_OUT_FLT4_SINGLE Out;
float3 vColorSrcA = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord).xyz;
float3 vColorSrcB = g_BlurTexture.Sample(BorderZeroSampler, In.vTexcoord).xyz;
float4 vColorSrcA = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord);
float4 vColorSrcB = g_BlurTexture.Sample(BorderZeroSampler, In.vTexcoord);
Out.vFirstTarget = float4(saturate(vColorSrcA + vColorSrcB), 1.f);
Out.vFirstTarget = saturate(vColorSrcA + vColorSrcB);
return Out;
}
@@ -842,9 +842,9 @@ PS_OUT_FLT4_SINGLE PS_MAIN_BLOOM_FINISH(PS_IN In)
PS_OUT_FLT4_SINGLE Out;
vector vColor = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord);
float3 vBloom = g_BlurTexture.Sample(BorderZeroSampler, In.vTexcoord).xyz;
float4 vBloom = g_BlurTexture.Sample(BorderZeroSampler, In.vTexcoord);
Out.vFirstTarget = vColor;
Out.vFirstTarget += float4(vBloom, 1.f);
Out.vFirstTarget += vBloom;
return Out;
}
@@ -794,6 +794,7 @@ PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In)
{
PS_OUT_FLT4_SINGLE Out;
float2 uv = In.vTexcoord;
float fSrcAlpha = g_DiffuseTexture.Sample(PointSampler, uv).a;
float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y);
float3 vColor = (0.f, 0.f, 0.f);
@@ -805,7 +806,7 @@ PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In)
float fBloomIntensity = GetBloomCurve(fIntensity, g_fBloomThreshold, g_iBloomEmbossingPass);
float3 bloomColor = (vColor * fBloomIntensity) / fIntensity;
Out.vFirstTarget = float4(bloomColor, 1.f);
Out.vFirstTarget = float4(bloomColor, fSrcAlpha);
return Out;
}
@@ -829,10 +830,10 @@ PS_OUT_FLT4_SINGLE PS_MAIN_BLOOM_ACCUM(PS_IN In)
{
PS_OUT_FLT4_SINGLE Out;
float3 vColorSrcA = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord).xyz;
float3 vColorSrcB = g_BlurTexture.Sample(BorderZeroSampler, In.vTexcoord).xyz;
float4 vColorSrcA = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord);
float4 vColorSrcB = g_BlurTexture.Sample(BorderZeroSampler, In.vTexcoord);
Out.vFirstTarget = float4(saturate(vColorSrcA + vColorSrcB), 1.f);
Out.vFirstTarget = saturate(vColorSrcA + vColorSrcB);
return Out;
}
@@ -841,9 +842,9 @@ PS_OUT_FLT4_SINGLE PS_MAIN_BLOOM_FINISH(PS_IN In)
PS_OUT_FLT4_SINGLE Out;
vector vColor = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord);
float3 vBloom = g_BlurTexture.Sample(BorderZeroSampler, In.vTexcoord).xyz;
float4 vBloom = g_BlurTexture.Sample(BorderZeroSampler, In.vTexcoord);
Out.vFirstTarget = vColor;
Out.vFirstTarget += float4(vBloom, 1.f);
Out.vFirstTarget += vBloom;
return Out;
}