diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl deleted file mode 100644 index 1aee12e67..000000000 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ /dev/null @@ -1,1164 +0,0 @@ -#include "Engine_Shader_Defines.hlsli" - -matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; -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_fBlinkTime; -float g_fTime; -float g_fFrame; -float g_fDeltaU; -float g_fDeltaV; -float g_fAlpha; -float g_fOwnerAlpha; -float g_fCanvasAlpha; -float g_fAngle; -float g_fCoolTime; -float g_fHp; - -float2 g_fOrigin_Size; -float2 g_fCurrent_Size; -float2 g_fHpBG; -float2 g_Pos; -float2 g_fImageSize; - -float4 g_fNine_Slice; -float4 g_fImageUV; -float4 g_fImageUV1; - -uint g_iArrayCount; -float2 g_fItemPosition1; -float2 g_fItemImageSizes1; -float2 g_fItemPosition2; -float2 g_fItemImageSizes2; -float2 g_fPosition[4]; -float2 g_fImageSizes[4]; -float4 g_fImagesUV[4]; - -float4 g_fImageSipos1; -float4 g_fImageSipos2; -float4 g_fImageSipos3; - -Texture2D g_Texture; -Texture2D g_Texture1; -Texture2D g_Texture2; -Texture2D g_Texture3; -Texture2D g_Texture4; -Texture2D g_Texture5; -Texture2D g_DiffuseTexture; -Texture2D g_MaskingTexture; - - -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 vColor : SV_Target0; -}; - -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; -} - -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.rgb *= 1.5f; - - Color.a *= Alpha; - Out.vColor = Color; - - return Out; -} - -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 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); - - float2 UV = In.vTexcoord; - float2 Center = float2(0.5f, 0.5f); - - float CW = -g_fTime; - float CCW = g_fTime; - - 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; - - 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; - - - float4 Texture1 = g_Texture.Sample(ClampSampler, RedCircle); - float4 Texture2 = g_Texture2.Sample(ClampSampler, BlueCircle); - - if (Texture1.r >= 0.7f) - Color = Texture1; - - if (Texture2.b >= 0.7f) - Color = Texture2; - - if (all(Color.rgb <= 0.5f)) - discard; - - Color = White; - - Color.a *= Alpha; - - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_Key_Hold_Rotation(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); - - float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); - Color = tex1; - - float2 Imagetexpos1 = g_fImageSipos1.xy / g_fCurrent_Size; - float2 Imagetexsize1 = g_fImageSipos1.zw / g_fCurrent_Size; - float2 Imagelocal = (In.vTexcoord - Imagetexpos1) / Imagetexsize1; - bool inside1 = all(Imagelocal >= 0.0f && Imagelocal <= 1.0f); - float4 tex2 = g_Texture1.Sample(ClampSampler, Imagelocal); - if (inside1) - { - float2 center = float2(0.5f, 0.5f); - float2 dir = Imagelocal - center; - - float angle = atan2(dir.x, -dir.y); - if (angle < 0) - angle += g_fPI; - - float rotation = saturate(g_fTime) * g_fPI; - - tex2.rgb = (angle <= rotation) ? 1.0 : tex2.rgb; - - - Color = lerp(Color, tex2, tex2.a); - } - - - - float2 Imagetexpos2 = g_fImageSipos2.xy / g_fCurrent_Size; - float2 Imagetexsize2 = g_fImageSipos2.zw / g_fCurrent_Size; - float2 Imagelocal2 = (In.vTexcoord - Imagetexpos2) / Imagetexsize2; - bool inside2 = all(Imagelocal2 >= 0.0f && Imagelocal2 <= 1.0f); - if (inside2) - { - float2 atlasUV = g_fImageUV.xy + Imagelocal2 * (g_fImageUV.zw - g_fImageUV.xy); - float2 safeUV = saturate(atlasUV); - float4 tex3 = g_Texture2.Sample(ClampSampler, safeUV); - Color = lerp(Color, tex3, tex3.a); - } - - float2 Imagetexpos3 = g_fImageSipos3.xy / g_fCurrent_Size; - float2 Imagetexsize3 = g_fImageSipos3.zw / g_fCurrent_Size; - float2 Imagelocal3 = (In.vTexcoord - Imagetexpos3) / Imagetexsize3; - bool inside3 = all(Imagelocal3 >= 0.0f && Imagelocal3 <= 1.0f); - if (inside3) - { - float3 QuestColor = float3(253.f, 207.f, 11.f) / 255.f; - - float4 tex4 = g_Texture3.Sample(ClampSampler, Imagelocal3); - - if (g_iQuestType == 0) - { - - tex4.rgb *= QuestColor; - - } - - Color = lerp(Color, tex4, tex4.a); - } - - Color.a *= Alpha; - - Out.vColor = Color; - - 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; - 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; - - uint iCurrentFrame = uint(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; - - UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; - UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; - - float4 Texture = g_Texture.Sample(DefaultSampler, UV); - - Color = Texture; - - if (Color.r <= 0.4f) - discard; - - - Color.a *= Alpha; - - Out.vColor = Color; - - return Out; -} - -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); - - if (g_iQuestType == 0) - { - if (Texture1.r >= 0.3f) - { - Texture1.rgb = Color; - } - } - - Texture1.a *= Alpha; - Out.vColor = Texture1; - - return Out; -} - -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; -} - -PS_OUT PS_NineSlice(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); - 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; - - 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 Finaluv = In.vTexcoord; - - if (CurrentPixelPosition.x < CurrentLeft) - { - Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; - } - else if (CurrentPixelPosition.x > CurrentRight) - { - float dist = CurrentPixelPosition.x - CurrentRight; - Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; - } - else - { - float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); - Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); - } - - if (CurrentPixelPosition.y < CurrentTop) - { - Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; - } - else if (CurrentPixelPosition.y > CurrentBottom) - { - float dist = CurrentPixelPosition.y - CurrentBottom; - Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; - } - else - { - float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); - Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); - } - - 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(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; - - float2 startUV = g_fImageUV.xy; - float2 endUV = g_fImageUV.zw; - - float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); - - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); - float4 tex2 = g_Texture2.Sample(DefaultSampler, atlasUV); - - tex1.rgb *= 0.4f; - color = tex1; - tex2.rgb *= 0.3f; - - if (tex2.a >= 0.9f) - color = tex2; - 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; - } - float4 color1 = float4(1.f, 1.f, 1.f, 1.f); - - float2 OverrayUV = In.vTexcoord; - float CoolTime = 1.f - g_fDeltaV; - float CoolTime2 = 1.f - g_fDeltaV + 0.1f; - atlasUV = startUV + In.vTexcoord * (endUV - startUV); - float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); - tex3.rgb *= BGColor; - float4 tex4 = g_Texture2.Sample(DefaultSampler, atlasUV); - - if (tex4.a >= 0.9f) - tex3 = tex4; - - color1 = tex3; - - float wave1 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; - float wave2 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; - float waveThreshold1 = CoolTime + wave1; - float waveThreshold2 = CoolTime2 + wave2; - float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f , waveUV.y = (OverrayUV.y - waveThreshold1) /(waveThreshold2 - waveThreshold1)); - waveUV = saturate(waveUV); - float tex5 = g_Texture3.Sample(DefaultSampler, waveUV).r; - - if (g_fDeltaV <= 1.f) - { - if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) - { - color1.rgb += float3(1.f, 1.f, 1.f) * tex5 * g_fDeltaU; - } - } - - float waveThreshold = CoolTime + wave1; - - if (OverrayUV.y <= waveThreshold) - { - color1.a = 0.f; - } - - color = lerp(color, color1, color1.a); - - color.a *= Alpha; - - Out.vColor = color; - return Out; -} - -PS_OUT PS_HpBar(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); - float4 Color1 = 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; - - 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 Finaluv = In.vTexcoord; - - if (CurrentPixelPosition.x < CurrentLeft) - { - Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; - } - else if (CurrentPixelPosition.x > CurrentRight) - { - float dist = CurrentPixelPosition.x - CurrentRight; - Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; - } - else - { - float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); - Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); - } - - if (CurrentPixelPosition.y < CurrentTop) - { - Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; - } - else if (CurrentPixelPosition.y > CurrentBottom) - { - float dist = CurrentPixelPosition.y - CurrentBottom; - Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; - } - else - { - float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); - Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); - } - - float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv); - tex1.rgb = float3(255.f, 0.f, 0.f) / 255.f; - if (g_fHp <= 0.3f) - { - tex1.a *= (sin(g_fBlinkTime) * 0.25f + 0.75f) * 1.5f; - } - else - { - tex1.a = 0.f; - } - Color = tex1; - - float2 BGPos = g_Pos; - float2 BGSize = g_fImageSize; - float2 BGPixel = Finaluv * g_fOrigin_Size; - float2 localUV = (BGPixel - BGPos) / BGSize; - bool inside = all(localUV >= 0.0f && localUV <= 1.0f); - - float4 tex2 = g_Texture1.Sample(ClampSampler, localUV); - - if (inside) - Color = lerp(Color, tex2, tex2.a); - - float2 reversuv = In.vTexcoord; - - reversuv.x = 1.0f - localUV.x; - - float4 tex3 = g_Texture2.Sample(ClampSampler, localUV); - - if (reversuv.x >= g_fHp) - { - tex3.rgb = float3(0.f, 0.f, 0.f); - } - - float3 Green = (float3(112.f, 241.f, 31.f) / 255.f) * 1.2f; - float3 Red = (float3(255.f, 0.f, 0.f) / 255.f) * 1.2f; - - tex3.rgb *= lerp(Green, Red, g_fTime); - - if (all(Color.rgb >= float3(55.f / 255.f, 0.f / 255.f, 55.f / 255.f))) - Color = lerp(Color, tex3, tex3.a); - - Color.a *= Alpha; - Out.vColor = Color; - return Out; -} - -PS_OUT PS_Magic_Meter(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float3 Blue = float3(41.f, 165.f, 255.f) / 255.f; - - float4 color = float4(1.f, 1.f, 1.f, 1.f); - float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); - float4 tex2 = g_Texture1.Sample(ClampSampler, In.vTexcoord); - - float2 reverseuv = 1.f - In.vTexcoord; - - color = tex1; - tex2.rgb *= Blue * 1.5f; - - if (reverseuv.x >= g_fHp) - { - tex2.rgb = float3(0.f, 0.f, 0.f); - } - - if (all(color.rgb >= float3(65.f / 255.f, 65.f / 255.f, 65.f / 255.f))) - color = tex2; - - color.a *= Alpha; - - Out.vColor = color; - - return Out; -} - - -PS_OUT PS_Magic_Icon(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); - - float2 center = float2(0.5f, 0.5f); - float2 BGuv = In.vTexcoord - center; - BGuv *= sqrt(2.0f); - float2 Rotation = In.vTexcoord; - Rotation.x = BGuv.x * cos(g_fAngle) - BGuv.y * sin(g_fAngle); - Rotation.y = BGuv.x * sin(g_fAngle) + BGuv.y * cos(g_fAngle); - Rotation += center; - - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); - float4 tex2 = g_Texture1.Sample(ClampSampler, Rotation); - - Color = tex1; - Color = lerp(tex1, tex2, tex2.a); - - float2 uv = In.vTexcoord; - float scale = 1.2; - - uv = (uv - center) * scale + center; - float4 tex3 = g_Texture2.Sample(ClampSampler, uv); - - - Color = Color * (1 - tex3.a) + tex3; - - Color.a *= Alpha; - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_RemapUV(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); - - - float2 startUV = g_fImageUV.xy; - float2 endUV = g_fImageUV.zw; - - float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); - - float4 tex1 = g_Texture.Sample(DefaultSampler, atlasUV); - - Color = tex1; - - Color.a *= Alpha; - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_Revelio(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); - float2 UV = In.vTexcoord; - - //float2 Position[4]; - //float2 startUV[4]; - //float2 endUV[4]; - - //float2 Atlases[4]; - - //for (int i = 0; i < 4; ++i) - //{ - // Position[i] = g_fPosition[i]; - // startUV[i] = g_fImagesUV[i].xy; - // endUV[i] = g_fImagesUV[i].zw; - - // Atlases[i] = startUV[i] + UV * (endUV[i] - startUV[i]); - //} - - //float4 tex1 = g_Texture.Sample(DefaultSampler, UV); - //float4 tex2 = g_Texture1.Sample(DefaultSampler, Atlases[0]); - //float4 tex3 = g_Texture1.Sample(DefaultSampler, Atlases[1]); - //float4 tex4 = g_Texture2.Sample(DefaultSampler, Atlases[2]); - //float4 tex5 = g_Texture2.Sample(DefaultSampler, Atlases[3]); - - - - ////float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); - - Color.a *= Alpha; - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_Potion(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float4 Color = float4(214.f / 255.f, 225 / 255.f, 36 / 255.f, 1.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); - Color = tex1; - - float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); - //Color += tex2; - float4 tex3 = g_Texture2.Sample(ClampSampler, Rotation); - Color = lerp(Color, tex3, tex3.a); - - float2 Potionuv = In.vTexcoord; - float scale = 1.2; - - Potionuv = (Potionuv - center) * scale + center; - float4 tex4 = g_Texture3.Sample(ClampSampler, Potionuv); - Color = lerp(Color, tex4, tex4.a); - - float2 tex5pos = g_Pos / g_fCurrent_Size; - float2 tex5size = g_fOrigin_Size / g_fCurrent_Size; - float2 tex5local = (In.vTexcoord - tex5pos) / tex5size; - bool inside = all(tex5local >= 0.0f && tex5local <= 1.0f); - float4 tex5 = g_Texture4.Sample(ClampSampler, tex5local); - if (inside) - Color = lerp(Color, tex5, tex5.a); - - Color.a *= Alpha; - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_Magic_Item(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); - - 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; - - float2 startUV = g_fImageUV.xy; - float2 endUV = g_fImageUV.zw; - - float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); - - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); - float4 tex2 = g_Texture3.Sample(ClampSampler, atlasUV); - - tex1.rgb *= 0.4f; - color = tex1; - tex2.rgb *= 0.3f; - - if (tex2.a >= 0.9f) - color = tex2; - float3 BGColor = float3(1.f, 1.f, 1.f); - - switch (g_iSpellType) - { - case 0: - BGColor = float3(50.f, 50.f, 50.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; - } - - float4 color1 = float4(1.f, 1.f, 1.f, 1.f); - - float2 OverrayUV = In.vTexcoord; - float CoolTime = 0.f + g_fDeltaV; - float CoolTime2 = 0.f + g_fDeltaV + 0.05; - atlasUV = startUV + In.vTexcoord * (endUV - startUV); - float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); - tex3.rgb *= BGColor; - float4 tex4 = g_Texture3.Sample(DefaultSampler, atlasUV); - - if (g_fDeltaV <= 1.f) - { - if (tex4.a >= 0.9f) - tex3 = tex4; - - color1 = tex3; - - float wave1 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; - float wave2 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; - - float waveThreshold1 = CoolTime + wave1; - float waveThreshold2 = CoolTime2 + wave2; - - if (g_fDeltaV <= 1.f) - { - if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) - { - color1.rgb = float3(1.f, 1.f, 1.f); - } - } - - if (OverrayUV.y <= CoolTime) - { - color1.a = 0.f; - } - - color = lerp(color, color1, color1.a); - } - else if (g_fDeltaV >= 1.f) - color = lerp(color, tex4, tex4.a); - - float4 tex5 = g_Texture2.Sample(ClampSampler, Rotation); - color = lerp(color, tex5, tex5.a); - - float2 texpos1 = g_fItemPosition1 / g_fCurrent_Size; - float2 texpos2 = g_fItemPosition2 / g_fCurrent_Size; - float2 texsize1 = g_fItemImageSizes1 / g_fCurrent_Size; - float2 texsize2 = g_fItemImageSizes2 / g_fCurrent_Size; - float2 texlocal1 = (In.vTexcoord - texpos1) / texsize1; - float2 texlocal2 = (In.vTexcoord - texpos2) / texsize2; - - - bool inside1 = all(texlocal1 >= 0.0f && texlocal1 <= 1.0f); - float4 tex6 = g_Texture4.Sample(DefaultSampler, texlocal1); - - if (inside1) - color = lerp(color, tex6, tex6.a); - - bool inside2 = all(texlocal2 >= 0.0f && texlocal2 <= 1.0f); - - float4 tex7 = g_Texture5.Sample(DefaultSampler, texlocal2); - if (inside2) - color = lerp(color, tex7, tex7.a); - - color.a *= Alpha; - - Out.vColor = color; - return Out; -} - -technique11 PosTexTechnique11 -{ - pass Default - { - 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_MAIN(); - } - - pass AlphaBlend - { - 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_AlphaBlend(); - } - - pass TextureClamp - { - 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_Clamp(); - } - - pass Mouse_Cursor - { - 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(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Cursor(); - } - - pass Sptire_Sheet - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_UIBlend, 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_Sptire_Sheet(); - } - - pass Key_Hold_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_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); - 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_QuestType(); - } - - pass UVMult - { - 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_UVMult(); - } - - pass NineSlice - { - 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_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(); - } - pass HpBar - { - 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_HpBar(); - } - pass Magic_Meter - { - 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_Magic_Meter(); - } - - pass Magic_Icon - { - 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_Magic_Icon(); - } - - pass RemapUV - { - 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_RemapUV(); - } - - pass Revelio - { - 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_Revelio(); - } - - pass Potion - { - 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_Potion(); - } - - pass Magic_Item - { - 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_Magic_Item(); - } - -}