diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl new file mode 100644 index 000000000..14c08945d --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -0,0 +1,1380 @@ + +#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; +int 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(255.f, 255.f, 0.f) / 255.f; + break; + case 1: + BGColor = float3(150.f, 120.f, 240.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(24.f, 190.f, 255.f) / 255.f; + break; + case 4: + BGColor = float3(200.f, 220.f, 150.f) / 255.f; + break; + case 5: + BGColor = float3(50.f, 150.f, 110.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.1f; + 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; + float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f, waveUV.y = (OverrayUV.y - waveThreshold1) / (waveThreshold2 - waveThreshold1)); + waveUV = saturate(waveUV); + float Mask = g_MaskingTexture.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) * Mask * 1.f; + } + } + + float waveThreshold = CoolTime + wave1; + + if (OverrayUV.y <= waveThreshold) + { + 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; +} + +PS_OUT PS_Spell_Preview(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(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + float4 tex3 = g_Texture2.Sample(DefaultSampler, Finaluv); + Color = tex1; + + tex3.rgb = tex2.rgb; + + Color = lerp(Color, tex3, tex3.a); + + 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 tex4 = g_Texture3.Sample(DefaultSampler, Finaluv); + if (inside1) + { + Color = lerp(Color, tex4, tex4.a); + } + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Spell_Header(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(255.f, 255.f, 0.f) / 255.f; + break; + case 1: + BGColor = float3(150.f, 120.f, 240.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(24.f, 190.f, 255.f) / 255.f; + break; + case 4: + BGColor = float3(200.f, 220.f, 150.f) / 255.f; + break; + case 5: + BGColor = float3(50.f, 150.f, 110.f) / 255.f; + break; + case 6: + BGColor = float3(0.f, 0.f, 0.f); + break; + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + Color.rgb *= BGColor; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} +PS_OUT PS_Spell_Header_Line(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(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + //Color.rgb = tex2.rgb; + + 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(); + } + + pass Spell_Preview + { + 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_Spell_Preview(); + } + + pass Spell_Header + { + 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_Spell_Header(); + } + + pass Spell_Header_Line + { + 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_Spell_Header_Line(); + } + +} diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index d45466eb1..c5685a157 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -263,21 +263,6 @@ HRESULT CLoader::Loading_For_GamePlay() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, wstrFileName, - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { - return E_FAIL; - } - - return S_OK; - - }); - Asset_FileLoad("../Bin/Resources/Textures/HUD", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) - { - - _string strFilePath = pFilePath; - _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Slot_Number.cpp b/Jusin154_Team3D/Client/Private/Slot_Number.cpp index 675349f6b..0e7a0d043 100644 --- a/Jusin154_Team3D/Client/Private/Slot_Number.cpp +++ b/Jusin154_Team3D/Client/Private/Slot_Number.cpp @@ -211,17 +211,13 @@ HRESULT CSlot_Number::Ready_Components(void* pArg) void CSlot_Number::UV() { - pUVDesc[0].fUVStart = Meter_Index(1); - pUVDesc[0].fUVEnd = Compute_UVY(1); - pUVDesc[1].fUVStart = Meter_Index(2); - pUVDesc[1].fUVEnd = Compute_UVY(2); - pUVDesc[2].fUVStart = Meter_Index(3); - pUVDesc[2].fUVEnd = Compute_UVY(3); - pUVDesc[3].fUVStart = Meter_Index(4); - pUVDesc[3].fUVEnd = Compute_UVY(4); + pUVDesc[0].fUV = Meter_Index(1); + pUVDesc[1].fUV = Meter_Index(2); + pUVDesc[2].fUV = Meter_Index(3); + pUVDesc[3].fUV = Meter_Index(4); } -_float2 CSlot_Number::Meter_Index(_uint Number) +_float4 CSlot_Number::Meter_Index(_uint Number) { m_fIamge_Size = { 320.f, 128.f }; @@ -234,29 +230,15 @@ _float2 CSlot_Number::Meter_Index(_uint Number) _uint frameX = Number % iXCount; _uint frameY = Number / iXCount; - _float2 UVStart; - UVStart.x = frameX * frameWidth / m_fIamge_Size.x; - UVStart.y = frameY * frameHeight / m_fIamge_Size.y; + _float4 UV; + UV.x = frameX * frameWidth / m_fIamge_Size.x; + UV.y = frameY * frameHeight / m_fIamge_Size.y; + UV.z = UV.x + (frameWidth / m_fIamge_Size.x); + UV.w = UV.y + (frameHeight / m_fIamge_Size.y); - return UVStart; + return UV; } -_float2 CSlot_Number::Compute_UVY(_uint Number) -{ - m_fIamge_Size = { 320.f, 128.f }; - - _float frameWidth = 64.f; - _float frameHeight = 64.f; - - // Start 구함 - _float2 UVStart = Meter_Index(Number); - - _float2 UVEnd; - UVEnd.x = UVStart.x + (frameWidth / m_fIamge_Size.x); - UVEnd.y = UVStart.y + (frameHeight / m_fIamge_Size.y); - - return UVEnd; -} CSlot_Number* CSlot_Number::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { diff --git a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp index d7335caec..d86062901 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp @@ -44,10 +44,11 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) m_fAngle = XMConvertToRadians(-135.f); m_fAlpha = 1.f; m_fAlphaTime = 1.f; + m_vUVScale.x = 1.f; m_vUVScale.y = 1.f; m_fCoolTime = 5.f; m_fSortZ = 0.01f; - m_iSkillType = ENUM_CLASS(SKILLTYPE::CONTROL); + m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); Compute_UI(5); m_bActive = true; return S_OK; @@ -55,7 +56,7 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) void CSpell_Overlay::Compute_UI(_uint SpellID) { - _float2 fImage_Size = { 1024.f, 1536.f }; + _float2 fImage_Size = { 1024.f, 1536.f}; _uint iCountX = 4; _uint iCountY = 6; @@ -154,7 +155,7 @@ HRESULT CSpell_Overlay::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELLTYPE)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::TYPE)))) { return E_FAIL; } @@ -201,6 +202,10 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pDiffuse_TextureCom3->Bind_ShaderResource(m_pShaderCom, "g_Texture3", 0))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -221,7 +226,7 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSkillType, sizeof(_float)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) { return E_FAIL; } @@ -241,6 +246,10 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDeltaU", &m_vUVScale.x, sizeof(_float)))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fDeltaV", &m_vUVScale.y, sizeof(_float)))) { return E_FAIL; @@ -274,6 +283,10 @@ HRESULT CSpell_Overlay::Ready_Components(void* pArg) { return E_FAIL; } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_tillingSmokes"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) { return E_FAIL; @@ -315,6 +328,7 @@ void CSpell_Overlay::Free() SAFE_RELEASE(m_pDiffuse_TextureCom); SAFE_RELEASE(m_pDiffuse_TextureCom1); SAFE_RELEASE(m_pDiffuse_TextureCom2); + SAFE_RELEASE(m_pDiffuse_TextureCom3); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp index cb57aa16d..6fed41de8 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp @@ -39,7 +39,7 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_fAlpha = 1.f; m_fTimeMult = 3.f; - m_fAngle = XMConvertToRadians(45); + m_fAngle = XMConvertToRadians(-135); m_fAlphaTime = 1.f; m_fOffSetX = 101.f; m_fOffSetY = 101.f; @@ -47,7 +47,6 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(380.f, -30.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 9dc3ae989..9b8ff21c8 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -13,7 +13,7 @@ namespace Client enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR, TRAIL_BLOOM, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, BLOOM, END }; - enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, SPELLTYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, END }; + enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, END }; enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, END }; diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h index fff89ab5c..5c631300c 100644 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -15,4 +15,15 @@ namespace Client vector<_wstring> pRigidBodyTags; vector LoadedRigidBody; }FOLDER_LOAD; + + typedef struct tagSpellInfo + { + _uint iSpell_ID{}; + _wstring pSpell_Name{}; + _uint iSpell_Type{}; + _uint iSpell_CoolTime{}; + _bool bSpell_Lock = false; + _bool bEquip_Spell = false; + + }SPELLINFO; }; diff --git a/Jusin154_Team3D/Client/Public/Slot_Number.h b/Jusin154_Team3D/Client/Public/Slot_Number.h index 0d30e7301..7b4ad290b 100644 --- a/Jusin154_Team3D/Client/Public/Slot_Number.h +++ b/Jusin154_Team3D/Client/Public/Slot_Number.h @@ -33,8 +33,7 @@ class CSlot_Number final : public CElementObject virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; void UV(); - _float2 Meter_Index(_uint Numver); - _float2 Compute_UVY(_uint Numver); + _float4 Meter_Index(_uint Numver); virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; diff --git a/Jusin154_Team3D/Client/Public/Spell_Overlay.h b/Jusin154_Team3D/Client/Public/Spell_Overlay.h index ae3ce440e..2b889685c 100644 --- a/Jusin154_Team3D/Client/Public/Spell_Overlay.h +++ b/Jusin154_Team3D/Client/Public/Spell_Overlay.h @@ -39,6 +39,7 @@ class CSpell_Overlay final : public CElementObject CTexture* m_pDiffuse_TextureCom = { nullptr }; CTexture* m_pDiffuse_TextureCom1 = { nullptr }; CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 70ab08713..db13bce76 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -46,12 +46,17 @@ Texture2D g_BlurWeightTexture; Texture2D g_BlurWeightXTexture; Texture2D g_SurfaceTexture; +Texture2D g_OriginalTexture; vector g_vLightDiffuse; vector g_vLightAmbient; vector g_vLightSpecular; +float g_fFogDensity; +float g_fFogPow; +vector g_vFogColor; + struct VS_IN { float3 vPosition : POSITION; @@ -776,6 +781,31 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_Y(PS_IN In) return Out; } +PS_OUT_FLT4_SINGLE PS_MAIN_FOG(PS_IN In) +{ + PS_OUT_FLT4_SINGLE Out; + + vector vColor = g_OriginalTexture.Sample(DefaultSampler, In.vTexcoord); + vector vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord); + + vector vFinalColor; + float fViewZ = vDepthDesc.y * g_fFar; + + float fRatio; + + fRatio = clamp(pow(exp(-(g_fFogDensity * fViewZ)), g_fFogPow), 0.f, 1.f); + + vFinalColor = lerp(g_vFogColor, vColor, max(fRatio, 0.2f)); + vFinalColor.a = 1.f; + + if (1.f == vDepthDesc.y) + vFinalColor = float4(g_vFogColor); + + Out.vSingleTarget = vFinalColor; + + return Out; +} + technique11 DefaultTechnique { @@ -916,4 +946,14 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN_POSTCOMBINED(); } + + pass FogPass // 14 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_FOG(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 1aee12e67..14c08945d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1,3 +1,4 @@ + #include "Engine_Shader_Defines.hlsli" matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; @@ -9,7 +10,7 @@ int g_iImageCountY; uint g_iIndexU; uint g_iIndexV; uint g_iQuestType; -uint g_iSpellType; +int g_iSpellType; float g_fPI; float g_fFar; @@ -505,22 +506,22 @@ PS_OUT PS_SpellAnim(PS_IN In) switch (g_iSpellType) { case 0: - BGColor = float3(208.f, 179.f, 54.f) / 255.f; + BGColor = float3(255.f, 255.f, 0.f) / 255.f; break; case 1: - BGColor = float3(89.f, 32.f, 215.f) / 255.f; + BGColor = float3(150.f, 120.f, 240.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; + BGColor = float3(24.f, 190.f, 255.f) / 255.f; break; case 4: - BGColor = float3(134.f, 171.f, 78.f) / 255.f; + BGColor = float3(200.f, 220.f, 150.f) / 255.f; break; case 5: - BGColor = float3(0.f, 80.f, 55.f) / 255.f; + BGColor = float3(50.f, 150.f, 110.f) / 255.f; break; case 6: BGColor = float3(0.f, 0.f, 0.f); @@ -541,11 +542,11 @@ PS_OUT PS_SpellAnim(PS_IN In) 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 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)); + 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; @@ -895,7 +896,7 @@ PS_OUT PS_Magic_Item(PS_IN In) float2 OverrayUV = In.vTexcoord; float CoolTime = 0.f + g_fDeltaV; - float CoolTime2 = 0.f + g_fDeltaV + 0.05; + float CoolTime2 = 0.f + g_fDeltaV + 0.1f; atlasUV = startUV + In.vTexcoord * (endUV - startUV); float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); tex3.rgb *= BGColor; @@ -913,16 +914,20 @@ PS_OUT PS_Magic_Item(PS_IN In) 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 Mask = g_MaskingTexture.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); + color1.rgb += float3(1.f, 1.f, 1.f) * Mask * 1.f; } } - if (OverrayUV.y <= CoolTime) + float waveThreshold = CoolTime + wave1; + + if (OverrayUV.y <= waveThreshold) { color1.a = 0.f; } @@ -961,6 +966,187 @@ PS_OUT PS_Magic_Item(PS_IN In) return Out; } +PS_OUT PS_Spell_Preview(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(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + float4 tex3 = g_Texture2.Sample(DefaultSampler, Finaluv); + Color = tex1; + + tex3.rgb = tex2.rgb; + + Color = lerp(Color, tex3, tex3.a); + + 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 tex4 = g_Texture3.Sample(DefaultSampler, Finaluv); + if (inside1) + { + Color = lerp(Color, tex4, tex4.a); + } + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Spell_Header(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(255.f, 255.f, 0.f) / 255.f; + break; + case 1: + BGColor = float3(150.f, 120.f, 240.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(24.f, 190.f, 255.f) / 255.f; + break; + case 4: + BGColor = float3(200.f, 220.f, 150.f) / 255.f; + break; + case 5: + BGColor = float3(50.f, 150.f, 110.f) / 255.f; + break; + case 6: + BGColor = float3(0.f, 0.f, 0.f); + break; + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + Color.rgb *= BGColor; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} +PS_OUT PS_Spell_Header_Line(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(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + //Color.rgb = tex2.rgb; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -1161,4 +1347,34 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Magic_Item(); } + pass Spell_Preview + { + 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_Spell_Preview(); + } + + pass Spell_Header + { + 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_Spell_Header(); + } + + pass Spell_Header_Line + { + 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_Spell_Header_Line(); + } + } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl index d6b238656..5b35a6cf9 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl @@ -4,12 +4,18 @@ matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; Texture2D g_Texture; Texture2D g_Texture1; +Texture2D g_Texture2; +Texture2D g_Texture3; +Texture2D g_Texture4; +Texture2D g_Texture5; +Texture2D g_MaskTexture; float g_fAlpha; float g_fOwnerAlpha; float g_fCanvasAlpha; float g_fAngle; float g_fFar; +float g_fTime; struct VS_IN { @@ -18,14 +24,17 @@ struct VS_IN float2 vSize : TEXCOORD1; float2 vPos : TEXCOORD2; - float2 vUVStart : TEXCOORD3; - float2 vUVEnd: TEXCOORD4; + float4 vUV : TEXCOORD3; + float4 vColor : TEXCOORD4; + float bHover : TEXCOORD5; }; struct VS_OUT { float4 vPosition : SV_POSITION; float2 vTexcoord : TEXCOORD0; + float4 vColor : TEXCOORD1; + float bHover : TEXCOORD2; }; VS_OUT VS_MAIN(VS_IN In) @@ -34,17 +43,21 @@ VS_OUT VS_MAIN(VS_IN In) matrix matVP = mul(g_ViewMatrix, g_ProjMatrix); float3 vLocalPos = In.vPosition; - vLocalPos.xy *= In.vSize; - vLocalPos.xy += In.vPos; - float2 StartUV = In.vUVStart; - float2 EndUV = In.vUVEnd; + if (In.bHover != 0) + vLocalPos.xy *= In.vSize * 1.1f; + else + vLocalPos.xy *= In.vSize; + + vLocalPos.xy += In.vPos; + float4 UV = In.vUV; float3 vParentPos = float3(g_WorldMatrix._41, g_WorldMatrix._42, g_WorldMatrix._43); float3 vFinalWorldPos = vLocalPos + vParentPos; - + Out.vPosition = mul(float4(vFinalWorldPos, 1.f), matVP); - Out.vTexcoord = StartUV + In.vTexcoord * (EndUV - StartUV); - + Out.vTexcoord = UV.xy + In.vTexcoord * (UV.zw - UV.xy); + Out.vColor = In.vColor; + Out.bHover = In.bHover; return Out; } @@ -52,6 +65,8 @@ struct PS_IN { float4 vPosition : SV_POSITION; float2 vTexcoord : TEXCOORD0; + float4 vColor : TEXCOORD1; + float bHover : TEXCOORD2; }; struct PS_OUT @@ -88,7 +103,7 @@ PS_OUT PS_Alpha_Blend(PS_IN In) float4 color = g_Texture.Sample(ClampSampler, In.vTexcoord); - if(color.a <= 0.4f) + if (color.a <= 0.4f) discard; color.a *= Alpha; @@ -124,6 +139,172 @@ PS_OUT PS_Megic_Meter(PS_IN In) return Out; } +PS_OUT PS_Spell_List(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); + + color = tex1; + tex2.rgb *= Blue * 1.5f; + + if (all(color.rgb >= float3(65.f / 255.f, 65.f / 255.f, 65.f / 255.f))) + color = tex2; + + //if(color.a <= 0.4f) + // discard; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Eessential_Spell_Slot(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(ClampSampler, In.vTexcoord); + float4 tex2 = g_Texture1.Sample(ClampSampler, In.vTexcoord); + + color = tex1; + + color = lerp(tex1, tex2, tex2.a); + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Eessential_Spell(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(ClampSampler, In.vTexcoord); + + color = tex1; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Color_Image(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(ClampSampler, In.vTexcoord); + color = tex1; + color *= In.vColor; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Spell_Hover(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float3 HoverOff = g_Texture2.Sample(DefaultSampler, In.vTexcoord).rgb; + float3 HoverOn = g_Texture3.Sample(DefaultSampler, In.vTexcoord).rgb; + + float4 color = float4(1.f, 1.f, 1.f, 1.f); + + if (In.bHover != 0) + { + float tex1 = g_Texture5.Sample(DefaultSampler, In.vTexcoord).r; + color.r *= tex1.r; + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + color = lerp(tex1, tex2, tex2.a); + color.rgb = HoverOn; + } + else + { + float tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord).r; + color.r *= tex1.r; + float4 tex2 = g_Texture4.Sample(DefaultSampler, In.vTexcoord); + color = lerp(tex1, tex2, tex2.a); + color.rgb = HoverOff; + color.a *= 0.5f; + } + + + color *= In.vColor; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Spell_Effect(PS_IN In) +{ + PS_OUT Out; + + if (In.bHover == 0) + discard; + + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 color = float4(1.f, 1.f, 1.f, 1.f); + float2 maskUV = In.vTexcoord + g_fTime * float2(0.2f, 0.0f); + + //float2 center = float2(0.5, 0.5); + //float2 uv = In.vTexcoord - center; + //float angle = -g_fTime; + //float s = sin(angle); + //float c = cos(angle); + //float2 rotUV = float2( + //uv.x * c - uv.y * s, + //uv.x * s + uv.y * c + //) + center; + + //float2 maskUV = In.vTexcoord; + + //maskUV.x += g_fTime * float2(0.05, 0.02); // 속도 조절 가능 + + //float2 center = float2(0.5, 0.0); + //float2 uv = In.vTexcoord - center; + + //float scale = 0.5 + sin(g_fTime * 20) * 0.5; + //uv.x *= scale; + + //uv += center; + + float tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord).r; + float mask = g_MaskTexture.Sample(DefaultSampler, maskUV).r; + + color.a *= tex1; + color.a *= mask; + color.a *= Alpha; + + color *= In.vColor; + + Out.vColor = color; + + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -158,4 +339,70 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Megic_Meter(); } + + pass Spell_List + { + 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_Spell_List(); + } + + pass Eessential_Spell_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_Eessential_Spell_Slot(); + } + + pass Eessential_Spell + { + 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_Eessential_Spell(); + } + + pass Color_Image + { + 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_Color_Image(); + } + + pass Spell_Hover + { + 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_Spell_Hover(); + } + + pass Spell_Effect + { + 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_Spell_Effect(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoFlyIcon.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoFlyIcon.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoFlyIcon.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoFlyIcon.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoMountIcon.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoMountIcon.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoMountIcon.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoMountIcon.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Lock.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Lock.png new file mode 100644 index 000000000..5e3716df2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Lock.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/SpellWidgetPanelBack.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/SpellWidgetPanelBack.png new file mode 100644 index 000000000..7a7da21f3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/SpellWidgetPanelBack.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png index bd3c9cea3..f8ec4801b 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_GoldLeaf.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_GoldLeaf.png new file mode 100644 index 000000000..10b0bed15 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_GoldLeaf.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Goldleaf_Large.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Goldleaf_Large.png new file mode 100644 index 000000000..d6d761b05 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Goldleaf_Large.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Header_Line.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Header_Line.png new file mode 100644 index 000000000..3d6fffb31 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Header_Line.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButton.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButton.png new file mode 100644 index 000000000..d350d3d8b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButton.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonHighlight.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonHighlight.png new file mode 100644 index 000000000..867ef1d40 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonHighlight.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonOutline.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonOutline.png new file mode 100644 index 000000000..cc1dffe78 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonOutline.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_LighthouseHeaderBack.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_LighthouseHeaderBack.png new file mode 100644 index 000000000..ab94ead0f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_LighthouseHeaderBack.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png new file mode 100644 index 000000000..18e940838 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderMask.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderMask.png new file mode 100644 index 000000000..833a8ab61 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderMask.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedPresetBorder.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedPresetBorder.png new file mode 100644 index 000000000..a75f3ae17 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedPresetBorder.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_Generic.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SpellType_Generic.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_Generic.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SpellType_Generic.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentTree_TreeBack.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentTree_TreeBack.png new file mode 100644 index 000000000..fa79e0ed1 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentTree_TreeBack.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentVideoBorder.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentVideoBorder.png new file mode 100644 index 000000000..b12972394 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentVideoBorder.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TooltipBorder_4K.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TooltipBorder_4K.png new file mode 100644 index 000000000..8310c6dd5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TooltipBorder_4K.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Crucio_Decal_Emiss_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Crucio_Decal_Emiss_D.png new file mode 100644 index 000000000..3f857f63b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Crucio_Decal_Emiss_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Cursed_X_Outer_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Cursed_X_Outer_D.png new file mode 100644 index 000000000..f667ecabd Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Cursed_X_Outer_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_FlameTileGrey_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_FlameTileGrey_D.png new file mode 100644 index 000000000..b1a59d625 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_FlameTileGrey_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flare02_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flare02_D.png new file mode 100644 index 000000000..83ac7e0ee Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flare02_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flippendo_ScorchMark2_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flippendo_ScorchMark2_D.png new file mode 100644 index 000000000..41450a0b7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flippendo_ScorchMark2_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Inky_Smoke_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Inky_Smoke_D.png new file mode 100644 index 000000000..eebd2001f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Inky_Smoke_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Noise08_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Noise08_D.png new file mode 100644 index 000000000..7c1ae0e40 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Noise08_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Repairo_Wisp_04_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Repairo_Wisp_04_D.png new file mode 100644 index 000000000..d8ef663c4 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Repairo_Wisp_04_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_RingFlare_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_RingFlare_D.png new file mode 100644 index 000000000..5b2e570ee Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_RingFlare_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_SwirlNoise_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_SwirlNoise_01_D.png new file mode 100644 index 000000000..bf956b0cf Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_SwirlNoise_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WhispLine_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WhispLine_D.png new file mode 100644 index 000000000..47abb63ce Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WhispLine_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WindNoise_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WindNoise_D.png new file mode 100644 index 000000000..6f434b183 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WindNoise_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WispyNoise_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WispyNoise_D.png new file mode 100644 index 000000000..77c43e314 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WispyNoise_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Altas_Eessential.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Altas_Eessential.dds new file mode 100644 index 000000000..0a0543a48 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Altas_Eessential.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Atlas_Widget_Spell.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Atlas_Widget_Spell.dds new file mode 100644 index 000000000..66d912ed0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Atlas_Widget_Spell.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Conjuration.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Conjuration.png deleted file mode 100644 index e865c8647..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Conjuration.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Descendo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Descendo.png deleted file mode 100644 index 23163f45e..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Descendo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_InnerShadow.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_InnerShadow.png deleted file mode 100644 index b505584cc..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_InnerShadow.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_reparo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_reparo.png deleted file mode 100644 index 7b0f22d55..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_reparo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_Crucio.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_Crucio.png deleted file mode 100644 index 61cdd37f4..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_Crucio.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformation_4K.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformation_4K.png deleted file mode 100644 index a0bba2153..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformation_4K.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformationoverland.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformationoverland.png deleted file mode 100644 index 6c0797351..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformationoverland.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_wingardium.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_wingardium.png deleted file mode 100644 index 4196a09cf..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_wingardium.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/accio.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/accio.png deleted file mode 100644 index 2bce2fb55..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/accio.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/arrestomomentum.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/arrestomomentum.png deleted file mode 100644 index 62cb4c8a5..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/arrestomomentum.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/avadakedavra.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/avadakedavra.png deleted file mode 100644 index 1d0cb34a1..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/avadakedavra.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/confringo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/confringo.png deleted file mode 100644 index fe2968523..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/confringo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/depulso.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/depulso.png deleted file mode 100644 index ed98ea5d7..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/depulso.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/diffindo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/diffindo.png deleted file mode 100644 index 919119ab1..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/diffindo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expelliarmus.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expelliarmus.png deleted file mode 100644 index b272c4fa8..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expelliarmus.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expulso.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expulso.png deleted file mode 100644 index 91a3a6b73..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expulso.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/glacius.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/glacius.png deleted file mode 100644 index 06f10cee2..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/glacius.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/imperius.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/imperius.png deleted file mode 100644 index b4315b7a6..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/imperius.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/incendio.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/incendio.png deleted file mode 100644 index d9ce34549..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/incendio.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/levioso.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/levioso.png deleted file mode 100644 index e5b078558..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/levioso.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index fe6803c13..2066d1f43 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -208,6 +208,9 @@ + + + @@ -215,6 +218,7 @@ + @@ -252,9 +256,18 @@ + + + + + + + + + @@ -347,6 +360,9 @@ + + + @@ -355,6 +371,7 @@ + @@ -393,9 +410,18 @@ + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 0a58bca2a..c6cd1d72c 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -205,9 +205,6 @@ {3131278b-18f5-4b84-ba85-73104998e9c9} - - {9c21aba5-00c1-4b4c-8a82-dac7a156fd9b} - {680910fd-aee2-4f69-b644-12b36b0f635b} @@ -298,30 +295,6 @@ {c81350c7-0edb-4e51-babf-09bf627414f1} - - {a56502cb-b0b8-4ea7-bc5e-5482b416fef9} - - - {8a70232d-f917-4ff6-b617-302e325996ae} - - - {dac78c4e-b898-45dc-8740-794899de0c69} - - - {d5681f71-af29-4418-bf3a-a1486c6ba171} - - - {029a22c4-ab06-4db0-9527-4e3cfa1a2e0d} - - - {b017e167-f48d-4417-a924-765ab802cff5} - - - {904a7ae5-33fe-49a1-9f31-27443acc9e1a} - - - {0b8cac41-419f-48ce-87bc-805b8962b4df} - {7e8b7123-11fb-4946-99fe-3265932d0536} @@ -378,7 +351,7 @@ {8bb21e5b-933f-4930-8d49-1093e0c3ea77} - + {a54567fa-e528-4c98-a605-289d7d300029} @@ -391,6 +364,72 @@ {c7b1ffc6-548f-464c-8f19-8b6ff5913b06} + + {8d15e456-f0d7-45b6-b725-7f1a8c0f6b0f} + + + {bae34bc2-3b69-40c0-8c9a-278dba07c8aa} + + + {1700ba11-4e28-4934-b757-bfed96b74503} + + + {da710064-ef45-41e1-8fc5-1fc544cb4cb8} + + + {78ffbbbe-930a-4770-93fc-ec46f7ff2c8d} + + + {d5815cd9-96d2-4364-b0d6-be0bb10b02db} + + + {62f1bdfb-9162-434a-a462-b63f5e763277} + + + {9c21aba5-00c1-4b4c-8a82-dac7a156fd9b} + + + {a56502cb-b0b8-4ea7-bc5e-5482b416fef9} + + + {8a70232d-f917-4ff6-b617-302e325996ae} + + + {dac78c4e-b898-45dc-8740-794899de0c69} + + + {d5681f71-af29-4418-bf3a-a1486c6ba171} + + + {029a22c4-ab06-4db0-9527-4e3cfa1a2e0d} + + + {b017e167-f48d-4417-a924-765ab802cff5} + + + {904a7ae5-33fe-49a1-9f31-27443acc9e1a} + + + {0b8cac41-419f-48ce-87bc-805b8962b4df} + + + {99125f58-acb9-4e9c-af15-87bf4e09c9b1} + + + {261e2297-e48d-4e42-b57e-12b0c0e633a3} + + + {754c2260-5073-4489-9fa8-0df8da6d0255} + + + {9d80f32a-aaca-490e-babf-3a7fe4cc0600} + + + {cf446efa-94e5-4fd2-83e1-dba2149eddc8} + + + {99652c97-4011-4d1f-84fb-7e6aa9f6ec1a} + @@ -749,7 +788,7 @@ 02.GameObjects\Layer_Effect\Effect\08.Protego - + 50.UI\GamePlay_Canvas\Mission_Panel\MissionBanner_Border @@ -762,6 +801,45 @@ 50.UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell_Slot + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List_Image + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_State + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hober + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hover_Effect + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header_Line + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Vidio_Border + + + 03.GameTime + + + 02.GameObjects\Env\03.MapElement\Light + @@ -1119,7 +1197,7 @@ 02.GameObjects\Layer_Effect\Effect\08.Protego - + 50.UI\GamePlay_Canvas\Mission_Panel\MissionBanner_Border @@ -1132,6 +1210,45 @@ 50.UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell_Slot + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List_Image + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_State + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hober + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hover_Effect + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header_Line + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Vidio_Border + + + 03.GameTime + + + 02.GameObjects\Env\03.MapElement\Light + diff --git a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp index 5e22856f8..ceee66aaa 100644 --- a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp @@ -39,15 +39,14 @@ HRESULT CCurrent_Spell_Slot::Initialize(void* pArg) m_fAlpha = 1.f; m_fTimeMult = 3.f; - m_fAngle = XMConvertToRadians(45); + m_fAngle = XMConvertToRadians(-135); m_fAlphaTime = 1.f; m_fOffSetX = 105.f; m_fOffSetY = 150.f; m_iCols = 4; m_pVIBufferCom->Set_Cloned(true); - m_pVIBufferCom->Set_Pos(-780.f, -110.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Pos(-780.f, 340.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); return S_OK; } @@ -113,7 +112,7 @@ HRESULT CCurrent_Spell_Slot::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::DEFAULT)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Eessential_Spell.cpp b/Jusin154_Team3D/Editor/Private/Eessential_Spell.cpp new file mode 100644 index 000000000..ab66cc828 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Eessential_Spell.cpp @@ -0,0 +1,283 @@ +#include "pch.h" +#include "Eessential_Spell.h" +#include "GameInstance.h" + +CEessential_Spell::CEessential_Spell(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CEessential_Spell::CEessential_Spell(const CEessential_Spell& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CEessential_Spell::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEessential_Spell::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 40.f; + Desc.fSizeY = 40.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 80.f; + m_fOffSetY = 80.f; + m_iCols = 4; + UV(); + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-731.f, -300.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(pUVDesc); + return S_OK; +} + +void CEessential_Spell::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CEessential_Spell::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CEessential_Spell::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CEessential_Spell::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::EESSENTIAL_SPELL)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CEessential_Spell::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CEessential_Spell::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CEessential_Spell::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CEessential_Spell::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CEessential_Spell::UV() +{ + for (_uint i = 0; i < 8; ++i) + { + pUVDesc[i].fUV = Meter_Index(i); + } +} + +_float4 CEessential_Spell::Meter_Index(_uint Number) +{ + _float2 fImage_Size = _float2{ 512.f, 256.f}; + + _uint iXCount = 4; + _uint iYCount = 2; + + _float frameWidth = 128.f; + _float frameHeight = 128.f; + + _uint frameX = Number % iXCount; + _uint frameY = Number / iXCount; + + _float4 UV{}; + UV.x = frameX * frameWidth / fImage_Size.x; + UV.y = frameY * frameHeight / fImage_Size.y; + UV.z = UV.x + (frameWidth / fImage_Size.x); + UV.w = UV.y + (frameHeight / fImage_Size.y); + + return UV; +} + +HRESULT CEessential_Spell::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CEessential_Spell::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Altas_Eessential"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CEessential_Spell* CEessential_Spell::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CEessential_Spell* pInstance = new CEessential_Spell(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CEessential_Spell"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CEessential_Spell::Clone(void* pArg, CGameObject* pOwner) +{ + CEessential_Spell* pInstance = new CEessential_Spell(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CEessential_Spell"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CEessential_Spell::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CEessential_Spell::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp new file mode 100644 index 000000000..923cc1afb --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp @@ -0,0 +1,278 @@ +#include "pch.h" +#include "Eessential_Spell_Slot.h" +#include "GameInstance.h" + +CEessential_Spell_Slot::CEessential_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CEessential_Spell_Slot::CEessential_Spell_Slot(const CEessential_Spell_Slot& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CEessential_Spell_Slot::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEessential_Spell_Slot::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 65.f; + Desc.fSizeY = 65.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 80.f; + m_fOffSetY = 80.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos( -731.f, -300.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + return S_OK; +} + +void CEessential_Spell_Slot::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CEessential_Spell_Slot::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + m_fTime += fTimeDelta * m_fTimeMult; + Hover(); + __super::Update(fTimeDelta); +} + +void CEessential_Spell_Slot::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CEessential_Spell_Slot::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::EESSENTIAL_SPELL_SOLT)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CEessential_Spell_Slot::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CEessential_Spell_Slot::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CEessential_Spell_Slot::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CEessential_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CEessential_Spell_Slot::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_pVIBufferCom->Set_Mouse_Hover(fMouse); + +} + +HRESULT CEessential_Spell_Slot::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CEessential_Spell_Slot::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell_Slot"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemBG"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionDiamondTriggerBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CEessential_Spell_Slot* CEessential_Spell_Slot::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CEessential_Spell_Slot* pInstance = new CEessential_Spell_Slot(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CEessential_Spell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CEessential_Spell_Slot::Clone(void* pArg, CGameObject* pOwner) +{ + CEessential_Spell_Slot* pInstance = new CEessential_Spell_Slot(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CEessential_Spell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CEessential_Spell_Slot::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CEessential_Spell_Slot::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/GameTime.cpp b/Jusin154_Team3D/Editor/Private/GameTime.cpp new file mode 100644 index 000000000..fb874c02b --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/GameTime.cpp @@ -0,0 +1,47 @@ +#include "pch.h" +#include "GameTime.h" +#include "GameInstance.h" + +CGameTime::CGameTime() + : m_pGameInstance(CGameInstance::GetInstance()) +{ + SAFE_ADDREF(m_pGameInstance); +} + +HRESULT CGameTime::Initialize() +{ + return S_OK; +} + +void CGameTime::Update_GameTime(_float fTiemDelta) +{ + m_fGameTime += fTiemDelta; + m_fDayTime += fTiemDelta; + + if (SECONDS_PER_GAME_DAY <= m_fDayTime) + { + m_fDayTime = 0.f; + } + + +} + +CGameTime* CGameTime::Create() +{ + CGameTime* pInstance = new CGameTime(); + + if (FAILED(pInstance->Initialize())) + { + MSG_BOX("Failed to Created : CGameTime"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CGameTime::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pGameInstance); +} diff --git a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp index 42977a5f6..e25650f18 100644 --- a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp +++ b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp @@ -153,7 +153,7 @@ void CIMGUIUI::Update(_float fTimeDelta) m_fLerpY = static_cast(m_pElementObject)->Get_Lerp_Pos().m128_f32[1]; m_fMoveSpeed = static_cast(m_pElementObject)->Get_Speed(); m_fAngle = static_cast(m_pElementObject)->Get_Angle(); - m_iSkillType = static_cast(m_pElementObject)->Get_SkillType(); + m_iSpellType = static_cast(m_pElementObject)->Get_SkillType(); m_fCoolTime = static_cast(m_pElementObject)->Get_CoolTime(); } GUI::Begin("Current_PanelObject_Info"); @@ -436,10 +436,10 @@ void CIMGUIUI::Update(_float fTimeDelta) static_cast(m_pElementObject)->Set_Angle(m_fAngle); } - GUI::Text("SkillType %d", m_iSkillType); - if (GUI::Combo("SkillType", &m_iSkillType, SpellTypeNames, itemCount)) + GUI::Text("SkillType %d", m_iSpellType); + if (GUI::Combo("SkillType", &m_iSpellType, SpellTypeNames, itemCount)) { - static_cast(m_pElementObject)->Set_SkillType(m_iSkillType); + static_cast(m_pElementObject)->Set_SkillType(m_iSpellType); } GUI::Text("CoolTime %.1f", m_fCoolTime); diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 38d2e4c5b..2eb0d395a 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -66,6 +66,17 @@ #include "Spell_Canvas.h" #include "Spell_Panel.h" #include "Current_Spell_Slot.h" +#include "Spell_List.h" +#include "Eessential_Spell_Slot.h" +#include "Eessential_Spell.h" +#include "Spell_List_Image.h" +#include "Spell_State.h" +#include "Spell_Hover.h" +#include "Spell_Hover_Effect.h" +#include "Spell_Preview.h" +#include "Spell_Header.h" +#include "Spell_Header_Line.h" +#include "Spell_Vidio_Border.h" #include "IMGUIUI.h" @@ -82,6 +93,7 @@ #include "MapObject_Manager.h" #include "MapElement_Interactable.h" #include "MapElement_Static.h" +#include "MapElement_Light.h" #include "Land.h" #include "Collider.h" #include "VIBuffer_Model_Instance.h" @@ -386,22 +398,6 @@ HRESULT CLoader::Loading_For_UI() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { - return E_FAIL; - } - - return S_OK; - - }); - - Asset_FileLoad("../Bin/Resources/Textures/HUD", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) - { - - _string strFilePath = pFilePath; - _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; @@ -482,6 +478,22 @@ HRESULT CLoader::Loading_For_UI() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/GadgetWheel", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) + { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; @@ -516,6 +528,42 @@ HRESULT CLoader::Loading_For_UI() return E_FAIL; } + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Spell_List{}; + + Spell_List.iNum = 26; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Spell_List)))) { + return E_FAIL; + } + + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Eessential_Spell_Slot{}; + + Eessential_Spell_Slot.iNum = 8; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell_Slot"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Eessential_Spell_Slot)))) { + return E_FAIL; + } + + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Eessential_Spell{}; + + Eessential_Spell.iNum = 8; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Eessential_Spell)))) { + return E_FAIL; + } + + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Spell_List_Image{}; + + Spell_List_Image.iNum = 26; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List_Image"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Spell_List_Image)))) { + return E_FAIL; + } + CVIBuffer_UI_Instance::UI_INSTANCE_DESC SlotNumberUIDesc{}; SlotNumberUIDesc.iNum = 4; @@ -667,6 +715,50 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_List::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CEessential_Spell_Slot::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CEessential_Spell::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_List_Image::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_State::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Hover::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Hover_Effect::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Preview::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Header::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Header_Line::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Vidio_Border::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CIMGUIUI::Create(m_pDevice, m_pContext)))) { @@ -1969,320 +2061,325 @@ HRESULT CLoader::Loading_For_MapViewer() //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", // ".bin", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; + + /* Light */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\LightPosts", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; #pragma endregion #ifdef gimch -vector> jobFutures; +//vector> jobFutures; +// +//_uint iLoadCount = 46; +//vector*> Contents(iLoadCount); -_uint iLoadCount = 46; -vector*> Contents(iLoadCount); - -{ - { /* Terrain */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* TScrolls */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Collisions", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* 3BroomStick*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* Ollivanders*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* Gatehouse*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Gatehouse\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_QuidditchShop */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_HogsheadInn */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Honeydukes */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_OwlPost */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_TeaShop */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Zonkos */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_DB_GR */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Potions */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Collisions", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Salon */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* Hengist_Tree */ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Vegetation\\Hengist_Tree", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Vegetation", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN A*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN B*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN C*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN E*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN F*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN G*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN H*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN J*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } -} - - for (auto& jobFuture : jobFutures) - { - jobFuture.get(); - } - - for (_uint i = 0; i < Contents.size(); ++i) { - for (_uint j = 0; j < (Contents[i])->size(); ++j) { - FOLDER_LOAD* pContents = (*Contents[i])[j]; - if (true == pContents->bLoadTags) { - ModelPrototypeTags.push_back(pContents->pModelTag); - ModelPrototypePath.push_back(pContents->pathModel); - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { - return E_FAIL; - } - - for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { - return E_FAIL; - } - } - - } - } +//{ +// { /* Terrain */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* TScrolls */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Collisions", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* 3BroomStick*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* Ollivanders*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* Gatehouse*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Gatehouse\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_QuidditchShop */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_HogsheadInn */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Honeydukes */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_OwlPost */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_TeaShop */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Zonkos */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_DB_GR */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Potions */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Collisions", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Salon */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* Hengist_Tree */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Vegetation\\Hengist_Tree", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Vegetation", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN A*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN B*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN C*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN E*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN F*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN G*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN H*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN J*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +//} +// +// for (auto& jobFuture : jobFutures) +// { +// jobFuture.get(); +// } +// +// for (_uint i = 0; i < Contents.size(); ++i) { +// for (_uint j = 0; j < (Contents[i])->size(); ++j) { +// FOLDER_LOAD* pContents = (*Contents[i])[j]; +// if (true == pContents->bLoadTags) { +// ModelPrototypeTags.push_back(pContents->pModelTag); +// ModelPrototypePath.push_back(pContents->pathModel); +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { +// return E_FAIL; +// } +// +// for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { +// return E_FAIL; +// } +// } +// +// } +// } m_strMessage = TEXT("쉐이더를(을) 로딩 중 입니다."); @@ -2374,6 +2471,10 @@ vector*> Contents(iLoadCount); if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMapElement_Static::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_MapElement_Light */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMapElement_Light::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Terrain */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTerrain::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -2393,12 +2494,12 @@ vector*> Contents(iLoadCount); m_isFinished = true; - for (_uint i = 0; i < Contents.size(); ++i) { + /*for (_uint i = 0; i < Contents.size(); ++i) { for (_uint j = 0; j < (Contents[i])->size(); ++j) { Safe_Delete((*Contents[i])[j]); } Safe_Delete(Contents[i]); - } + }*/ #endif return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Magic_Item.cpp b/Jusin154_Team3D/Editor/Private/Magic_Item.cpp index b2a9664e9..beefb262a 100644 --- a/Jusin154_Team3D/Editor/Private/Magic_Item.cpp +++ b/Jusin154_Team3D/Editor/Private/Magic_Item.cpp @@ -219,6 +219,10 @@ HRESULT CMagic_Item::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pDiffuse_TextureCom6->Bind_ShaderResource(m_pShaderCom, "g_MaskingTexture", 0))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -316,6 +320,10 @@ HRESULT CMagic_Item::Ready_Components(void* pArg) { return E_FAIL; } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_tillingSmokes"), reinterpret_cast(&m_pDiffuse_TextureCom6), nullptr))) + { + return E_FAIL; + } if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) { return E_FAIL; @@ -360,6 +368,7 @@ void CMagic_Item::Free() SAFE_RELEASE(m_pDiffuse_TextureCom3); SAFE_RELEASE(m_pDiffuse_TextureCom4); SAFE_RELEASE(m_pDiffuse_TextureCom5); + SAFE_RELEASE(m_pDiffuse_TextureCom6); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/MainLight.cpp b/Jusin154_Team3D/Editor/Private/MainLight.cpp index a950ae69a..6e1ef1be7 100644 --- a/Jusin154_Team3D/Editor/Private/MainLight.cpp +++ b/Jusin154_Team3D/Editor/Private/MainLight.cpp @@ -3,6 +3,7 @@ #include "GameInstance.h" #include "Camera_Debug.h" +#include "GameTime.h" CMainLight::CMainLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CGameObject(pDevice, pContext) @@ -30,17 +31,84 @@ HRESULT CMainLight::Initialize(void* pArg) m_pTransformCom->Set_State(STATE::LOOK, XMVectorSet(1.f, -1.f, 1.f, 0.f)); + m_pGameTime = CGameTime::Create(); + + // --- m_Diffuse_Colors 초기화 (주요 색상) --- + m_Diffuse_Colors[ENUM_CLASS(DAY_PHASE::DAWN)] = { 0.8f, 0.6f, 0.4f, 1.0f }; // 따뜻한 새벽 햇살 + m_Diffuse_Colors[ENUM_CLASS(DAY_PHASE::DAY)] = { 1.0f, 1.0f, 1.0f, 1.0f }; // 순백색 주광 + m_Diffuse_Colors[ENUM_CLASS(DAY_PHASE::DUSK)] = { 0.9f, 0.4f, 0.2f, 1.0f }; // 붉은 석양 + m_Diffuse_Colors[ENUM_CLASS(DAY_PHASE::NIGHT)] = { 0.2f, 0.2f, 0.4f, 1.0f }; // 푸른 달빛 + + // --- m_Ambient_Colors 초기화 (그림자 및 전체적인 밝기) --- + m_Ambient_Colors[ENUM_CLASS(DAY_PHASE::DAWN)] = { 0.3f, 0.3f, 0.4f, 1.0f }; // 그림자도 약간 푸른빛 + m_Ambient_Colors[ENUM_CLASS(DAY_PHASE::DAY)] = { 0.4f, 0.4f, 0.4f, 1.0f }; // 밝은 환경광 + m_Ambient_Colors[ENUM_CLASS(DAY_PHASE::DUSK)] = { 0.2f, 0.2f, 0.3f, 1.0f }; // 환경광 감소 + m_Ambient_Colors[ENUM_CLASS(DAY_PHASE::NIGHT)] = { 0.1f, 0.1f, 0.2f, 1.0f }; // 최소한의 어두운 환경광 + + // --- m_Specular_Colors 초기화 (반짝이는 하이라이트) --- + m_Specular_Colors[ENUM_CLASS(DAY_PHASE::DAWN)] = { 0.7f, 0.7f, 0.7f, 1.0f }; + m_Specular_Colors[ENUM_CLASS(DAY_PHASE::DAY)] = { 1.0f, 1.0f, 1.0f, 1.0f }; // 가장 선명한 반사 + m_Specular_Colors[ENUM_CLASS(DAY_PHASE::DUSK)] = { 0.8f, 0.6f, 0.4f, 1.0f }; // 석양 색이 입혀진 반사 + m_Specular_Colors[ENUM_CLASS(DAY_PHASE::NIGHT)] = { 0.3f, 0.3f, 0.5f, 1.0f }; + + if (nullptr == m_pGameTime) + return E_FAIL; + return S_OK; } void CMainLight::Priority_Update(_float fTimeDelta) { - + m_pGameTime->Update_GameTime(fTimeDelta); } void CMainLight::Update(_float fTimeDelta) { + _float fProgress = m_pGameTime->Get_DayTime() / SECONDS_PER_GAME_DAY; + _float fStartProgress = {}; + + if (0.25f > fProgress) + { + m_eCurPhase = DAY_PHASE::DAWN; + m_eNextPhase = DAY_PHASE::DAY; + fStartProgress = 0.f; + } + else if (0.25f <= fProgress && 0.5f > fProgress) + { + m_eCurPhase = DAY_PHASE::DAY; + m_eNextPhase = DAY_PHASE::DUSK; + fStartProgress = 0.25f; + } + else if (0.5f <= fProgress && 0.75f > fProgress) + { + m_eCurPhase = DAY_PHASE::DUSK; + m_eNextPhase = DAY_PHASE::NIGHT; + fStartProgress = 0.5f; + } + else if (0.75f <= fProgress) + { + m_eCurPhase = DAY_PHASE::NIGHT; + m_eNextPhase = DAY_PHASE::DAWN; + fStartProgress = 0.75f; + } + _float fRatio = (fProgress - fStartProgress) / 0.25f; + + XMStoreFloat4(&m_vCurDiffuse, XMVectorLerp( + XMLoadFloat4(&m_Diffuse_Colors[ENUM_CLASS(m_eCurPhase)]), + XMLoadFloat4(&m_Diffuse_Colors[ENUM_CLASS(m_eNextPhase)]), fRatio)); + + XMStoreFloat4(&m_vAmbient, XMVectorLerp( + XMLoadFloat4(&m_Ambient_Colors[ENUM_CLASS(m_eCurPhase)]), + XMLoadFloat4(&m_Ambient_Colors[ENUM_CLASS(m_eNextPhase)]), fRatio)); + + XMStoreFloat4(&m_vSpecular, XMVectorLerp( + XMLoadFloat4(&m_Specular_Colors[ENUM_CLASS(m_eCurPhase)]), + XMLoadFloat4(&m_Specular_Colors[ENUM_CLASS(m_eNextPhase)]), fRatio)); + + m_pLightCom->Set_Color(m_vCurDiffuse, m_vAmbient, m_vSpecular); + + //m_pLightCom->Describe_Entity(); } void CMainLight::Late_Update(_float fTimeDelta) @@ -116,7 +184,8 @@ void CMainLight::Free() { __super::Free(); - Safe_Release(m_pLightCom); + SAFE_RELEASE(m_pLightCom); + SAFE_RELEASE(m_pGameTime); } void CMainLight::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/MapElement_Light.cpp b/Jusin154_Team3D/Editor/Private/MapElement_Light.cpp new file mode 100644 index 000000000..504db6bd8 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/MapElement_Light.cpp @@ -0,0 +1,263 @@ +#include "pch.h" +#include "MapElement_Light.h" + +#include "GameInstance.h" + +#include "Terrain.h" +#include "Layer.h" +#include "VIBuffer_Terrain.h" + +CMapElement_Light::CMapElement_Light(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CMapElement{ pDevice, pContext } +{ +} + +CMapElement_Light::CMapElement_Light(const CMapElement_Light& rhs) + : CMapElement(rhs) +{ +} + +HRESULT CMapElement_Light::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMapElement_Light::Initialize(void* pArg) +{ + MAPOBJECT_LOD_DESC* pDesc = static_cast(pArg); + + m_iMaxLodLevel = pDesc->iMaxLodLevel; + + for (_uint i = 0; i < m_iMaxLodLevel + 1; i++) + { + m_ModelPrototypeTags.push_back(pDesc->ModelPrototypeTags[i]); + //m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[i]); + } + + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + +#ifdef _DEBUG + m_bSelected = false; + m_vPosition = pDesc->vPosition; + m_vScale = pDesc->vScale; + m_vRotation = pDesc->vRotation; + + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); + m_pTransformCom->Set_Scale(m_vScale); + m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); +#endif // _DEBUG + + return S_OK; +} + +void CMapElement_Light::Priority_Update(_float fTimeDelta) +{ +#ifdef _DEBUG + m_bSelected = false; +#endif +} + +void CMapElement_Light::Update(_float fTimeDelta) +{ + m_pLightCom->Describe_Entity(); +} + +void CMapElement_Light::Late_Update(_float fTimeDelta) +{ +#ifdef _DEBUG + if (m_bSelected) + { + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); + m_pTransformCom->Set_Scale(m_vScale); + m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); + } +#endif + + if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + } +} + +HRESULT CMapElement_Light::Render() +{ + if (FAILED(Bind_ShaderResources())) + return E_FAIL; + + _uint iNumMeshes = m_pModelComs[m_iLodIndex]->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelComs[0]->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + if (m_bSelected) + { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::MAPTOOL)))) { + return E_FAIL; + } + } + else + { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + return E_FAIL; + } + } + + if (FAILED(m_pModelComs[m_iLodIndex]->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CMapElement_Light::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + for (_uint i = 0; i < m_iMaxLodLevel + 1; ++i) + { + CModel* pModel = { nullptr }; + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_ModelPrototypeTags[i], + reinterpret_cast(&pModel)))) + return E_FAIL; + + m_pModelComs.push_back(pModel); + } + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + LIGHT_DESC LightDesc{}; + + LightDesc.eType = LIGHT::POINT; + LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); + LightDesc.vAmbient = _float4(0.8f, 0.8f, 0.8f, 0.f); + LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); + LightDesc.fRange = 5.f; + LightDesc.iLevel = NEXT_LEVEL; + + /* Com_Light*/ + if (FAILED(Add_Component(g_iStaticLevel, &m_pLightCom, &LightDesc))) + { + return E_FAIL; + } + + + + return S_OK; +} + +HRESULT CMapElement_Light::Bind_ShaderResources() +{ + if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + + return S_OK; +} + +CMapElement_Light* CMapElement_Light::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMapElement_Light* pInstance = new CMapElement_Light(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMapElement_Light"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CMapElement_Light::Clone(void* pArg, CGameObject* pOwner) +{ + CMapElement_Light* pInstance = new CMapElement_Light(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMapElement_Light"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMapElement_Light::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pLightCom); + + SAFE_RELEASE(m_pShaderCom); + for (auto& pModel : m_pModelComs) + SAFE_RELEASE(pModel); +} + +void CMapElement_Light::Describe_Entity() +{ + if (m_bDead) + return; + if (nullptr == m_pGameInstance) + return; + + GUI::Text(CMyTools::ToString(m_ModelPrototypeTags[m_iLodIndex]).c_str()); + GUI::InputInt("Lod Level", (_int*)(&m_iLodIndex)); + m_iLodIndex = max(0, m_iLodIndex); + m_iLodIndex = min(m_iMaxLodLevel, m_iLodIndex); + GUI::Text("----- Transfrom ----"); + GUI::InputFloat("X##Position", &m_vPosition.x, 0.1f, 1.f); + GUI::InputFloat("Y##Position", &m_vPosition.y, 0.1f, 1.f); + GUI::InputFloat("Z##Position", &m_vPosition.z, 0.1f, 1.f); + + if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT)) + { + CTerrain* pTerrain = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Terrain"))->Get_Object(); + if (nullptr != pTerrain) + { + pTerrain->Get_Component()->Picking(pTerrain->Get_Component()->Get_XMWorldMatrix(), &m_vPosition); + } + + } + + GUI::Text("----- Rotation ----"); + GUI::InputFloat("X##Rotation", &m_vRotation.x, 10.f, 45.f); + GUI::InputFloat("Y##Rotation", &m_vRotation.y, 10.f, 45.f); + GUI::InputFloat("Z##Rotation", &m_vRotation.z, 10.f, 45.f); + + GUI::Text("----- Scale ----"); + GUI::InputFloat("X##Scale", &m_vScale.x, 0.1f, 1.f); + GUI::InputFloat("Y##Scale", &m_vScale.y, 0.1f, 1.f); + GUI::InputFloat("Z##Scale", &m_vScale.z, 0.1f, 1.f); + + m_vScale.x = max(0.01f, m_vScale.x); + m_vScale.y = max(0.01f, m_vScale.y); + m_vScale.z = max(0.01f, m_vScale.z); + + if (GUI::Button("Delete")) + m_bDead = true; + + + + m_bSelected = true; +} diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp index 9b53b0049..476220b99 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp @@ -10,6 +10,7 @@ #include "BuildingContainer.h" #include "MapElement_Static.h" #include "MapElement_Interactable.h" +#include "MapElement_Light.h" CMapObject_Manager::CMapObject_Manager(ID3D11Device * pDevice, ID3D11DeviceContext * pContext) @@ -28,7 +29,7 @@ CMapObject_Manager::CMapObject_Manager(const CMapObject_Manager& rhs) HRESULT CMapObject_Manager::Initialize_Prototype(vector<_wstring>& ModelPrototypeTags, vector& ModelPrototypePaths) { - /*for (_uint i = 0 ; i < ModelPrototypeTags.size(); ++i) + for (_uint i = 0 ; i < ModelPrototypeTags.size(); ++i) { if (_wstring::npos != ModelPrototypeTags[i].find(L"Lod")) { @@ -41,7 +42,7 @@ HRESULT CMapObject_Manager::Initialize_Prototype(vector<_wstring>& ModelPrototyp m_ModelPrototypeTags.push_back(ModelPrototypeTags[i]); m_ModelPrototypePaths.push_back(ModelPrototypePaths[i]); - }*/ + } return S_OK; } @@ -75,11 +76,12 @@ void CMapObject_Manager::Priority_Update(_float fTimeDelta) void CMapObject_Manager::Update(_float fTimeDelta) { GUI::Begin("File"); - const char* ModeNames[3] = + const char* ModeNames[4] = { "CONTAINER", "ELEMENT_STATIC", - "ELEMENT_INTERACT" + "ELEMENT_INTERACT", + "ELEMENT_LIGHT" }; GUI::Combo("MODE", (_int*)(&m_eType), ModeNames, IM_ARRAYSIZE(ModeNames)); GUI::Checkbox("Model View", &m_bModelVisable); @@ -1156,23 +1158,10 @@ void CMapObject_Manager::Update_PrototypeList() if (ImGui::Button(CMyTools::ToString(Tag).c_str())) { - switch (m_eType) - { - case Editor::CMapObject_Manager::ADD_TYPE::CONTAINER: + if (ADD_TYPE::CONTAINER == m_eType) Create_PartObject(Tag); - break; - - case Editor::CMapObject_Manager::ADD_TYPE::ELEMENT_STATIC: - Create_Elemnt_Static(Tag); - break; - - case Editor::CMapObject_Manager::ADD_TYPE::ELEMENT_INTERACT: - Create_Elemnt_Interact(Tag); - break; - default: - break; - } - + else + Create_Elemnt(Tag); } } GUI::End(); @@ -1291,6 +1280,8 @@ void CMapObject_Manager::Update_ObjectList() pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Element_Static")); else if (ADD_TYPE::ELEMENT_INTERACT == m_eType) pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Element_Interact")); + else if (ADD_TYPE::ELEMENT_LIGHT == m_eType) + pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Element_Light")); if (nullptr == pLayer) { @@ -1440,13 +1431,12 @@ void CMapObject_Manager::Create_PartObject(_wstring& strPrototypeTag) m_MapObjects.push_back(pMapObject); } -void CMapObject_Manager::Create_Elemnt_Static(_wstring& strPrototypeTag) +void CMapObject_Manager::Create_Elemnt(_wstring& strPrototypeTag) { - vector<_uint> LodModelIndices; - MAPOBJECT_LOD_DESC Desc = {}; vector<_wstring> PrototypeTags; + vector<_uint> LodModelIndices; Find_Lod_Prototype(strPrototypeTag, LodModelIndices); @@ -1466,42 +1456,19 @@ void CMapObject_Manager::Create_Elemnt_Static(_wstring& strPrototypeTag) Desc.vScale = _float3(1.f, 1.f, 1.f); Desc.pModelPathIndices = &LodModelIndices; - CMapElement_Static* pMapObject = { nullptr }; - const string strKey = CMyTools::ToString(strPrototypeTag); - - m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Static"), &Desc); -} - -void CMapObject_Manager::Create_Elemnt_Interact(_wstring& strPrototypeTag) -{ - vector<_uint> LodModelIndices; - - MAPOBJECT_LOD_DESC Desc = {}; - - vector<_wstring> PrototypeTags; - - Find_Lod_Prototype(strPrototypeTag, LodModelIndices); - - PrototypeTags.push_back(strPrototypeTag); - - for (_uint i = 0; i < LodModelIndices.size(); ++i) + if (ADD_TYPE::ELEMENT_STATIC == m_eType) { - _wstring strLodTag = strPrototypeTag + L"_Lod" + to_wstring(i + 1); - PrototypeTags.push_back(strLodTag); + m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Static"), &Desc); } - - Desc.iMaxLodLevel = (_uint)LodModelIndices.size() - 1; - Desc.ModelPrototypeTags = PrototypeTags; - Desc.pParentTransform = m_pTransformCom; - Desc.vPosition = _float3(0.f, 0.f, 0.f); - Desc.vRotation = _float3(0.f, 0.f, 0.f); - Desc.vScale = _float3(1.f, 1.f, 1.f); - Desc.pModelPathIndices = &LodModelIndices; - - CMapElement_Interactable* pMapObject = { nullptr }; - const string strKey = CMyTools::ToString(strPrototypeTag); - - m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Interact"), &Desc); + else if (ADD_TYPE::ELEMENT_INTERACT == m_eType) + { + m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Interact"), &Desc); + } + else if (ADD_TYPE::ELEMENT_LIGHT == m_eType) + { + m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Light"), &Desc); + } + } _bool CMapObject_Manager::Find_Lod_Prototype(_wstring strPrototypeTag, vector<_uint>& LodModelIndices) @@ -1566,6 +1533,11 @@ void CMapObject_Manager::Free() { __super::Free(); + m_ModelPrototypeTags.clear(); + m_PartObjectKeyCount.clear(); + m_LODModelPrototypeTags.clear(); + m_ModelPrototypePaths.clear(); + for (auto& pObject : m_MapObjects) { SAFE_RELEASE(pObject); diff --git a/Jusin154_Team3D/Editor/Private/Slot_Number.cpp b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp index 3099589bb..11ddde33b 100644 --- a/Jusin154_Team3D/Editor/Private/Slot_Number.cpp +++ b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp @@ -210,17 +210,13 @@ HRESULT CSlot_Number::Ready_Components(void* pArg) void CSlot_Number::UV() { - pUVDesc[0].fUVStart = Meter_Index(1); - pUVDesc[0].fUVEnd = Compute_UVY(1); - pUVDesc[1].fUVStart = Meter_Index(2); - pUVDesc[1].fUVEnd = Compute_UVY(2); - pUVDesc[2].fUVStart = Meter_Index(3); - pUVDesc[2].fUVEnd = Compute_UVY(3); - pUVDesc[3].fUVStart = Meter_Index(4); - pUVDesc[3].fUVEnd = Compute_UVY(4); + pUVDesc[0].fUV = Meter_Index(1); + pUVDesc[1].fUV = Meter_Index(2); + pUVDesc[2].fUV = Meter_Index(3); + pUVDesc[3].fUV = Meter_Index(4); } -_float2 CSlot_Number::Meter_Index(_uint Number) +_float4 CSlot_Number::Meter_Index(_uint Number) { m_fIamge_Size = { 320.f, 128.f }; @@ -233,28 +229,13 @@ _float2 CSlot_Number::Meter_Index(_uint Number) _uint frameX = Number % iXCount; _uint frameY = Number / iXCount; - _float2 UVStart; - UVStart.x = frameX * frameWidth / m_fIamge_Size.x; - UVStart.y = frameY * frameHeight / m_fIamge_Size.y; + _float4 UV; + UV.x = frameX * frameWidth / m_fIamge_Size.x; + UV.y = frameY * frameHeight / m_fIamge_Size.y; + UV.z = UV.x + (frameWidth / m_fIamge_Size.x); + UV.w = UV.y + (frameHeight / m_fIamge_Size.y); - return UVStart; -} - -_float2 CSlot_Number::Compute_UVY(_uint Number) -{ - m_fIamge_Size = { 320.f, 128.f }; - - _float frameWidth = 64.f; - _float frameHeight = 64.f; - - // Start 구함 - _float2 UVStart = Meter_Index(Number); - - _float2 UVEnd; - UVEnd.x = UVStart.x + (frameWidth / m_fIamge_Size.x); - UVEnd.y = UVStart.y + (frameHeight / m_fIamge_Size.y); - - return UVEnd; + return UV; } CSlot_Number* CSlot_Number::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) diff --git a/Jusin154_Team3D/Editor/Private/Spell_Header.cpp b/Jusin154_Team3D/Editor/Private/Spell_Header.cpp new file mode 100644 index 000000000..284be9ad9 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Header.cpp @@ -0,0 +1,221 @@ +#include "pch.h" +#include "Spell_Header.h" +#include "GameInstance.h" + +CSpell_Header::CSpell_Header(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Header::CSpell_Header(const CSpell_Header& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Header::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Header::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = -20.f; + Desc.fSizeX = 512.f; + Desc.fSizeY = 64.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.f; + m_fMoveSpeed = 5.f; + m_fLerpX = m_fX; + m_fLerpY = 45; + return S_OK; +} + +void CSpell_Header::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Header::Update(_float fTimeDelta) +{ + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + { + m_fAlpha += fTimeDelta * m_fAlphaTime; + } + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Header::Late_Update(_float fTimeDelta) +{ + if (m_bVisible) { + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpell_Header::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_HEADER)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_Header::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Header::MoveY(_float fY) +{ + m_fY += fY; +} + +HRESULT CSpell_Header::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Header::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_LighthouseHeaderBack"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Header* CSpell_Header::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Header* pInstance = new CSpell_Header(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Header::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Header* pInstance = new CSpell_Header(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Header::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Header::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp b/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp new file mode 100644 index 000000000..dbd3bdaf5 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp @@ -0,0 +1,214 @@ +#include "pch.h" +#include "Spell_Header_Line.h" +#include "GameInstance.h" + +CSpell_Header_Line::CSpell_Header_Line(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Header_Line::CSpell_Header_Line(const CSpell_Header_Line& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Header_Line::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Header_Line::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 20.f; + Desc.fSizeX = 487.f; + Desc.fSizeY = 18.f; + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.f; + m_fMoveSpeed = 5.f; + return S_OK; +} + +void CSpell_Header_Line::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Header_Line::Update(_float fTimeDelta) +{ + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + { + m_fAlpha += fTimeDelta * m_fAlphaTime; + } + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Header_Line::Late_Update(_float fTimeDelta) +{ + if (m_bVisible) { + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpell_Header_Line::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_Header_Line::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Header_Line::MoveY(_float fY) +{ + m_fY += fY; +} + +HRESULT CSpell_Header_Line::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Header_Line::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_Header_Line"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Header_Line* CSpell_Header_Line::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Header_Line* pInstance = new CSpell_Header_Line(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Header_Line"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Header_Line::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Header_Line* pInstance = new CSpell_Header_Line(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Header_Line::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Header_Line::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp new file mode 100644 index 000000000..86a4e1685 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp @@ -0,0 +1,313 @@ +#include "pch.h" +#include "Spell_Hover.h" +#include "GameInstance.h" + +CSpell_Hover::CSpell_Hover(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Hover::CSpell_Hover(const CSpell_Hover& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Hover::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Hover::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + return S_OK; +} + +void CSpell_Hover::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Hover::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + Hover(); + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Hover::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_Hover::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::SPELL_HOVER)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_Hover::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Hover::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_Hover::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_Hover::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_Hover::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY* 0.5f)); + + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_pVIBufferCom->Set_Mouse_Hover(fMouse); + +} + +HRESULT CSpell_Hover::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom3->Bind_ShaderResource(m_pShaderCom, "g_Texture3", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom4->Bind_ShaderResource(m_pShaderCom, "g_Texture4", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom5->Bind_ShaderResource(m_pShaderCom, "g_Texture5", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpell_Hover::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_IconButtonOutline"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_IconButtonHighlight"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_GoldLeaf"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_Goldleaf_Large"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_IconButton"), reinterpret_cast(&m_pDiffuse_TextureCom4), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SelectedPresetBorder"), reinterpret_cast(&m_pDiffuse_TextureCom5), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Hover* CSpell_Hover::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Hover* pInstance = new CSpell_Hover(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Hover"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Hover::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Hover* pInstance = new CSpell_Hover(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Hover"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Hover::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pDiffuse_TextureCom2); + SAFE_RELEASE(m_pDiffuse_TextureCom3); + SAFE_RELEASE(m_pDiffuse_TextureCom4); + SAFE_RELEASE(m_pDiffuse_TextureCom5); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Hover::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp new file mode 100644 index 000000000..f336f09d1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp @@ -0,0 +1,279 @@ +#include "pch.h" +#include "Spell_Hover_Effect.h" +#include "GameInstance.h" + +CSpell_Hover_Effect::CSpell_Hover_Effect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Hover_Effect::CSpell_Hover_Effect(const CSpell_Hover_Effect& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Hover_Effect::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Hover_Effect::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fAlpha = 1.f; + m_fTimeMult = 1.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + m_fSortZ = 0.02f; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + return S_OK; +} + +void CSpell_Hover_Effect::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Hover_Effect::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + Hover(); + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Hover_Effect::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_Hover_Effect::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::SPELL_SLOT_EFFECT)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_Hover_Effect::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Hover_Effect::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_Hover_Effect::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_Hover_Effect::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_Hover_Effect::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_pVIBufferCom->Set_Mouse_Hover(fMouse); + +} + +HRESULT CSpell_Hover_Effect::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_MaskTexture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + + +HRESULT CSpell_Hover_Effect::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SelectedBorderMask"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_VFX_T_WhispLine_D"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Hover_Effect* CSpell_Hover_Effect::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Hover_Effect* pInstance = new CSpell_Hover_Effect(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Hover_Effect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Hover_Effect::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Hover_Effect* pInstance = new CSpell_Hover_Effect(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Hover_Effect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Hover_Effect::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Hover_Effect::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_List.cpp b/Jusin154_Team3D/Editor/Private/Spell_List.cpp new file mode 100644 index 000000000..2f93ffc37 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_List.cpp @@ -0,0 +1,286 @@ +#include "pch.h" +#include "Spell_List.h" +#include "GameInstance.h" + +CSpell_List::CSpell_List(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_List::CSpell_List(const CSpell_List& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_List::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_List::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + Color(); + return S_OK; +} + +void CSpell_List::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_List::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + m_fTime += fTimeDelta * m_fTimeMult; + Hover(); + __super::Update(fTimeDelta); +} + +void CSpell_List::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + + +HRESULT CSpell_List::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::COLOR)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_List::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_List::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_List::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_List::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_List::Color() +{ + m_pVIBufferCom->Set_Index_Renge_Color(0, 3, _float4(255.f / 255.f, 255.f / 255.f, 0.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(4, 7, _float4(150.f / 255.f, 120.f / 255.f, 240.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(8, 12, _float4(190.f / 255.f, 46.f / 255.f, 34.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(13, 16, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(17, 19, _float4(200.f / 255.f, 220.f / 255.f, 150.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(20, 22, _float4(50.f / 255.f, 150.f / 255.f, 110.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(23, 25, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); +} + +void CSpell_List::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_pVIBufferCom->Set_Mouse_Hover(fMouse); + +} + +HRESULT CSpell_List::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpell_List::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SpellType_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_List* CSpell_List::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_List* pInstance = new CSpell_List(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_List"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_List::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_List* pInstance = new CSpell_List(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_List"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_List::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_List::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_List_Image.cpp b/Jusin154_Team3D/Editor/Private/Spell_List_Image.cpp new file mode 100644 index 000000000..b263f0576 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_List_Image.cpp @@ -0,0 +1,286 @@ +#include "pch.h" +#include "Spell_List_Image.h" +#include "GameInstance.h" + +CSpell_List_Image::CSpell_List_Image(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_List_Image::CSpell_List_Image(const CSpell_List_Image& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_List_Image::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_List_Image::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeY = 90.f; + Desc.fSizeX = 90.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + UV(); + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(pUVDesc); + return S_OK; +} + +void CSpell_List_Image::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_List_Image::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_List_Image::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_List_Image::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::EESSENTIAL_SPELL)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_List_Image::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_List_Image::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_List_Image::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_List_Image::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_List_Image::UV() +{ + for (_uint i = 0; i < 26; ++i) + { + pUVDesc[i].fUV = Meter_Index(i); + } +} + +_float4 CSpell_List_Image::Meter_Index(_uint Number) +{ + _float2 fImage_Size = { 1024.f, 1792.f }; + + _uint iCountX = 4; + _uint iCountY = 7; + + _float iImageX = 256.f; + _float iImageY = 256.f; + + _uint iframeX = Number % iCountX; + _uint iframeY = Number / iCountX; + + _float2 UVStart; + UVStart.x = iframeX * iImageX / fImage_Size.x; + UVStart.y = iframeY * iImageY / fImage_Size.y; + + _float2 UVEnd; + UVEnd.x = UVStart.x + (iImageX / fImage_Size.x); + UVEnd.y = UVStart.y + (iImageY / fImage_Size.y); + + _float4 UV = _float4{ UVStart.x, UVStart.y, UVEnd.x, UVEnd.y }; + return UV; +} + +HRESULT CSpell_List_Image::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpell_List_Image::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List_Image"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Widget_Spell"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_List_Image* CSpell_List_Image::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_List_Image* pInstance = new CSpell_List_Image(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_List_Image"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_List_Image::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_List_Image* pInstance = new CSpell_List_Image(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_List_Image"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_List_Image::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_List_Image::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp index 0b657c26f..566519b20 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp @@ -48,7 +48,7 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) m_vUVScale.y = 1.f; m_fCoolTime = 5.f; m_fSortZ = 1.f; - m_iSkillType = ENUM_CLASS(SKILLTYPE::CONTROL); + m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); Compute_UI(5); return S_OK; } @@ -154,7 +154,7 @@ HRESULT CSpell_Overlay::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELLTYPE)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::TYPE)))) { return E_FAIL; } @@ -225,7 +225,7 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSkillType, sizeof(_float)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp index 40ad30251..7a9613978 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp @@ -2,6 +2,15 @@ #include "Spell_Panel.h" #include "GameInstance.h" #include "Current_Spell_Slot.h" +#include "Spell_List.h" +#include "Eessential_Spell_Slot.h" +#include "Eessential_Spell.h" +#include "Spell_List_Image.h" +#include "Spell_State.h" +#include "Spell_Hover.h" +#include "Spell_Hover_Effect.h" +#include "Spell_Preview.h" +#include "Spell_Vidio_Border.h" CSpell_Panel::CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -161,6 +170,60 @@ HRESULT CSpell_Panel::Ready_Element(void* pArg) } Add_Element(TEXT("Current_Spell_Slot"), m_pCurrent_Spell_Slot); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_List)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_List"), m_pSpell_List); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pEessential_Spell_Slot)))) + { + return E_FAIL; + } + Add_Element(TEXT("Eessential_Spell_Slot"), m_pEessential_Spell_Slot); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pEessential_Spell)))) + { + return E_FAIL; + } + Add_Element(TEXT("Eessential_Spell"), m_pEessential_Spell); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_List_Image)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_List_Image"), m_pSpell_List_Image); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_State)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_State"), m_pSpell_State); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Hover)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Hover"), m_pSpell_Hover); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Hover_Effect)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Hover_Effect"), m_pSpell_Hover_Effect); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Preview)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Preview"), m_pSpell_Preview); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Vidio_Border)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Vidio_Border"), m_pSpell_Vidio_Border); + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp b/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp new file mode 100644 index 000000000..3d187563a --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp @@ -0,0 +1,296 @@ +#include "pch.h" +#include "Spell_Preview.h" +#include "GameInstance.h" +#include "Spell_Header.h" +#include "Spell_Header_Line.h" + +CSpell_Preview::CSpell_Preview(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Preview::CSpell_Preview(const CSpell_Preview& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Preview::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Preview::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 400.f; + Desc.fY = -365.f; + Desc.fSizeX = 128.f; + Desc.fSizeY = 128.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + // y값 최소 270 최대 410 + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.f; + m_vNine_Slice = _float4(50.f, 75.f, 30.f, 96.f); + m_fTopY = m_fY - m_vScale.y * 0.5f; + SizeUpX(512.f); + SizeUpY(270.f); + m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); + return S_OK; +} + +void CSpell_Preview::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Preview::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + static_cast(m_pSpell_Header)->Set_SkillType(ENUM_CLASS(m_iSpellType)); + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Preview::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpell_Preview::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_PREVIEW)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + m_pSpell_Header->Render(); + m_pSpell_Header_Line->Render(); + return S_OK; +} + +_vector CSpell_Preview::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Preview::SizeUpX(_float fSizeX) +{ + _float fX = (fSizeX - m_vScale.x) * 0.5f; + m_fSizeX = fSizeX; + m_fX += fX; + m_fLerpX += fX; + +} + +void CSpell_Preview::SizeUpY(_float fSizeY) +{ + _float prevY = m_fY; + m_fSizeY = fSizeY; + m_fY = m_fTopY + fSizeY * 0.5f; + + _float deltaY = m_fY - prevY; + + static_cast(m_pSpell_Header_Line)->MoveY(-deltaY); + static_cast(m_pSpell_Header)->MoveY(-deltaY); +} + +HRESULT CSpell_Preview::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fNine_Slice", &m_vNine_Slice, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_fOrigin_Size, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageSipos1", &m_vHeaderBack, sizeof(_float4)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Preview::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_SpellWidgetPanelBack"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_Goldleaf_Large"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_TooltipBorder_4K"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_LighthouseHeaderBack"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header_Line)))) + { + return E_FAIL; + } + return S_OK; +} + +CSpell_Preview* CSpell_Preview::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Preview* pInstance = new CSpell_Preview(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Preview"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Preview::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Preview* pInstance = new CSpell_Preview(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Preview"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Preview::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pDiffuse_TextureCom2); + SAFE_RELEASE(m_pDiffuse_TextureCom3); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Preview::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp index ebe541b3d..3e7fb4cfe 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp @@ -39,7 +39,7 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_fAlpha = 1.f; m_fTimeMult = 3.f; - m_fAngle = XMConvertToRadians(45); + m_fAngle = XMConvertToRadians(-135); m_fAlphaTime = 1.f; m_fOffSetX = 101.f; m_fOffSetY = 101.f; @@ -47,7 +47,6 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(380.f, -30.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp b/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp index 2a4986416..979927f06 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp @@ -44,7 +44,6 @@ HRESULT CSpell_Slot_Preview::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); //m_pVIBufferCom->Set_Pos(0.f, 0.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_State.cpp b/Jusin154_Team3D/Editor/Private/Spell_State.cpp new file mode 100644 index 000000000..44fdf495c --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_State.cpp @@ -0,0 +1,269 @@ +#include "pch.h" +#include "Spell_State.h" +#include "GameInstance.h" + +CSpell_State::CSpell_State(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_State::CSpell_State(const CSpell_State& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_State::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_State::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + return S_OK; +} + +void CSpell_State::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_State::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + m_fTime += fTimeDelta * m_fTimeMult; + Hover(); + __super::Update(fTimeDelta); +} + +void CSpell_State::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_State::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::ALPHABLEND)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_State::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_State::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_State::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_State::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_State::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_pVIBufferCom->Set_Mouse_Hover(fMouse); + +} + +HRESULT CSpell_State::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpell_State::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_NewLock"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_State* CSpell_State::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_State* pInstance = new CSpell_State(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_State"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_State::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_State* pInstance = new CSpell_State(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_State"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_State::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_State::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp new file mode 100644 index 000000000..094e65afd --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp @@ -0,0 +1,229 @@ +#include "pch.h" +#include "Spell_Vidio_Border.h" +#include "GameInstance.h" + +CSpell_Vidio_Border::CSpell_Vidio_Border(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Vidio_Border::CSpell_Vidio_Border(const CSpell_Vidio_Border& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Vidio_Border::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Vidio_Border::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 590.f; + Desc.fY = -100.f; + Desc.fSizeX = 520.f; + Desc.fSizeY = 275.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.f; + m_fMoveSpeed = 5.f; + m_fLerpX = m_fX; + m_fLerpY = 45; + return S_OK; +} + +void CSpell_Vidio_Border::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Vidio_Border::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); + +} + +void CSpell_Vidio_Border::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_Vidio_Border::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_Vidio_Border::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpell_Vidio_Border::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Vidio_Border::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_TalentVideoBorder"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Vidio_Border* CSpell_Vidio_Border::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Vidio_Border* pInstance = new CSpell_Vidio_Border(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Vidio_Border"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Vidio_Border::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Vidio_Border* pInstance = new CSpell_Vidio_Border(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Vidio_Border"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Vidio_Border::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Vidio_Border::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Terrain.cpp b/Jusin154_Team3D/Editor/Private/Terrain.cpp index bba59e573..9cb5a4222 100644 --- a/Jusin154_Team3D/Editor/Private/Terrain.cpp +++ b/Jusin154_Team3D/Editor/Private/Terrain.cpp @@ -138,7 +138,7 @@ HRESULT CTerrain::Render() } else { - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::DEFAULT)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::ENV_TERRAIN_ANISO)))) { return E_FAIL; } } @@ -191,6 +191,15 @@ HRESULT CTerrain::Ready_Components() HRESULT CTerrain::Bind_ShaderResources() { + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDiffuseMultiplier", &m_vDRN.x, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fSurfaceMultiplier", &m_vDRN.y, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fNormalMultiplier", &m_vDRN.z, sizeof(_float)))) { + return E_FAIL; + } if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index 163a5f0e0..e26924901 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -16,7 +16,7 @@ namespace Editor enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT, MAP, UI, EFFECT, PHYSX, BLOOM, END }; enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END }; enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT }; - enum class MAPOBJECT_RENDER_TYPE {NORMAL, DECAL, GLASS}; + enum class MAPOBJECT_RENDER_TYPE { NORMAL, DECAL, GLASS }; enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, HAIR, EYELASH, OUTLINE_WRITE, OUTLINE_READ, END }; enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END }; @@ -24,11 +24,13 @@ namespace Editor enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, ENV_TERRAIN_ANISO, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; + enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR , TRAIL_BLOOM, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, BLOOM, END }; + enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, END }; + enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, END }; + - enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, SPELLTYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, END }; - enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, END }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; enum class SKILL_TYPE{ JAP , BOMBARD , DECENDO , PROTEGO , END }; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Macro.h b/Jusin154_Team3D/Editor/Public/Editor_Macro.h index 7d99927b5..4f18a9b2d 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Macro.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Macro.h @@ -58,6 +58,11 @@ namespace Editor { #define LAYER_MAPOBJECTMANAGER TEXT("Layer_MapObjectManager") +#pragma region TIME +#define SECONDS_PER_GAME_DAY 30.f +#pragma endregion + + #pragma endregion #pragma region MACRO_TEXTURE diff --git a/Jusin154_Team3D/Editor/Public/Eessential_Spell.h b/Jusin154_Team3D/Editor/Public/Eessential_Spell.h new file mode 100644 index 000000000..3a793d636 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Eessential_Spell.h @@ -0,0 +1,53 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CEessential_Spell final : public CElementObject +{ +private: + CEessential_Spell(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEessential_Spell(const CEessential_Spell& rhs); + virtual ~CEessential_Spell() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +public: + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + + void UV(); + _float4 Meter_Index(_uint Number); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + CVIBuffer_UI_Instance::UI_ATLAS_DESC pUVDesc[8]; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CEessential_Spell* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h new file mode 100644 index 000000000..7aadab096 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h @@ -0,0 +1,53 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CEessential_Spell_Slot final : public CElementObject +{ +private: + CEessential_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEessential_Spell_Slot(const CEessential_Spell_Slot& rhs); + virtual ~CEessential_Spell_Slot() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + + +private: + void Hover(); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CEessential_Spell_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/GameTime.h b/Jusin154_Team3D/Editor/Public/GameTime.h new file mode 100644 index 000000000..c152d526f --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/GameTime.h @@ -0,0 +1,39 @@ +#pragma once + +#include "Editor_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Editor) + +class CGameTime : public CBase +{ +private: + CGameTime(); + virtual ~CGameTime() = default; + +public: + _float Get_DayTime() const { return m_fDayTime; } + +public: + void Update_GameTime(_float fTiemDelta); + +private: + CGameInstance* m_pGameInstance = { nullptr }; + + _float m_PerDayTime = { 24.f }; + _float m_fGameTime = { 0.f }; + _float m_fDayTime = { 0.f }; + +private: + HRESULT Initialize(); + +public: + static CGameTime* Create(); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/IMGUIUI.h b/Jusin154_Team3D/Editor/Public/IMGUIUI.h index 3b8461faf..77f8ef5fe 100644 --- a/Jusin154_Team3D/Editor/Public/IMGUIUI.h +++ b/Jusin154_Team3D/Editor/Public/IMGUIUI.h @@ -48,7 +48,7 @@ class CIMGUIUI final : public CGameObject _float m_fAlpha{}; _float2 m_UV{}; - _int m_iSkillType{}; + _int m_iSpellType{}; _vector m_vLerpPosition{}; _float m_fLerpX{}; diff --git a/Jusin154_Team3D/Editor/Public/Magic_Item.h b/Jusin154_Team3D/Editor/Public/Magic_Item.h index 83cf77f0c..18df03ef7 100644 --- a/Jusin154_Team3D/Editor/Public/Magic_Item.h +++ b/Jusin154_Team3D/Editor/Public/Magic_Item.h @@ -35,6 +35,7 @@ class CMagic_Item final : public CElementObject CTexture* m_pDiffuse_TextureCom3 = { nullptr }; CTexture* m_pDiffuse_TextureCom4 = { nullptr }; CTexture* m_pDiffuse_TextureCom5 = { nullptr }; + CTexture* m_pDiffuse_TextureCom6 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; diff --git a/Jusin154_Team3D/Editor/Public/MainLight.h b/Jusin154_Team3D/Editor/Public/MainLight.h index 87a3e8dad..111f7be96 100644 --- a/Jusin154_Team3D/Editor/Public/MainLight.h +++ b/Jusin154_Team3D/Editor/Public/MainLight.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" @@ -11,6 +11,8 @@ NS_BEGIN(Editor) class CMainLight final : public CGameObject { +public: + enum class DAY_PHASE { DAWN, DAY, DUSK, NIGHT, END }; private: CMainLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -26,7 +28,19 @@ class CMainLight final : public CGameObject virtual HRESULT Render() override; private: - CLight* m_pLightCom = { nullptr }; + CLight* m_pLightCom = { nullptr }; + class CGameTime* m_pGameTime = { nullptr }; + _float4 m_vCurDiffuse = {}; + _float4 m_vAmbient = {}; + _float4 m_vSpecular = {}; + + DAY_PHASE m_eCurPhase = { DAY_PHASE::END}; + DAY_PHASE m_eNextPhase = { DAY_PHASE::END }; + + _float4 m_Diffuse_Colors[ENUM_CLASS(DAY_PHASE::END)] = {}; + _float4 m_Ambient_Colors[ENUM_CLASS(DAY_PHASE::END)] = {}; + _float4 m_Specular_Colors[ENUM_CLASS(DAY_PHASE::END)] = {}; + private: HRESULT Ready_Components(); @@ -39,4 +53,4 @@ class CMainLight final : public CGameObject virtual void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/MapElement.h b/Jusin154_Team3D/Editor/Public/MapElement.h index d88aa7df9..c903efc46 100644 --- a/Jusin154_Team3D/Editor/Public/MapElement.h +++ b/Jusin154_Team3D/Editor/Public/MapElement.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "GameObject.h" @@ -43,7 +43,6 @@ class CMapElement abstract : public CGameObject _float3 m_vScale = {}; #endif // _DEBUG - protected: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; @@ -56,4 +55,4 @@ class CMapElement abstract : public CGameObject void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/MapElement_Light.h b/Jusin154_Team3D/Editor/Public/MapElement_Light.h new file mode 100644 index 000000000..89be70ebe --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/MapElement_Light.h @@ -0,0 +1,41 @@ +#pragma once + +#include "Editor_Define.h" +#include "MapElement.h" + +NS_BEGIN(Engine) +class CLight; +NS_END + +NS_BEGIN(Editor) + +class CMapElement_Light : public CMapElement +{ +private: + CMapElement_Light(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMapElement_Light(const CMapElement_Light& rhs); + virtual ~CMapElement_Light() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + CLight* m_pLightCom = { nullptr }; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Bind_ShaderResources() override; + +public: + static CMapElement_Light* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/MapObject_Manager.h b/Jusin154_Team3D/Editor/Public/MapObject_Manager.h index 05a238d2e..571f456d3 100644 --- a/Jusin154_Team3D/Editor/Public/MapObject_Manager.h +++ b/Jusin154_Team3D/Editor/Public/MapObject_Manager.h @@ -12,7 +12,7 @@ NS_BEGIN(Editor) class CMapObject_Manager final : public CGameObject { - enum class ADD_TYPE {CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT}; + enum class ADD_TYPE {CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT, ELEMENT_LIGHT }; private: CMapObject_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -68,8 +68,7 @@ class CMapObject_Manager final : public CGameObject void Update_ContainerObject(); void Create_PartObject(_wstring& strPrototypeTag); - void Create_Elemnt_Static(_wstring& strPrototypeTag); - void Create_Elemnt_Interact(_wstring& strPrototypeTag); + void Create_Elemnt(_wstring& strPrototypeTag); _bool Find_Lod_Prototype(_wstring strPrototypeTag, vector<_uint>& LodModelIndices); _uint Get_KeyCount(_wstring strPrototypeTag); diff --git a/Jusin154_Team3D/Editor/Public/Slot_Number.h b/Jusin154_Team3D/Editor/Public/Slot_Number.h index 340b9b872..a419eee42 100644 --- a/Jusin154_Team3D/Editor/Public/Slot_Number.h +++ b/Jusin154_Team3D/Editor/Public/Slot_Number.h @@ -27,8 +27,7 @@ class CSlot_Number final : public CElementObject virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; void UV(); - _float2 Meter_Index(_uint Numver); - _float2 Compute_UVY(_uint Numver); + _float4 Meter_Index(_uint Numver); virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Header.h b/Jusin154_Team3D/Editor/Public/Spell_Header.h new file mode 100644 index 000000000..41fb41913 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Header.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Header final : public CElementObject +{ +private: + CSpell_Header(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Header(const CSpell_Header& rhs); + virtual ~CSpell_Header() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual void MoveY(_float fY) override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpell_Header* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h b/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h new file mode 100644 index 000000000..d8062f7ec --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Header_Line final : public CElementObject +{ +private: + CSpell_Header_Line(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Header_Line(const CSpell_Header_Line& rhs); + virtual ~CSpell_Header_Line() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual void MoveY(_float fY) override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpell_Header_Line* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Hover.h b/Jusin154_Team3D/Editor/Public/Spell_Hover.h new file mode 100644 index 000000000..496588411 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover.h @@ -0,0 +1,60 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_Hover final : public CElementObject +{ +private: + CSpell_Hover(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Hover(const CSpell_Hover& rhs); + virtual ~CSpell_Hover() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + +private: + void Hover(); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; + CTexture* m_pDiffuse_TextureCom4 = { nullptr }; + CTexture* m_pDiffuse_TextureCom5 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_Hover* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h new file mode 100644 index 000000000..433d74719 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h @@ -0,0 +1,56 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_Hover_Effect final : public CElementObject +{ +private: + CSpell_Hover_Effect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Hover_Effect(const CSpell_Hover_Effect& rhs); + virtual ~CSpell_Hover_Effect() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + +private: + void Hover(); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_Hover_Effect* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_List.h b/Jusin154_Team3D/Editor/Public/Spell_List.h new file mode 100644 index 000000000..e4a085e4b --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_List.h @@ -0,0 +1,57 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_List final : public CElementObject +{ +private: + CSpell_List(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_List(const CSpell_List& rhs); + virtual ~CSpell_List() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + +private: + void Color(); + void Hover(); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_List* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_List_Image.h b/Jusin154_Team3D/Editor/Public/Spell_List_Image.h new file mode 100644 index 000000000..2a8a3ba0b --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_List_Image.h @@ -0,0 +1,57 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_List_Image final : public CElementObject +{ +private: + CSpell_List_Image(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_List_Image(const CSpell_List_Image& rhs); + virtual ~CSpell_List_Image() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +public: + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + + void UV(); + _float4 Meter_Index(_uint Number); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + CVIBuffer_UI_Instance::UI_ATLAS_DESC pUVDesc[26]; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_List_Image* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Panel.h b/Jusin154_Team3D/Editor/Public/Spell_Panel.h index 4d7ebe882..fc3e3dcc6 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Panel.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Panel.h @@ -36,6 +36,15 @@ class CSpell_Panel final : public CPanelObject CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pCurrent_Spell_Slot = { nullptr }; + CGameObject* m_pSpell_List = { nullptr }; + CGameObject* m_pEessential_Spell_Slot = { nullptr }; + CGameObject* m_pEessential_Spell = { nullptr }; + CGameObject* m_pSpell_List_Image = { nullptr }; + CGameObject* m_pSpell_State = { nullptr }; + CGameObject* m_pSpell_Hover = { nullptr }; + CGameObject* m_pSpell_Hover_Effect = { nullptr }; + CGameObject* m_pSpell_Preview = { nullptr }; + CGameObject* m_pSpell_Vidio_Border = { nullptr }; public: static CSpell_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Public/Spell_Preview.h b/Jusin154_Team3D/Editor/Public/Spell_Preview.h new file mode 100644 index 000000000..6f3dcd134 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Preview.h @@ -0,0 +1,51 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Preview final : public CElementObject +{ +private: + CSpell_Preview(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Preview(const CSpell_Preview& rhs); + virtual ~CSpell_Preview() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + CGameObject* m_pSpell_Header = { nullptr }; + CGameObject* m_pSpell_Header_Line = { nullptr }; + + _float4 m_vHeaderBack{}; + +public: + static CSpell_Preview* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_State.h b/Jusin154_Team3D/Editor/Public/Spell_State.h new file mode 100644 index 000000000..ae6d7a509 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_State.h @@ -0,0 +1,55 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_State final : public CElementObject +{ +private: + CSpell_State(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_State(const CSpell_State& rhs); + virtual ~CSpell_State() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + +private: + void Hover(); + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_State* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h new file mode 100644 index 000000000..d447cc059 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h @@ -0,0 +1,40 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Vidio_Border final : public CElementObject +{ +private: + CSpell_Vidio_Border(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Vidio_Border(const CSpell_Vidio_Border& rhs); + virtual ~CSpell_Vidio_Border() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpell_Vidio_Border* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Terrain.h b/Jusin154_Team3D/Editor/Public/Terrain.h index b1ca26178..bf82379b1 100644 --- a/Jusin154_Team3D/Editor/Public/Terrain.h +++ b/Jusin154_Team3D/Editor/Public/Terrain.h @@ -43,6 +43,9 @@ class CTerrain final : public CGameObject _uint m_iTextureIndex = {}; + _float3 m_vDRN = { (1.f / 16.f), (1.f / 16.f), (1.f / 16.f) }; + + class CAlphaMap* m_pAlphaMap = { nullptr }; _uint m_iMaskRange = {1}; _int m_iColorIndex = {0}; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 70ab08713..db13bce76 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -46,12 +46,17 @@ Texture2D g_BlurWeightTexture; Texture2D g_BlurWeightXTexture; Texture2D g_SurfaceTexture; +Texture2D g_OriginalTexture; vector g_vLightDiffuse; vector g_vLightAmbient; vector g_vLightSpecular; +float g_fFogDensity; +float g_fFogPow; +vector g_vFogColor; + struct VS_IN { float3 vPosition : POSITION; @@ -776,6 +781,31 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_Y(PS_IN In) return Out; } +PS_OUT_FLT4_SINGLE PS_MAIN_FOG(PS_IN In) +{ + PS_OUT_FLT4_SINGLE Out; + + vector vColor = g_OriginalTexture.Sample(DefaultSampler, In.vTexcoord); + vector vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord); + + vector vFinalColor; + float fViewZ = vDepthDesc.y * g_fFar; + + float fRatio; + + fRatio = clamp(pow(exp(-(g_fFogDensity * fViewZ)), g_fFogPow), 0.f, 1.f); + + vFinalColor = lerp(g_vFogColor, vColor, max(fRatio, 0.2f)); + vFinalColor.a = 1.f; + + if (1.f == vDepthDesc.y) + vFinalColor = float4(g_vFogColor); + + Out.vSingleTarget = vFinalColor; + + return Out; +} + technique11 DefaultTechnique { @@ -916,4 +946,14 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN_POSTCOMBINED(); } + + pass FogPass // 14 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_FOG(); + } } diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index f92ffb8d6..a884dc4a7 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -207,6 +207,7 @@ call Update_Lib.bat + @@ -423,6 +424,7 @@ call Update_Lib.bat + diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index bf933498c..1240a0667 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -295,6 +295,9 @@ {432b36d5-fdf6-456a-bc71-8bf793a42314} + + {d566d9e6-6183-48dc-a196-25fd47a10c48} + @@ -558,6 +561,9 @@ 02.Element\02.Component\02.VIBuffer\Box + + 01.Utility\07. Fog + @@ -1190,6 +1196,9 @@ 02.Element\02.Component\02.VIBuffer\Box + + 01.Utility\07. Fog + diff --git a/Jusin154_Team3D/Engine/Private/Fog.cpp b/Jusin154_Team3D/Engine/Private/Fog.cpp new file mode 100644 index 000000000..39fefeaa3 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/Fog.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "Fog.h" +#include "Shader.h" + +CFog::CFog() + : m_bVisible{ true } +{ +} + +void CFog::Set_FogDensity(_float fFogDensity) +{ + m_fFogDensity = fFogDensity; +} + +void CFog::Set_FogColor(_float4& vFogColor) +{ + memcpy(&m_vFogColor, &vFogColor, sizeof(_float4)); +} + +HRESULT CFog::Bind_FogValue(CShader* pShader) +{ +#ifdef _DEBUG + if (m_bVisible) { + pShader->Bind_RawValue("g_fFogDensity", &m_fFogDensity, sizeof(_float)); + pShader->Bind_RawValue("g_fFogPow", &m_fFogPow, sizeof(_float)); + pShader->Bind_RawValue("g_vFogColor", &m_vFogColor, sizeof(_float4)); + } + else + { + _float fValue = 0.f; + _float4 vColor = { 0.f, 0.f,0.f,0.f }; + pShader->Bind_RawValue("g_fFogDensity", &fValue, sizeof(_float)); + pShader->Bind_RawValue("g_fFogDensity", &fValue, sizeof(_float)); + pShader->Bind_RawValue("g_vFogColor", &vColor, sizeof(_float4)); + } +#else + pShader->Bind_RawValue("g_fFogDensity", &m_fFogDensity, sizeof(_float)); + pShader->Bind_RawValue("g_vFogColor", &m_vFogColor, sizeof(_float4)); +#endif // _DEBUG + + return S_OK; +} + +#ifdef _DEBUG +void CFog::Update_Fog() +{ + GUI::Begin("Fog Edit"); + GUI::Checkbox("Fog ON / OFF", &m_bVisible); + GUI::InputFloat("g_fFogDensity", &m_fFogDensity, 0.001f); + GUI::InputFloat("g_fFogPow", &m_fFogPow, 0.1f); + GUI::ColorEdit4("Fog Color", (_float*)(&m_vFogColor), ImGuiColorEditFlags_NoInputs); + GUI::End(); +} +#endif // _DEBUG + +CFog* CFog::Create() +{ + return new CFog(); +} + +void CFog::Free() +{ + __super::Free(); +} diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 97fdcc968..7539f7c80 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -17,6 +17,7 @@ #include "Picking.h" #include "PhysX_Manager.h" #include "ThreadHolder.h" +#include "Fog.h" IMPLEMENT_SINGLETON(CGameInstance) @@ -100,6 +101,11 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De return E_FAIL; } + m_pFog = CFog::Create(); + if (nullptr == m_pFog) { + return E_FAIL; + } + return S_OK; } @@ -108,7 +114,9 @@ void CGameInstance::Update_Engine(_float fTimeDelta) m_pKey_Manager->Update(); m_pMouse_Manager->Update(); //m_pSound_Manager->Update(); - +#ifdef _DEBUG + m_pFog->Update_Fog(); +#endif // _DEBUG m_pPicking->Update(); m_pObject_Manager->Priority_Update(fTimeDelta); @@ -514,6 +522,11 @@ HRESULT CGameInstance::Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilVi return m_pRenderTarget_Manager->Begin_MRT(strMRTTag, pDSV); } +HRESULT CGameInstance::Begin_MRT_NonClear(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV) +{ + return m_pRenderTarget_Manager->Begin_MRT_NonClear(strMRTTag, pDSV); +} + HRESULT CGameInstance::Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV) { return m_pRenderTarget_Manager->Begin_MRT_Include_BackBuffer(strMRTTag, pDSV); @@ -623,6 +636,7 @@ _bool CGameInstance::SaveAssimpModel(const _char* filename) auto iter = m_ModelMap.find(filename); return iter->second->SaveAssimpModel(filename); } + void CGameInstance::Add_ModelToMap(const _char* filePath, CModel* pModel) { m_ModelMap[filePath] = pModel; @@ -715,6 +729,22 @@ HRESULT CGameInstance::LoadTriMeshes(const _char* pPath, vectorSet_FogDensity(fFogDensity); +} +void CGameInstance::Set_FogColor(_float4& vFogColor) +{ + m_pFog->Set_FogColor(vFogColor); +} + +HRESULT CGameInstance::Bind_FogValue(class CShader* pShader) +{ + return m_pFog->Bind_FogValue(pShader); +} +#pragma endregion // FOG + bool CGameInstance::Key_Pressing(int _iKey) { //if (false == (GUI::IsWindowFocused(ImGuiFocusedFlags_AnyWindow))) { @@ -824,6 +854,7 @@ void CGameInstance::Release_Engine() DestroyInstance(); + SAFE_RELEASE(m_pFog); SAFE_RELEASE(m_pPicking); SAFE_RELEASE(m_pCollider_Manager); SAFE_RELEASE(m_pShadow); diff --git a/Jusin154_Team3D/Engine/Private/Light.cpp b/Jusin154_Team3D/Engine/Private/Light.cpp index 4a77afd55..b18672ef2 100644 --- a/Jusin154_Team3D/Engine/Private/Light.cpp +++ b/Jusin154_Team3D/Engine/Private/Light.cpp @@ -57,6 +57,13 @@ HRESULT CLight::Initialize(void* pArg) return S_OK; } +void CLight::Set_Color(_float4& vDiffuse, _float4& vAmbient, _float4& vSpecular) +{ + memcpy(&m_LightDesc.vDiffuse, &vDiffuse, sizeof(_float4)); + memcpy(&m_LightDesc.vAmbient, &vAmbient, sizeof(_float4)); + memcpy(&m_LightDesc.vSpecular, &vSpecular, sizeof(_float4)); +} + HRESULT CLight::Render(CShader* pShader, CVIBuffer* pVIBuffer) const { _uint iPassIndex = { 0 }; diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp index bd05b1b2a..fb0294ef9 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp @@ -84,6 +84,37 @@ HRESULT CRenderTarget_Manager::Begin_MRT(const _wstring& strMultiRenderTargetKey return S_OK; } +HRESULT CRenderTarget_Manager::Begin_MRT_NonClear(const _wstring& strMultiRenderTargetKey, ID3D11DepthStencilView* pDSV) +{ + m_pContext->OMGetRenderTargets(1, &m_pBackBufferRTV, &m_pOriginalDSV); + + list* pMRTList = Find_MRT(strMultiRenderTargetKey); + + if (nullptr == pMRTList) { + return E_FAIL; + } + + _uint iNumRenderTargets = { 0 }; + ID3D11RenderTargetView* pRenderTargetViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = {}; + + m_pContext->OMSetRenderTargets(0, nullptr, nullptr); + + if (nullptr != pDSV) { + m_pContext->ClearDepthStencilView(pDSV, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.f, 0); + } + + for (auto& pRenderTarget : *pMRTList) + { + pRenderTargetViews[iNumRenderTargets++] = pRenderTarget->Get_RTV(); + } + if (0 == iNumRenderTargets) { + return E_FAIL; + } + + m_pContext->OMSetRenderTargets(iNumRenderTargets, pRenderTargetViews, (nullptr == pDSV) ? m_pOriginalDSV : pDSV); + + return S_OK; +} HRESULT CRenderTarget_Manager::Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV) { m_pContext->OMGetRenderTargets(1, &m_pBackBufferRTV, &m_pOriginalDSV); diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index 8d79136a4..0d47c79da 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -65,6 +65,7 @@ void CRenderer::Render() Render_Combined(); Render_Occlusion(); Render_EnvironmentPostProcess(); + Render_Fog(); Render_Effect(); Render_NonLight(); Render_Blend(); @@ -117,6 +118,7 @@ void CRenderer::Render_Priority() } m_RenderObjects[ENUM_CLASS(RENDER::PRIORITY)].clear(); + } void CRenderer::Render_Shadow() @@ -227,7 +229,7 @@ void CRenderer::Render_LightAcc() void CRenderer::Render_Combined() { - if (FAILED(m_pGameInstance->Begin_MRT_Include_BackBuffer(TEXT("MRT_Combined")))) { + if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Combined")))) { return; } { @@ -319,7 +321,7 @@ void CRenderer::Render_EnvironmentPostProcess() } m_pShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix); - m_pShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix); + m_pShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix); m_pShader->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix); m_pShader->Bind_Matrix("g_invMatView", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW_INV)); m_pShader->Bind_Matrix("g_invmatProj", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ_INV)); @@ -345,6 +347,10 @@ void CRenderer::Render_EnvironmentPostProcess() return; } + if (FAILED(m_pGameInstance->Begin_MRT_NonClear(TEXT("MRT_Fog")))) { + return; + } + m_pShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix); m_pShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix); m_pShader->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix); @@ -356,6 +362,7 @@ void CRenderer::Render_EnvironmentPostProcess() m_pShader->Bind_RawValue("g_fFarBlurStart", &m_fDOF_ENV_StartDistance, sizeof(_float)); m_pShader->Bind_RawValue("g_fFarBlurEnd", &m_fDOF_ENV_MaxEnd, sizeof(_float)); m_pShader->Bind_RawValue("g_fDOFBlurMultiplier", &m_fDOF_ENV_AmountRadius, sizeof(_float)); + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Depth"), m_pShader, "g_DepthTexture"))) { return; } @@ -369,6 +376,31 @@ void CRenderer::Render_EnvironmentPostProcess() m_pVIBuffer->Bind_Resources(); m_pVIBuffer->Render(); + + if (FAILED(m_pGameInstance->End_MRT())) { + return; + } +} + +void CRenderer::Render_Fog() +{ + m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)); + + m_pGameInstance->Bind_FogValue(m_pShader); + + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Fog"), m_pShader, "g_OriginalTexture"))) { + return; + } + + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Depth"), m_pShader, "g_DepthTexture"))) { + return; + } + + m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::FOG)); + + m_pVIBuffer->Bind_Resources(); + m_pVIBuffer->Render(); + } void CRenderer::Render_Effect() @@ -824,6 +856,11 @@ HRESULT CRenderer::Initialize() return E_FAIL; } + /* Target_Diffuse */ + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Fog"), (_uint)Viewport.Width, (_uint)Viewport.Height, + DXGI_FORMAT_R8G8B8A8_UNORM, _float4(0.0f, 0.f, 0.f, 0.f)))) { + return E_FAIL; + } if (FAILED(Ready_ShadowDepthStencilView(g_iMaxShadowWidth, g_iMaxShadowHeight))) { @@ -850,6 +887,9 @@ HRESULT CRenderer::Initialize() } /* MRT_Combined */ + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Combined"), TEXT("Target_Fog")))) { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Combined"), TEXT("Target_AfterCombined")))) { return E_FAIL; } @@ -909,6 +949,11 @@ HRESULT CRenderer::Initialize() if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_WB"), TEXT("Target_Color")))) { return E_FAIL; } + + /* MRT_Fog */ + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Fog"), TEXT("Target_Fog")))) { + return E_FAIL; + } } m_pShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, FX_DEFERRED, nullptr, nullptr); diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index 8549335bc..c3824772e 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -441,12 +441,12 @@ _float CUIObject::Get_Angle() void CUIObject::Set_SkillType(_int eType) { - m_iSkillType = eType; + m_iSpellType = eType; } _int CUIObject::Get_SkillType() { - return m_iSkillType; + return m_iSpellType; } void CUIObject::Set_CoolTime(_float CoolTime) diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp index 110a22c4f..357a5a182 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp @@ -114,6 +114,14 @@ HRESULT CVIBuffer_UI_Instance::Initialize_Prototype(const INSTANCE_DESC* pInstan m_fPosition = new _float2[m_iNumInstance]; ZeroMemory(m_fPosition, sizeof(_float2) * m_iNumInstance); + for (_uint i = 0; i < m_iNumInstance; ++i) + { + m_pInstanceVertices[i].fSize = _float2(1.f, 1.f); // 기본 크기 + m_pInstanceVertices[i].fPos = _float2(0.f, 0.f); // 기본 위치 + m_pInstanceVertices[i].fUV = _float4(0.f, 0.f, 1.f, 1.f); // 전체 텍스처 영역 + m_pInstanceVertices[i].vColor = _float4(1.f, 1.f, 1.f, 1.f); // 기본 흰색 + m_pInstanceVertices[i].bHover = 0; + } m_InstanceInitialDesc.pSysMem = m_pInstanceVertices; @@ -140,7 +148,6 @@ void CVIBuffer_UI_Instance::Set_Index_Position(_uint iIndex, _float fX, _float f pVertices[iIndex].fPos.x = fX; pVertices[iIndex].fPos.y = fY; - m_pContext->Unmap(m_pVBInstance, 0); } @@ -171,7 +178,7 @@ void CVIBuffer_UI_Instance::Set_Pos(_float fX, _float fY, _float OffSetX, _float _uint row = i / iCols; // 세로 인덱스 pVertices[i].fPos.x = fX + col * OffSetX; - pVertices[i].fPos.y = fY + row * OffSetY; + pVertices[i].fPos.y = fY - row * OffSetY; } m_pContext->Unmap(m_pVBInstance, 0); @@ -236,21 +243,67 @@ void CVIBuffer_UI_Instance::Set_ImageUV(UI_ATLAS_DESC* AtlasUV) for (size_t i = 0; i < m_iNumInstance; i++) { - if (AtlasUV == nullptr) - { - pVertices[i].fUVStart = _float2(0.f, 0.f); - pVertices[i].fUVStart = _float2(1.f, 1.f); - } - else - { - pVertices[i].fUVStart = AtlasUV[i].fUVStart; - pVertices[i].fUVEnd = AtlasUV[i].fUVEnd; - } + pVertices[i].fUV = AtlasUV[i].fUV; } m_pContext->Unmap(m_pVBInstance, 0); } +void CVIBuffer_UI_Instance::Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float4 vColor) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + for (size_t i = StartIndex; i <= EndIndex; i++) + { + pVertices[i].vColor = vColor; + } + + m_pContext->Unmap(m_pVBInstance, 0); +} + +_uint CVIBuffer_UI_Instance::Set_Mouse_Hover(_float2 fMousePos) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + _uint hoveredIndex = (_uint)-1; + for (_uint i = 0; i < m_iNumInstance; i++) + { + _float2 pos = pVertices[i].fPos; + _float2 size = pVertices[i].fSize; + + RECT rcInstance{}; + rcInstance.left = LONG(pos.x - size.x * 0.5f); + rcInstance.right = LONG(pos.x + size.x * 0.5f); + rcInstance.top = LONG(pos.y - size.y * 0.5f); + rcInstance.bottom = LONG(pos.y + size.y * 0.5f); + + POINT pt{}; + pt.x = LONG(fMousePos.x); + pt.y = LONG(fMousePos.y); + + if (PtInRect(&rcInstance, pt)) + { + pVertices[i].bHover = 1.f; + hoveredIndex = i; // ✅ 인덱스 저장 + } + else + { + pVertices[i].bHover = 0.f; + } + } + + m_pContext->Unmap(m_pVBInstance, 0); + return hoveredIndex; +} + CVIBuffer_UI_Instance* CVIBuffer_UI_Instance::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const INSTANCE_DESC* pInstanceDesc) { CVIBuffer_UI_Instance* pInstance = new CVIBuffer_UI_Instance(pDevice, pContext); diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index fd55e6016..bac13c485 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -34,7 +34,7 @@ enum class NAVI_POINT { A, B, C, END }; enum class NAVI_LINE { AB, BC, CA, END }; enum class SHADER_PASS_CELL { DEBUG, END }; -enum class SHADER_PASS_DEFERRED { DEBUG, DIRECTIONAL, POINT, COMBINED, BLUR, SPOT, REFIT, EMBOSSING, BLOOM_BLURX, BLOOM_BLURY, BLOOM_ACCUM, BLOOM_FINISH, BLURX_ENVIRONMENT, POSTCOMBINED, END }; +enum class SHADER_PASS_DEFERRED { DEBUG, DIRECTIONAL, POINT, COMBINED, BLUR, SPOT, REFIT, EMBOSSING, BLOOM_BLURX, BLOOM_BLURY, BLOOM_ACCUM, BLOOM_FINISH, BLURX_ENVIRONMENT, POSTCOMBINED, FOG, END }; enum class QUESTYPE {MAIN, SUB, END}; enum class TEXTURE_MOUNT_SLOT0 { NOT_DEFINED, METALLIC, SPECULAR, HEIGHT, END }; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index a3f05288f..cae318eb1 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -200,8 +200,9 @@ typedef struct tagVertexInstance_UI { _float2 fSize = {}; _float2 fPos = {}; - _float2 fUVStart = {}; - _float2 fUVEnd = {}; + _float4 fUV = _float4(0.f, 0.f, 1.f, 1.f); + _float4 vColor = _float4(1.f, 1.f, 1.f, 1.f); + _float bHover = 0; }VTX_INSTANCE_UI; typedef struct tagVertexBlock @@ -361,22 +362,23 @@ typedef struct tagVertexModelInstanceModelDesc typedef struct tagVertexInstance_UIDesc { - static constexpr unsigned int iNumElements = {6}; + static constexpr unsigned int iNumElements = { 7 }; static constexpr D3D11_INPUT_ELEMENT_DESC Elements[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0}, { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT, 1, 0, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, { "TEXCOORD", 2, DXGI_FORMAT_R32G32_FLOAT, 1, 8, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, - { "TEXCOORD", 3, DXGI_FORMAT_R32G32_FLOAT, 1, 16, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, - { "TEXCOORD", 4, DXGI_FORMAT_R32G32_FLOAT, 1, 24, D3D11_INPUT_PER_INSTANCE_DATA, 1 } + { "TEXCOORD", 3, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 16, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 4, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 32, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 5, DXGI_FORMAT_R32_FLOAT, 1, 48, D3D11_INPUT_PER_INSTANCE_DATA, 1 } }; }VTX_POSTEX_INSTANCE_UI; typedef struct tagPhsXUserData { - PHYSX_KIND eKind = PHYSX_KIND::NOT_DEFINED; + PHYSX_KIND eKind = PHYSX_KIND::NOT_DEFINED; class CGameObject* pOwner = { nullptr }; _float4x4 BeforeMatrix = { }; @@ -410,7 +412,7 @@ typedef struct tagKeyFrameDesc typedef struct tagChannelDesc { - _uint StartIndex; + _uint StartIndex; _uint KeyCount; _uint BoneIndex; //_uint Padding; diff --git a/Jusin154_Team3D/Engine/Public/Fog.h b/Jusin154_Team3D/Engine/Public/Fog.h new file mode 100644 index 000000000..4548b9122 --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/Fog.h @@ -0,0 +1,35 @@ +#pragma once + +#include "Base.h" + +NS_BEGIN(Engine) + +class CFog final : public CBase +{ +private: + CFog(); + virtual ~CFog() = default; + +public: + void Set_FogDensity(_float fFogDensity); + void Set_FogColor(_float4& vFogColor); + + HRESULT Bind_FogValue(class CShader* pShader); + +#ifdef _DEBUG + void Update_Fog(); +#endif // _DEBUG + + +private: + _bool m_bVisible = {}; + _float m_fFogDensity = { 0.04f }; + _float m_fFogPow = { 0.1f }; + _float4 m_vFogColor = { 0.906f, 0.812f, 0.745f, 0.5f }; + +public: + static CFog* Create(); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 0449f0134..c6a45d9a4 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -153,6 +153,7 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Add_RenderTarget(const _wstring& strRenderTargetKey, _uint iSizeX, _uint iSizeY, DXGI_FORMAT ePixelFormat, const _float4& vClearColor); HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey); HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr); + HRESULT Begin_MRT_NonClear(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr); HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr); HRESULT Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag); HRESULT End_MRT(); @@ -222,6 +223,14 @@ class ENGINE_DLL CGameInstance final : public CBase } #pragma endregion +#pragma region FOG + void Set_FogDensity(_float fFogDensity); + void Set_FogColor(_float4& vFogColor); + + HRESULT Bind_FogValue(class CShader* pShader); +#pragma endregion + + public: void Add_ModelToMap(const _char* filePath, CModel* pModel); @@ -255,7 +264,8 @@ class ENGINE_DLL CGameInstance final : public CBase class CPhysX_Manager* m_pPhysX_Manager = { nullptr }; class CPicking* m_pPicking = { nullptr }; class CThreadHolder* m_pThreadHolder = { nullptr }; - class COcclusionQuery* m_pOcclusionQuery = { nullptr }; + class CFog* m_pFog = { nullptr }; + #ifdef _DEBUG private: diff --git a/Jusin154_Team3D/Engine/Public/Light.h b/Jusin154_Team3D/Engine/Public/Light.h index ac5562130..ad0f232c2 100644 --- a/Jusin154_Team3D/Engine/Public/Light.h +++ b/Jusin154_Team3D/Engine/Public/Light.h @@ -20,6 +20,7 @@ class ENGINE_DLL CLight final : public CComponent virtual HRESULT Initialize(void* pArg) override; public: const LIGHT_DESC* Get_LightDesc() { return &m_LightDesc; } + void Set_Color(_float4& vDiffuse, _float4& vAmbient, _float4& vSpecular); public: HRESULT Render(class CShader* pShader, class CVIBuffer* pVIBuffer) const; diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h index 72de0e6d5..4a90b57e5 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h @@ -13,6 +13,7 @@ class CRenderTarget_Manager final : public CBase HRESULT Add_RenderTarget(const _wstring& strRenderTargetKey, _uint iSizeX, _uint iSizeY, DXGI_FORMAT ePixelFormat, const _float4& vClearColor); HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey); HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV); + HRESULT Begin_MRT_NonClear(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV); HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV); HRESULT Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag); HRESULT End_MRT(); diff --git a/Jusin154_Team3D/Engine/Public/Renderer.h b/Jusin154_Team3D/Engine/Public/Renderer.h index 7ffddfd9a..72fc175ce 100644 --- a/Jusin154_Team3D/Engine/Public/Renderer.h +++ b/Jusin154_Team3D/Engine/Public/Renderer.h @@ -40,7 +40,6 @@ class CRenderer final : public CBase _float4x4 m_ProjMatrix = {}; ID3D11DepthStencilView* m_pShadowDSV = { nullptr }; - ID3D11DepthStencilView* m_pOcclusionDSV = { nullptr }; SHADOW_LIGHT_DESC m_PreShadowDesc = {}; _float4x4 m_PreShadowMatrices[ENUM_CLASS(D3DTS::END)] = {}; @@ -55,7 +54,6 @@ class CRenderer final : public CBase _float m_fDOF_ENV_MaxEnd = { 360.f }; _float m_fDOF_ENV_AmountRadius = { 1.f }; - private: void Render_Occlusion(); void Render_Priority(); @@ -65,6 +63,7 @@ class CRenderer final : public CBase void Render_Blur(); void Render_Combined(); void Render_EnvironmentPostProcess(); + void Render_Fog(); void Render_Effect(); void Render_WeightBlend(); void Render_NonLight(); @@ -81,7 +80,6 @@ class CRenderer final : public CBase private: HRESULT Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY); - HRESULT Ready_OcclusionDepthStencilView(_uint iSizeX, _uint iSizeY); private: HRESULT Initialize(); diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index cc24b14a3..1564d510c 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -7,7 +7,7 @@ NS_BEGIN(Engine) class ENGINE_DLL CUIObject abstract : public CGameObject { public: - enum class SKILLTYPE { + enum class SPELLTYPE { CONTROL, POWER, DAMAGE, UTILITY ,TRANSFORM, CURSE, ESSENTIAL }; @@ -151,12 +151,14 @@ typedef struct tagUIObjectDesc RECT m_pRect{}; - _int m_iSkillType{}; + _int m_iSpellType{}; _float m_fSortZ{}; _float m_fMoveSpeed{}; _float4 m_vNine_Slice{}; + _float m_fTopY{}; + protected: virtual HRESULT Initialize_Prototype(); virtual HRESULT Initialize(void* pArg); diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h index 6c65232a6..2ad90c4aa 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h @@ -12,8 +12,7 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance }UI_INSTANCE_DESC; typedef struct tagUIAtlasDesc { - _float2 fUVStart{}; - _float2 fUVEnd{}; + _float4 fUV{}; }UI_ATLAS_DESC; private: CVIBuffer_UI_Instance(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -32,7 +31,9 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance void Set_SizeX(_float fSizeX); void Set_SizeY(_float fSizeY); void Set_Cloned(_bool isCloned) { m_isCloned = isCloned; } - void Set_ImageUV(UI_ATLAS_DESC* AtlasUV = nullptr); + void Set_ImageUV(UI_ATLAS_DESC* AtlasUV); + void Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float4 vColor); + _uint Set_Mouse_Hover(_float2 fMousePos); private: VTX_INSTANCE_UI* m_pInstanceVertices = { nullptr };