[Add] Client에 추가 밎 슬롯 넘버 추가

This commit is contained in:
qordlsgur
2025-11-21 23:49:14 +09:00
parent 697719e23c
commit 24f26e617a
384 changed files with 1908 additions and 299 deletions
@@ -6,22 +6,28 @@ Texture2D g_DepthTexture;
int g_iImageCountX;
int g_iImageCountY;
uint g_iIndexU;
uint g_iIndexV;
uint g_iQuestType;
uint g_iSpellType;
float g_fPI;
float g_fFar;
float g_fTime;
float g_fTimeMult;
float g_fFrame;
float g_fDeltaU;
float g_fDeltaV;
float g_fAlpha;
float g_fOwnerAlpha;
float g_fCanvasAlpha;
float g_fDeltaU;
float g_fDeltaV;
uint g_iIndexU;
uint g_iIndexV;
float4 g_fNine_Slice;
float g_fAngle;
float g_fCoolTime;
float2 g_fOrigin_Size;
float2 g_fCurrent_Size;
uint g_iQuestType;
float g_fPI;
float4 g_fNine_Slice;
Texture2D g_Texture;
Texture2D g_Texture1;
@@ -71,12 +77,13 @@ struct PS_OUT
PS_OUT PS_MAIN(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord);
if (Color.a <= 0.1f)
discard;
Color.a *= Alpha;
Out.vColor = Color;
return Out;
}
@@ -84,9 +91,11 @@ PS_OUT PS_MAIN(PS_IN In)
PS_OUT PS_AlphaBlend(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord);
Color.a *= Alpha;
Out.vColor = Color;
return Out;
@@ -95,45 +104,47 @@ PS_OUT PS_AlphaBlend(PS_IN In)
PS_OUT PS_Clamp(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord);
Color.a *= Alpha;
Out.vColor = Color;
return Out;
}
PS_OUT PS_Cursor(PS_IN In)
PS_OUT PS_Cursor(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 Color = float4(0.f, 0.f, 0.f, 0.f);
float4 White = float4(1.f, 1.f, 1.f, 1.f);
float4 Color = float4(0.f, 0.f, 0.f, 0.f);
float4 White = float4(1.f, 1.f, 1.f, 1.f);
float2 UV = In.vTexcoord;
float2 Center = float2(0.5f, 0.5f);
float2 UV = In.vTexcoord;
float2 Center = float2(0.5f, 0.5f);
float CW = -g_fTime;
float CCW = g_fTime;
float CW = -g_fTime;
float CCW = g_fTime;
float2 RedCircle = UV;
float2 RedUV = UV - Center;
float2 RedCircle = UV;
float2 RedUV = UV - Center;
RedCircle.x = RedUV.x * cos(CCW) - RedUV.y * sin(CCW);
RedCircle.y = RedUV.x * sin(CCW) + RedUV.y * cos(CCW);
RedCircle = RedCircle + Center;
RedCircle.x = RedUV.x * cos(CCW) - RedUV.y * sin(CCW);
RedCircle.y = RedUV.x * sin(CCW) + RedUV.y * cos(CCW);
RedCircle = RedCircle + Center;
float2 BlueCircle = UV;
float2 BlueCircle = UV;
float2 BlueUV = UV - Center;
BlueCircle.x = BlueUV.x * cos(CW) - BlueUV.y * sin(CW);
BlueCircle.y = BlueUV.x * sin(CW) + BlueUV.y * cos(CW);
BlueCircle = BlueCircle + Center;
BlueCircle.x = BlueUV.x * cos(CW) - BlueUV.y * sin(CW);
BlueCircle.y = BlueUV.x * sin(CW) + BlueUV.y * cos(CW);
BlueCircle = BlueCircle + Center;
float4 Texture1 = g_Texture.Sample(ClampSampler, RedCircle);
float4 Texture2 = g_Texture2.Sample(ClampSampler, BlueCircle);
float4 Texture1 = g_Texture.Sample(ClampSampler, RedCircle);
float4 Texture2 = g_Texture2.Sample(ClampSampler, BlueCircle);
if (Texture1.r >= 0.7f)
Color = Texture1;
@@ -144,7 +155,9 @@ PS_OUT PS_Cursor(PS_IN In)
if (all(Color.rgb <= 0.5f))
discard;
Color = White;
Color = White;
Color.a *= Alpha;
Out.vColor = Color;
@@ -154,6 +167,7 @@ PS_OUT PS_Cursor(PS_IN In)
PS_OUT PS_Key_Hold_Rotation(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float2 uv = In.vTexcoord;
@@ -170,30 +184,53 @@ PS_OUT PS_Key_Hold_Rotation(PS_IN In)
tex.rgb = (angle <= rotation) ? 1.0 : tex.rgb;
tex.a *= Alpha;
Out.vColor = tex;
return Out;
}
PS_OUT PS_Mission(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 Color = float4(0.f, 0.f, 0.f, 0.f);
float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord);
float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord);
tex1.a *= 0.5f;
if (tex1.a >= 0.f)
Color = tex1;
Color = lerp(Color, tex2, tex2.a);
Color.a *= Alpha;
Out.vColor = Color;
return Out;
}
PS_OUT PS_Sptire_Sheet(PS_IN In)
{
PS_OUT Out;
float4 Color = float4(0.f, 0.f, 0.f, 0.f);
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 Color = float4(0.f, 0.f, 0.f, 0.f);
float2 UV = In.vTexcoord;
int iTotalFrame = g_iImageCountX * g_iImageCountY;
int iCurrentFrame = int(floor(g_fTime / g_fFrame)) % iTotalFrame;
uint iCurrentFrame = uint(floor(g_fTime / g_fFrame)) % iTotalFrame;
int iFrameX = iCurrentFrame % g_iImageCountX;
int iFrameY = iCurrentFrame / g_iImageCountX;
int iFrameX = iCurrentFrame % g_iImageCountX;
int iFrameY = iCurrentFrame / g_iImageCountX;
float fFreamWidth = 1.0 / g_iImageCountX;
float fFreamHeight = 1.0 / g_iImageCountY;
float fFreamWidth = 1.0 / g_iImageCountX;
float fFreamHeight = 1.0 / g_iImageCountY;
UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth;
UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth;
UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight;
float4 Texture = g_Texture.Sample(DefaultSampler, UV);
@@ -203,7 +240,7 @@ PS_OUT PS_Sptire_Sheet(PS_IN In)
if (Color.r <= 0.4f)
discard;
Color.a = Alpha;
Color.a *= Alpha;
Out.vColor = Color;
@@ -213,6 +250,7 @@ PS_OUT PS_Sptire_Sheet(PS_IN In)
PS_OUT PS_QuestType(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float3 Color = float3(253.f, 207.f, 11.f) / 255.f;
float4 Texture1 = g_Texture.Sample(DefaultSampler, In.vTexcoord);
@@ -224,6 +262,7 @@ PS_OUT PS_QuestType(PS_IN In)
}
}
Texture1.a *= Alpha;
Out.vColor = Texture1;
return Out;
@@ -232,9 +271,11 @@ PS_OUT PS_QuestType(PS_IN In)
PS_OUT PS_UVMult(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 color = g_Texture.Sample(DefaultSampler, In.vTexcoord);
color.a *= Alpha;
Out.vColor = color;
return Out;
@@ -243,46 +284,191 @@ PS_OUT PS_UVMult(PS_IN In)
PS_OUT PS_NineSlice(PS_IN In)
{
PS_OUT Out;
float Left = g_fNine_Slice.x / g_fOrigin_Size.x;
float Right = (g_fOrigin_Size.x - g_fNine_Slice.y) / g_fOrigin_Size.x;
float Top = g_fNine_Slice.z / g_fOrigin_Size.y;
float Bottom = (g_fOrigin_Size.y - g_fNine_Slice.w) / g_fOrigin_Size.y;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
float2 uv = In.vTexcoord;
float2 CurrentPixelPosition = uv * g_fCurrent_Size;
float OriginLeft = g_fNine_Slice.x;
float OriginRight = g_fNine_Slice.y;
float OriginTop = g_fNine_Slice.z;
float OriginBottom = g_fNine_Slice.w;
float2 ratio = g_fCurrent_Size / g_fOrigin_Size;
float CurrentLeft = OriginLeft;
float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight);
float CurrentTop = OriginTop;
float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom);
float2 UV = In.vTexcoord * 0.5f + 0.5f;
float2 ScaledUV = UV;
if(UV.x < Left)
float2 Finaluv = In.vTexcoord;
if (CurrentPixelPosition.x < CurrentLeft)
{
ScaledUV.x = UV.x;
Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x;
}
else if(UV.x > Right)
else if (CurrentPixelPosition.x > CurrentRight)
{
ScaledUV.x = 1.0f - ((1.0f - UV.x) / ratio.x);
float dist = CurrentPixelPosition.x - CurrentRight;
Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x;
}
else
{
ScaledUV.x = Left + (UV.x - Left) / ratio.x;
float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft);
Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x);
}
if(UV.y < Top)
if (CurrentPixelPosition.y < CurrentTop)
{
ScaledUV.y = UV.y;
Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y;
}
else if(UV.y > Bottom)
else if (CurrentPixelPosition.y > CurrentBottom)
{
ScaledUV.y = 1.0f - ((1.0f - UV.y) / ratio.y);
float dist = CurrentPixelPosition.y - CurrentBottom;
Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y;
}
else
{
ScaledUV.y = Top + (UV.y - Top) / ratio.y;
float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop);
Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y);
}
float4 color = g_Texture.Sample(ClampSampler, ScaledUV);
float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv);
float4 tex2 = g_Texture1.Sample(ClampSampler, Finaluv);
tex1.a *= 0.5f;
if (tex1.a >= 0.f)
Color = tex1;
Color = lerp(Color, tex2, tex2.a);
Color.a *= Alpha;
Out.vColor = Color;
return Out;
}
PS_OUT PS_Rotation(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 color = float4(0.f, 0.f, 0.f, 0.f);
float2 center = float2(0.5f, 0.5f);
float2 uv = In.vTexcoord - center;
uv *= sqrt(2.0f);
float2 Rotation = In.vTexcoord;
Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle);
Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle);
Rotation += center;
float4 tex1 = g_Texture.Sample(ClampSampler, Rotation);
float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord);
tex1.rgb *= 0.4f;
color = tex1;
tex2.rgb *= 0.3f;
if (tex2.a >= 0.9f)
color = tex2;
color.a *= Alpha;
Out.vColor = color;
return Out;
}
PS_OUT PS_Slot(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float2 center = float2(0.5f, 0.5f);
float2 uv = In.vTexcoord - center;
uv *= sqrt(2.0f);
float2 Rotation = In.vTexcoord;
Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle);
Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle);
Rotation += center;
float4 color = g_Texture.Sample(ClampSampler, Rotation);
color.a *= Alpha;
Out.vColor = color;
return Out;
}
PS_OUT PS_SpellAnim(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 color = float4(1.f, 1.f, 1.f, 1.f);
float3 BGColor = float3(1.f, 1.f, 1.f);
switch (g_iSpellType)
{
case 0:
BGColor = float3(208.f, 179.f, 54.f) / 255.f;
break;
case 1:
BGColor = float3(89.f, 32.f, 215.f) / 255.f;
break;
case 2:
BGColor = float3(190.f, 46., 34.f) / 255.f;
break;
case 3:
BGColor = float3(37.f, 129.f, 162.f) / 255.f;
break;
case 4:
BGColor = float3(134.f, 171.f, 78.f) / 255.f;
break;
case 5:
BGColor = float3(0.f, 80.f, 55.f) / 255.f;
break;
case 6:
BGColor = float3(0.f, 0.f, 0.f);
break;
}
float2 uv = In.vTexcoord;
float CoolTime = 1.f - g_fDeltaV;
float CoolTime2 = 1.f - g_fDeltaV + 0.05;
float4 tex1 = g_Texture.Sample(ClampSampler, uv);
tex1.rgb *= BGColor;
float4 tex2 = g_Texture1.Sample(DefaultSampler, uv);
if (tex2.a >= 0.9f)
tex1 = tex2;
color = tex1;
float wave1 = sin(uv.x * 10.f + g_fTime * 2.f) * 0.01f;
float wave2 = sin(uv.x * 10.f + g_fTime * 2.f) * 0.01f;
float waveThreshold1 = CoolTime + wave1;
float waveThreshold2 = CoolTime2 + wave2;
if (g_fDeltaV <= 1.f)
{
if (uv.y >= waveThreshold1 && uv.y <= waveThreshold2)
{
color.rgb = float3(1.f, 1.f, 1.f);
}
}
if (uv.y <= CoolTime)
{
color.a = 0.f;
}
color.a *= Alpha;
Out.vColor = color;
return Out;
}
@@ -292,7 +478,7 @@ technique11 PosTexTechnique11
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 0);
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
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();
@@ -348,6 +534,16 @@ technique11 PosTexTechnique11
PixelShader = compile ps_5_0 PS_Key_Hold_Rotation();
}
pass Mission
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 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_Mission();
}
pass QuestType
{
SetRasterizerState(RS_Default);
@@ -378,4 +574,33 @@ technique11 PosTexTechnique11
PixelShader = compile ps_5_0 PS_NineSlice();
}
pass Rotation
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 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_Rotation();
}
pass Slot
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 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_Slot();
}
pass SpellAnim
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 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_SpellAnim();
}
}
@@ -18,6 +18,7 @@ Texture2D g_DiffuseTexture;
Texture2D g_NormalTexture;
Texture2D g_DAOTexture;
Texture2D g_THVTexture;
Texture2D g_SurfaceParamsTexture;
float3 g_RootColor;
float3 g_TipColor;
@@ -25,6 +26,7 @@ float3 g_DyeColor;
float g_DyeOpacity;
float g_HairRoughness;
float g_fUsingSurfaceParams;
matrix g_BoneMatrices[512];
@@ -156,10 +158,10 @@ VS_OUT_SHADOW VS_MAIN_SHADOW(VS_IN In)
float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z);
matrix BoneMatrix = g_BoneMatrices[In.vBlendIndex.x] * In.vBlendWeight.x +
g_BoneMatrices[In.vBlendIndex.y] * In.vBlendWeight.y +
g_BoneMatrices[In.vBlendIndex.z] * In.vBlendWeight.z +
g_BoneMatrices[In.vBlendIndex.w] * fWeightW;
matrix BoneMatrix = mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) +
mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) +
mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) +
mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW);
/* ?ㅽ궎??*/
vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix);
@@ -188,9 +190,11 @@ struct PS_IN
struct PS_OUT
{
float4 vDiffuse : SV_TARGET0;
float4 vAlbedo : SV_TARGET0;
float4 vNormal : SV_TARGET1;
float4 vDepth : SV_TARGET2;
float4 vColor : SV_Target3;
float4 vSurface : SV_Target4;
};
PS_OUT PS_MAIN(PS_IN In)
@@ -198,15 +202,13 @@ PS_OUT PS_MAIN(PS_IN In)
PS_OUT Out;
vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
if (vMtrlDiffuse.a < 0.4f)
{
discard;
}
vector vSurface = g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord);
if (vMtrlDiffuse.a < 0.2f) { discard; }
vector vNormalDesc = g_NormalTexture.Sample(MirrorSampler, In.vTexcoord);
float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, DefaultSampler, In.vTexcoord);
float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal);
float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix);
float3 vNormal = normalize(mul(vNormalDecoded, WorldMatrix));
if (true == g_bRimLight)
{
@@ -214,11 +216,14 @@ PS_OUT PS_MAIN(PS_IN In)
vMtrlDiffuse.xyz = (vMtrlDiffuse.xyz * (1 - fRimLight)) + g_vRimColor * fRimLight;
}
Out.vDiffuse = vMtrlDiffuse;
Out.vAlbedo = vMtrlDiffuse;
Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f);
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.f);
Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 깊이 ( 0~ 1)
(In.vProjPos.w / g_fFar), // 뷰 스페이스 Z
g_fUsingSurfaceParams, // 서페이스 파라미터
1.f);
Out.vColor = float4(0.f, 0.f, 0.f, 1.f);
Out.vSurface = vSurface;
return Out;
}
@@ -313,7 +318,7 @@ PS_OUT PS_HAIR(PS_IN In)
baseColor = lerp(baseColor, g_vRimColor.rgb, fRim);
}
Out.vDiffuse = float4(baseColor, alpha);
Out.vAlbedo = float4(baseColor, alpha);
Out.vNormal = float4(normal * 0.5f + 0.5f, 0.f);
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.f);
@@ -342,7 +347,7 @@ PS_OUT PS_EYELASH(PS_IN In)
}
Out.vDiffuse = float4(vMtrlDiffuse.rgb, vMtrlDiffuse.g);
Out.vAlbedo = float4(vMtrlDiffuse.rgb, vMtrlDiffuse.g);
Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f);
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.f);
@@ -5,6 +5,7 @@ matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
bool g_bUVTargetDiffuse;
bool g_bAdditiveDisolve;
float g_LifeRatio;
float g_fFar;
float g_fTime;
@@ -14,6 +15,7 @@ uint g_iIndexU;
uint g_iIndexV;
float g_fDisolveRatio;
float g_fUsingSurfaceParams;
float2 g_vClipBoxSize;
float2 g_vClipBoxLTPos;
@@ -24,6 +26,7 @@ Texture2D g_ClippingTexture;
Texture2D g_DisolveTexture;
Texture2D g_NormalTexture;
Texture2D g_GlowTexture;
Texture2D g_SurfaceParamsTexture;
struct VS_IN
{
@@ -155,32 +158,37 @@ struct PS_IN
struct PS_OUT
{
float4 vDiffuse : SV_TARGET0;
float4 vAlbedo : SV_TARGET0;
float4 vNormal : SV_TARGET1;
float4 vDepth : SV_TARGET2;
float4 vColor : SV_Target3;
float4 vSurface : SV_Target4;
};
PS_OUT PS_MAIN(PS_IN In)
{
PS_OUT Out;
vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
if (vMtrlDiffuse.a < 0.1f)
{
discard;
}
vector vSurface = g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord);
if (vMtrlDiffuse.a < 0.2f) { discard; }
vector vNormalDesc = g_NormalTexture.Sample(MirrorSampler, In.vTexcoord);
float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, DefaultSampler, In.vTexcoord);
float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal);
float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix);
float3 vNormal = normalize(mul(vNormalDecoded, WorldMatrix));
Out.vDiffuse = vMtrlDiffuse;
Out.vAlbedo = vMtrlDiffuse;
Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f);
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.f);
Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 깊이 ( 0~ 1)
(In.vProjPos.w / g_fFar), // 뷰 스페이스 Z
g_fUsingSurfaceParams, // 서페이스 파라미터
1.f);
Out.vColor = float4(0.f, 0.f, 0.f, 1.f);
Out.vSurface = vSurface;
return Out;
}
PS_OUT PS_MAIN_SELECT(PS_IN In)
{
PS_OUT Out;
@@ -196,7 +204,7 @@ PS_OUT PS_MAIN_SELECT(PS_IN In)
float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix);
Out.vDiffuse = vMtrlDiffuse * float4(0.f, 1.f, 1.f, 0.3f);
Out.vAlbedo = vMtrlDiffuse * float4(0.f, 1.f, 1.f, 0.3f);
Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f);
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.f);
return Out;
@@ -207,14 +215,14 @@ PS_OUT PS_GLASS(PS_IN In)
PS_OUT Out;
vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
vector vMtrlGlow = g_GlowTexture.Sample(DefaultSampler, In.vTexcoord);
vector vNormalDesc = g_NormalTexture.Sample(MirrorSampler, In.vTexcoord);
float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal);
float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix);
Out.vDiffuse = lerp(vMtrlDiffuse, vMtrlGlow, vMtrlDiffuse.a);
Out.vAlbedo = lerp(vMtrlDiffuse, float4(1.f, 1.f, 1.f, 1.f), 0.5f);
float4(vMtrlDiffuse.xyz, 1.f);
Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f);
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.f);
@@ -356,7 +364,7 @@ technique11 MeshTechnique11
{
pass MeshPass // 0
{
SetRasterizerState(RS_Nocull);
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 0);
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN();
@@ -1,7 +1,5 @@
#include "Engine_Shader_Defines.hlsli"
float PI = 3.141592;
struct ParticleValue
{
float fSpeed;
@@ -14,6 +12,7 @@ struct ParticleValue
float2 vMaskingUVMoveTime;
float2 vDiffuseUVMoveTime;
float2 vDistortionUVMoveTime;
float2 vNoiseUVMoveTime;
float2 vAniTime;
@@ -35,6 +34,7 @@ StructuredBuffer<ParticleValue> g_ParticleValue : register(t5);
Texture2D g_EmissiveTexture : register(t6);
Texture2D g_DepthStencilTexture : register(t7);
Texture2D g_DistortionTexture : register(t8);
@@ -44,27 +44,30 @@ vector g_vColor;
float2 g_vDiffuseUVGainAmount;
float2 g_vMaskingUVGainAmount;
float2 g_vNoiseUVGainAmount;
float2 g_vDiffuseNoiseUVGainAmount;
float2 g_vMaskNoiseUVGainAmount;
//
int g_iMaskMoveLerpOption;
int g_iDiffuseMoveLerpOption;
int g_iMaskNoiseMoveLerpOption;
int g_iDiffuseNoiseMoveLerpOption;
int g_iNoiseMoveLerpOption;
//
float2 g_vDiffuseDistortionUVGainAmount;
float2 g_vMaskDistortionUVGainAmount;
int g_iMaskDistortionMoveLerpOption;
int g_iDiffuseDistortionMoveLerpOption;
//
float2 g_vUVCutting;
float2 g_vUVMaskCutting;
float g_fDiffuseAlpha;
int g_iBlurWeight; // 블러 강도
float g_fBlurIntensity; //블러 세기
float g_fNoiseDistortionIntensity; // 노이즈 왜곡 세기
float g_fNoiseDistortionIntensity; // 디스토션 왜곡 세기
float4 g_vEmissive;
float g_fColorOption;
float g_fEmissiveCutAlpha;
bool g_isDiffuse;
@@ -72,9 +75,14 @@ bool g_isMasking;
bool g_isDissolve;
bool g_isNoise;
bool g_isEmissive;
bool g_isDistortion;
bool g_isDiffuseUVMove;
bool g_isMaskUVMove;
bool g_isNoiseUVMove;
bool g_isReverseDissolve;
bool g_isEmissiveDissolve;
float g_fFar;
@@ -151,11 +159,11 @@ VS_OUT VS_MAIN(VS_IN In, uint iGPUIndex : SV_InstanceID)
{
VS_OUT Out = (VS_OUT) 0;
row_major matrix matW, matWV, matWVP;
matrix matW, matWV, matWVP;
row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation);
matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation);
matW = mul(g_WorldMatrix, TransformMatrix);
matW = mul(TransformMatrix, g_WorldMatrix);
matWV = mul(matW, g_ViewMatrix);
matWVP = mul(matWV, g_ProjMatrix);
@@ -201,31 +209,32 @@ 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.01 / (1e-4 + pow(fLinearZ / 200, 4.0)), 0.01f, 1000 );
// 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);
//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);
float fWeight = clamp(pow(fLinearZ, -2.5f), 1.0f, 1000.0f);
Out.vDiffuse = vector(vColor.rgb * fAlpha, fAlpha) * fWeight;
Out.vRevealage.a = fAlpha;
Out.vRevealage.r = fAlpha;
return Out;
}
@@ -266,11 +275,13 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
vector vMtrlMask;
vector vMtrlNoise;
vector vMtrlDissolve;
vector vMtrlDistortion;
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;
float2 vDistortionUVMoveTime = g_ParticleValue[In.iGPUIndex].vDistortionUVMoveTime;
if (g_isDiffuse == true)
{
@@ -283,57 +294,74 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
UV += SelectLerpUV((g_vDiffuseUVGainAmount / g_vUVCutting), (vDiffuseTime.x / vDiffuseTime.y), g_iDiffuseMoveLerpOption);
}
/* 노이즈 */
if (g_isNoise == true)
/* 디퓨즈 디스토션 */
if (g_isDistortion == true)
{
float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vDiffuseNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iDiffuseNoiseMoveLerpOption);
float2 vDistortion = In.vTexcoord + SelectLerpUV(g_vDiffuseDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iDiffuseDistortionMoveLerpOption);
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV);
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortion);
//0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다.
vMtrlNoise.rg -= 0.5f;
vMtrlDistortion.rg -= 0.5f;
//아마 분할되었다면 noise도 분할해야할듯
vMtrlNoise.rg /= g_vUVCutting;
vMtrlDistortion.rg /= g_vUVCutting;
//노이즈 텍스쳐로 uv를 왜곡함
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
UV = UV + (vMtrlNoise).rg * g_fNoiseDistortionIntensity;
UV = UV + (vMtrlDistortion).rg * g_fNoiseDistortionIntensity;
}
/* 최종 색깔 */
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, UV);
if (g_vColor.a > 0)
vMtrlDiffuse += g_vColor;
if (vMtrlDiffuse.a < 0.3f)
discard;
}
else
{
vMtrlDiffuse = g_vColor;
}
/* 노이즈 */
if(g_isNoise)
{
float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iNoiseMoveLerpOption);
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV);
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r);
vMtrlDiffuse *= vMtrlNoise;
}
/* 마스크 */
if (g_isMasking == true)
{
float2 vMaskTexcoord = In.vTexcoord;
vMaskTexcoord = UV_Cutting(In.vTexcoord, g_vUVMaskCutting, int(fAnimIndex.x));
if (g_isNoise == true)
// 마스크 디스토션
if (g_isDistortion == true)
{
float2 UV; // 이미지의 UV값
float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vMaskNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iMaskNoiseMoveLerpOption);
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iMaskDistortionMoveLerpOption);
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV);
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV);
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity;
//노이즈 텍스쳐로 uv를 왜곡함
vMaskTexcoord = vMaskTexcoord + (vMtrlNoise - 0.5f).rg * g_fNoiseDistortionIntensity;
}
if (g_isMaskUVMove)
@@ -343,6 +371,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
}
vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord);
}
else
{
@@ -353,6 +382,8 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r);
if (vMtrlDiffuse.a <= 0.f)
discard;
@@ -360,15 +391,26 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
{
vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord);
if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y))
discard;
if(g_isReverseDissolve == true)
{
if (vMtrlDissolve.r >= (In.vLifeTime.x / In.vLifeTime.y))
discard;
}
else
{
if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y))
discard;
}
}
vMtrlDiffuse.a *= g_fDiffuseAlpha;
// 색깔 추가할 처리 (이미시브)
float4 vEmissiveMtrl;
float4 vEmissiveMtrl = vector(0.f ,0.f ,0.f ,0.f);
if (g_isEmissive == true)
{
@@ -380,20 +422,29 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
float fDepthStencilValue = g_DepthStencilTexture.Load(int3(iTexel, 0)).r;
float fbias = 0.00005f;
float fbias = 0.000005f;
if (fDepthStencilValue <= In.vProjPos.z / In.vProjPos.w + fbias)
discard;
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);
float fEmissiveCutAlpha = g_fEmissiveCutAlpha;
if (g_isEmissiveDissolve == true)
{
fEmissiveCutAlpha += (In.vLifeTime.x / In.vLifeTime.y) / 2;
}
float fSmoothAlpha = smoothstep(fEmissiveCutAlpha - 0.1f, fEmissiveCutAlpha + 0.1f, vMtrlDiffuse.a);
float3 vEmissiveColor = g_vEmissive.rgb * g_vEmissive.a + vEmissiveMtrl.rgb * (1 - g_vEmissive.a);
Out.vColorTarget = vector(vEmissiveColor * fSmoothAlpha, vMtrlDiffuse.a);
return Out;
}
@@ -414,7 +465,7 @@ VS_BLUR_OUT VS_BLUR(VS_IN In, uint iGPUIndex : SV_InstanceID)
row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation);
matW = mul(g_WorldMatrix, TransformMatrix);
matW = mul(TransformMatrix, g_WorldMatrix);
matWV = mul(matW, g_ViewMatrix);
matWVP = mul(matWV, g_ProjMatrix);
@@ -441,7 +492,6 @@ struct PS_BLUR_IN
struct PS_BLUR_OUT
{
float4 vDiffuse : SV_TARGET0;
float4 vBlurWeight : SV_TARGET1;
};
@@ -450,16 +500,17 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
PS_BLUR_OUT Out;
vector vMtrlDiffuse;
vector vMtrlMask;
vector vMtrlNoise;
vector vMtrlDissolve;
vector vMtrlDistortion;
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;
float2 vDistortionUVMoveTime = g_ParticleValue[In.iGPUIndex].vDistortionUVMoveTime;
if (g_isDiffuse == true)
{
@@ -472,57 +523,74 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
UV += SelectLerpUV((g_vDiffuseUVGainAmount / g_vUVCutting), (vDiffuseTime.x / vDiffuseTime.y), g_iDiffuseMoveLerpOption);
}
/* 노이즈 */
if (g_isNoise == true)
/* 디퓨즈 디스토션 */
if (g_isDistortion == true)
{
float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vDiffuseNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iDiffuseNoiseMoveLerpOption);
float2 vDistortion = In.vTexcoord + SelectLerpUV(g_vDiffuseDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iDiffuseDistortionMoveLerpOption);
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV);
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortion);
//0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다.
vMtrlNoise.rg -= 0.5f;
vMtrlDistortion.rg -= 0.5f;
//아마 분할되었다면 noise도 분할해야할듯
vMtrlNoise.rg /= g_vUVCutting;
vMtrlDistortion.rg /= g_vUVCutting;
//노이즈 텍스쳐로 uv를 왜곡함
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
UV = UV + (vMtrlNoise).rg * g_fNoiseDistortionIntensity;
UV = UV + (vMtrlDistortion).rg * g_fNoiseDistortionIntensity;
}
/* 최종 색깔 */
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, UV);
if (g_vColor.a > 0)
vMtrlDiffuse += g_vColor;
if (vMtrlDiffuse.a < 0.3f)
discard;
}
else
{
vMtrlDiffuse = g_vColor;
}
/* 노이즈 */
if (g_isNoise)
{
float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iNoiseMoveLerpOption);
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV);
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r);
vMtrlDiffuse *= vMtrlNoise;
}
/* 마스크 */
if (g_isMasking == true)
{
float2 vMaskTexcoord = In.vTexcoord;
vMaskTexcoord = UV_Cutting(In.vTexcoord, g_vUVMaskCutting, int(fAnimIndex.x));
if (g_isNoise == true)
// 마스크 디스토션
if (g_isDistortion == true)
{
float2 UV; // 이미지의 UV값
float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vMaskNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iMaskNoiseMoveLerpOption);
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iMaskDistortionMoveLerpOption);
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV);
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV);
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity;
//노이즈 텍스쳐로 uv를 왜곡함
vMaskTexcoord = vMaskTexcoord + (vMtrlNoise - 0.5f).rg * g_fNoiseDistortionIntensity;
}
if (g_isMaskUVMove)
@@ -532,6 +600,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
}
vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord);
}
else
{
@@ -542,27 +611,43 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r);
if (g_isDissolve == true)
{
vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord);
if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y))
discard;
}
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r);
if (vMtrlDiffuse.a <= 0.f)
discard;
if (g_isDissolve == true)
{
vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord);
if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y))
discard;
if (g_isReverseDissolve == true)
{
if (vMtrlDissolve.r >= (In.vLifeTime.x / In.vLifeTime.y))
discard;
}
else
{
if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y))
discard;
}
}
Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity;
Out.vBlurWeight.r = g_iBlurWeight / 32.f;
vMtrlDiffuse.a *= g_fDiffuseAlpha;
// 색깔 추가할 처리 (이미시브)
vector vEmissive;
float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f);
float fSmoothAlpha = smoothstep(g_fEmissiveCutAlpha - 0.02f, g_fEmissiveCutAlpha + 0.02f, vMtrlDiffuse.a);
float3 vEmissiveColor = g_vEmissive.rgb * g_vEmissive.a + vEmissiveMtrl.rgb * (1 - g_vEmissive.a);
vEmissive = vector(vEmissiveColor * fSmoothAlpha, vMtrlDiffuse.a);
Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity + vEmissive;
return Out;
}
@@ -584,7 +669,7 @@ technique11 DefaultTechnique
{
SetRasterizerState(RS_Nocull);
SetDepthStencilState(DSS_None, 0);
SetBlendState(BS_WB_Acc, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
SetBlendState(BS_Blend, 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();
@@ -593,7 +678,7 @@ technique11 DefaultTechnique
pass Blur
{
SetRasterizerState(RS_Nocull);
SetDepthStencilState(DSS_Default, 0);
SetDepthStencilState(DSS_Effect, 0);
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_BLUR();
GeometryShader = NULL;
@@ -11,9 +11,14 @@ uint g_iIndexU;
uint g_iIndexV;
Texture2D g_Texture;
Texture2D g_DiffuseTexture;
Texture2D g_MaskingTexture;
Texture2D g_NoiseTexture;
bool g_isDiffuse;
bool g_isNoise;
bool g_isMask;
struct VS_IN
{
@@ -25,27 +30,55 @@ struct VS_OUT
{
float4 vPosition : SV_Position;
float2 vTexcoord : TEXCOORD0;
float4 vProjPos : TEXCOORD1;
};
VS_OUT VS_MAIN(VS_IN In)
{
VS_OUT Out;
matrix matWV, matWVP;
matWV = mul(g_WorldMatrix, g_ViewMatrix);
matWVP = mul(matWV, g_ProjMatrix);
vector vPosition = mul(vector(In.vPosition, 1.f), matWVP);
Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP);
Out.vTexcoord = In.vTexcoord;
Out.vProjPos = vPosition;
return Out;
}
VS_OUT VS_TRAIL(VS_IN In)
{
VS_OUT Out;
matrix matWVP;
matWVP = mul(g_ViewMatrix , g_ProjMatrix); //월드행렬 곱해져서 오기때문에 월드 곱하지 않음
vector vPosition = mul(vector(In.vPosition, 1.f), matWVP);
Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP);
Out.vTexcoord = In.vTexcoord;
Out.vProjPos = vPosition;
return Out;
}
struct PS_IN
{
float4 vPosition : SV_Position;
float2 vTexcoord : TEXCOORD0;
float4 vProjPos : TEXCOORD1;
};
struct PS_OUT
@@ -72,17 +105,54 @@ PS_OUT PS_UVMove(PS_IN In)
return Out;
}
PS_OUT PS_Trail(PS_IN In)
struct PS_TRAILOUT
{
PS_OUT Out;
float4 vDiffuse : SV_TARGET0;
float4 vRevealage : SV_TARGET1;
float4 vColorTarget : SV_TARGET2;
};
PS_TRAILOUT PS_Trail(PS_IN In)
{
PS_TRAILOUT Out;
vector vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
vector vMasking = g_MaskingTexture.Sample(DefaultSampler, In.vTexcoord);
vector vMtrlDiffuse;
vector vMtrlMask;
vector vMtrlNoise;
if (g_isDiffuse == true)
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
else
vMtrlDiffuse = vector(0.f, 0.f, 0.f, 1.f);
if (g_isMask == true)
vMtrlMask = g_MaskingTexture.Sample(PointSampler, In.vTexcoord);
else
vMtrlMask = vector(1.f, 1.f, 1.f, 1.f);
if (g_isNoise == true)
{
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, In.vTexcoord);
//vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r);
vMtrlDiffuse *= vMtrlNoise;
}
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r);
float fWeight = clamp(pow(In.vProjPos.w, -2.5f), 1.0f, 1000.0f);
Out.vDiffuse = vector(vMtrlDiffuse.rgb * vMtrlDiffuse.a, vMtrlDiffuse.a) * fWeight;
Out.vRevealage.r = vMtrlDiffuse.a;
Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f);
vDiffuse.a = vDiffuse.a * vMasking.r;
Out.vColor = vDiffuse;
Out.vColor.a *= In.vTexcoord.x;
clip(Out.vColor.a - 0.01f);
return Out;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 356 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 785 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 826 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 857 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 577 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 603 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 504 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 301 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 331 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 429 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 356 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 686 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 463 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 543 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 430 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 442 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 367 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 523 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 442 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 6.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 892 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 620 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 842 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 437 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 591 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 240 KiB

Some files were not shown because too many files have changed in this diff Show More