@@ -3,6 +3,8 @@ vector g_vMtrlDiffuse = 1.f;
|
||||
vector g_vMtrlAmbient = 1.f;
|
||||
vector g_vMtrlSpecular = 1.f;
|
||||
|
||||
float PI = 3.14592;
|
||||
|
||||
sampler DefaultSampler = sampler_state
|
||||
{
|
||||
Filter = MIN_MAG_MIP_LINEAR;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
float PI = 3.141592;
|
||||
|
||||
struct Particle
|
||||
{
|
||||
float4 vRight;
|
||||
@@ -26,8 +28,9 @@ struct ParticleValue
|
||||
float2 vAniTime;
|
||||
|
||||
float2 vAniIndex;
|
||||
float fGravity;
|
||||
|
||||
|
||||
float3 vSinAmount;
|
||||
};
|
||||
|
||||
|
||||
@@ -42,40 +45,16 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐
|
||||
row_major matrix CamViewInvMatrix;
|
||||
|
||||
bool isLoop; // 상수 버퍼에서 불값은 4바이트로 처리되기 때문에 반드시 클라에서는 int형으로 선언해라
|
||||
bool isBillboard;
|
||||
bool isPadding2;
|
||||
bool isPadding3;
|
||||
bool isDrop;
|
||||
bool isMoveForward;
|
||||
bool isSinWave;
|
||||
|
||||
float fTimeDelta;
|
||||
float fPadding; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다.
|
||||
float fPadding1; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다.
|
||||
float fPadding2;
|
||||
float fPadding3;
|
||||
}
|
||||
|
||||
void Billboard(Particle particle)
|
||||
{
|
||||
if (isBillboard == true)
|
||||
{
|
||||
float3 vScale;
|
||||
|
||||
vScale.x = length(particle.vRight);
|
||||
vScale.y = length(particle.vUp);
|
||||
vScale.z = length(particle.vLook);
|
||||
|
||||
|
||||
particle.vRight = CamViewInvMatrix[0] * vScale.x;
|
||||
particle.vUp = CamViewInvMatrix[1] * vScale.y;
|
||||
particle.vLook = CamViewInvMatrix[2] * vScale.z;
|
||||
|
||||
//180도 회전 시키기
|
||||
particle.vRight.x *= -1.f;
|
||||
particle.vLook.z *= -1.f;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//내가 몇개의 스레드를 사용할 것인지 지정하는데
|
||||
//GPU 칩의 개수를 X * Y * Z의 개수 만큼 사용하겠다는 의미이다.
|
||||
[numthreads(256, 1, 1)]
|
||||
@@ -88,26 +67,47 @@ void CS_MAIN(
|
||||
|
||||
ParticleValue particleValue = g_ParticleValueBufferInput[iIndex];
|
||||
|
||||
// 라이프타임 움직임
|
||||
particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta;
|
||||
|
||||
// 라이프타임 움직임
|
||||
particle.vLifeTime.x += fTimeDelta;
|
||||
|
||||
if (particle.vLifeTime.x >= particle.vLifeTime.y)
|
||||
{
|
||||
if (isLoop == false)
|
||||
{
|
||||
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//초기화
|
||||
particle.vRight = particleValue.vOriginRight;
|
||||
particle.vUp = particleValue.vOriginUp;
|
||||
particle.vLook = particleValue.vOriginLook;
|
||||
particle.vTranslation = particleValue.vOriginTranslation;
|
||||
|
||||
particle.vLifeTime.x = 0.f;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (isMoveForward)
|
||||
{
|
||||
float4 vVelocity = vector(normalize(particleValue.vOriginLook.xyz) * particleValue.fSpeed, 1.f);
|
||||
|
||||
Billboard(particle);
|
||||
particle.vTranslation += vVelocity * fTimeDelta;
|
||||
}
|
||||
|
||||
if (isDrop == true)
|
||||
{
|
||||
particle.vTranslation.y -= 0.5f * particle.vLifeTime.x * particleValue.fGravity;
|
||||
}
|
||||
|
||||
|
||||
/* 사인 웨이브 */
|
||||
if(isSinWave == true)
|
||||
{
|
||||
particle.vTranslation += vector( sin(particle.vLifeTime.x * 3.141592 * 2.f) * particleValue.vSinAmount, 0.f);
|
||||
}
|
||||
|
||||
//애니메이션 속도 , 인덱스
|
||||
|
||||
particleValue.vAniTime.x += fTimeDelta;
|
||||
@@ -152,6 +152,13 @@ void CS_MAIN(
|
||||
{
|
||||
particleValue.vNoiseUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
particleValue.vDistortionUVMoveTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vDistortionUVMoveTime.x >= particleValue.vDistortionUVMoveTime.y)
|
||||
{
|
||||
particleValue.vDistortionUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
|
||||
//아웃풋 대입
|
||||
|
||||
|
After Width: | Height: | Size: 14 MiB |
|
After Width: | Height: | Size: 6.2 MiB |
@@ -3,6 +3,8 @@ vector g_vMtrlDiffuse = 1.f;
|
||||
vector g_vMtrlAmbient = 1.f;
|
||||
vector g_vMtrlSpecular = 1.f;
|
||||
|
||||
float PI = 3.14592;
|
||||
|
||||
sampler DefaultSampler = sampler_state
|
||||
{
|
||||
Filter = MIN_MAG_MIP_LINEAR;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
float PI = 3.141592;
|
||||
|
||||
struct Particle
|
||||
{
|
||||
float4 vRight;
|
||||
@@ -26,8 +28,9 @@ struct ParticleValue
|
||||
float2 vAniTime;
|
||||
|
||||
float2 vAniIndex;
|
||||
float fGravity;
|
||||
|
||||
|
||||
float3 vSinAmount;
|
||||
};
|
||||
|
||||
|
||||
@@ -42,40 +45,16 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐
|
||||
row_major matrix CamViewInvMatrix;
|
||||
|
||||
bool isLoop; // 상수 버퍼에서 불값은 4바이트로 처리되기 때문에 반드시 클라에서는 int형으로 선언해라
|
||||
bool isBillboard;
|
||||
bool isPadding2;
|
||||
bool isPadding3;
|
||||
bool isDrop;
|
||||
bool isMoveForward;
|
||||
bool isSinWave;
|
||||
|
||||
float fTimeDelta;
|
||||
float fPadding; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다.
|
||||
float fPadding1; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다.
|
||||
float fPadding2;
|
||||
float fPadding3;
|
||||
}
|
||||
|
||||
void Billboard(Particle particle)
|
||||
{
|
||||
if (isBillboard == true)
|
||||
{
|
||||
float3 vScale;
|
||||
|
||||
vScale.x = length(particle.vRight);
|
||||
vScale.y = length(particle.vUp);
|
||||
vScale.z = length(particle.vLook);
|
||||
|
||||
|
||||
particle.vRight = CamViewInvMatrix[0] * vScale.x;
|
||||
particle.vUp = CamViewInvMatrix[1] * vScale.y;
|
||||
particle.vLook = CamViewInvMatrix[2] * vScale.z;
|
||||
|
||||
//180도 회전 시키기
|
||||
particle.vRight.x *= -1.f;
|
||||
particle.vLook.z *= -1.f;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//내가 몇개의 스레드를 사용할 것인지 지정하는데
|
||||
//GPU 칩의 개수를 X * Y * Z의 개수 만큼 사용하겠다는 의미이다.
|
||||
[numthreads(256, 1, 1)]
|
||||
@@ -88,26 +67,47 @@ void CS_MAIN(
|
||||
|
||||
ParticleValue particleValue = g_ParticleValueBufferInput[iIndex];
|
||||
|
||||
// 라이프타임 움직임
|
||||
particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta;
|
||||
|
||||
// 라이프타임 움직임
|
||||
particle.vLifeTime.x += fTimeDelta;
|
||||
|
||||
if (particle.vLifeTime.x >= particle.vLifeTime.y)
|
||||
{
|
||||
if (isLoop == false)
|
||||
{
|
||||
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//초기화
|
||||
particle.vRight = particleValue.vOriginRight;
|
||||
particle.vUp = particleValue.vOriginUp;
|
||||
particle.vLook = particleValue.vOriginLook;
|
||||
particle.vTranslation = particleValue.vOriginTranslation;
|
||||
|
||||
particle.vLifeTime.x = 0.f;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (isMoveForward)
|
||||
{
|
||||
float4 vVelocity = vector(normalize(particleValue.vOriginLook.xyz) * particleValue.fSpeed, 1.f);
|
||||
|
||||
Billboard(particle);
|
||||
particle.vTranslation += vVelocity * fTimeDelta;
|
||||
}
|
||||
|
||||
if (isDrop == true)
|
||||
{
|
||||
particle.vTranslation.y -= 0.5f * particle.vLifeTime.x * particleValue.fGravity;
|
||||
}
|
||||
|
||||
|
||||
/* 사인 웨이브 */
|
||||
if(isSinWave == true)
|
||||
{
|
||||
particle.vTranslation += vector( sin(particle.vLifeTime.x * 3.141592 * 2.f) * particleValue.vSinAmount, 0.f);
|
||||
}
|
||||
|
||||
//애니메이션 속도 , 인덱스
|
||||
|
||||
particleValue.vAniTime.x += fTimeDelta;
|
||||
@@ -152,6 +152,13 @@ void CS_MAIN(
|
||||
{
|
||||
particleValue.vNoiseUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
particleValue.vDistortionUVMoveTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vDistortionUVMoveTime.x >= particleValue.vDistortionUVMoveTime.y)
|
||||
{
|
||||
particleValue.vDistortionUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
|
||||
//아웃풋 대입
|
||||
|
||||
@@ -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,6 +184,8 @@ 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;
|
||||
@@ -178,22 +194,21 @@ PS_OUT PS_Key_Hold_Rotation(PS_IN In)
|
||||
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;
|
||||
int iCurrentFrame = int(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 +218,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 +228,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 +240,7 @@ PS_OUT PS_QuestType(PS_IN In)
|
||||
}
|
||||
}
|
||||
|
||||
Texture1.a *= Alpha;
|
||||
Out.vColor = Texture1;
|
||||
|
||||
return Out;
|
||||
@@ -232,9 +249,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,6 +262,7 @@ PS_OUT PS_UVMult(PS_IN In)
|
||||
PS_OUT PS_NineSlice(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
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;
|
||||
@@ -253,11 +273,11 @@ PS_OUT PS_NineSlice(PS_IN In)
|
||||
float2 UV = In.vTexcoord * 0.5f + 0.5f;
|
||||
float2 ScaledUV = UV;
|
||||
|
||||
if(UV.x < Left)
|
||||
if (UV.x < Left)
|
||||
{
|
||||
ScaledUV.x = UV.x;
|
||||
}
|
||||
else if(UV.x > Right)
|
||||
else if (UV.x > Right)
|
||||
{
|
||||
ScaledUV.x = 1.0f - ((1.0f - UV.x) / ratio.x);
|
||||
}
|
||||
@@ -266,11 +286,11 @@ PS_OUT PS_NineSlice(PS_IN In)
|
||||
ScaledUV.x = Left + (UV.x - Left) / ratio.x;
|
||||
}
|
||||
|
||||
if(UV.y < Top)
|
||||
if (UV.y < Top)
|
||||
{
|
||||
ScaledUV.y = UV.y;
|
||||
}
|
||||
else if(UV.y > Bottom)
|
||||
else if (UV.y > Bottom)
|
||||
{
|
||||
ScaledUV.y = 1.0f - ((1.0f - UV.y) / ratio.y);
|
||||
}
|
||||
@@ -281,8 +301,160 @@ PS_OUT PS_NineSlice(PS_IN In)
|
||||
|
||||
float4 color = g_Texture.Sample(ClampSampler, ScaledUV);
|
||||
|
||||
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);
|
||||
float3 BGColor = float3(1.f, 1.f, 1.f);
|
||||
|
||||
if (g_iSpellType == 0)
|
||||
{
|
||||
tex1.rgb *= 0.4f;
|
||||
color = tex1;
|
||||
tex2.rgb *= 0.3f;
|
||||
|
||||
if (tex2.a >= 0.9f)
|
||||
color = tex2;
|
||||
|
||||
color.a *= Alpha;
|
||||
|
||||
Out.vColor = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
//int iTotalFrame = g_iImageCountX * g_iImageCountY;
|
||||
//int iCurrentFrame = int(floor(g_fTime / g_fFrame)) % iTotalFrame;
|
||||
//int iFrameX = iCurrentFrame % g_iImageCountX;
|
||||
//int iFrameY = iCurrentFrame / g_iImageCountX;
|
||||
//float fFreamWidth = 1.0 / g_iImageCountX;
|
||||
//float fFreamHeight = 1.0 / g_iImageCountY;
|
||||
|
||||
//float2 UV = In.vTexcoord;
|
||||
//UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth;
|
||||
//UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight;
|
||||
|
||||
//float4 tex3 = g_Texture2.Sample(DefaultSampler, UV);
|
||||
//if (tex3.r <= 0.5f)
|
||||
// discard;
|
||||
switch (g_iSpellType)
|
||||
{
|
||||
case 1:
|
||||
BGColor = float3(208.f, 179.f, 54.f) / 255.f;
|
||||
tex1.rgb *= BGColor;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
BGColor = float3(89.f, 32.f, 215.f) / 255.f;
|
||||
tex1.rgb *= BGColor;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
BGColor = float3(190.f, 46., 34.f) / 255.f;
|
||||
tex1.rgb *= BGColor;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
BGColor = float3(37.f, 129.f, 162.f) / 255.f;
|
||||
tex1.rgb *= BGColor;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
BGColor = float3(134.f, 171.f, 78.f) / 255.f;
|
||||
tex1.rgb *= BGColor;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
BGColor = float3(0.f, 80.f, 55.f) / 255.f;
|
||||
tex1.rgb *= BGColor;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
BGColor = float3(0.f, 0.f, 0.f);
|
||||
tex1.rgb *= BGColor;
|
||||
break;
|
||||
}
|
||||
|
||||
color = tex1;
|
||||
|
||||
//color = tex3;
|
||||
|
||||
if (tex2.a >= 0.9f)
|
||||
color = tex2;
|
||||
|
||||
float CoolTime = 1.f - g_fDeltaV;
|
||||
|
||||
if (In.vTexcoord.y <= CoolTime)
|
||||
{
|
||||
color.a = 0.f;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
//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;
|
||||
}
|
||||
|
||||
@@ -292,7 +464,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();
|
||||
@@ -378,4 +550,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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
|
||||
float PI = 3.141592;
|
||||
|
||||
struct ParticleValue
|
||||
{
|
||||
float fSpeed;
|
||||
@@ -312,12 +310,14 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
|
||||
UV = UV + (vMtrlDistortion).rg * g_fNoiseDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* 최종 색깔 */
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, UV);
|
||||
|
||||
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
@@ -354,14 +354,14 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
{
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iMaskDistortionMoveLerpOption);
|
||||
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iMaskDistortionMoveLerpOption);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV);
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r / g_vUVCutting * g_fNoiseDistortionIntensity;
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity;
|
||||
|
||||
vMtrlDiffuse *= vMtrlDistortion.r;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -529,8 +529,8 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
//0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다.
|
||||
vMtrlDistortion.rg -= 0.5f;
|
||||
|
||||
//아마 분할되었다면 noise도 분할해야할듯
|
||||
vMtrlDistortion.rg /= g_vUVCutting;
|
||||
////아마 분할되었다면 noise도 분할해야할듯
|
||||
//vMtrlDistortion.rg /= g_vUVCutting;
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
|
||||
@@ -573,14 +573,13 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
{
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iMaskDistortionMoveLerpOption);
|
||||
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iMaskDistortionMoveLerpOption);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV);
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r / g_vUVCutting * g_fNoiseDistortionIntensity;
|
||||
|
||||
vMtrlDiffuse *= vMtrlDistortion.r;
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 932 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 3.3 KiB |