diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl deleted file mode 100644 index 1aee12e67..000000000 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ /dev/null @@ -1,1164 +0,0 @@ -#include "Engine_Shader_Defines.hlsli" - -matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; -Texture2D g_DepthTexture; - -int g_iImageCountX; -int g_iImageCountY; - -uint g_iIndexU; -uint g_iIndexV; -uint g_iQuestType; -uint g_iSpellType; - -float g_fPI; -float g_fFar; -float g_fBlinkTime; -float g_fTime; -float g_fFrame; -float g_fDeltaU; -float g_fDeltaV; -float g_fAlpha; -float g_fOwnerAlpha; -float g_fCanvasAlpha; -float g_fAngle; -float g_fCoolTime; -float g_fHp; - -float2 g_fOrigin_Size; -float2 g_fCurrent_Size; -float2 g_fHpBG; -float2 g_Pos; -float2 g_fImageSize; - -float4 g_fNine_Slice; -float4 g_fImageUV; -float4 g_fImageUV1; - -uint g_iArrayCount; -float2 g_fItemPosition1; -float2 g_fItemImageSizes1; -float2 g_fItemPosition2; -float2 g_fItemImageSizes2; -float2 g_fPosition[4]; -float2 g_fImageSizes[4]; -float4 g_fImagesUV[4]; - -float4 g_fImageSipos1; -float4 g_fImageSipos2; -float4 g_fImageSipos3; - -Texture2D g_Texture; -Texture2D g_Texture1; -Texture2D g_Texture2; -Texture2D g_Texture3; -Texture2D g_Texture4; -Texture2D g_Texture5; -Texture2D g_DiffuseTexture; -Texture2D g_MaskingTexture; - - -struct VS_IN -{ - float3 vPosition : POSITION; - float2 vTexcoord : TEXCOORD0; -}; - -struct VS_OUT -{ - float4 vPosition : SV_Position; - float2 vTexcoord : TEXCOORD0; -}; - -VS_OUT VS_MAIN(VS_IN In) -{ - VS_OUT Out; - - - matrix matWV, matWVP; - matWV = mul(g_WorldMatrix, g_ViewMatrix); - matWVP = mul(matWV, g_ProjMatrix); - - Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); - Out.vTexcoord = In.vTexcoord; - - return Out; -} - -struct PS_IN -{ - float4 vPosition : SV_Position; - float2 vTexcoord : TEXCOORD0; -}; - -struct PS_OUT -{ - float4 vColor : SV_Target0; -}; - -PS_OUT PS_MAIN(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord); - - if (Color.a <= 0.1f) - discard; - - Color.a *= Alpha; - Out.vColor = Color; - return Out; -} - -PS_OUT PS_AlphaBlend(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord); - - Color.rgb *= 1.5f; - - Color.a *= Alpha; - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_Clamp(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord); - - Color.a *= Alpha; - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_Cursor(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float4 Color = float4(0.f, 0.f, 0.f, 0.f); - float4 White = float4(1.f, 1.f, 1.f, 1.f); - - float2 UV = In.vTexcoord; - float2 Center = float2(0.5f, 0.5f); - - float CW = -g_fTime; - float CCW = g_fTime; - - float2 RedCircle = UV; - float2 RedUV = UV - Center; - - RedCircle.x = RedUV.x * cos(CCW) - RedUV.y * sin(CCW); - RedCircle.y = RedUV.x * sin(CCW) + RedUV.y * cos(CCW); - RedCircle = RedCircle + Center; - - float2 BlueCircle = UV; - float2 BlueUV = UV - Center; - - BlueCircle.x = BlueUV.x * cos(CW) - BlueUV.y * sin(CW); - BlueCircle.y = BlueUV.x * sin(CW) + BlueUV.y * cos(CW); - BlueCircle = BlueCircle + Center; - - - float4 Texture1 = g_Texture.Sample(ClampSampler, RedCircle); - float4 Texture2 = g_Texture2.Sample(ClampSampler, BlueCircle); - - if (Texture1.r >= 0.7f) - Color = Texture1; - - if (Texture2.b >= 0.7f) - Color = Texture2; - - if (all(Color.rgb <= 0.5f)) - discard; - - Color = White; - - Color.a *= Alpha; - - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_Key_Hold_Rotation(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float4 Color = float4(1.f, 1.f, 1.f, 1.f); - - float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); - Color = tex1; - - float2 Imagetexpos1 = g_fImageSipos1.xy / g_fCurrent_Size; - float2 Imagetexsize1 = g_fImageSipos1.zw / g_fCurrent_Size; - float2 Imagelocal = (In.vTexcoord - Imagetexpos1) / Imagetexsize1; - bool inside1 = all(Imagelocal >= 0.0f && Imagelocal <= 1.0f); - float4 tex2 = g_Texture1.Sample(ClampSampler, Imagelocal); - if (inside1) - { - float2 center = float2(0.5f, 0.5f); - float2 dir = Imagelocal - center; - - float angle = atan2(dir.x, -dir.y); - if (angle < 0) - angle += g_fPI; - - float rotation = saturate(g_fTime) * g_fPI; - - tex2.rgb = (angle <= rotation) ? 1.0 : tex2.rgb; - - - Color = lerp(Color, tex2, tex2.a); - } - - - - float2 Imagetexpos2 = g_fImageSipos2.xy / g_fCurrent_Size; - float2 Imagetexsize2 = g_fImageSipos2.zw / g_fCurrent_Size; - float2 Imagelocal2 = (In.vTexcoord - Imagetexpos2) / Imagetexsize2; - bool inside2 = all(Imagelocal2 >= 0.0f && Imagelocal2 <= 1.0f); - if (inside2) - { - float2 atlasUV = g_fImageUV.xy + Imagelocal2 * (g_fImageUV.zw - g_fImageUV.xy); - float2 safeUV = saturate(atlasUV); - float4 tex3 = g_Texture2.Sample(ClampSampler, safeUV); - Color = lerp(Color, tex3, tex3.a); - } - - float2 Imagetexpos3 = g_fImageSipos3.xy / g_fCurrent_Size; - float2 Imagetexsize3 = g_fImageSipos3.zw / g_fCurrent_Size; - float2 Imagelocal3 = (In.vTexcoord - Imagetexpos3) / Imagetexsize3; - bool inside3 = all(Imagelocal3 >= 0.0f && Imagelocal3 <= 1.0f); - if (inside3) - { - float3 QuestColor = float3(253.f, 207.f, 11.f) / 255.f; - - float4 tex4 = g_Texture3.Sample(ClampSampler, Imagelocal3); - - if (g_iQuestType == 0) - { - - tex4.rgb *= QuestColor; - - } - - Color = lerp(Color, tex4, tex4.a); - } - - Color.a *= Alpha; - - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_Mission(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float4 Color = float4(0.f, 0.f, 0.f, 0.f); - - float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); - float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); - - tex1.a *= 0.5f; - - if (tex1.a >= 0.f) - Color = tex1; - - Color = lerp(Color, tex2, tex2.a); - - Color.a *= Alpha; - Out.vColor = Color; - return Out; -} - -PS_OUT PS_Sptire_Sheet(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float4 Color = float4(0.f, 0.f, 0.f, 0.f); - float2 UV = In.vTexcoord; - - int iTotalFrame = g_iImageCountX * g_iImageCountY; - - uint iCurrentFrame = uint(floor(g_fTime / g_fFrame)) % iTotalFrame; - - int iFrameX = iCurrentFrame % g_iImageCountX; - int iFrameY = iCurrentFrame / g_iImageCountX; - - float fFreamWidth = 1.0 / g_iImageCountX; - float fFreamHeight = 1.0 / g_iImageCountY; - - UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; - UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; - - float4 Texture = g_Texture.Sample(DefaultSampler, UV); - - Color = Texture; - - if (Color.r <= 0.4f) - discard; - - - Color.a *= Alpha; - - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_QuestType(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float3 Color = float3(253.f, 207.f, 11.f) / 255.f; - float4 Texture1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); - - if (g_iQuestType == 0) - { - if (Texture1.r >= 0.3f) - { - Texture1.rgb = Color; - } - } - - Texture1.a *= Alpha; - Out.vColor = Texture1; - - return Out; -} - -PS_OUT PS_UVMult(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float4 color = g_Texture.Sample(DefaultSampler, In.vTexcoord); - - - color.a *= Alpha; - Out.vColor = color; - - return Out; -} - -PS_OUT PS_NineSlice(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float4 Color = float4(1.f, 1.f, 1.f, 1.f); - float2 uv = In.vTexcoord; - float2 CurrentPixelPosition = uv * g_fCurrent_Size; - float OriginLeft = g_fNine_Slice.x; - float OriginRight = g_fNine_Slice.y; - float OriginTop = g_fNine_Slice.z; - float OriginBottom = g_fNine_Slice.w; - - float CurrentLeft = OriginLeft; - float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); - float CurrentTop = OriginTop; - float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); - - float2 Finaluv = In.vTexcoord; - - if (CurrentPixelPosition.x < CurrentLeft) - { - Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; - } - else if (CurrentPixelPosition.x > CurrentRight) - { - float dist = CurrentPixelPosition.x - CurrentRight; - Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; - } - else - { - float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); - Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); - } - - if (CurrentPixelPosition.y < CurrentTop) - { - Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; - } - else if (CurrentPixelPosition.y > CurrentBottom) - { - float dist = CurrentPixelPosition.y - CurrentBottom; - Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; - } - else - { - float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); - Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); - } - - float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv); - float4 tex2 = g_Texture1.Sample(ClampSampler, Finaluv); - - tex1.a *= 0.5f; - - if (tex1.a >= 0.f) - Color = tex1; - - Color = lerp(Color, tex2, tex2.a); - - Color.a *= Alpha; - Out.vColor = Color; - return Out; -} - -PS_OUT PS_Rotation(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float4 color = float4(0.f, 0.f, 0.f, 0.f); - - float2 center = float2(0.5f, 0.5f); - float2 uv = In.vTexcoord - center; - uv *= sqrt(2.0f); - float2 Rotation = In.vTexcoord; - Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); - Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); - Rotation += center; - - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); - float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); - - tex1.rgb *= 0.4f; - color = tex1; - tex2.rgb *= 0.3f; - - if (tex2.a >= 0.9f) - color = tex2; - - color.a *= Alpha; - - Out.vColor = color; - return Out; - -} - -PS_OUT PS_Slot(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float2 center = float2(0.5f, 0.5f); - float2 uv = In.vTexcoord - center; - uv *= sqrt(2.0f); - float2 Rotation = In.vTexcoord; - Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); - Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); - Rotation += center; - - float4 color = g_Texture.Sample(ClampSampler, Rotation); - - color.a *= Alpha; - - Out.vColor = color; - - return Out; -} - -PS_OUT PS_SpellAnim(PS_IN In) -{ - PS_OUT Out; - - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float4 color = float4(0.f, 0.f, 0.f, 0.f); - - float2 center = float2(0.5f, 0.5f); - float2 uv = In.vTexcoord - center; - uv *= sqrt(2.0f); - float2 Rotation = In.vTexcoord; - Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); - Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); - Rotation += center; - - float2 startUV = g_fImageUV.xy; - float2 endUV = g_fImageUV.zw; - - float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); - - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); - float4 tex2 = g_Texture2.Sample(DefaultSampler, atlasUV); - - tex1.rgb *= 0.4f; - color = tex1; - tex2.rgb *= 0.3f; - - if (tex2.a >= 0.9f) - color = tex2; - float3 BGColor = float3(1.f, 1.f, 1.f); - - switch (g_iSpellType) - { - case 0: - BGColor = float3(208.f, 179.f, 54.f) / 255.f; - break; - case 1: - BGColor = float3(89.f, 32.f, 215.f) / 255.f; - break; - case 2: - BGColor = float3(190.f, 46., 34.f) / 255.f; - break; - case 3: - BGColor = float3(37.f, 129.f, 162.f) / 255.f; - break; - case 4: - BGColor = float3(134.f, 171.f, 78.f) / 255.f; - break; - case 5: - BGColor = float3(0.f, 80.f, 55.f) / 255.f; - break; - case 6: - BGColor = float3(0.f, 0.f, 0.f); - break; - } - float4 color1 = float4(1.f, 1.f, 1.f, 1.f); - - float2 OverrayUV = In.vTexcoord; - float CoolTime = 1.f - g_fDeltaV; - float CoolTime2 = 1.f - g_fDeltaV + 0.1f; - atlasUV = startUV + In.vTexcoord * (endUV - startUV); - float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); - tex3.rgb *= BGColor; - float4 tex4 = g_Texture2.Sample(DefaultSampler, atlasUV); - - if (tex4.a >= 0.9f) - tex3 = tex4; - - color1 = tex3; - - float wave1 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; - float wave2 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; - float waveThreshold1 = CoolTime + wave1; - float waveThreshold2 = CoolTime2 + wave2; - float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f , waveUV.y = (OverrayUV.y - waveThreshold1) /(waveThreshold2 - waveThreshold1)); - waveUV = saturate(waveUV); - float tex5 = g_Texture3.Sample(DefaultSampler, waveUV).r; - - if (g_fDeltaV <= 1.f) - { - if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) - { - color1.rgb += float3(1.f, 1.f, 1.f) * tex5 * g_fDeltaU; - } - } - - float waveThreshold = CoolTime + wave1; - - if (OverrayUV.y <= waveThreshold) - { - color1.a = 0.f; - } - - color = lerp(color, color1, color1.a); - - color.a *= Alpha; - - Out.vColor = color; - return Out; -} - -PS_OUT PS_HpBar(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float4 Color = float4(1.f, 1.f, 1.f, 1.f); - float4 Color1 = float4(1.f, 1.f, 1.f, 1.f); - float2 uv = In.vTexcoord; - float2 CurrentPixelPosition = uv * g_fCurrent_Size; - float OriginLeft = g_fNine_Slice.x; - float OriginRight = g_fNine_Slice.y; - float OriginTop = g_fNine_Slice.z; - float OriginBottom = g_fNine_Slice.w; - - float CurrentLeft = OriginLeft; - float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); - float CurrentTop = OriginTop; - float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); - - float2 Finaluv = In.vTexcoord; - - if (CurrentPixelPosition.x < CurrentLeft) - { - Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; - } - else if (CurrentPixelPosition.x > CurrentRight) - { - float dist = CurrentPixelPosition.x - CurrentRight; - Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; - } - else - { - float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); - Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); - } - - if (CurrentPixelPosition.y < CurrentTop) - { - Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; - } - else if (CurrentPixelPosition.y > CurrentBottom) - { - float dist = CurrentPixelPosition.y - CurrentBottom; - Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; - } - else - { - float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); - Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); - } - - float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv); - tex1.rgb = float3(255.f, 0.f, 0.f) / 255.f; - if (g_fHp <= 0.3f) - { - tex1.a *= (sin(g_fBlinkTime) * 0.25f + 0.75f) * 1.5f; - } - else - { - tex1.a = 0.f; - } - Color = tex1; - - float2 BGPos = g_Pos; - float2 BGSize = g_fImageSize; - float2 BGPixel = Finaluv * g_fOrigin_Size; - float2 localUV = (BGPixel - BGPos) / BGSize; - bool inside = all(localUV >= 0.0f && localUV <= 1.0f); - - float4 tex2 = g_Texture1.Sample(ClampSampler, localUV); - - if (inside) - Color = lerp(Color, tex2, tex2.a); - - float2 reversuv = In.vTexcoord; - - reversuv.x = 1.0f - localUV.x; - - float4 tex3 = g_Texture2.Sample(ClampSampler, localUV); - - if (reversuv.x >= g_fHp) - { - tex3.rgb = float3(0.f, 0.f, 0.f); - } - - float3 Green = (float3(112.f, 241.f, 31.f) / 255.f) * 1.2f; - float3 Red = (float3(255.f, 0.f, 0.f) / 255.f) * 1.2f; - - tex3.rgb *= lerp(Green, Red, g_fTime); - - if (all(Color.rgb >= float3(55.f / 255.f, 0.f / 255.f, 55.f / 255.f))) - Color = lerp(Color, tex3, tex3.a); - - Color.a *= Alpha; - Out.vColor = Color; - return Out; -} - -PS_OUT PS_Magic_Meter(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float3 Blue = float3(41.f, 165.f, 255.f) / 255.f; - - float4 color = float4(1.f, 1.f, 1.f, 1.f); - float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); - float4 tex2 = g_Texture1.Sample(ClampSampler, In.vTexcoord); - - float2 reverseuv = 1.f - In.vTexcoord; - - color = tex1; - tex2.rgb *= Blue * 1.5f; - - if (reverseuv.x >= g_fHp) - { - tex2.rgb = float3(0.f, 0.f, 0.f); - } - - if (all(color.rgb >= float3(65.f / 255.f, 65.f / 255.f, 65.f / 255.f))) - color = tex2; - - color.a *= Alpha; - - Out.vColor = color; - - return Out; -} - - -PS_OUT PS_Magic_Icon(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float4 Color = float4(1.f, 1.f, 1.f, 1.f); - - float2 center = float2(0.5f, 0.5f); - float2 BGuv = In.vTexcoord - center; - BGuv *= sqrt(2.0f); - float2 Rotation = In.vTexcoord; - Rotation.x = BGuv.x * cos(g_fAngle) - BGuv.y * sin(g_fAngle); - Rotation.y = BGuv.x * sin(g_fAngle) + BGuv.y * cos(g_fAngle); - Rotation += center; - - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); - float4 tex2 = g_Texture1.Sample(ClampSampler, Rotation); - - Color = tex1; - Color = lerp(tex1, tex2, tex2.a); - - float2 uv = In.vTexcoord; - float scale = 1.2; - - uv = (uv - center) * scale + center; - float4 tex3 = g_Texture2.Sample(ClampSampler, uv); - - - Color = Color * (1 - tex3.a) + tex3; - - Color.a *= Alpha; - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_RemapUV(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float4 Color = float4(1.f, 1.f, 1.f, 1.f); - - - float2 startUV = g_fImageUV.xy; - float2 endUV = g_fImageUV.zw; - - float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); - - float4 tex1 = g_Texture.Sample(DefaultSampler, atlasUV); - - Color = tex1; - - Color.a *= Alpha; - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_Revelio(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float4 Color = float4(1.f, 1.f, 1.f, 1.f); - float2 UV = In.vTexcoord; - - //float2 Position[4]; - //float2 startUV[4]; - //float2 endUV[4]; - - //float2 Atlases[4]; - - //for (int i = 0; i < 4; ++i) - //{ - // Position[i] = g_fPosition[i]; - // startUV[i] = g_fImagesUV[i].xy; - // endUV[i] = g_fImagesUV[i].zw; - - // Atlases[i] = startUV[i] + UV * (endUV[i] - startUV[i]); - //} - - //float4 tex1 = g_Texture.Sample(DefaultSampler, UV); - //float4 tex2 = g_Texture1.Sample(DefaultSampler, Atlases[0]); - //float4 tex3 = g_Texture1.Sample(DefaultSampler, Atlases[1]); - //float4 tex4 = g_Texture2.Sample(DefaultSampler, Atlases[2]); - //float4 tex5 = g_Texture2.Sample(DefaultSampler, Atlases[3]); - - - - ////float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); - - Color.a *= Alpha; - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_Potion(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float4 Color = float4(214.f / 255.f, 225 / 255.f, 36 / 255.f, 1.f); - - float2 center = float2(0.5f, 0.5f); - float2 uv = In.vTexcoord - center; - uv *= sqrt(2.0f); - float2 Rotation = In.vTexcoord; - Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); - Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); - Rotation += center; - - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); - Color = tex1; - - float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); - //Color += tex2; - float4 tex3 = g_Texture2.Sample(ClampSampler, Rotation); - Color = lerp(Color, tex3, tex3.a); - - float2 Potionuv = In.vTexcoord; - float scale = 1.2; - - Potionuv = (Potionuv - center) * scale + center; - float4 tex4 = g_Texture3.Sample(ClampSampler, Potionuv); - Color = lerp(Color, tex4, tex4.a); - - float2 tex5pos = g_Pos / g_fCurrent_Size; - float2 tex5size = g_fOrigin_Size / g_fCurrent_Size; - float2 tex5local = (In.vTexcoord - tex5pos) / tex5size; - bool inside = all(tex5local >= 0.0f && tex5local <= 1.0f); - float4 tex5 = g_Texture4.Sample(ClampSampler, tex5local); - if (inside) - Color = lerp(Color, tex5, tex5.a); - - Color.a *= Alpha; - Out.vColor = Color; - - return Out; -} - -PS_OUT PS_Magic_Item(PS_IN In) -{ - PS_OUT Out; - float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - - float4 color = float4(1.f, 1.f, 1.f, 1.f); - - float2 center = float2(0.5f, 0.5f); - float2 uv = In.vTexcoord - center; - uv *= sqrt(2.0f); - float2 Rotation = In.vTexcoord; - Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); - Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); - Rotation += center; - - float2 startUV = g_fImageUV.xy; - float2 endUV = g_fImageUV.zw; - - float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); - - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); - float4 tex2 = g_Texture3.Sample(ClampSampler, atlasUV); - - tex1.rgb *= 0.4f; - color = tex1; - tex2.rgb *= 0.3f; - - if (tex2.a >= 0.9f) - color = tex2; - float3 BGColor = float3(1.f, 1.f, 1.f); - - switch (g_iSpellType) - { - case 0: - BGColor = float3(50.f, 50.f, 50.f) / 255.f; - break; - case 1: - BGColor = float3(89.f, 32.f, 215.f) / 255.f; - break; - case 2: - BGColor = float3(190.f, 46., 34.f) / 255.f; - break; - case 3: - BGColor = float3(37.f, 129.f, 162.f) / 255.f; - break; - case 4: - BGColor = float3(134.f, 171.f, 78.f) / 255.f; - break; - } - - float4 color1 = float4(1.f, 1.f, 1.f, 1.f); - - float2 OverrayUV = In.vTexcoord; - float CoolTime = 0.f + g_fDeltaV; - float CoolTime2 = 0.f + g_fDeltaV + 0.05; - atlasUV = startUV + In.vTexcoord * (endUV - startUV); - float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); - tex3.rgb *= BGColor; - float4 tex4 = g_Texture3.Sample(DefaultSampler, atlasUV); - - if (g_fDeltaV <= 1.f) - { - if (tex4.a >= 0.9f) - tex3 = tex4; - - color1 = tex3; - - float wave1 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; - float wave2 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; - - float waveThreshold1 = CoolTime + wave1; - float waveThreshold2 = CoolTime2 + wave2; - - if (g_fDeltaV <= 1.f) - { - if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) - { - color1.rgb = float3(1.f, 1.f, 1.f); - } - } - - if (OverrayUV.y <= CoolTime) - { - color1.a = 0.f; - } - - color = lerp(color, color1, color1.a); - } - else if (g_fDeltaV >= 1.f) - color = lerp(color, tex4, tex4.a); - - float4 tex5 = g_Texture2.Sample(ClampSampler, Rotation); - color = lerp(color, tex5, tex5.a); - - float2 texpos1 = g_fItemPosition1 / g_fCurrent_Size; - float2 texpos2 = g_fItemPosition2 / g_fCurrent_Size; - float2 texsize1 = g_fItemImageSizes1 / g_fCurrent_Size; - float2 texsize2 = g_fItemImageSizes2 / g_fCurrent_Size; - float2 texlocal1 = (In.vTexcoord - texpos1) / texsize1; - float2 texlocal2 = (In.vTexcoord - texpos2) / texsize2; - - - bool inside1 = all(texlocal1 >= 0.0f && texlocal1 <= 1.0f); - float4 tex6 = g_Texture4.Sample(DefaultSampler, texlocal1); - - if (inside1) - color = lerp(color, tex6, tex6.a); - - bool inside2 = all(texlocal2 >= 0.0f && texlocal2 <= 1.0f); - - float4 tex7 = g_Texture5.Sample(DefaultSampler, texlocal2); - if (inside2) - color = lerp(color, tex7, tex7.a); - - color.a *= Alpha; - - Out.vColor = color; - return Out; -} - -technique11 PosTexTechnique11 -{ - pass Default - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_MAIN(); - } - - pass AlphaBlend - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_AlphaBlend(); - } - - pass TextureClamp - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Clamp(); - } - - pass Mouse_Cursor - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Cursor(); - } - - pass Sptire_Sheet - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_UIBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Sptire_Sheet(); - } - - pass Key_Hold_Rotation - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Key_Hold_Rotation(); - } - - pass Mission - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Mission(); - } - - pass QuestType - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_QuestType(); - } - - pass UVMult - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_UVMult(); - } - - pass NineSlice - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_NineSlice(); - } - - pass Rotation - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Rotation(); - } - - pass Slot - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Slot(); - } - - pass SpellAnim - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_SpellAnim(); - } - pass HpBar - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_HpBar(); - } - pass Magic_Meter - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Magic_Meter(); - } - - pass Magic_Icon - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Magic_Icon(); - } - - pass RemapUV - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_RemapUV(); - } - - pass Revelio - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Revelio(); - } - - pass Potion - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Potion(); - } - - pass Magic_Item - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Magic_Item(); - } - -} diff --git a/Jusin154_Team3D/Client/Private/Bombard.cpp b/Jusin154_Team3D/Client/Private/Bombard.cpp index 8cab71f85..0d6897a7b 100644 --- a/Jusin154_Team3D/Client/Private/Bombard.cpp +++ b/Jusin154_Team3D/Client/Private/Bombard.cpp @@ -25,15 +25,18 @@ HRESULT CBombard::Initialize_Prototype() HRESULT CBombard::Initialize(void* pArg) { - if (FAILED(__super::Initialize(pArg))) + if (FAILED(__super::Initialize(pArg))){ return E_FAIL; + } - if (FAILED(Ready_Components(pArg))) + if (FAILED(Ready_Components(pArg))) { return E_FAIL; + } - if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Bombard"))) + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Bombard"))) { return E_FAIL; + } m_wstrEffectName = L"Bombard"; @@ -78,13 +81,15 @@ void CBombard::Late_Update(_float fTimeDelta) HRESULT CBombard::Pre_Setting(CGameObject* pObject) { - if (pObject == nullptr) + if (pObject == nullptr) { return E_FAIL; + } m_pOwner = pObject; - if (FAILED(Ready_Child())) + if (FAILED(Ready_Child())) { return E_FAIL; + } Reset_EffectParts(); @@ -141,7 +146,7 @@ HRESULT CBombard::Ready_Child() XMStoreFloat3(&vDir, vOwnerLook * 2.f); Desc.vRotRPY = { 0.f, 0.f, 0.f }; - Desc.iSubKind = 70; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::SKILL_BOMBARD_STRIKE); Desc.vDeltaPos = vDir; Desc.vLifeTime = { 0.f, 2.f }; diff --git a/Jusin154_Team3D/Client/Private/Broom.cpp b/Jusin154_Team3D/Client/Private/Broom.cpp index 1548dd0e0..f6cb448d4 100644 --- a/Jusin154_Team3D/Client/Private/Broom.cpp +++ b/Jusin154_Team3D/Client/Private/Broom.cpp @@ -20,12 +20,14 @@ HRESULT CBroom::Initialize_Prototype() HRESULT CBroom::Initialize(void* pArg) { - if (FAILED(__super::Initialize(pArg))) + if (FAILED(__super::Initialize(pArg))) { return E_FAIL; + } - if (FAILED(Ready_Components())) + if (FAILED(Ready_Components())) { return E_FAIL; + } Add_FSM(); @@ -105,8 +107,9 @@ HRESULT CBroom::Ready_Components() /* Com_Model */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Broom_Model"), - reinterpret_cast(&m_pModelCom)))) + reinterpret_cast(&m_pModelCom)))) { return E_FAIL; + } /* Com_Shader */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH, diff --git a/Jusin154_Team3D/Client/Private/BuildingContainer.cpp b/Jusin154_Team3D/Client/Private/BuildingContainer.cpp index 788f6ba07..a0724e7a9 100644 --- a/Jusin154_Team3D/Client/Private/BuildingContainer.cpp +++ b/Jusin154_Team3D/Client/Private/BuildingContainer.cpp @@ -64,14 +64,17 @@ HRESULT CBuildingContainer::Render_BoundingBox() return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(0))) + if (FAILED(m_pShaderCom->Begin(0))) { return E_FAIL; + } - if (FAILED(m_pVIBufferCom->Bind_Resources())) + if (FAILED(m_pVIBufferCom->Bind_Resources())) { return E_FAIL; + } - if (FAILED(m_pVIBufferCom->Render())) + if (FAILED(m_pVIBufferCom->Render())) { return E_FAIL; + } m_pOcclusionQueryCom->End_Query(); @@ -112,8 +115,9 @@ HRESULT CBuildingContainer::Ready_Components(void* pArg) /* Com_Shader */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_VTXPOS, - reinterpret_cast(&m_pShaderCom)))) - return E_FAIL; + reinterpret_cast(&m_pShaderCom)))) { + return E_FAIL; + } MAP_CONTAINER_DESC* pDesc = static_cast(pArg); @@ -140,13 +144,15 @@ HRESULT CBuildingContainer::Ready_Components(void* pArg) /* Com_VIBuffer */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Box"), - reinterpret_cast(&m_pVIBufferCom), &vBoxCorners))) + reinterpret_cast(&m_pVIBufferCom), &vBoxCorners))) { return E_FAIL; + } /* Com_OcclusionQuery */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_OcclusionQuery"), - reinterpret_cast(&m_pOcclusionQueryCom)))) + reinterpret_cast(&m_pOcclusionQueryCom)))) { return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Decendo.cpp b/Jusin154_Team3D/Client/Private/Decendo.cpp index f282862cd..0f2d27a51 100644 --- a/Jusin154_Team3D/Client/Private/Decendo.cpp +++ b/Jusin154_Team3D/Client/Private/Decendo.cpp @@ -26,14 +26,17 @@ HRESULT CDecendo::Initialize_Prototype() HRESULT CDecendo::Initialize(void* pArg) { - if (FAILED(__super::Initialize(pArg))) + if (FAILED(__super::Initialize(pArg))) { return E_FAIL; + } - if (FAILED(Ready_Components(pArg))) + if (FAILED(Ready_Components(pArg))) { return E_FAIL; + } - if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Decendo"))) + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Decendo"))) { return E_FAIL; + } m_wstrEffectName = L"Decendo"; @@ -62,8 +65,9 @@ void CDecendo::Priority_Update(_float fTimeDelta) void CDecendo::Update(_float fTimeDelta) { - if (m_bVisible == false) + if (m_bVisible == false){ return; + } __super::Update(fTimeDelta); @@ -103,15 +107,17 @@ void CDecendo::Late_Update(_float fTimeDelta) HRESULT CDecendo::Pre_Setting(CGameObject* pObject) { - if (pObject == nullptr) + if (pObject == nullptr) { return E_FAIL; + } /* 부모 할당 */ m_pOwner = pObject; /* 피직스 생성*/ - if (FAILED(Ready_Child())) + if (FAILED(Ready_Child())) { return E_FAIL; + } /* 초기 셋팅 초기화 */ Reset_EffectParts(); @@ -171,6 +177,7 @@ HRESULT CDecendo::Ready_Child() Desc.vRotRPY = { 0.f, 0.f, 0.f }; + Desc.iSubKind = 70; Desc.vDeltaPos = _float3(0.f, 0.f, 0.f); Desc.vLifeTime = { 0.f, 1.f }; @@ -249,8 +256,9 @@ void CDecendo::Free() { __super::Free(); - if (m_pPhysHitBox != nullptr) + if (m_pPhysHitBox != nullptr){ SAFE_RELEASE(m_pPhysHitBox); + } SAFE_RELEASE(m_pProjectile_Blur); SAFE_RELEASE(m_pProjectile); diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 9521d742f..2c0cb6115 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -148,7 +148,7 @@ HRESULT CGoblin::Ready_Components() { // CCT CCharacter_Controller::Character_Controller_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::MONSTER); + Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR); Desc.pTransform = m_pTransformCom; Desc.eBodyType = ACTOR::CAPSULE; Desc.fContactOffset = 0.1f; @@ -167,7 +167,7 @@ HRESULT CGoblin::Ready_Components() m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION)); { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::MONSTER); + Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR); if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index c69baa289..5e955fb4d 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -26,6 +26,16 @@ void CInfoInstance::Change_Level() m_pMapInfo->Change_Level(); } +void CInfoInstance::Update_CameraCoordinateSystem(_float3& vLook, _float3& vRight) +{ + m_pPlayerInfo->Update_CameraCoordinateSystem(vLook, vRight); +} + +pair<_float3, _float3> CInfoInstance::Get_CameraCoordinateSystem() +{ + return m_pPlayerInfo->Get_CameraCoordinateSystem(); +} + #pragma region MONSTER_INFO HRESULT CInfoInstance::Regist_PlayerAlly(CUnit* pUnit) { diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 44d2071ff..fc65df560 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -204,7 +204,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag) CDummy_PhysXWall::PHYSXDUMMY_DESC Desc{}; Desc.vPos = { 0.f, 0.f, 0.f }; Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f }; - Desc.iSubKind = 23; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::WALL); if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index 185f88cb0..a57e8d4ab 100644 --- a/Jusin154_Team3D/Client/Private/MainApp.cpp +++ b/Jusin154_Team3D/Client/Private/MainApp.cpp @@ -28,7 +28,7 @@ HRESULT CMainApp::Initialize() EngineDesc.iWinSizeY = g_iWinSizeY; EngineDesc.iStaticLevel = g_iStaticLevel; EngineDesc.iNumLevels = ENUM_CLASS(LEVEL::END); - EngineDesc.iNumCollidableGroup = ENUM_CLASS(COLLIDABLEOBJECT::END); + EngineDesc.iNumCollidableGroup = ENUM_CLASS(COLLIDABLEOBJECT_KIND::END); //ShowCursor(false); diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp index 6d9bb4c65..288e74f50 100644 --- a/Jusin154_Team3D/Client/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp @@ -36,8 +36,9 @@ HRESULT CNomalJap::Initialize(void* pArg) m_wstrEffectName = L"Nomal_Jap"; - if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Jap"))) + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Jap"))){ return E_FAIL; + } m_pProjectile_Side = Get_PartObject("JapProjSide"); @@ -114,8 +115,9 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) m_pOwner = pObject; /* 피직스 생성*/ - if (FAILED(Ready_Child())) + if (FAILED(Ready_Child())){ return E_FAIL; + } /* 초기 셋팅 초기화 */ Reset_EffectParts(); @@ -137,12 +139,10 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) Get_PartObject()->Get_Component()->Reset_Trail(); - //나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬 m_vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); - _vector vQuaternion = XMQuaternionRotationAxis(m_vOwnerLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); m_vRotateUp = XMVector3Rotate(vUp, vQuaternion); @@ -172,7 +172,7 @@ HRESULT CNomalJap::Ready_Child() XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); Desc.vRotRPY = { 0.f, 0.f, 0.f }; - Desc.iSubKind = 70; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::SKILL_NORMALJAP); Desc.vDeltaPos = _float3(0.f, 0.f, 0.f); Desc.vLifeTime = { 0.f, 1.f }; diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 25edf412a..d7726e40b 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -101,7 +101,7 @@ HRESULT CPlayer::Initialize(void* pArg) void CPlayer::Priority_Update(_float fTimeDelta) { ReLockOnTarget(); - + SetGravity(); m_pTransformCom->RewindMomentum(); __super::Priority_Update(fTimeDelta); @@ -194,15 +194,16 @@ void CPlayer::Render_CameraCoordinateSystem() GUI::Text("S : %.2f, %.2f, %.2f", -m_vCameraLookDir.x, 0.f, -m_vCameraLookDir.z); GUI::Text("D : %.2f, %.2f, %.2f", m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z); - GUI::Button("##0", { 100.f, 100.f }); GUI::SameLine(); - GUI::Button(("W : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraLookDir.x , m_vCameraLookDir.z })))).c_str(), {100.f, 100.f}); GUI::SameLine(); - GUI::Button("##2", {100.f, 100.f}); - GUI::Button(("A : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraRightDir.x , -m_vCameraRightDir.z })))).c_str(), { 100.f, 100.f }); GUI::SameLine(); - GUI::Button("##4", { 100.f, 100.f }); GUI::SameLine(); - GUI::Button(("D : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraRightDir.x , m_vCameraRightDir.z })))).c_str(), { 100.f, 100.f }); - GUI::Button("##6", {100.f, 100.f}); GUI::SameLine(); - GUI::Button(("S : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraLookDir.x , -m_vCameraLookDir.z })))).c_str(), { 100.f, 100.f }); GUI::SameLine(); - GUI::Button("##8", {100.f, 100.f}); + _float fButtonSize = 25.f; + GUI::Button("##0", { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button(("W : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraLookDir.x , m_vCameraLookDir.z })))).c_str(), { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button("##2", { fButtonSize, fButtonSize }); + GUI::Button(("A : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraRightDir.x , -m_vCameraRightDir.z })))).c_str(), { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button("##4", { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button(("D : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraRightDir.x , m_vCameraRightDir.z })))).c_str(), { fButtonSize, fButtonSize }); + GUI::Button("##6", { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button(("S : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraLookDir.x , -m_vCameraLookDir.z })))).c_str(), { fButtonSize, fButtonSize }); GUI::SameLine(); + GUI::Button("##8", { fButtonSize, fButtonSize }); //W CMyTools::Get_Direction2D(vLook, { m_vCameraLookDir.x , m_vCameraLookDir.z }) //A CMyTools::Get_Direction2D(vLook, { -m_vCameraRightDir.x , - m_vCameraRightDir.z }) //S CMyTools::Get_Direction2D(vLook, { m_vCameraRightDir.x , m_vCameraRightDir.z }) @@ -253,12 +254,12 @@ HRESULT CPlayer::Ready_Components() { // CCT CCharacter_Controller::Character_Controller_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::PLAYER); + Desc.iSubKind = ENUM_CLASS(PXOBJECT::PLAYER); Desc.pTransform = m_pTransformCom; Desc.eBodyType = ACTOR::CAPSULE; Desc.fContactOffset = 0.17f; Desc.fMaterial = { 0.5f, 0.5f, 0.6f }; - Desc.bAutoStepping = { false }; + Desc.bAutoStepping = { true }; Desc.fStepOffset = { 0.05f }; Desc.fRadius = 0.5f; Desc.fHeight = 1.0f; @@ -268,11 +269,12 @@ HRESULT CPlayer::Ready_Components() if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { return E_FAIL; } + m_pCharacter_Controller->SetGravity(false); } { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::PLAYER); + Desc.iSubKind = ENUM_CLASS(PXOBJECT::PLAYER); if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { return E_FAIL; } @@ -337,6 +339,23 @@ void CPlayer::ReLockOnTarget() } } +void CPlayer::SetGravity() +{ + PSX::PxControllerCollisionFlags eCollisionFlags = m_pCharacter_Controller->Get_CollisionFlags(); + eCollisionFlags; + if ( false == eCollisionFlags.isSet(PSX::PxControllerCollisionFlag::Enum::eCOLLISION_DOWN) + && false == eCollisionFlags.isSet(PSX::PxControllerCollisionFlag::Enum::eCOLLISION_SIDES)) { + if (false == m_pFSM->IsEnable(STATEANIM::JUMP)) { // 벽에 닿지 않았는데 점프 중이 아닐 땐 중력 on + m_pCharacter_Controller->SetGravity(true); + } + else { // 점프 중일 땐 off + m_pCharacter_Controller->SetGravity(false); + } + } + else { // 벽에 닿는중일 땐 항상 중력 off + m_pCharacter_Controller->SetGravity(false); + } +} void CPlayer::Update_CameraCoordinateSystem() { @@ -344,6 +363,7 @@ void CPlayer::Update_CameraCoordinateSystem() _vector xmvUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); XMStoreFloat3(&m_vCameraRightDir, XMVector3Normalize(XMVector3Cross(xmvUp, xmvCameraLook))); XMStoreFloat3(&m_vCameraLookDir, xmvCameraLook); + m_pInfoInstance->Update_CameraCoordinateSystem(m_vCameraLookDir, m_vRimLightColor); } _matrix CPlayer::Get_WandPos() diff --git a/Jusin154_Team3D/Client/Private/PlayerInfo.cpp b/Jusin154_Team3D/Client/Private/PlayerInfo.cpp index a923b62a7..57d8fe77a 100644 --- a/Jusin154_Team3D/Client/Private/PlayerInfo.cpp +++ b/Jusin154_Team3D/Client/Private/PlayerInfo.cpp @@ -11,6 +11,17 @@ void CPlayerInfo::Update(_float fTimeDelta) { } +void CPlayerInfo::Update_CameraCoordinateSystem(_float3& vLook, _float3& vRight) +{ + m_vCameraLookDir = vLook; + m_vCameraRightDir = vRight; +} + +pair<_float3, _float3> CPlayerInfo::Get_CameraCoordinateSystem() +{ + return { m_vCameraLookDir, m_vCameraRightDir }; +} + void CPlayerInfo::Change_Level() { } diff --git a/Jusin154_Team3D/Client/Private/Terrain.cpp b/Jusin154_Team3D/Client/Private/Terrain.cpp index 9180c852d..107408e01 100644 --- a/Jusin154_Team3D/Client/Private/Terrain.cpp +++ b/Jusin154_Team3D/Client/Private/Terrain.cpp @@ -37,7 +37,7 @@ HRESULT CTerrain::Initialize(void* pArg) CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc{}; Desc.pMeshName = TEXT("Hogsmeade_HeightMap"); - Desc.iSubKind = 998; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN); /* Com_RigidBody */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_RigidBody_Static_Terrain_Hogsmeade"), reinterpret_cast(&m_pRigidBody), &Desc))) { diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 046bbb1b4..9dc3ae989 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -3,7 +3,6 @@ namespace Client { enum class LEVEL { STATIC, LOADING, LOGO, INTRO, GAMEPLAY, FIELD, RESTART, 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 }; @@ -21,5 +20,112 @@ namespace Client enum class EFFECT_TYPE { EFFECT, TRAIL, END }; enum class SKILL_TYPE { JAP, BOMBARD, DESCENDO, PROTEGO, END }; enum class BLOOM_TYPE { NONE, BASIC, MULTIPLY, END }; - +} + + +namespace Client { + enum class COLLIDABLEOBJECT_KIND { + NOT_DEFINE, + PLAYER, + MONSTER, + HOSTILE_HITBOX, + ALLY_HITBOX, + NEUTRAL_HITBOX, + ENVIRONMENT, + NPC, + ITEM, + TRIGGERBOX, + REGION, + NOCOLLIDE, + END, + }; + enum class PXOBJECT : _uint { +#pragma region NOT_DEFINE + NOT_DEFINE = 000, +#pragma endregion +#pragma region PLAYER + PLAYER = 010, +#pragma endregion +#pragma region MONSTER + MONSTER = 030, + GOBLIN_WARRIOR, // 031 + GOBLIN_MAGICIAN, + GOBLIN_THEIF, + TROLL, + PENSIVE_GUARDIAN, + +#pragma endregion +#pragma region HOSTILE_HITBOX + HOSTILE_HITBOX = 100, + GOBLIN_SMASH, + GOBLIN_DAGGER, + GOBLIN_SHIELD_BREAK_MELEE, + GOBLIN_SHIELD_BREAK_MAGIC, + GOBLIN_NORMAL_MAGIC, + +#pragma endregion +#pragma region ALLY_HITBOX + ALLY_HITBOX = 200, + SKILL_REVAILIO, + SKILL_ACCIO, + SKILL_DEPULSO, + SKILL_DEPULSO_OBSTACLE, + SKILL_DEPULSO_OBSTACLE_FLAMED, + SKILL_NORMALJAP, + SKILL_NORMALJAP_FINAL, + SKILL_BOMBARD_STRIKE, + SKILL_BOMBARD_FLAME, + SKILL_INCENDIO_STRIKE, + SKILL_INCENDIO_SPREAD, + +#pragma endregion +#pragma region NEUTRAL_HITBOX + NEUTRAL_HITBOX = 300, + FLAMED_FLOOR, + +#pragma endregion +#pragma region ENVIRIONMENT + ENVIRIONMENT = 400, + TERRAIN, + WATER, + WALL, + WALL_BREAKABLE, + WALL_CLIMBABLE, + DOOR, + BUILDING, + BOX, +#pragma endregion +#pragma region NPC + NPC = 500, + +#pragma endregion +#pragma region ITEM + ITEM = 600, + DROPITEM = 630, + TRAP = 660, + +#pragma endregion +#pragma region TRIGGERBOX + TRIGGERBOX = 700, + + + CINEMATIC = 770, + CINEMATIC_INTRO, + CINEMATIC_HOGSMEADE_ENTER, + CINEMATIC_TROLL_ENCOUNTER, + CINEMATIC_TROLL_DEAD, +#pragma endregion +#pragma region REGION + REGION = 800, + HOGWARTS, + HOGSMEADE, + +#pragma endregion +#pragma region NOCOLLIDE + NOCOLLIDE = 900, + GAIL, + +#pragma endregion + END = 999 + }; } diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index 982be5a56..0f7adec6e 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -25,6 +25,10 @@ class CInfoInstance final : public CBase void Update(_float fTimeDelta); void Change_Level(); +#pragma region PLAYER_INFO + void Update_CameraCoordinateSystem(_float3& vLook, _float3& vRight); + pair<_float3, _float3> Get_CameraCoordinateSystem(); +#pragma endregion #pragma region MONSTER_INFO HRESULT Regist_PlayerAlly(CUnit* pUnit); HRESULT Deregist_PlayerAlly(CUnit* pUnit); diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 9651566c6..f2b34928a 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -52,6 +52,7 @@ class CPlayer final : public CUnit HRESULT Ready_Parts(); HRESULT Bind_ShaderResources(); void ReLockOnTarget(); + void SetGravity(); void Update_CameraCoordinateSystem(); #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Public/PlayerInfo.h b/Jusin154_Team3D/Client/Public/PlayerInfo.h index 01ebcd01b..3a4fa0654 100644 --- a/Jusin154_Team3D/Client/Public/PlayerInfo.h +++ b/Jusin154_Team3D/Client/Public/PlayerInfo.h @@ -19,6 +19,8 @@ class CPlayerInfo final : public CBase void Update(_float fTimeDelta); void Change_Level(); + void Update_CameraCoordinateSystem(_float3& vLook, _float3& vRight); + pair<_float3, _float3> Get_CameraCoordinateSystem(); private: CGameInstance* m_pGameInstance = { nullptr }; class CInfoInstance* m_pInfoInstance = { nullptr }; @@ -27,6 +29,8 @@ class CPlayerInfo final : public CBase private: CTransform* m_pTransform = { nullptr }; + _float3 m_vCameraLookDir = { 0.f, 0.f, 1.f, }; + _float3 m_vCameraRightDir = { 1.f, 0.f, 0.f }; private: diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli index 6dd9a46db..916fcb483 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli @@ -108,7 +108,7 @@ DepthStencilState DSS_Default_Environment_SWrite DepthStencilState DSS_Default_Environment_SRead { DepthEnable = true; - DepthWriteMask = zero; + DepthWriteMask = false; DepthFunc = less_equal; StencilEnable = true; @@ -129,7 +129,7 @@ DepthStencilState DSS_Default_Environment_SRead DepthStencilState DSS_Default_OutLine_SWrite { DepthEnable = true; - DepthWriteMask = true; + DepthWriteMask = zero; DepthFunc = less_equal; StencilEnable = true; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index aebef6d50..70ab08713 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -145,7 +145,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float fOcclusion = 1.f; float fAttenuation = 1.f; - float fDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 float3 vToLight = normalize(-g_vLightDir.xyz); // 픽셀에서 라이트로 @@ -177,10 +177,10 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) } float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); - { // 수치조정 + { // 수치조정 // 디렉셔널 float fMinRoughness = 0.05f; fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 - fRoughness = saturate(saturate(fDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) vF0 = min(vF0, 0.9f); // 메탈릭 상한선 } @@ -221,31 +221,35 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) float3 vF0 = float3(0.04f, 0.04f, 0.04f); float fMetallic = 0.f; float fRoughness = 0.5f; - float fOcclusion = 1.f; float fAttenuation = 1.f; - float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 - float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); + float fLightDistance = length(g_vLightPos.xyz - vWorldPosition.xyz); + float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 + float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + fAttenuation = saturate((g_fLightRange - fLightDistance) / g_fLightRange); + if (fAttenuation <= 0.f) { - float fDistance = length(vToLight); - fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange); - if (fAttenuation <= 0.f) { discard; } + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; } - + if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_METALNESS)) // Metallic { float3 vMRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; fMetallic = vMRO.r; fRoughness = vMRO.g; fOcclusion = vMRO.b; - + vF0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic); } else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_SPECULAR)) // Specular { fMetallic = 0.f; + float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; vF0 = vSRO.rrr; fRoughness = vSRO.g; @@ -259,8 +263,18 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) return Out; } + float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); + { // 수치조정 // 점광원 + float fMinRoughness = 0.05f; + fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + vF0 = min(vF0, 0.9f); // 메탈릭 상한선 + } + PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); + PBR_Out.vShade *= fDiffuseAOStrength; + Out.vShade = float4(PBR_Out.vShade, 1.f); Out.vSpecular = float4(PBR_Out.vSpecular, 1.f); @@ -279,7 +293,7 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float fViewZ = vDepth.y * g_fFar; - float4 vWorldPosition; + float4 vWorldPosition; // 월드 복원 { vWorldPosition.x = uv.x * 2 - 1; vWorldPosition.y = uv.y * -2 + 1; @@ -296,16 +310,26 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float fOcclusion = 1.f; float fAttenuation = 1.f; + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); + float fLightDistance = length(g_vLightPos.xyz - vWorldPosition.xyz); float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + fAttenuation = saturate((g_fLightRange - fLightDistance) / g_fLightRange); + if (fAttenuation <= 0.f) { - float fDistance = length(vToLight); - fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange); - if (fAttenuation <= 0.f) { discard; } + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; } + float fCosAngle = dot(vToView, g_vLightDir.xyz); - if (fCosAngle < g_fSpotOuterAngle) { discard; } + if (fCosAngle < g_fSpotOuterAngle) + { + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; + } float fSpotAttenenuation = saturate((fCosAngle - g_fSpotInnerAngle) / (g_fSpotInnerAngle - g_fSpotOuterAngle)); fAttenuation *= fSpotAttenenuation; @@ -316,12 +340,13 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) fMetallic = vMRO.r; fRoughness = vMRO.g; fOcclusion = vMRO.b; - + vF0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic); } else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_SPECULAR)) // Specular { fMetallic = 0.f; + float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; vF0 = vSRO.rrr; fRoughness = vSRO.g; @@ -335,8 +360,18 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) return Out; } + float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); + { // 수치조정 // 점광원 + float fMinRoughness = 0.05f; + fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + vF0 = min(vF0, 0.9f); // 메탈릭 상한선 + } + PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); + PBR_Out.vShade *= fDiffuseAOStrength; + Out.vShade = float4(PBR_Out.vShade, 1.f); Out.vSpecular = float4(PBR_Out.vSpecular, 1.f); diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli index 6dd9a46db..916fcb483 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli @@ -108,7 +108,7 @@ DepthStencilState DSS_Default_Environment_SWrite DepthStencilState DSS_Default_Environment_SRead { DepthEnable = true; - DepthWriteMask = zero; + DepthWriteMask = false; DepthFunc = less_equal; StencilEnable = true; @@ -129,7 +129,7 @@ DepthStencilState DSS_Default_Environment_SRead DepthStencilState DSS_Default_OutLine_SWrite { DepthEnable = true; - DepthWriteMask = true; + DepthWriteMask = zero; DepthFunc = less_equal; StencilEnable = true; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index aebef6d50..70ab08713 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -145,7 +145,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float fOcclusion = 1.f; float fAttenuation = 1.f; - float fDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 float3 vToLight = normalize(-g_vLightDir.xyz); // 픽셀에서 라이트로 @@ -177,10 +177,10 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) } float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); - { // 수치조정 + { // 수치조정 // 디렉셔널 float fMinRoughness = 0.05f; fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 - fRoughness = saturate(saturate(fDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) vF0 = min(vF0, 0.9f); // 메탈릭 상한선 } @@ -221,31 +221,35 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) float3 vF0 = float3(0.04f, 0.04f, 0.04f); float fMetallic = 0.f; float fRoughness = 0.5f; - float fOcclusion = 1.f; float fAttenuation = 1.f; - float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 - float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); + float fLightDistance = length(g_vLightPos.xyz - vWorldPosition.xyz); + float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 + float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + fAttenuation = saturate((g_fLightRange - fLightDistance) / g_fLightRange); + if (fAttenuation <= 0.f) { - float fDistance = length(vToLight); - fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange); - if (fAttenuation <= 0.f) { discard; } + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; } - + if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_METALNESS)) // Metallic { float3 vMRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; fMetallic = vMRO.r; fRoughness = vMRO.g; fOcclusion = vMRO.b; - + vF0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic); } else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_SPECULAR)) // Specular { fMetallic = 0.f; + float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; vF0 = vSRO.rrr; fRoughness = vSRO.g; @@ -259,8 +263,18 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) return Out; } + float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); + { // 수치조정 // 점광원 + float fMinRoughness = 0.05f; + fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + vF0 = min(vF0, 0.9f); // 메탈릭 상한선 + } + PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); + PBR_Out.vShade *= fDiffuseAOStrength; + Out.vShade = float4(PBR_Out.vShade, 1.f); Out.vSpecular = float4(PBR_Out.vSpecular, 1.f); @@ -279,7 +293,7 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float fViewZ = vDepth.y * g_fFar; - float4 vWorldPosition; + float4 vWorldPosition; // 월드 복원 { vWorldPosition.x = uv.x * 2 - 1; vWorldPosition.y = uv.y * -2 + 1; @@ -296,16 +310,26 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float fOcclusion = 1.f; float fAttenuation = 1.f; + float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz); + float fLightDistance = length(g_vLightPos.xyz - vWorldPosition.xyz); float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로 + fAttenuation = saturate((g_fLightRange - fLightDistance) / g_fLightRange); + if (fAttenuation <= 0.f) { - float fDistance = length(vToLight); - fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange); - if (fAttenuation <= 0.f) { discard; } + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; } + float fCosAngle = dot(vToView, g_vLightDir.xyz); - if (fCosAngle < g_fSpotOuterAngle) { discard; } + if (fCosAngle < g_fSpotOuterAngle) + { + Out.vShade = float4(0.f, 0.f, 0.f, 1.f); + Out.vSpecular = float4(0.f, 0.f, 0.f, 1.f); + return Out; + } float fSpotAttenenuation = saturate((fCosAngle - g_fSpotInnerAngle) / (g_fSpotInnerAngle - g_fSpotOuterAngle)); fAttenuation *= fSpotAttenenuation; @@ -316,12 +340,13 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) fMetallic = vMRO.r; fRoughness = vMRO.g; fOcclusion = vMRO.b; - + vF0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic); } else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_SPECULAR)) // Specular { fMetallic = 0.f; + float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb; vF0 = vSRO.rrr; fRoughness = vSRO.g; @@ -335,8 +360,18 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) return Out; } + float fDiffuseAOStrength = lerp(0.3f, 3.f, fOcclusion); + { // 수치조정 // 점광원 + float fMinRoughness = 0.05f; + fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 + fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 ) + vF0 = min(vF0, 0.9f); // 메탈릭 상한선 + } + PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); + PBR_Out.vShade *= fDiffuseAOStrength; + Out.vShade = float4(PBR_Out.vShade, 1.f); Out.vSpecular = float4(PBR_Out.vSpecular, 1.f); diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp index 1fff47315..bbe400cdf 100644 --- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp +++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp @@ -69,6 +69,11 @@ PSX::PxController* CCharacter_Controller::Get_Controller() return m_pController; } +PSX::PxControllerCollisionFlags CCharacter_Controller::Get_CollisionFlags() +{ + return m_eBeforeCollisionFlags; +} + void CCharacter_Controller::Resize_Volume(_float fHeight) { m_pController->resize(fHeight); @@ -326,6 +331,7 @@ void CCharacter_Controller::Free() void CCharacter_Controller::Describe_Entity() { GUI::Begin("Character_Controller"); + GUI::Text("Gravity : %d ", m_bGravity); m_pTransform->Describe_Entity(); GUI::TextLinkOpenURL("More details here", "https://dev-treadmill.tistory.com/158"); _float fContact = m_pController->getContactOffset(); diff --git a/Jusin154_Team3D/Engine/Public/Character_Controller.h b/Jusin154_Team3D/Engine/Public/Character_Controller.h index 44f4fe536..119755fd4 100644 --- a/Jusin154_Team3D/Engine/Public/Character_Controller.h +++ b/Jusin154_Team3D/Engine/Public/Character_Controller.h @@ -55,7 +55,8 @@ class ENGINE_DLL CCharacter_Controller final : void Set_Position(_fvector vNewPos); // 순간이동 _vector Get_Position(); _vector Get_FootPosition(); // ContactOffset이 고려된 발바닥 위치( 실제보다 바닥 위치가 더 아래에 위치한다는 뜻 ) - + + PSX::PxControllerCollisionFlags Get_CollisionFlags(); void Resize_Volume(_float fHeight); // 높이를 수정하고 바닥에 붙임 void Modify_Volume(_float3 fVolume); _float3 Get_Volume(); @@ -71,8 +72,8 @@ class ENGINE_DLL CCharacter_Controller final : PSX::PxController* m_pController = { nullptr }; CTransform* m_pTransform = { nullptr }; _bool m_bAutoStepping = { false }; - _float m_fGravity = { 0.129f }; - _float m_fSlopeLimit = { 0.69f/*0~1*/}; // cosf각도, 오르막 경사각 제한. ( 추가설정 필요함 ) + _float m_fGravity = { 0.094f }; + _float m_fSlopeLimit = { 0.302f/*0~1*/}; // cosf각도, 오르막 경사각 제한. ( 추가설정 필요함 ) PhsXUserData m_tagData = {}; PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {};