@@ -303,7 +303,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
vTexcoord.y = In.vTexcoord.y + (float)i / g_vResolution.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(BorderZeroSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBackBuffer += vColor;
|
||||
@@ -329,7 +329,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In)
|
||||
vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x;
|
||||
vTexcoord.y = In.vTexcoord.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(BorderZeroSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBlurX = vColor;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
|
||||
Texture2D g_ColorTexture;
|
||||
Texture2D g_DiffuseTexture;
|
||||
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
@@ -48,39 +50,41 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
|
||||
Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
vector ColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (0.f == ColorTexture.a)
|
||||
vector vDiffuseTexture = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
|
||||
if (0.f == vColorTexture.a)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
int iOption = ColorTexture.a * 10;
|
||||
int iOption = vColorTexture.a * 10;
|
||||
|
||||
|
||||
switch (iOption)
|
||||
{
|
||||
case 1:
|
||||
Out.vBackBuffer.rgb += ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb = vColorTexture.rgb;
|
||||
break;
|
||||
case 2:
|
||||
Out.vBackBuffer.rgb *= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb *= vColorTexture.rgb;
|
||||
break;
|
||||
case 3:
|
||||
Out.vBackBuffer.rgb -= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb -= vColorTexture.rgb;
|
||||
break;
|
||||
case 4:
|
||||
Out.vBackBuffer.rgb /= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb /= vColorTexture.rgb;
|
||||
break;
|
||||
case 5:
|
||||
Out.vBackBuffer.rgb = ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb += vColorTexture.rgb;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
@@ -90,7 +94,7 @@ technique11 DefaultTechnique
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_None, 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_OUT_LASTCOLOR();
|
||||
|
||||
@@ -19,14 +19,34 @@ struct ParticleValue
|
||||
float4 vOriginLook;
|
||||
float4 vOriginTranslation;
|
||||
|
||||
float2 fPadding;
|
||||
float2 vMaskingUVMoveTime;
|
||||
float2 vDiffuseUVMoveTime;
|
||||
float2 vAniTime;
|
||||
|
||||
float2 vAniIndex;
|
||||
};
|
||||
|
||||
struct ParticleOut
|
||||
{
|
||||
float4 vRight;
|
||||
float4 vUp;
|
||||
float4 vLook;
|
||||
float4 vTranslation;
|
||||
float2 vLifeTime;
|
||||
|
||||
float2 vMaskingUVMoveTime;
|
||||
float2 vDiffuseUVMoveTime;
|
||||
float2 vAniTime;
|
||||
|
||||
float2 vAniIndex;
|
||||
|
||||
};
|
||||
|
||||
|
||||
StructuredBuffer<Particle> g_ParticleBufferInput : register(t0);
|
||||
StructuredBuffer<ParticleValue> g_ParticleValueBufferInput : register(t1);
|
||||
|
||||
RWStructuredBuffer<Particle> g_ParticleBufferOutput : register(u0);
|
||||
RWStructuredBuffer<ParticleOut> g_ParticleBufferOutput : register(u0);
|
||||
|
||||
cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐이더 바인딩할때 인덱스가 동일해야함
|
||||
{
|
||||
@@ -49,6 +69,9 @@ void CS_MAIN(
|
||||
|
||||
ParticleValue particleValue = g_ParticleValueBufferInput[iIndex];
|
||||
|
||||
ParticleOut ParticleOut;
|
||||
|
||||
// 라이프타임 움직임
|
||||
particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta;
|
||||
|
||||
particle.vLifeTime.x += fTimeDelta;
|
||||
@@ -59,6 +82,58 @@ void CS_MAIN(
|
||||
particle.vTranslation.y = 0.f;
|
||||
}
|
||||
|
||||
g_ParticleBufferOutput[iIndex] = particle;
|
||||
|
||||
//애니메이션 속도 , 인덱스
|
||||
|
||||
particleValue.vAniTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vAniTime.x >= particleValue.vAniTime.y)
|
||||
{
|
||||
particleValue.vAniTime.x = 0.f;
|
||||
|
||||
particleValue.vAniIndex.x++;
|
||||
|
||||
if (particleValue.vAniIndex.x > particleValue.vAniIndex.y) // 애니메이션에 끝에 다다랐다면
|
||||
{
|
||||
particleValue.vAniIndex.x = 0.f; // 인덱스 초기화
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//마스킹 UV 움직임 시간
|
||||
|
||||
particleValue.vMaskingUVMoveTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vMaskingUVMoveTime.x >= particleValue.vMaskingUVMoveTime.x)
|
||||
{
|
||||
particleValue.vMaskingUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
|
||||
//디퓨즈 UV 움직임
|
||||
|
||||
particleValue.vDiffuseUVMoveTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vDiffuseUVMoveTime.x >= particleValue.vDiffuseUVMoveTime.x)
|
||||
{
|
||||
particleValue.vDiffuseUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
|
||||
//아웃풋 대입
|
||||
|
||||
ParticleOut.vRight = particle.vRight;
|
||||
ParticleOut.vUp = particle.vUp;
|
||||
ParticleOut.vLook = particle.vLook;
|
||||
ParticleOut.vTranslation = particle.vTranslation;
|
||||
ParticleOut.vLifeTime = particle.vLifeTime;
|
||||
|
||||
ParticleOut.vMaskingUVMoveTime = particleValue.vMaskingUVMoveTime;
|
||||
ParticleOut.vDiffuseUVMoveTime = particleValue.vDiffuseUVMoveTime;
|
||||
ParticleOut.vAniTime = particleValue.vAniTime;
|
||||
ParticleOut.vAniIndex = particleValue.vAniIndex;
|
||||
|
||||
|
||||
g_ParticleBufferOutput[iIndex] = ParticleOut;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ float g_fBlurIntensity; //블러 세기
|
||||
|
||||
float4 g_vEmissive;
|
||||
float g_fColorOption;
|
||||
float g_fEmissiveCutAlpha;
|
||||
|
||||
bool g_isDiffuse;
|
||||
bool g_isMasking;
|
||||
@@ -98,10 +99,8 @@ struct PS_IN
|
||||
|
||||
struct PS_OUT
|
||||
{
|
||||
float4 vDiffuse : SV_TARGET0;
|
||||
float4 vNormal : SV_TARGET1;
|
||||
float4 vDepth : SV_TARGET2;
|
||||
float4 vColor : SV_TARGET3;
|
||||
float4 vDiffuse: SV_TARGET0;
|
||||
float4 vColorTarget : SV_TARGET1;
|
||||
};
|
||||
|
||||
PS_OUT PS_MAIN(PS_IN In)
|
||||
@@ -119,8 +118,8 @@ PS_OUT PS_MAIN(PS_IN In)
|
||||
float3 vNormal = mul(vMtrlNormal.xyz * 2.f - 1.f, NormalMap_WorldMatrix);
|
||||
|
||||
|
||||
Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f);
|
||||
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
//Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f);
|
||||
//Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
|
||||
if (vMtrlDiffuse.a < 0.3f)
|
||||
discard;
|
||||
@@ -187,20 +186,71 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r - vMtrlDisolve.r * (In.vLifeTime.x / In.vLifeTime.y));
|
||||
|
||||
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
|
||||
Out.vDiffuse = vMtrlDiffuse;
|
||||
Out.vDiffuse = vMtrlDiffuse;
|
||||
|
||||
// 색깔 추가할 처리 (이미시브)
|
||||
if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha )
|
||||
Out.vColorTarget = vector(g_vEmissive.rgb, g_fColorOption / 10.f);
|
||||
else
|
||||
Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
// 색깔 추가할 처리
|
||||
Out.vColor = vector(g_vEmissive.rgb , g_fColorOption / 10.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_Blur(PS_IN In)
|
||||
struct VS_BLUR_OUT
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
float2 vLifeTime : TEXCOORD1;
|
||||
};
|
||||
|
||||
VS_BLUR_OUT VS_BLUR(VS_IN In)
|
||||
{
|
||||
VS_BLUR_OUT Out = (VS_BLUR_OUT) 0;
|
||||
|
||||
matrix matWV, matWVP;
|
||||
|
||||
matWV = mul(g_WorldMatrix, g_ViewMatrix);
|
||||
|
||||
float4 vProjPos = vector(In.vPosition, 1.f);
|
||||
|
||||
Out.vPosition = mul(vProjPos, matWVP);
|
||||
|
||||
matWVP = mul(matWV, g_ProjMatrix);
|
||||
|
||||
matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation);
|
||||
|
||||
vector vPosition = mul(vector(In.vPosition, 1.f), TransformMatrix);
|
||||
|
||||
Out.vPosition = mul(vPosition, matWVP);
|
||||
Out.vTexcoord = In.vTexcoord;
|
||||
Out.vLifeTime = In.vLifeTime;
|
||||
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_BLUR_IN
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
float2 vLifeTime : TEXCOORD1;
|
||||
|
||||
};
|
||||
|
||||
struct PS_BLUR_OUT
|
||||
{
|
||||
float4 vDiffuse : SV_TARGET0;
|
||||
};
|
||||
|
||||
|
||||
PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
{
|
||||
|
||||
PS_OUT Out;
|
||||
PS_BLUR_OUT Out;
|
||||
|
||||
vector vMtrlDiffuse;
|
||||
vector vMtrlMask;
|
||||
@@ -253,13 +303,8 @@ PS_OUT PS_Blur(PS_IN In)
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r - vMtrlDisolve.r * (In.vLifeTime.x / In.vLifeTime.y));
|
||||
|
||||
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
|
||||
Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity;
|
||||
|
||||
// 색깔 추가할 처리
|
||||
Out.vColor = vector(g_vEmissive.rgb, g_fColorOption / 10.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
@@ -291,9 +336,9 @@ technique11 DefaultTechnique
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
VertexShader = compile vs_5_0 VS_BLUR();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Blur();
|
||||
PixelShader = compile ps_5_0 PS_BLUR();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 MiB |
|
Before Width: | Height: | Size: 24 MiB |
|
Before Width: | Height: | Size: 854 KiB |
|
Before Width: | Height: | Size: 3.0 MiB |
|
Before Width: | Height: | Size: 6.6 MiB |
|
Before Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 4.1 MiB |
|
Before Width: | Height: | Size: 5.7 MiB |
|
Before Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 4.1 MiB |
|
Before Width: | Height: | Size: 6.1 MiB |
|
Before Width: | Height: | Size: 16 MiB |
|
Before Width: | Height: | Size: 14 MiB |
|
Before Width: | Height: | Size: 249 KiB |
|
Before Width: | Height: | Size: 3.0 MiB |
|
Before Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 8.3 MiB After Width: | Height: | Size: 7.8 MiB |