This commit is contained in:
GiJungSUk
2025-11-15 22:04:24 +09:00
parent b4eb62c025
commit 137e1ebb54
29 changed files with 578 additions and 50 deletions
@@ -157,6 +157,52 @@ BlendState BS_UIBlend
RenderTargetWriteMask[0] = 0x0F; // RGBA 모두 출력
};
BlendState BS_WB_Acc
{
BlendEnable[0] = true;
BlendEnable[1] = true;
BlendEnable[2] = true;
BlendEnable[3] = true;
BlendEnable[4] = true;
BlendEnable[5] = true;
BlendEnable[6] = true;
BlendEnable[7] = true;
SrcBlend[0] = one;
DestBlend[0] = one;
BlendOp[0] = Add;
SrcBlend[1] = Zero;
DestBlend[1] = Inv_Src_Alpha;
BlendOp[1] = Add;
SrcBlend[2] = one;
DestBlend[2] = one;
BlendOp[2] = Add;
};
BlendState BS_WeightBlend
{
BlendEnable[0] = true;
BlendEnable[1] = true;
BlendEnable[2] = true;
BlendEnable[3] = true;
BlendEnable[4] = true;
BlendEnable[5] = true;
BlendEnable[6] = true;
BlendEnable[7] = true;
SrcBlend[0] = Inv_Src_Alpha;
DestBlend[0] = Src_Alpha;
BlendOp[0] = Add;
};
float ShadowVisibility_hwPCF(Texture2D ShadowMap, float4 vLightClip, float2 vShadowMapSize, float bias)
{
float2 uv = float2(vLightClip.x / vLightClip.w, -vLightClip.y / vLightClip.w) * 0.5f + 0.5f;
@@ -99,7 +99,7 @@ void CS_MAIN(
}
particle.vLifeTime.x = 0.f;
particle.vTranslation.y = 0.f;
}
Billboard(particle);
@@ -114,7 +114,6 @@ float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption)
}
struct VS_IN
{
float3 vPosition : POSITION;
@@ -188,9 +187,45 @@ struct PS_IN
struct PS_OUT
{
float4 vDiffuse : SV_TARGET0;
float4 vColorTarget : SV_TARGET1;
float4 vRevealage : SV_TARGET1;
float4 vColorTarget : SV_TARGET2;
};
PS_OUT BlendedWeight(vector fDiffuse, float fLinearZ)
{
PS_OUT Out;
float3 vColor = fDiffuse.rgb;
float fAlpha = fDiffuse.a;
float fWeight =
max(
min(1.0, max(max(vColor.r, vColor.g), vColor.b) * fAlpha),
fAlpha
) *
clamp(
0.03 / (1e-4 + pow(fLinearZ / 200, 4.0)),
1e-2, 3e3
);
//float fWeight = clamp(0.03f / (1e-5 + pow(fLinearZ, 4.0f)), 0.01, 3e3);
//fWeight = max(fWeight, 1.0);
//이게 오리지널 웨이트 함수
//float fWeight = pow(fLinearZ, -2.5);
//float fWeight = clamp(pow(fLinearZ, -2.5f), 1.0f, 1000.0f);
Out.vDiffuse = vector(vColor.rgb * fAlpha, fAlpha) * fWeight;
Out.vRevealage.r = fAlpha;
Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f);
return Out;
}
PS_OUT PS_MAIN(PS_IN In)
{
@@ -228,7 +263,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
vector vMtrlNoise;
vector vMtrlDissolve;
float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x;
float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x;
float2 vDiffuseTime = g_ParticleValue[In.iGPUIndex].vDiffuseUVMoveTime;
float2 vMaskingTime = g_ParticleValue[In.iGPUIndex].vMaskingUVMoveTime;
float2 vNoiseUVMoveTime = g_ParticleValue[In.iGPUIndex].vNoiseUVMoveTime;
@@ -322,7 +357,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
discard;
}
Out.vDiffuse = vMtrlDiffuse;
// 색깔 추가할 처리 (이미시브)
@@ -332,12 +367,15 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
{
vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord);
}
if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha)
Out.vColorTarget = vector(g_vEmissive.rgb + vEmissiveMtrl.rgb, g_fColorOption / 10.f);
else
Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f);
Out = BlendedWeight(vMtrlDiffuse , In.vProjPos.w);
//if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha)
// Out.vColorTarget = vector(g_vEmissive.rgb + vEmissiveMtrl.rgb, g_fColorOption / 10.f);
//else
// Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f);
return Out;
}
@@ -528,7 +566,7 @@ technique11 DefaultTechnique
{
SetRasterizerState(RS_Nocull);
SetDepthStencilState(DSS_Default, 0);
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
SetBlendState(BS_WB_Acc, 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_NON_NORMALMAP();
@@ -544,6 +582,8 @@ technique11 DefaultTechnique
PixelShader = compile ps_5_0 PS_BLUR();
}
}
@@ -98,6 +98,7 @@ technique11 PosTexTechnique11
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_MAIN();
}
pass ScissorPass
{
SetRasterizerState(RS_Scissor);
@@ -107,6 +108,7 @@ technique11 PosTexTechnique11
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_MAIN();
}
pass UIPass
{
SetRasterizerState(RS_Nocull);
@@ -116,6 +118,7 @@ technique11 PosTexTechnique11
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_MAIN();
}
pass UVMovePass
{
SetRasterizerState(RS_Nocull);
@@ -125,6 +128,7 @@ technique11 PosTexTechnique11
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_UVMove();
}
pass TrailPass
{
SetRasterizerState(RS_Nocull);
@@ -134,4 +138,5 @@ technique11 PosTexTechnique11
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_Trail();
}
}