251115
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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);
|
||||
|
||||
@@ -29,10 +29,15 @@ Texture2D g_NormalTexture : register(t1);
|
||||
Texture2D g_MaskingTexture : register(t2);
|
||||
Texture2D g_DissolveTexture : register(t3);
|
||||
Texture2D g_NoiseTexture : register(t4);
|
||||
Texture2D g_EmissiveTexture : register(t6);
|
||||
|
||||
StructuredBuffer<ParticleValue> g_ParticleValue : register(t5);
|
||||
|
||||
|
||||
Texture2D g_EmissiveTexture : register(t6);
|
||||
Texture2D g_DepthStencilTexture : register(t7);
|
||||
|
||||
|
||||
|
||||
float4 g_vCamPosition;
|
||||
|
||||
vector g_vColor;
|
||||
@@ -70,7 +75,6 @@ bool g_isEmissive;
|
||||
|
||||
bool g_isDiffuseUVMove;
|
||||
bool g_isMaskUVMove;
|
||||
bool g_isBlendedWeight;
|
||||
|
||||
float g_fFar;
|
||||
|
||||
@@ -115,7 +119,6 @@ float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption)
|
||||
|
||||
}
|
||||
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
float3 vPosition : POSITION;
|
||||
@@ -189,9 +192,49 @@ 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_IN In , float fProjZ)
|
||||
{
|
||||
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.01 / (1e-4 + pow(fLinearZ / 200, 4.0)),
|
||||
// 0.01f, 1000
|
||||
//);
|
||||
|
||||
|
||||
|
||||
float fWeight = clamp(0.03f / (1e-5 + pow(fLinearZ, 2.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.a = fAlpha;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_MAIN(PS_IN In)
|
||||
{
|
||||
|
||||
@@ -229,7 +272,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;
|
||||
@@ -315,6 +358,9 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r);
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
if (g_isDissolve == true)
|
||||
{
|
||||
vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
@@ -323,7 +369,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
discard;
|
||||
}
|
||||
|
||||
Out.vDiffuse = vMtrlDiffuse;
|
||||
|
||||
|
||||
// 색깔 추가할 처리 (이미시브)
|
||||
|
||||
@@ -333,12 +379,24 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
{
|
||||
vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
}
|
||||
|
||||
int2 texel = int2(In.vPosition.xy);
|
||||
|
||||
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);
|
||||
float fDepthStencilValue = g_DepthStencilTexture.Load(int3(texel, 0));
|
||||
|
||||
|
||||
float bias = 0.0005f;
|
||||
|
||||
if (fDepthStencilValue + bias < In.vProjPos.z / In.vProjPos.w)
|
||||
discard;
|
||||
|
||||
Out = BlendedWeight(vMtrlDiffuse, In.vProjPos.w, In, In.vProjPos.z / 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,8 +586,8 @@ technique11 DefaultTechnique
|
||||
pass NON_NOMALMAP
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
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();
|
||||
@@ -545,6 +603,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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
|
||||
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
|
||||
|
||||
Texture2D g_MixedDiffuseTexture;
|
||||
Texture2D g_RevealageTexture;
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
float3 vPosition : POSITION;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VS_OUT
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
VS_OUT VS_MAIN(VS_IN In)
|
||||
{
|
||||
VS_OUT Out;
|
||||
|
||||
matrix matWV, matWVP;
|
||||
|
||||
matWV = mul(g_WorldMatrix, g_ViewMatrix);
|
||||
matWVP = mul(matWV, g_ProjMatrix);
|
||||
|
||||
Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP);
|
||||
Out.vTexcoord = In.vTexcoord;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_IN
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct PS_OUT
|
||||
{
|
||||
float4 vBackBuffer : SV_TARGET0;
|
||||
};
|
||||
|
||||
PS_OUT PS_MAIN(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
|
||||
vector vMixedDiffuse = g_MixedDiffuseTexture.Sample(PointSampler, In.vTexcoord);
|
||||
vector vRevealage = g_RevealageTexture.Sample(PointSampler, In.vTexcoord);
|
||||
|
||||
if(vRevealage.b >= 1.f)
|
||||
discard;
|
||||
|
||||
Out.vBackBuffer = vector(vMixedDiffuse.rgb / max(vMixedDiffuse.a, 1e-5), 1 - vRevealage.r);
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
technique11 DefaultTechnique
|
||||
{
|
||||
pass WeightBlend
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_AlphaBlend, 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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -40,6 +40,9 @@ HRESULT CEffectObject::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Bind_DepthStencil(m_pShaderCom, "g_DepthStencilTexture")))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pInstance_ModelCom->Bind_CS_Output(5, 1)))
|
||||
return E_FAIL;
|
||||
|
||||
@@ -48,8 +51,6 @@ HRESULT CEffectObject::Render()
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
@@ -97,6 +98,18 @@ HRESULT CEffectObject::Render_Blur()
|
||||
|
||||
HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel)
|
||||
{
|
||||
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pDissolve_TextureCom);
|
||||
SAFE_RELEASE(m_pEmissive_TextureCom);
|
||||
|
||||
SAFE_RELEASE(m_pInstance_ModelCom);
|
||||
|
||||
if (m_pLightCom != nullptr)
|
||||
SAFE_RELEASE(m_pLightCom);
|
||||
|
||||
_string strPerfectFilePath = pFilePath;
|
||||
|
||||
strPerfectFilePath += ".bin";
|
||||
|
||||
@@ -303,6 +303,7 @@ HRESULT CEffect_Editor::Load_Edit(const _char* pPath)
|
||||
|
||||
if (m_pEditEffect == nullptr)
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(m_pEditEffect->Load(pPath, LEVEL::EFFECT)))
|
||||
{
|
||||
@@ -404,6 +405,7 @@ void CEffect_Editor::Describe_Entity()
|
||||
return;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
ImGui::EndPopup();
|
||||
|
||||
@@ -97,7 +97,6 @@ class CEffectObject abstract : public CPartObject
|
||||
_string m_strModelName = {};
|
||||
_string m_strEmissiveName = {};
|
||||
|
||||
_bool m_isBlendedWeight = {};
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
|
||||
Reference in New Issue
Block a user