diff --git a/Jusin154_Team3D/Client/Bin/Resources/Fonts/HYHL.spritefont b/Jusin154_Team3D/Client/Bin/Resources/Fonts/HYHL.spritefont deleted file mode 100644 index 85902d726..000000000 Binary files a/Jusin154_Team3D/Client/Bin/Resources/Fonts/HYHL.spritefont and /dev/null differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Fonts/showg.ttf b/Jusin154_Team3D/Client/Bin/Resources/Fonts/showg.ttf deleted file mode 100644 index 8317848b6..000000000 Binary files a/Jusin154_Team3D/Client/Bin/Resources/Fonts/showg.ttf and /dev/null differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.bin b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.bin deleted file mode 100644 index 357dffe23..000000000 --- a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1b2436f7a866e3b41742ca01e2f37f72a68d6cc12c5256e6c3d806a4432984ad -size 2629 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.fbx deleted file mode 100644 index 5aaa7259d..000000000 --- a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.fbx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:080a0a3ed020c28e328279970ea89819fb309033b535f1b0bd7b61a6b055b1bc -size 18300 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.dds b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.dds deleted file mode 100644 index 381cd3a32..000000000 Binary files a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.dds and /dev/null differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.png deleted file mode 100644 index 744e67150..000000000 Binary files a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.png and /dev/null differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.dds b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.dds deleted file mode 100644 index bbc1e6aae..000000000 Binary files a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.dds and /dev/null differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.png deleted file mode 100644 index 18d3a6683..000000000 Binary files a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.png and /dev/null differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/assimp-vc143-mt.dll b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/assimp-vc143-mt.dll deleted file mode 100644 index 2366a0910..000000000 Binary files a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/assimp-vc143-mt.dll and /dev/null differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.dds b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.dds deleted file mode 100644 index 995411b24..000000000 Binary files a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.dds and /dev/null differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.png deleted file mode 100644 index a06c63c7f..000000000 Binary files a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.png and /dev/null differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl deleted file mode 100644 index 91a72f9db..000000000 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ /dev/null @@ -1,324 +0,0 @@ -#include "Engine_Shader_Functions.hlsli" - -struct Particle -{ - float4 vRight; - float4 vUp; - float4 vLook; - float4 vTranslation; - - float2 vLifeTime; -}; - -struct ParticleValue -{ - float fSpeed; - float fRotaionSpeed; - - float4 vOriginRight; - float4 vOriginUp; - float4 vOriginLook; - float4 vOriginTranslation; - - float2 vMaskingUVMoveTime; - float2 vDiffuseUVMoveTime; - float2 vDistortionUVMoveTime; - float2 vNoiseUVMoveTime; - float2 vAniTime; - - float2 vAniIndex; - float fGravity; - - float3 vSinAmount; - float3 vDeltaAngle; - float3 vDeltaAxisAngle; - - float fDrag; - float3 vPivot; - - float fSizeDrag; - float3 vDeltaSize; - float2 vDelay; -}; - - -StructuredBuffer g_ParticleBufferInput : register(t0); -StructuredBuffer g_ParticleValueBufferInput : register(t1); - -RWStructuredBuffer g_VBInstanceOutput : register(u0); -RWStructuredBuffer g_ParticleValueOutput : register(u1); - -cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐이더 바인딩할때 인덱스가 동일해야함 -{ - row_major matrix WorldMatrix; - - bool isLoop; // 상수 버퍼에서 불값은 4바이트로 처리되기 때문에 반드시 클라에서는 int형으로 선언해라 - bool isDrop; - bool isMoveForward; - bool isSinWave; - - bool isTurn; - bool isAxisTurn; - bool isPivotMove; - bool isSizeMove; - - bool isNoWorld; - bool isPadding0; - bool isPadding1; - bool isPadding2; - - float fTimeDelta; - float fPadding1; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다. - float fPadding2; - float fPadding3; -} - -//내가 몇개의 스레드를 사용할 것인지 지정하는데 -//GPU 칩의 개수를 X * Y * Z의 개수 만큼 사용하겠다는 의미이다. -[numthreads(256, 1, 1)] -void CS_MAIN( - uint3 DispatchThreadID : SV_DispatchThreadID) -{ - int iIndex = DispatchThreadID.x; // 배열 인덱스 - - Particle particle = g_ParticleBufferInput[iIndex]; - - ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; - - particleValue.vDelay.x += fTimeDelta; - - if (particleValue.vDelay.x < particleValue.vDelay.y) - { - - - g_VBInstanceOutput[iIndex] = particle; - g_ParticleValueOutput[iIndex] = particleValue; - - return; - } - - if (particle.vLifeTime.x <= FLT_EPSILON5) - { - if (isNoWorld) - { - float4x4 CurMat = { particle.vRight, particle.vUp, particle.vLook, particle.vTranslation }; - - - CurMat = mul(CurMat, WorldMatrix); - - particle.vRight = CurMat[0].xyzw; - particle.vUp = CurMat[1].xyzw; - particle.vLook = CurMat[2].xyzw; - particle.vTranslation = CurMat[3].xyzw; - } - } - // 라이프타임 움직임 - particle.vLifeTime.x += fTimeDelta; - - if (particle.vLifeTime.x >= particle.vLifeTime.y) - { - if (isLoop == false) - { - return ; - } - //초기화 - particle.vRight = particleValue.vOriginRight; - particle.vUp = particleValue.vOriginUp; - particle.vLook = particleValue.vOriginLook; - particle.vTranslation = particleValue.vOriginTranslation; - - particle.vLifeTime.x = 0.f; - particleValue.vAniIndex.x = 0.f; - particleValue.vDelay.x = 0.f; - - - - g_VBInstanceOutput[iIndex] = particle; - g_ParticleValueOutput[iIndex] = particleValue; - - return ; - } - - - if (isMoveForward) - { - float fTime = (particle.vLifeTime.x / particle.vLifeTime.y); - - float fRatio = 1 - (1 - fTime * fTime); - - float fDrag = particleValue.fDrag; - - if (particleValue.fDrag < FLT_EPSILON5) - fDrag = 1; - - float4 vVelocity = vector(normalize(particle.vLook.xyz) * particleValue.fSpeed, 1.f); - - particle.vTranslation += vVelocity * fTimeDelta * fDrag; - } - - if (isPivotMove) - { - float3 vDir = normalize(particleValue.vPivot - particleValue.vOriginTranslation.xyz); - - float fDrag = particleValue.fDrag; - - if (particleValue.fDrag < FLT_EPSILON5) - fDrag = 1; - - float4 vVelocity = vector(vDir * particleValue.fSpeed, 1.f); - - particle.vTranslation += vVelocity * fTimeDelta * fDrag; - - } - - if (isDrop == true) - { - particle.vTranslation.y -= 0.5f * particle.vLifeTime.x * particleValue.fGravity; - } - - /* 사인 웨이브 */ - if(isSinWave == true) - { - particle.vTranslation += vector( sin(particle.vLifeTime.x * 3.141592 * 2.f) * particleValue.vSinAmount, 0.f); - } - - if (isTurn == true) - { - /* ROTATE */ - float4x4 RotateXMat = RotateX(particleValue.vDeltaAngle.x * fTimeDelta); - float4x4 RotateYMat = RotateY(particleValue.vDeltaAngle.y * fTimeDelta); - float4x4 RotateZMat = RotateZ(particleValue.vDeltaAngle.z * fTimeDelta); - - - float4x4 CombinedRotMat = mul(RotateZMat, mul(RotateYMat, RotateXMat)); - - float4x4 CurRotatemat = {particle.vRight, particle.vUp, particle.vLook, vector(0.f , 0.f, 0.f, 1.f)}; - - - - CurRotatemat = mul(CombinedRotMat, CurRotatemat); - - particle.vRight = CurRotatemat[0].xyzw; - particle.vUp = CurRotatemat[1].xyzw; - particle.vLook = CurRotatemat[2].xyzw; - - } - - if (isAxisTurn) - { - float4x4 RotateAxisRightMat = RotateAxis(particle.vRight, particleValue.vDeltaAxisAngle.x * fTimeDelta); - float4x4 RotateAxisUpMat = RotateAxis(particle.vUp, particleValue.vDeltaAxisAngle.y * fTimeDelta); - float4x4 RotateAxisLookMat = RotateAxis(particle.vLook, particleValue.vDeltaAxisAngle.z * fTimeDelta); - - - float4x4 CombinedRotMat = mul(RotateAxisLookMat, mul(RotateAxisUpMat, RotateAxisRightMat)); - - float4x4 CurRotatemat = { particle.vRight, particle.vUp, particle.vLook, vector(0.f, 0.f, 0.f, 1.f) }; - - - CurRotatemat = mul(CurRotatemat ,CombinedRotMat); - - particle.vRight = CurRotatemat[0].xyzw; - particle.vUp = CurRotatemat[1].xyzw; - particle.vLook = CurRotatemat[2].xyzw; - - - } - - if (isSizeMove == true) - { - float3 CurLength = - { - length(particle.vRight), - length(particle.vUp), - length(particle.vLook), - }; - - float fTime = (particle.vLifeTime.x / particle.vLifeTime.y); - - float fRatio = 1 - (1 - fTime * fTime); - - float fDrag = particleValue.fSizeDrag; - - if (particleValue.fSizeDrag < FLT_EPSILON5) - fDrag = 1; - - //fDrag *= fRatio; - - CurLength += particleValue.vDeltaSize * fTimeDelta * fDrag; - - if (CurLength.x < FLT_EPSILON5) - CurLength.x = FLT_EPSILON5; - - if (CurLength.y < FLT_EPSILON5) - CurLength.y = FLT_EPSILON5; - - if (CurLength.z < FLT_EPSILON5) - CurLength.z = FLT_EPSILON5; - - particle.vRight = normalize(particle.vRight) * CurLength.x; - particle.vUp = normalize(particle.vUp) * CurLength.y; - particle.vLook = normalize(particle.vLook) * CurLength.z; - - } - - - //애니메이션 속도 , 인덱스 - - particleValue.vAniTime.x += fTimeDelta; - - if (particleValue.vAniTime.x >= particleValue.vAniTime.y) - { - particleValue.vAniTime.x = 0.f; - - particleValue.vAniIndex.x += 1.f; - - if (particleValue.vAniIndex.x > particleValue.vAniIndex.y) // 애니메이션에 끝에 다다랐다면 - { - particleValue.vAniIndex.x = 0.f; // 인덱스 초기화 - - } - - } - - //마스킹 UV 움직임 시간 - - particleValue.vMaskingUVMoveTime.x += fTimeDelta; - - if (particleValue.vMaskingUVMoveTime.x >= particleValue.vMaskingUVMoveTime.y) - { - particleValue.vMaskingUVMoveTime.x = 0.f; - } - - - //디퓨즈 UV 움직임 - - particleValue.vDiffuseUVMoveTime.x += fTimeDelta; - - if (particleValue.vDiffuseUVMoveTime.x >= particleValue.vDiffuseUVMoveTime.y) - { - particleValue.vDiffuseUVMoveTime.x = 0.f; - } - - //노이즈 움직임 - particleValue.vNoiseUVMoveTime.x += fTimeDelta; - - if (particleValue.vNoiseUVMoveTime.x >= particleValue.vNoiseUVMoveTime.y) - { - particleValue.vNoiseUVMoveTime.x = 0.f; - } - - particleValue.vDistortionUVMoveTime.x += fTimeDelta; - - if (particleValue.vDistortionUVMoveTime.x >= particleValue.vDistortionUVMoveTime.y) - { - particleValue.vDistortionUVMoveTime.x = 0.f; - } - - - //아웃풋 대입 - - g_VBInstanceOutput[iIndex] = particle; - g_ParticleValueOutput[iIndex] = particleValue; - -} 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 cd43fbd4d..000000000 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ /dev/null @@ -1,1111 +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_fTimeMult; -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]; - -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; - - float2 uv = In.vTexcoord; - - float4 tex = g_Texture.Sample(DefaultSampler, uv); - - float2 center = float2(0.5f, 0.5f); - float2 dir = uv - center; - - float angle = atan2(dir.x, -dir.y); - if (angle < 0) - angle += g_fPI; - - float rotation = saturate(g_fTime * g_fTimeMult) * g_fPI; - - tex.rgb = (angle <= rotation) ? 1.0 : tex.rgb; - - tex.a *= Alpha; - - Out.vColor = tex; - - 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.05; - 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 * 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); - - 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/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 49ec4ccdc..51b07cd9b 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -126,8 +126,9 @@ Engine.lib;fmod_vc.lib;DirectXTKd.lib;%(AdditionalDependencies) - - + cd /d "$(SolutionDir)" +call Update_Shaders.bat + @@ -152,11 +153,13 @@ Engine.lib;fmod_vc.lib;%(AdditionalDependencies) - - + cd /d "$(SolutionDir)" +call Update_Shaders.bat + + @@ -177,6 +180,8 @@ + + @@ -221,6 +226,7 @@ + @@ -234,6 +240,8 @@ + + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index 55ee2172e..7f4b487b4 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -184,9 +184,18 @@ 02.GameObjects\Environment\Terrain + + 02.GameObjects\Effect\EffectPool + + + 02.GameObjects\Effect\Effects\Decendo + 02.GameObjects\Environment\02.InstancedProp + + 02.GameObjects\Effect\Effects\Protego + @@ -443,9 +452,15 @@ {7db61780-d774-4a91-a429-2fb7634e43b3} + + {bdd4863e-8ab9-4ce8-a88d-9a0c558a67fb} + {4ef15d06-4520-4d55-ab49-1ae7179f145b} + + {37b6e4b9-42fb-4fda-9112-e62ab434bee0} + @@ -619,9 +634,18 @@ 02.GameObjects\Environment\Terrain + + 02.GameObjects\Effect\EffectPool + + + 02.GameObjects\Effect\Effects\Decendo + 02.GameObjects\Environment\02.InstancedProp + + 02.GameObjects\Effect\Effects\Protego + diff --git a/Jusin154_Team3D/Client/Private/Bombard.cpp b/Jusin154_Team3D/Client/Private/Bombard.cpp index c30992e55..8ab1a810a 100644 --- a/Jusin154_Team3D/Client/Private/Bombard.cpp +++ b/Jusin154_Team3D/Client/Private/Bombard.cpp @@ -31,28 +31,16 @@ HRESULT CBombard::Initialize(void* pArg) if (FAILED(Ready_Components(pArg))) return E_FAIL; - if (FAILED(Ready_Child())) - return E_FAIL; - if (FAILED(Load_Directory("../Bin/Resources/Data/Effect/Bombard/"))) + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Bombard"))) return E_FAIL; m_wstrEffectName = L"Bombard"; - CPartObject* pShootPt = Get_PartObject("Bombard_Shoot_Pt"); m_pLight_Projectile = Get_PartObject("Bombard_Projectile"); - CPartObject* pCircle0 = Get_PartObject("Bombard_Circle0"); - - pShootPt->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); - m_pLight_Projectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); - pCircle0->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); - - pCircle0->Set_Visible(true); - pShootPt->Set_Visible(true); - m_pLight_Projectile->Set_Visible(true); - SAFE_ADDREF(m_pLight_Projectile); + m_fDuration = 2.5f; return S_OK; @@ -73,7 +61,7 @@ void CBombard::Update(_float fTimeDelta) Update_Event(fTimeDelta); - _vector vOwnerLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); + _vector vOwnerLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); m_pLight_Projectile->Get_Component()->Translation(vOwnerLook * 2.f); } @@ -88,6 +76,44 @@ void CBombard::Late_Update(_float fTimeDelta) } +HRESULT CBombard::Pre_Setting(CGameObject* pObject) +{ + if (pObject == nullptr) + return E_FAIL; + + m_pOwner = pObject; + + if (FAILED(Ready_Child())) + return E_FAIL; + + Reset_EffectParts(); + + m_fAccTime = 0.f; + __super::m_fAccTime = 0.f; + m_fPreAccTime = 0.f; + + + + CPartObject* pShootPt = Get_PartObject("Bombard_Shoot_Pt"); + + CPartObject* pCircle0 = Get_PartObject("Bombard_Circle0"); + + pShootPt->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pLight_Projectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + pCircle0->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + pCircle0->Set_Visible(true); + pShootPt->Set_Visible(true); + + m_pLight_Projectile->Set_Visible(true); + + + m_bVisible = true; + + + return S_OK; +} + HRESULT CBombard::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) { @@ -102,6 +128,10 @@ HRESULT CBombard::Ready_Child() CPhysXEffectHitBox::PHYSXDUMMY_DESC Desc{}; m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); + + _vector vOwnerLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); _float3 vDir = {}; @@ -109,14 +139,13 @@ HRESULT CBombard::Ready_Child() XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); XMStoreFloat3(&vDir, vOwnerLook * 2.f); - Desc.vRotRPY = { 0.f, 0.f, 0.f }; Desc.iSubKind = 70; Desc.vDeltaPos = vDir; Desc.vLifeTime = { 0.f, 2.f }; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this, &m_pPhysHitBox))) { assert(false); return E_FAIL; } @@ -151,10 +180,10 @@ CGameObject* CBombard::Clone(void* pArg, CGameObject* pOwner) return pInstance; } -void CBombard::OnCollision(CGameObject* pOther , void* pDesc) +void CBombard::OnCollision(CGameObject* pOther, void* pDesc) { //CTransform* pOtherTransform = p - ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); for (auto& pPair : m_PartObjects) { @@ -164,7 +193,7 @@ void CBombard::OnCollision(CGameObject* pOther , void* pDesc) m_pLight_Projectile->Set_Visible(false); - Get_PartObject("Bombard_Shoot_Pt")->Set_Visible(false); + Get_PartObject("Bombard_Shoot_Pt")->Set_Visible(false); _vector vOwnerLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); Get_PartObject("Bombard_Smoke")->Get_Component()->Translation(vOwnerLook); @@ -185,13 +214,11 @@ void CBombard::Free() SAFE_RELEASE(m_pLight_Projectile); } -#ifdef _DEBUG void CBombard::Describe_Entity() { } -#endif // _DEBUG HRESULT CBombard::Bind_ShaderResources() { diff --git a/Jusin154_Team3D/Client/Private/Decendo.cpp b/Jusin154_Team3D/Client/Private/Decendo.cpp new file mode 100644 index 000000000..ebca51e45 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Decendo.cpp @@ -0,0 +1,271 @@ +#include "pch.h" +#include "Decendo.h" + +#include "GameInstance.h" +#include "EffectParts.h" +#include "PhysXEffectHitBox.h" +#include "TrailObject.h" + + +CDecendo::CDecendo(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CDecendo::CDecendo(const CDecendo& rhs) + : CEffect_Container(rhs) +{ +} + +HRESULT CDecendo::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CDecendo::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Decendo"))) + return E_FAIL; + + + m_wstrEffectName = L"Decendo"; + + m_pProjectile_Blur = Get_PartObject("Decendo_Proj_Blur"); + m_pProjectile = Get_PartObject("Decendo_Proj"); + + SAFE_ADDREF(m_pProjectile_Blur); + SAFE_ADDREF(m_pProjectile); + + m_fDuration = 2.5f; + + return S_OK; +} + +void CDecendo::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CDecendo::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + m_pProjectile_Blur->Get_Component()->Translation(m_vOwnerLook * 0.5f); + m_pProjectile->Get_Component()->Translation(m_vOwnerLook * 0.5f); + + + + if (m_fAccTime > XM_2PI) + return; + + m_fAccTime += fTimeDelta * 7.5f; + + m_pProjectile_Blur->Get_Component()->Translation(m_vRotateUp * 0.2f * sinf(m_fAccTime)); + m_pProjectile->Get_Component()->Translation(m_vRotateUp * 0.2f * sinf(m_fAccTime)); +} + +void CDecendo::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + Get_PartObject()->Trail_Update(m_pProjectile->Get_Component()->Get_XMWorldMatrix(), fTimeDelta); + + __super::Late_Update(fTimeDelta); +} + +HRESULT CDecendo::Pre_Setting(CGameObject* pObject) +{ + if (pObject == nullptr) + return E_FAIL; + + /* 부모 할당 */ + m_pOwner = pObject; + + /* 피직스 생성*/ + if (FAILED(Ready_Child())) + return E_FAIL; + + /* 초기 셋팅 초기화 */ + Reset_EffectParts(); + m_fAccTime = 0.f; + __super::m_fAccTime = 0.f; + m_fPreAccTime = 0.f; + + + CPartObject* pCircle0 = m_PartObjects.begin()->second; + + /* 초기 객체 위치 초기화 */ + pCircle0->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pProjectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pProjectile_Blur->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + /* 초기 객체 비지블 */ + pCircle0->Set_Visible(true); + m_pProjectile->Set_Visible(true); + m_pProjectile_Blur->Set_Visible(true); + + /*트레일 초기화 */ + Get_PartObject()->Set_Visible(true); + 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); + + m_vRotateUp = XMVector3Normalize(m_vRotateUp); + + m_bVisible = true; + + return S_OK; +} + +HRESULT CDecendo::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CDecendo::Ready_Child() +{ + CPhysXEffectHitBox::PHYSXDUMMY_DESC Desc{}; + + m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); + + _vector vOwnerLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); + + _float3 vDir = {}; + + XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); + + XMStoreFloat3(&vDir , vOwnerLook * 0.5f); + + Desc.vRotRPY = { 0.f, 0.f, 0.f }; + Desc.iSubKind = 70; + Desc.vDeltaPos = vDir ; + Desc.vLifeTime = { 0.f, 1.f }; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) { + assert(false); + return E_FAIL; + } + + return S_OK; +} + +CDecendo* CDecendo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CDecendo* pInstance = new CDecendo(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CDecendo"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CDecendo::Clone(void* pArg, CGameObject* pOwner) +{ + CDecendo* pInstance = new CDecendo(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CDecendo"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CDecendo::OnCollision(CGameObject* pOther , void* pDesc) +{ + //CTransform* pOtherTransform = p + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + + + for (auto& pPair : m_PartObjects) + { + pPair.second->Set_Visible(true); + pPair.second->Get_Component()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos); + } + + + + m_pProjectile_Blur->Set_Visible(false); + m_pProjectile->Set_Visible(false); + + + + _vector vPlayerPos = m_pOwner->Get_Component()->Get_State(STATE::POSITION); + + Get_PartObject("Decendo_Down")->Get_Component()->LookAt(vPlayerPos); + Get_PartObject("Decendo_Smoke")->Get_Component()->LookAt(vPlayerPos); + + m_PartObjects.begin()->second->Set_Visible(false); + + Get_PartObject()->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, 0.f, 0.f, 1.f)); + Get_PartObject()->Set_Visible(false); + + m_pPhysHitBox->Set_Dead(); +} + +void CDecendo::Free() +{ + __super::Free(); + + //if(m_pPhysHitBox != nullptr) + // if (m_pPhysHitBox->Get_Depth() == false) + // SAFE_RELEASE(m_pPhysHitBox); + + SAFE_RELEASE(m_pProjectile_Blur); + SAFE_RELEASE(m_pProjectile); + +} + +void CDecendo::Describe_Entity() +{ + GUI::Begin("VALUE"); + + _float4 vValue = {}; + + if (GUI::InputFloat("TurnValue", (_float*)&m_fTurnValue)) + { + } + + GUI::End(); +} + +HRESULT CDecendo::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Client/Private/EffectObject.cpp b/Jusin154_Team3D/Client/Private/EffectObject.cpp index c46bf2ebb..b698a66e8 100644 --- a/Jusin154_Team3D/Client/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Client/Private/EffectObject.cpp @@ -47,11 +47,6 @@ HRESULT CEffectObject::Render() if (FAILED(m_pInstance_ModelCom->Bind_CS_Output(5, 1))) return E_FAIL; - - - - - if (FAILED(m_pInstance_ModelCom->Render(i))) { return E_FAIL; @@ -77,9 +72,6 @@ HRESULT CEffectObject::Render_Blur() return E_FAIL; } - - - SHADER_PASS_INSTANCE_MODEL BlurPass = {}; if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NON_WORLD) @@ -110,7 +102,6 @@ HRESULT CEffectObject::Render_Blur() } - return S_OK; } @@ -400,6 +391,7 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) + HRESULT CEffectObject::Bind_ShaderResources() { @@ -479,6 +471,21 @@ HRESULT CEffectObject::Bind_ShaderResources() } + if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuseBlur", &m_EffectInfo.isDiffuseBlur, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskBlur", &m_EffectInfo.isMaskBlur, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isBlurDissolve", &m_EffectInfo.isBlurDissolve, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isBlurReverseDissolve", &m_EffectInfo.isBlurReverseDissolve, sizeof(_bool)))) { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_EffectInfo.vColor, sizeof(_float4)))) { return E_FAIL; @@ -574,6 +581,11 @@ HRESULT CEffectObject::Bind_ShaderResources() return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fBluringStrength", &m_EffectInfo.fBluringStrength, sizeof(_float)))) { + return E_FAIL; + } + + if (m_pDiffuse_TextureCom != nullptr) { @@ -625,6 +637,7 @@ HRESULT CEffectObject::Bind_ShaderResources() return S_OK; + } HRESULT CEffectObject::Ready_Components(void* pArg) diff --git a/Jusin154_Team3D/Client/Private/EffectParts.cpp b/Jusin154_Team3D/Client/Private/EffectParts.cpp index 9b990b848..bcf327c38 100644 --- a/Jusin154_Team3D/Client/Private/EffectParts.cpp +++ b/Jusin154_Team3D/Client/Private/EffectParts.cpp @@ -64,17 +64,24 @@ void CEffectParts::Late_Update(_float fTimeDelta) if (m_pInstance_ModelCom == nullptr) return; + if (m_EffectInfo.isBillboard) + m_pGameInstance->BillBoard(m_pTransformCom); + if (m_EffectInfo.isBlur == true) { m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this); } - m_pGameInstance->Add_RenderGroup(RENDER::EFFECT, this); + if (m_EffectInfo.isOnlyBlur == true) + return; + + m_pGameInstance->Add_RenderGroup(m_EffectInfo.eRenderOrder, this); } + HRESULT CEffectParts::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) diff --git a/Jusin154_Team3D/Client/Private/EffectPool.cpp b/Jusin154_Team3D/Client/Private/EffectPool.cpp new file mode 100644 index 000000000..3b0dc25ca --- /dev/null +++ b/Jusin154_Team3D/Client/Private/EffectPool.cpp @@ -0,0 +1,242 @@ +#include "pch.h" +#include "EffectPool.h" + +#include "GameInstance.h" +#include "Camera_Debug.h" +#include "Effect_Container.h" +#include "Bombard.h" +#include "NomalJap.h" +#include "Decendo.h" +#include "Protego.h" + +CEffectPool::CEffectPool(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject(pDevice, pContext) +{ +} + +CEffectPool::CEffectPool(const CEffectPool& Prototype) + : CGameObject(Prototype) +{ +} + +HRESULT CEffectPool::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEffectPool::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + if (FAILED(Ready_Effect())) + return E_FAIL; + + return S_OK; +} + +void CEffectPool::Priority_Update(_float fTimeDelta) +{ + for (auto iter = m_ActiveEffectList.begin(); iter != m_ActiveEffectList.end(); ) + { + if (false == (*iter)->Get_Visible()) + { + //SAFE_RELEASE(*iter); + //iter = m_ActiveEffectList.erase(iter); + } + else + { + (*iter)->Priority_Update(fTimeDelta); + ++iter; + } + } +} + +void CEffectPool::Update(_float fTimeDelta) +{ + for (auto iter = m_ActiveEffectList.begin() ; iter != m_ActiveEffectList.end(); ) + { + if (false == (*iter)->Get_Visible()) + { + //SAFE_RELEASE(*iter); + //iter = m_ActiveEffectList.erase(iter); + } + else + { + (*iter)->Update(fTimeDelta); + ++iter; + } + } +} + +void CEffectPool::Late_Update(_float fTimeDelta) +{ + + for (auto iter = m_ActiveEffectList.begin(); iter != m_ActiveEffectList.end(); ) + { + if (false == (*iter)->Get_Visible()) + { + SAFE_RELEASE(*iter); + iter = m_ActiveEffectList.erase(iter); + } + else + { + (*iter)->Late_Update(fTimeDelta); + ++iter; + } + } +} + +HRESULT CEffectPool::Render() +{ + return S_OK; +} + + +HRESULT CEffectPool::Ready_Components() +{ + __super::Ready_Components(nullptr); + return S_OK; +} + +HRESULT CEffectPool::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CEffectPool::Ready_Effect() +{ + + if(FAILED(Create_Effect(SKILL_TYPE::JAP, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + + CNomalJap* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect;} + ))) return E_FAIL; + + + if (FAILED(Create_Effect(SKILL_TYPE::BOMBARD, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + + CBombard* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect;} + ))) return E_FAIL; + + if (FAILED(Create_Effect(SKILL_TYPE::DESCENDO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + + CDecendo* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect;} + ))) return E_FAIL; + + if (FAILED(Create_Effect(SKILL_TYPE::PROTEGO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + + CProtego* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + ))) return E_FAIL; + + + + return S_OK; +} + +HRESULT CEffectPool::Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPrototypeLevel, _uint iCloneLevel, function AddPrototypeEvent) +{ + for (_uint i = 0; i < iNumEffect; i++) + { + CEffect_Container* pEffect_Container = AddPrototypeEvent(iPrototypeLevel, iCloneLevel); + + if (pEffect_Container == nullptr) + return E_FAIL; + + m_EffectList[ENUM_CLASS(eType)].push_back(pEffect_Container); + + } + + return S_OK; +} + +HRESULT CEffectPool::Use_Skill(SKILL_TYPE eType, CGameObject* pOwner) +{ + if (pOwner == nullptr) + return S_OK; + + for (auto& pSkill : m_EffectList[ENUM_CLASS(eType)]) + { + if (pSkill->Get_Visible() == true) + continue; + + pSkill->Pre_Setting(pOwner); + + m_ActiveEffectList.push_back(pSkill); + Safe_AddRef(pSkill); + + break; + } + + return S_OK; +} + + +CEffectPool* CEffectPool::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CEffectPool* pInstance = new CEffectPool(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CEffectPool"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CEffectPool::Clone(void* pArg, CGameObject* pOwner) +{ + CEffectPool* pInstance = new CEffectPool(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CEffectPool"); + Safe_Release(pInstance); + } + + return pInstance; +} + + + +void CEffectPool::Free() +{ + __super::Free(); + + for (size_t i = 0; i < ENUM_CLASS(SKILL_TYPE::END); i++) + { + for (auto& pEffect : m_EffectList[i]) + { + SAFE_RELEASE(pEffect); + } + } + + for (auto& pEffect : m_ActiveEffectList) + { + SAFE_RELEASE(pEffect); + } +} + +void CEffectPool::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Effect_Container.cpp b/Jusin154_Team3D/Client/Private/Effect_Container.cpp index 7f7a5e905..3065da72f 100644 --- a/Jusin154_Team3D/Client/Private/Effect_Container.cpp +++ b/Jusin154_Team3D/Client/Private/Effect_Container.cpp @@ -34,6 +34,8 @@ HRESULT CEffect_Container::Initialize(void* pArg) if (FAILED(Ready_Child())) return E_FAIL; + Set_Visible(false); + return S_OK; } @@ -132,6 +134,27 @@ HRESULT CEffect_Container::Ready_Components(void* pArg) return S_OK; } +HRESULT CEffect_Container::Pre_Setting(CGameObject* pObject) +{ + return S_OK; +} + +HRESULT CEffect_Container::Reset_EffectParts() +{ + for (auto& iter : m_PartObjects) + { + CInstance_Model* pInstanceModel = iter.second->Get_Component(); + + if (pInstanceModel == nullptr) + continue; + + pInstanceModel->Instane_Buffer_ReStruct(); + } + + return S_OK; +} + + HRESULT CEffect_Container::Ready_Child() { @@ -175,6 +198,11 @@ void CEffect_Container::Update_Event(_float fTimeDelta) } else { + for (auto& pPart : m_PartObjects) + { + pPart.second->Set_Visible(false); + } + m_bVisible = false; } } @@ -190,3 +218,146 @@ void CEffect_Container::Update_Event(_float fTimeDelta) } +HRESULT CEffect_Container::Load_Package(const _char* pPath) +{ + + _string strPerfectFilePath = pPath; + + strPerfectFilePath += ".bin"; + + HANDLE hFile = CreateFileW( + CMyTools::ToWstring(strPerfectFilePath).c_str(), // 파일 이름 + GENERIC_READ, // 읽기 모드 + FILE_SHARE_READ, // 다른 프로세스도 읽기 가능 + NULL, + OPEN_EXISTING, // 기존 파일 열기 + FILE_ATTRIBUTE_NORMAL, + NULL + ); + + + if (hFile == INVALID_HANDLE_VALUE) { + MessageBox(NULL, L"오브젝트 읽기 실패", L"System Message", MB_OK); + return E_FAIL; + } + + // 나중에 패키징할때 패스를 저장할거임 + + + DWORD dwByte(0); + + _int iEffectCount = {}; + + if (!ReadFile(hFile, &iEffectCount, sizeof(_int), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + + for (_int i = 0; i < iEffectCount; i++) + { + size_t iComponentLength = {}; + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + if (iComponentLength != 0) + { + if (!ReadFile(hFile, szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + } + + _string strEffectPath = szName; + _string strExt = {}; + _string strEffectName = {}; + + size_t iPos = strEffectPath.rfind('.'); // 뒤에서부터 '/' 검색 + + if (iPos != std::string::npos) + { + strExt += strEffectPath.substr(iPos + 1); + strEffectName = strEffectPath.substr(0, iPos); + } + + size_t pos = strEffectName.rfind('\\'); // 뒤에서부터 '/' 검색 + + if (pos != std::string::npos) + strEffectName = strEffectName.substr(pos + 1); + + if (!strcmp(strExt.c_str(), "trail")) + { + CTrailObject* pTrail = nullptr; + + CPartObject::PARTOBJECT_DESC PartsDesc{}; + + PartsDesc.pParentTransform = m_pTransformCom; + + if (FAILED(Add_PartObject(strEffectName, g_iStaticLevel, &pTrail, &PartsDesc))) { + assert(false); + return E_FAIL; + } + + + /*이펙트 로드 로드*/ + size_t iPos = {}; + + while ((iPos = strEffectPath.find(".trail")) != std::string::npos) { + strEffectPath.erase(iPos, 6); + }; + + + if (FAILED(pTrail->Load_Trail(strEffectPath.c_str(), static_cast(NEXT_LEVEL)))) + { + Safe_Release(pTrail); + continue; + } + + Safe_Release(pTrail); + + continue; + } + + + ///////////////////////////// + + CEffectParts* pEffectPart = nullptr; + + CPartObject::PARTOBJECT_DESC PartsDesc{}; + + PartsDesc.pParentTransform = m_pTransformCom; + + /*이펙트 껍데기 생성*/ + + if (FAILED(Add_PartObject(strEffectName, g_iStaticLevel, &pEffectPart, &PartsDesc))) { + assert(false); + return E_FAIL; + } + + /*이펙트 로드 로드*/ + size_t iPosition = {}; + _string strFilePath = strEffectPath; + + while ((iPosition = strFilePath.find(".bin")) != std::string::npos) { + strFilePath.erase(iPosition, 4); + }; + + + if (FAILED(pEffectPart->Load(strFilePath.c_str(), static_cast(NEXT_LEVEL)))) + { + Safe_Release(pEffectPart); + continue; + } + + Safe_Release(pEffectPart); + + } + + CloseHandle(hFile); + + return S_OK; +} diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 66bf65703..d0bd6d522 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -110,6 +110,10 @@ HRESULT CGoblin::Render() } } + if (m_bDrawOutLine) { + Render_OutLine(); + } + #ifdef _DEBUG m_pCharacter_Controller->Render(); //m_pRigidBody->Render(); @@ -132,8 +136,9 @@ HRESULT CGoblin::Ready_Components() /* Com_Model */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, - reinterpret_cast(&m_pModelCom)))) + reinterpret_cast(&m_pModelCom)))){ return E_FAIL; + } { // CCT CCharacter_Controller::Character_Controller_DESC Desc{}; diff --git a/Jusin154_Team3D/Client/Private/Goblin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_States.cpp index 2778e4285..8d927aaff 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_States.cpp @@ -115,7 +115,6 @@ void CGoblin::Add_FSM() m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); } #pragma endregion - #pragma region Behavior_Combat_NotFocus { CState_Combat::STATE_COMBAT_DESC Desc{}; diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 5e83e1506..0a411b686 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -14,6 +14,7 @@ #include "Dummy_PhysXPlayable.h" #include "Goblin.h" #include "Terrain.h" +#include "EffectPool.h" #include "InstancedProp.h" CLevel_GamePlay::CLevel_GamePlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) @@ -37,6 +38,9 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) if (FAILED(Ready_Layer_UI(LAYER_UI))) { return E_FAIL; } + if (FAILED(Reday_Layer_EffectPool())) { //플레이어보다 먼저 생성해야함! + return E_FAIL; + } if (FAILED(Ready_Layer_Player(LAYER_PLAYER))) { return E_FAIL; } @@ -47,6 +51,7 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) return E_FAIL; } + return S_OK; } @@ -177,7 +182,7 @@ HRESULT CLevel_GamePlay::Ready_Markers() HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag) { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag,nullptr,nullptr,&m_pPlayerTemp))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) return E_FAIL; /*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) @@ -206,7 +211,20 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag) HRESULT CLevel_GamePlay::Ready_Layer_Monster() { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER, m_pPlayerTemp))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))){ + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))){ + return E_FAIL; + } + + return S_OK; +} + +HRESULT CLevel_GamePlay::Reday_Layer_EffectPool() +{ + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함! return E_FAIL; return S_OK; diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index ee34a7e20..59a38a05d 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -33,9 +33,14 @@ #include "EffectParts.h" #include "Bombard.h" +#include "Decendo.h" +#include "NomalJap.h" +#include "Protego.h" + #include "TrailObject.h" #include "Instance_Model.h" #include "Trail.h" +#include "EffectPool.h" #pragma endregion @@ -366,6 +371,21 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CDecendo::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CNomalJap::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CProtego::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CEffectPool::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } m_strMessage = TEXT("Model Loading.."); diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index c134df4dd..5e53191fa 100644 --- a/Jusin154_Team3D/Client/Private/MainApp.cpp +++ b/Jusin154_Team3D/Client/Private/MainApp.cpp @@ -173,8 +173,6 @@ void CMainApp::Free() { __super::Free(); - m_pInfoInstance->Release_Information(); - SAFE_RELEASE(m_pInfoInstance); Release_IMGUI(); @@ -182,6 +180,8 @@ void CMainApp::Free() SAFE_RELEASE(m_pContext); m_pGameInstance->Release_Engine(); + m_pInfoInstance->Release_Information(); + SAFE_RELEASE(m_pInfoInstance); SAFE_RELEASE(m_pGameInstance); } diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp index d0e910781..3ddb235bd 100644 --- a/Jusin154_Team3D/Client/Private/Monster.cpp +++ b/Jusin154_Team3D/Client/Private/Monster.cpp @@ -28,6 +28,7 @@ HRESULT CMonster::Initialize(void* pArg) return E_FAIL; } + m_pInfoInstance->Regist_ActiveMonster(this); return S_OK; } @@ -57,11 +58,56 @@ void CMonster::Late_Update(_float fTimeDelta) __super::Late_Update(fTimeDelta); } -HRESULT CMonster::Render() +HRESULT CMonster::Render_OutLine() { + m_bDrawOutLine = false; + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_vOutLineColor", DirectX::Colors::SeaShell, sizeof(_float3)))) { + return E_FAIL; + } + _float fSpeed = m_pTransformCom->Get_Speed() * 0.5f; + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLineThickness", &(fSpeed), sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) { + return E_FAIL; + } + //static _float fPower = 0.3f; + //GUI::DragFloat("OuTLineDegg", &fPower, 0.01f, -1.f, 1.f, "%.3f"); + //if (FAILED(m_pShaderCom->Bind_RawValue("g_fPow", &fPower, sizeof(_float)))) { + // return E_FAIL; + //} + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { + return E_FAIL; + } + + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::OUTLINE)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } return S_OK; } +void CMonster::Set_DrawOutLine() +{ + m_bDrawOutLine = true; +} + HRESULT CMonster::Ready_Components(void*pArg) { __super::Ready_Components(pArg); @@ -75,11 +121,6 @@ HRESULT CMonster::Ready_Components(void*pArg) return S_OK; } -HRESULT CMonster::Bind_ShaderResources() -{ - return S_OK; -} - void CMonster::Set_Target(CUnit& pTarget, CTransform& pTransform) { SAFE_RELEASE(m_pTarget); @@ -98,6 +139,9 @@ void CMonster::Free() __super::Free(); SAFE_RELEASE(m_pTarget); + if (nullptr != m_pInfoInstance){ + m_pInfoInstance->Deregist_ActiveMonster(this); + } SAFE_RELEASE(m_pInfoInstance); } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp index 530634db5..babd1d828 100644 --- a/Jusin154_Team3D/Client/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp @@ -4,6 +4,7 @@ #include "GameInstance.h" #include "EffectParts.h" #include "PhysXEffectHitBox.h" +#include "TrailObject.h" CNomalJap::CNomalJap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -32,13 +33,18 @@ HRESULT CNomalJap::Initialize(void* pArg) if (FAILED(Ready_Components(pArg))) return E_FAIL; - if (FAILED(Ready_Child())) - return E_FAIL; m_wstrEffectName = L"Nomal_Jap"; - m_PartObjects.begin()->second->Set_Visible(true); - m_PartObjects.begin()->second->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Jap"))) + return E_FAIL; + + + m_pProjectile_Side = Get_PartObject("JapProjSide"); + m_pProjectile = Get_PartObject("JapProjCircle"); + + SAFE_ADDREF(m_pProjectile); + SAFE_ADDREF(m_pProjectile_Side); m_fDuration = 5.f; @@ -52,12 +58,26 @@ void CNomalJap::Priority_Update(_float fTimeDelta) void CNomalJap::Update(_float fTimeDelta) { + if (m_bVisible == false) return; __super::Update(fTimeDelta); Update_Event(fTimeDelta); + + m_pProjectile_Side->Get_Component()->Translation(m_vOwnerLook * 1.2f); + m_pProjectile->Get_Component()->Translation(m_vOwnerLook * 1.2f); + + + + if (m_fAccTime > XM_2PI) + return; + + m_fAccTime += fTimeDelta * 15.f; + + m_pProjectile_Side->Get_Component()->Translation(m_vRotateUp * 0.6f * sinf(m_fAccTime)); + m_pProjectile->Get_Component()->Translation(m_vRotateUp * 0.6f * sinf(m_fAccTime)); } void CNomalJap::Late_Update(_float fTimeDelta) @@ -65,9 +85,60 @@ void CNomalJap::Late_Update(_float fTimeDelta) if (m_bVisible == false) return; + Get_PartObject()->Trail_Update(m_pProjectile->Get_Component()->Get_XMWorldMatrix(), fTimeDelta); + __super::Late_Update(fTimeDelta); } +HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) +{ + if (pObject == nullptr) + return E_FAIL; + + /* 부모 할당 */ + m_pOwner = pObject; + + /* 피직스 생성*/ + if (FAILED(Ready_Child())) + return E_FAIL; + + /* 초기 셋팅 초기화 */ + Reset_EffectParts(); + m_fAccTime = 0.f; + __super::m_fAccTime = 0.f; + m_fPreAccTime = 0.f; + + + /* 초기 객체 위치 초기화 */ + m_pProjectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pProjectile_Side->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + /* 초기 객체 비지블 */ + m_pProjectile->Set_Visible(true); + m_pProjectile_Side->Set_Visible(true); + + /*트레일 초기화 */ + Get_PartObject()->Set_Visible(true); + + 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); + + m_vRotateUp = XMVector3Normalize(m_vRotateUp); + + m_bVisible = true; + + return S_OK; +} + HRESULT CNomalJap::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) { @@ -85,12 +156,22 @@ HRESULT CNomalJap::Ready_Child() XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); + + _vector vOwnerLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); + + _float3 vDir = {}; + + XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); + + XMStoreFloat3(&vDir, vOwnerLook * 0.6f); + + Desc.vRotRPY = { 0.f, 0.f, 0.f }; Desc.iSubKind = 70; - Desc.vDeltaPos = { 0.f, 0.f, 2.f }; - Desc.vLifeTime = { 0.f, 2.f }; + Desc.vDeltaPos = vDir; + Desc.vLifeTime = { 0.f, 1.f }; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this, &m_pPhysHitBox))) { assert(false); return E_FAIL; } @@ -125,18 +206,25 @@ CGameObject* CNomalJap::Clone(void* pArg, CGameObject* pOwner) return pInstance; } -void CNomalJap::OnCollision(CGameObject* pOther , void* pDesc) +void CNomalJap::OnCollision(CGameObject* pOther, void* pDesc) { //CTransform* pOtherTransform = p - ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); for (auto& pPair : m_PartObjects) { + pPair.second->Set_Visible(true); pPair.second->Get_Component()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos); } - m_PartObjects.begin()->second->Set_Visible(false); + Get_PartObject("JapPT0")->Get_Component()->LookAt(m_pOwner->Get_WorldPostion()); + + m_pProjectile_Side->Set_Visible(false); + m_pProjectile->Set_Visible(false); + + Get_PartObject()->Set_Visible(false); + Get_PartObject()->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, 0.f, 0.f, 1.f)); m_pPhysHitBox->Set_Dead(); } @@ -149,16 +237,16 @@ void CNomalJap::Free() // if (m_pPhysHitBox->Get_Depth() == false) // SAFE_RELEASE(m_pPhysHitBox); + Safe_Release(m_pProjectile); + Safe_Release(m_pProjectile_Side); + } -#ifdef _DEBUG void CNomalJap::Describe_Entity() { } -#endif // _DEBUG - HRESULT CNomalJap::Bind_ShaderResources() { return S_OK; diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 3aadbfd63..121b6dd52 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -11,6 +11,7 @@ #include "CallBack_Playable_Behavior.h" #include "CamPosition_Shoulder.h" #include "CallBack_Playable_HitReport.h" +#include "Monster.h" #pragma region STATE #include "State_Idle.h" @@ -21,7 +22,8 @@ #include "State_Combat.h" #pragma endregion -#include "Bombard.h" +#include "Layer.h" +#include "EffectPool.h" CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CUnit(pDevice, pContext) @@ -76,8 +78,12 @@ HRESULT CPlayer::Initialize(void* pArg) m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); + m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); + SAFE_ADDREF(m_pEffectPool); + m_pInfoInstance->Regist_PlayerAlly(this); + #ifdef _DEBUG m_BasicEffect = make_unique(m_pDevice); m_BasicEffect->SetVertexColorEnabled(true); @@ -92,6 +98,8 @@ HRESULT CPlayer::Initialize(void* pArg) void CPlayer::Priority_Update(_float fTimeDelta) { + ReLockOnTarget(); + m_pTransformCom->RewindMomentum(); __super::Priority_Update(fTimeDelta); @@ -127,6 +135,10 @@ void CPlayer::Late_Update(_float fTimeDelta) m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); __super::Late_Update(fTimeDelta); + + if (nullptr != m_pLockOnMonster && false == m_pLockOnMonster->isDead()) { + m_pLockOnMonster->Set_DrawOutLine(); + } } HRESULT CPlayer::Render() @@ -176,6 +188,7 @@ void CPlayer::Render_CameraCoordinateSystem() _vector xmvLook = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); _float2 vLook = { XMVectorGetX(xmvLook), XMVectorGetZ(xmvLook) }; + GUI::Text("%d", m_pLockOnMonster); GUI::Text("W : %.2f, %.2f, %.2f", m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z); GUI::Text("A : %.2f, %.2f, %.2f", -m_vCameraRightDir.x, 0.f, -m_vCameraRightDir.z); @@ -315,6 +328,15 @@ HRESULT CPlayer::Bind_ShaderResources() } return S_OK; } +void CPlayer::ReLockOnTarget() +{ + SAFE_RELEASE(m_pLockOnMonster); + m_pLockOnMonster = m_pInfoInstance->Get_LockOnMonster(); + if (nullptr != m_pLockOnMonster) { + SAFE_ADDREF(m_pLockOnMonster); + } +} + #ifdef _DEBUG void CPlayer::Update_CameraCoordinateSystem() @@ -354,6 +376,13 @@ void CPlayer::Free() { __super::Free(); + + SAFE_RELEASE(m_pLockOnMonster); + + if (nullptr != m_pInfoInstance) { + m_pInfoInstance->Deregist_PlayerAlly(this); + } + if (nullptr != m_pCallBack_Behavior) { m_pCallBack_Behavior->Finalize(); } @@ -367,6 +396,7 @@ void CPlayer::Free() SAFE_RELEASE(m_pCamPosition_TopDown_FollowPart); SAFE_RELEASE(m_pCamPosition_TopDown_LookPart); SAFE_RELEASE(m_pCamPosition_ShoulderPart); + SAFE_RELEASE(m_pEffectPool); SAFE_RELEASE(m_pInfoInstance); } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index 351319525..7a89bce5d 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -20,7 +20,7 @@ #include "State_Combat.h" #pragma endregion -#include "Bombard.h" +#include "EffectPool.h" template void CPlayer::Spawn_Effect() @@ -598,10 +598,18 @@ void CPlayer::Behavior_CombatEnter() else if (m_pGameInstance->Key_Down(DIK_Q)) { m_pFSM->Enable_State(FSMSTATE::SKILL2); pairAnimInfo = m_Animation[STATEANIM::SKILL2]; + + m_pEffectPool->Use_Skill(SKILL_TYPE::PROTEGO, this); } else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; + + m_pModelCom->Anim_Event(0.1f, m_Animation[STATEANIM::LIGHT_ATTACK].first, [this]() { + m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this); + + return E_FAIL; + }); } else if (SUCCEEDED(InputSpell())) { m_pFSM->Enable_State(FSMSTATE::SPELL); @@ -669,6 +677,9 @@ HRESULT CPlayer::Behavior_CombatExitCheck() pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; pairAnimInfo.first = iIndex + 1; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + + m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this); + } } } @@ -706,23 +717,38 @@ HRESULT CPlayer::Behavior_CombatExitCheck() { case STATEANIM::ACCIO: { - /* TODO 임시 방편 */ pairAnimInfo = m_Animation[STATEANIM::ACCIO]; - + + } break; case STATEANIM::DESCENDO: pairAnimInfo = m_Animation[STATEANIM::DESCENDO]; + break; default: break; } + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + + + m_pModelCom->Anim_Event(0.1f, m_Animation[STATEANIM::ACCIO].first, [this]() { - Spawn_Effect(); + m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARD, this); + m_eSpell = STATEANIM::END; return E_FAIL; }); + + m_pModelCom->Anim_Event(0.1f, m_Animation[STATEANIM::DESCENDO].first, [this]() { + m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO, this); + + m_eSpell = STATEANIM::END; + return E_FAIL; + }); + } } diff --git a/Jusin154_Team3D/Client/Private/Protego.cpp b/Jusin154_Team3D/Client/Private/Protego.cpp new file mode 100644 index 000000000..29aeb4474 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Protego.cpp @@ -0,0 +1,178 @@ +#include "pch.h" +#include "Protego.h" + +#include "GameInstance.h" +#include "EffectParts.h" +#include "PhysXEffectHitBox.h" + + +CProtego::CProtego(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CProtego::CProtego(const CProtego& rhs) + : CEffect_Container(rhs) +{ +} + +HRESULT CProtego::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CProtego::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Protego"))) + return E_FAIL; + + m_pSphere = Get_PartObject("ProtegoSphere"); + m_pBottom = Get_PartObject("ProtegoBottom"); + m_pCircle = Get_PartObject("ProtegoCircle"); + + SAFE_ADDREF(m_pSphere); + SAFE_ADDREF(m_pBottom); + SAFE_ADDREF(m_pCircle); + + m_wstrEffectName = L"Protego"; + + + m_fDuration = 2.5f; + + return S_OK; +} + +void CProtego::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CProtego::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + m_pSphere->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pBottom->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pCircle-> Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); +} + +void CProtego::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CProtego::Pre_Setting(CGameObject* pObject) +{ + if (pObject == nullptr) + return E_FAIL; + + m_pOwner = pObject; + + Reset_EffectParts(); + + m_fAccTime = 0.f; + __super::m_fAccTime = 0.f; + m_fPreAccTime = 0.f; + + m_pSphere->Set_Visible(true); + m_pCircle->Set_Visible(true); + m_pBottom->Set_Visible(true); + + m_bVisible = true; + + return S_OK; +} + +HRESULT CProtego::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CProtego::Ready_Child() +{ + return S_OK; +} + +CProtego* CProtego::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CProtego* pInstance = new CProtego(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CProtego"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CProtego::Clone(void* pArg, CGameObject* pOwner) +{ + CProtego* pInstance = new CProtego(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CProtego"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CProtego::OnCollision(CGameObject* pOther, void* pDesc) +{ + //CTransform* pOtherTransform = p + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + +} + +void CProtego::Free() +{ + __super::Free(); + + //if(m_pPhysHitBox != nullptr) + // if (m_pPhysHitBox->Get_Depth() == false) + // SAFE_RELEASE(m_pPhysHitBox); + + SAFE_RELEASE(m_pSphere); + SAFE_RELEASE(m_pBottom); + SAFE_RELEASE(m_pCircle); + +} + +void CProtego::Describe_Entity() +{ + +} + +HRESULT CProtego::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Client/Private/TrailObject.cpp b/Jusin154_Team3D/Client/Private/TrailObject.cpp index 4609804ab..129579f74 100644 --- a/Jusin154_Team3D/Client/Private/TrailObject.cpp +++ b/Jusin154_Team3D/Client/Private/TrailObject.cpp @@ -228,15 +228,16 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel) HRESULT CTrailObject::Render() { - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::TRAIL)))) + if (FAILED(Bind_ShaderResources())) return E_FAIL; - if (FAILED(Bind_ShaderResources())) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::TRAIL)))) return E_FAIL; if (FAILED(m_pTrailCom->Render())) return E_FAIL; + return S_OK; } diff --git a/Jusin154_Team3D/Client/Public/Bombard.h b/Jusin154_Team3D/Client/Public/Bombard.h index a7d0b9488..e20dbc145 100644 --- a/Jusin154_Team3D/Client/Public/Bombard.h +++ b/Jusin154_Team3D/Client/Public/Bombard.h @@ -20,6 +20,8 @@ class CBombard final : public CEffect_Container virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; +public: + virtual HRESULT Pre_Setting(CGameObject* pObject) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 99f111ed4..9f17f4fdc 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -7,9 +7,9 @@ namespace Client enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT }; enum class MAPOBJECT_RENDER_TYPE { NORMAL, DECAL, GLASS }; - enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END }; + enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, HAIR, EYELASH, OUTLINE, END }; enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END }; - enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, END }; + enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, OUTLINE, END }; enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR, END }; @@ -17,4 +17,5 @@ namespace Client enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, END }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; + enum class SKILL_TYPE { JAP, BOMBARD, DESCENDO, PROTEGO, END }; } diff --git a/Jusin154_Team3D/Client/Public/Decendo.h b/Jusin154_Team3D/Client/Public/Decendo.h new file mode 100644 index 000000000..122806d19 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Decendo.h @@ -0,0 +1,52 @@ +#pragma once + +#include "Client_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CDecendo final : public CEffect_Container +{ +private: + CDecendo(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CDecendo(const CDecendo& rhs); + virtual ~CDecendo() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + virtual HRESULT Pre_Setting(CGameObject* pObject) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + class CPhysXEffectHitBox* m_pPhysHitBox = {}; + + class CPartObject* m_pProjectile = {}; + class CPartObject* m_pProjectile_Blur = {}; + + _vector m_vRotateUp = {}; + _float m_fAccTime = {}; + _float m_fLerpAmount = {}; + _float m_fTurnValue = {}; + _vector m_vOwnerLook = {}; +public: + static CDecendo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/EffectObject.h b/Jusin154_Team3D/Client/Public/EffectObject.h index 497dd03b1..31ac62b9a 100644 --- a/Jusin154_Team3D/Client/Public/EffectObject.h +++ b/Jusin154_Team3D/Client/Public/EffectObject.h @@ -86,6 +86,13 @@ class CEffectObject abstract : public CPartObject SHADER_PASS_INSTANCE_MODEL eShaderPass = { SHADER_PASS_INSTANCE_MODEL::NON_NOMALMAP }; + _bool isDiffuseBlur = {}; + _bool isMaskBlur = {}; + _bool isBlurDissolve = {}; + _bool isBlurReverseDissolve = {}; + + _float fBluringStrength = { 0.01f }; + }EFFECT_INFO; diff --git a/Jusin154_Team3D/Client/Public/EffectPool.h b/Jusin154_Team3D/Client/Public/EffectPool.h new file mode 100644 index 000000000..bc52ed37b --- /dev/null +++ b/Jusin154_Team3D/Client/Public/EffectPool.h @@ -0,0 +1,45 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CLight; +NS_END + +NS_BEGIN(Client) + +class CEffectPool final : public CGameObject +{ + +private: + CEffectPool(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEffectPool(const CEffectPool& Prototype); + virtual ~CEffectPool() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; +public: + HRESULT Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPrototypeLevel, _uint iCloneLevel , function AddPrototypeEvent); + HRESULT Use_Skill(SKILL_TYPE eType , CGameObject* pOwner); +private: + list m_EffectList[ENUM_CLASS(SKILL_TYPE::END)] = {}; + list m_ActiveEffectList = {}; +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + HRESULT Ready_Effect(); +public: + static CEffectPool* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END + diff --git a/Jusin154_Team3D/Client/Public/Effect_Container.h b/Jusin154_Team3D/Client/Public/Effect_Container.h index e0e067265..092afba2f 100644 --- a/Jusin154_Team3D/Client/Public/Effect_Container.h +++ b/Jusin154_Team3D/Client/Public/Effect_Container.h @@ -21,7 +21,10 @@ class CEffect_Container abstract : public CContainerObject virtual void Late_Update(_float fTimeDelta) override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; public: - HRESULT Load_Directory(const _char* pPath); + HRESULT Load_Directory(const _char* pPath); + virtual HRESULT Pre_Setting(CGameObject* pObject); + HRESULT Load_Package(const _char* pPath); + protected: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; @@ -30,7 +33,7 @@ class CEffect_Container abstract : public CContainerObject HRESULT Bind_ShaderResources() override; void Update_Event(_float fTimeDelta); - + HRESULT Reset_EffectParts(); protected: _wstring m_wstrEffectName = {}; diff --git a/Jusin154_Team3D/Client/Public/Level_GamePlay.h b/Jusin154_Team3D/Client/Public/Level_GamePlay.h index 1c0272ff7..73c626c70 100644 --- a/Jusin154_Team3D/Client/Public/Level_GamePlay.h +++ b/Jusin154_Team3D/Client/Public/Level_GamePlay.h @@ -18,7 +18,6 @@ class CLevel_GamePlay final : public CLevel private: class CInfoInstance* m_pInfoInstance = { nullptr }; - class CPlayer* m_pPlayerTemp = { nullptr }; private: virtual HRESULT Initialize() override; HRESULT Initialize(void* pArg); @@ -31,6 +30,7 @@ class CLevel_GamePlay final : public CLevel HRESULT Ready_Layer_Player(const _wstring& strLayerTag); HRESULT Ready_Layer_SkyBox(const _wstring& strLayerTag); HRESULT Ready_Layer_Monster(); + HRESULT Reday_Layer_EffectPool(); public: static pair> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg); diff --git a/Jusin154_Team3D/Client/Public/Monster.h b/Jusin154_Team3D/Client/Public/Monster.h index d14859b21..77af41d2b 100644 --- a/Jusin154_Team3D/Client/Public/Monster.h +++ b/Jusin154_Team3D/Client/Public/Monster.h @@ -16,7 +16,8 @@ class CMonster abstract : public CUnit virtual void Priority_Update(_float fTimeDelta) override; virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; - virtual HRESULT Render() override; + virtual HRESULT Render_OutLine() override; + virtual void Set_DrawOutLine(); protected: CInfoInstance* m_pInfoInstance = { nullptr }; @@ -24,12 +25,12 @@ class CMonster abstract : public CUnit _float4 m_vTargetPos = { }; _float3 m_vToTargetDir = { }; _float m_fTargetDistance = { FLT_MAX }; + _bool m_bDrawOutLine = { false }; protected: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; HRESULT Ready_Components(void* pArg); - HRESULT Bind_ShaderResources(); void Set_Target(CUnit& pTarget, CTransform& pTransform); public: diff --git a/Jusin154_Team3D/Client/Public/NomalJap.h b/Jusin154_Team3D/Client/Public/NomalJap.h index 1ee112ae2..23d5683be 100644 --- a/Jusin154_Team3D/Client/Public/NomalJap.h +++ b/Jusin154_Team3D/Client/Public/NomalJap.h @@ -21,6 +21,9 @@ class CNomalJap final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; +public: + virtual HRESULT Pre_Setting(CGameObject* pObject) override; + private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; @@ -30,7 +33,16 @@ class CNomalJap final : public CEffect_Container virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; private: _wstring m_wstrEffectName = {}; - class CPhysXEffectHitBox* m_pPhysHitBox = {}; + class CPhysXEffectHitBox* m_pPhysHitBox = {}; + + class CPartObject* m_pProjectile = {}; + class CPartObject* m_pProjectile_Side = {}; + + _vector m_vRotateUp = {}; + _float m_fAccTime = {}; + _float m_fLerpAmount = {}; + _float m_fTurnValue = {}; + _vector m_vOwnerLook = {}; public: static CNomalJap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 650ffe4d0..18795999f 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -24,6 +24,7 @@ class CPlayer final : public CUnit private: CInfoInstance* m_pInfoInstance = { nullptr }; + class CMonster* m_pLockOnMonster = { nullptr }; _float m_fDirectionRadian = 0.f; _bool m_bSprintToggle = { false }; @@ -47,6 +48,7 @@ class CPlayer final : public CUnit HRESULT Ready_Components(); HRESULT Ready_Parts(); HRESULT Bind_ShaderResources(); + void ReLockOnTarget(); #ifdef _DEBUG void Update_CameraCoordinateSystem(); @@ -113,6 +115,9 @@ class CPlayer final : public CUnit void Behavior_CombatExit(); #pragma endregion + +private: + class CEffectPool* m_pEffectPool = nullptr; }; NS_END diff --git a/Jusin154_Team3D/Client/Public/Protego.h b/Jusin154_Team3D/Client/Public/Protego.h new file mode 100644 index 000000000..2c2c6fe0b --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Protego.h @@ -0,0 +1,48 @@ +#pragma once + +#include "Client_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CProtego final : public CEffect_Container +{ +private: + CProtego(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CProtego(const CProtego& rhs); + virtual ~CProtego() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + virtual HRESULT Pre_Setting(CGameObject* pObject) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + + CPartObject* m_pSphere = { nullptr }; + CPartObject* m_pBottom = { nullptr }; + CPartObject* m_pCircle = { nullptr }; +public: + static CProtego* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/TrailObject.h b/Jusin154_Team3D/Client/Public/TrailObject.h index 02bce36f3..c6c531778 100644 --- a/Jusin154_Team3D/Client/Public/TrailObject.h +++ b/Jusin154_Team3D/Client/Public/TrailObject.h @@ -91,13 +91,13 @@ class CTrailObject final : public CPartObject #endif // _DEBUG private: - CTexture* m_pDiffuse_TextureCom = { nullptr }; - CTexture* m_pNoise_TextureCom = { nullptr }; - CTexture* m_pMasking_TextureCom = { nullptr }; - CTexture* m_pDistortion_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pNoise_TextureCom = { nullptr }; + CTexture* m_pMasking_TextureCom = { nullptr }; + CTexture* m_pDistortion_TextureCom = { nullptr }; - CShader* m_pShaderCom = { nullptr }; - CTrail* m_pTrailCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CTrail* m_pTrailCom = { nullptr }; _string m_strTrailDiffuseName = {}; _string m_strTrailNoiseName = {}; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Circle_S.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Circle_S.bin new file mode 100644 index 000000000..12e74d397 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Circle_S.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0a1160cd6174e5e4f5a1a147f7604be06e5936f7cd14a517cf652bb71027fc3 +size 789 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Cricle_S.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Cricle_S.bin deleted file mode 100644 index b817c5a3c..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Cricle_S.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4f11629cc4a4d835c3e18278cb78ebc51403b8387715c77d99336a4890e01323 -size 789 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Proj.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Proj.bin index 937f1b655..f9d6173d4 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Proj.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Proj.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b7fec1300cc747a918a9a4d41efe068f8a52160a37152fe73325d77c03cbff05 -size 832 +oid sha256:2acf190d3c5e4cc435dc9d4c779a16bd3e038a9e9d3ff525aede0eb4429810f9 +size 785 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Proj_Blur.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Proj_Blur.bin index 3c1a86b45..77946c4e1 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Proj_Blur.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Proj_Blur.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b1612d28a2ec410db6ab80aaa93903b210489c7ae2458ba50eaaf35b1c79c69f +oid sha256:53bea717bfb06b0cc35cc7d5dd8fe5fedca496b2024ad36a1a4f339b1e0ca721 size 727 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapHit0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapHit0.bin new file mode 100644 index 000000000..0e7f9710b --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapHit0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab1a346e5f1b62d152251891bb5102fb1420207a6ce74a30d32e0c54eccbef99 +size 789 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapHit1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapHit1.bin new file mode 100644 index 000000000..433acbffa --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapHit1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7ec55a9b1000126f568a9c764716222eebd343a20815609e266dfd1d43a536f +size 733 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapPT0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapPT0.bin index f29275295..e96509260 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapPT0.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapPT0.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fc256f21b847eb54c3ec76578357134951c9cabb61534521d44bf2601877a07a -size 778 +oid sha256:4fc7b219cd30345b621339926808bc140397cf1064e2f3dcf6d13772dbb56aea +size 743 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapProjCircle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapProjCircle.bin new file mode 100644 index 000000000..9169ff50d --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapProjCircle.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c7dca44cd93b2f92665ebbddf455836af2dd6bc77b0552a41ae98bfb26cc130 +size 828 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapProjSide.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapProjSide.bin new file mode 100644 index 000000000..18e2fd193 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapProjSide.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a99edf82ca4e85ef52103f1526662df974fed740d4cde00b23ef90cebbb54ac0 +size 746 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapPT0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapPT0.bin deleted file mode 100644 index 175ad837c..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapPT0.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a46a6dde118944634aa526d34b9823ab5aa625ca5e4f42f1cca8e9e5fd0c6328 -size 786 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Bombard.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Bombard.bin new file mode 100644 index 000000000..d0e5dc2c3 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Bombard.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1aa176cc2a633eb12a2edcd82a34c80dc1e5bfcfbb79923361e960a94692919b +size 646 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Decendo.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Decendo.bin new file mode 100644 index 000000000..0cd0cc25d --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Decendo.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5805455e1494ccd694ea6f25871226e899ec5e71759e7bd1599309e136219bda +size 509 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap.bin new file mode 100644 index 000000000..ffa9a9497 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:807218446b2caf45986cc79908b50658bb86f5561653c45ed7e573579219a784 +size 334 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Protego.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Protego.bin new file mode 100644 index 000000000..0c08d6f6c --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Protego.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ddfb3185854514ab109c3b255761e2529f9f1989003ae86952b2d8c8dd9d359 +size 387 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoCircle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoCircle.bin index 588ddbd17..032a88b00 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoCircle.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoCircle.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a2490b71b3fb759b1452e4392cbd84ba1bd2b72045e9426fc2a92d7958d82bff +oid sha256:961dc1d6957ca3d69b94c0ff558876c0a9f5331be2f61e35b0609864d4d0eea7 size 813 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoHit_Lay.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoHit_Lay.bin index 0edf433a2..e6ed073a7 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoHit_Lay.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoHit_Lay.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c413d78be58a461fb61e0ec53cfa9e98972d75124c7ca58167d897be5d47cb0c +oid sha256:9ab21b312883411e87884a3ab536b2dc51692d9fe4b55fb3e05f985596aebf14 size 768 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoSphere.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoSphere.bin index 1a3774e17..e61968dcb 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoSphere.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Protego/ProtegoSphere.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2d59d568da29fb331d4e60ec7d395e56bb3925a44765551fe7bfcd35bc87f3df +oid sha256:f4d7b6dc29ad0d861eacb5ff4893dfc2397b9f84e88b2e22f73a420bef385694 size 788 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 f8468ae65..7ca8740fa 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli @@ -37,6 +37,12 @@ RasterizerState RS_Scissor ScissorEnable = true; }; +RasterizerState RS_Front +{ + FillMode = Solid; + CullMode = Front; +}; + DepthStencilState DSS_Default { DepthEnable = true; @@ -44,6 +50,13 @@ DepthStencilState DSS_Default DepthFunc = less_equal; }; +DepthStencilState DSS_OutLine +{ + DepthEnable = true; + DepthWriteMask = Zero; + DepthFunc = less_equal; +}; + DepthStencilState DSS_None { DepthEnable = false; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index f401dc228..664617cb5 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -455,7 +455,7 @@ PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In) vector vInput = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord); //float fMask = g_BloomMaskTexture.Sample(PointSampler, In.vTexcoord).a; float3 vColor = vInput.rgb; - uint iMask = (uint) round(vInput.a * 255.f); // int a = 1 // vBloom.a = (enum / 255); + uint iMask = (uint) round(vInput.a * 255.f); // int a = 1 -> // vBloom.a = (enum / 255); switch (iMask) { diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index 5b21faa0f..2763b3d6b 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -12,6 +12,9 @@ float g_fRimStrength; float g_fRimPower; float3 g_vRimColor; float4 g_TestColor; +float3 g_vOutLineColor; +float g_fOutLineThickness; +//float g_fPow; vector g_vCamPosition; Texture2D g_DiffuseTexture; @@ -88,6 +91,39 @@ VS_OUT VS_MAIN(VS_IN In) return Out; } +struct VS_OUT_OUTLINE +{ + float4 vPosition : SV_Position; + float3 vNormal : NORMAL; + float4 vWorldPos : TEXCOORD1; +}; + +VS_OUT_OUTLINE VS_MAIN_OUTLINE(VS_IN In) +{ + VS_OUT_OUTLINE Out; + + float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); + + matrix BoneMatrix = + mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) + + mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) + + mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) + + mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); + + vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); + vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix); + vPosition.xyz += (vNormal.xyz * g_fOutLineThickness).xyz; + + + matrix matWV, matWVP; + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vPosition, matWVP); + Out.vNormal = normalize(mul(vNormal, g_WorldMatrix)).xyz; + Out.vWorldPos = mul(vPosition, g_WorldMatrix); + return Out; +} struct VS_OUT_CAPTUREDMODEL { float4 vPosition : SV_Position; @@ -252,6 +288,31 @@ PS_OUT_SHADOW PS_MAIN_SHADOW(PS_IN_SHADOW In) return Out; } +struct PS_IN_OUTLINE +{ + float4 vPosition : SV_Position; + float3 vNormal : NORMAL; + float4 vWorldPos : TEXCOORD1; +}; +struct PS_OUT_OUTLINE +{ + float4 vOutLine : SV_TARGET0; +}; + +PS_OUT_OUTLINE PS_MAIN_OUTLINE(PS_IN_OUTLINE In) +{ + PS_OUT_OUTLINE Out = (PS_OUT_OUTLINE) 0; + + float3 vToView = normalize(g_vCamPosition.xyz - In.vWorldPos.xyz); // 픽셀에서 카메라로 + if (dot(vToView, In.vNormal) >= -0.12f) + { + discard; + } + Out.vOutLine = float4(g_vOutLineColor, 1.f); + + return Out; +} + struct PS_IN_CAPTUREDMODEL { float4 vPosition : SV_Position; @@ -362,7 +423,7 @@ PS_OUT PS_EYELASH(PS_IN In) technique11 DefaultTechnique { - pass Default + pass Default // 0 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -372,7 +433,7 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_MAIN(); } - pass ShadowPass + pass ShadowPass // 1 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -382,7 +443,7 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_MAIN_SHADOW(); } - pass CAPTUREDMODELPASS + pass CAPTUREDMODELPASS // 2 { SetRasterizerState(RS_Nocull); SetDepthStencilState(DSS_Effect, 0); @@ -391,7 +452,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_CAPTUREDMODEL(); } - pass BlurPass // 9 + pass BlurPass // 3 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -401,7 +462,7 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_MAIN_BLUR(); } - pass HairPass + pass HairPass // 4 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -411,7 +472,7 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_HAIR(); } - pass EyeLashPass + pass EyeLashPass // 5 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -420,4 +481,14 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_EYELASH(); } + + pass OutLinePass // 6 + { + SetRasterizerState(RS_Front); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN_OUTLINE(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_OUTLINE(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl index 1c0cd858a..9afbf30f9 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl @@ -11,6 +11,9 @@ float g_fFar; float g_fTime; float g_fDeltaU; float g_fDeltaV; +float3 g_vOutLineColor; +vector g_vCamPosition; +float g_fOutLineThickness; uint g_iIndexU; uint g_iIndexV; @@ -108,6 +111,32 @@ VS_OUT VS_MAIN(VS_IN In) return Out; } +struct VS_OUT_OUTLINE +{ + float4 vPosition : SV_Position; + float3 vNormal : NORMAL; + float4 vWorldPos : TEXCOORD1; +}; + +VS_OUT_OUTLINE VS_MAIN_OUTLINE(VS_IN In) +{ + VS_OUT_OUTLINE Out; + + vector vPosition = vector(In.vPosition, 1.f); + vector vNormal = vector(In.vNormal, 1.f); + vPosition.xyz += (vNormal.xyz * g_fOutLineThickness).xyz; + + + matrix matWV, matWVP; + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vPosition, matWVP); + Out.vNormal = normalize(mul(vNormal, g_WorldMatrix)).xyz; + Out.vWorldPos = mul(vPosition, g_WorldMatrix); + return Out; +} + struct VS_OUT_EFFECT { float4 vPosition : SV_POSITION; @@ -342,6 +371,31 @@ PS_OUT_EFFECT PS_EFFECT(PS_IN_EFFECT In) return Out; } +struct PS_IN_OUTLINE +{ + float4 vPosition : SV_Position; + float3 vNormal : NORMAL; + float4 vWorldPos : TEXCOORD1; +}; +struct PS_OUT_OUTLINE +{ + float4 vOutLine : SV_TARGET0; +}; + +PS_OUT_OUTLINE PS_MAIN_OUTLINE(PS_IN_OUTLINE In) +{ + PS_OUT_OUTLINE Out = (PS_OUT_OUTLINE) 0; + + float3 vToView = normalize(g_vCamPosition.xyz - In.vWorldPos.xyz); // 픽셀에서 카메라로 + if (dot(vToView, In.vNormal) >= 0.3f) + { + discard; + } + Out.vOutLine = float4(g_vOutLineColor, 1.f); + + return Out; +} + struct PS_IN_CAPTUREDMODEL { float4 vPosition : SV_Position; @@ -487,4 +541,14 @@ technique11 MeshTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_GLASS(); } + + pass OutLinePass // 13 + { + SetRasterizerState(RS_Front); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN_OUTLINE(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_OUTLINE(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index db2e7418c..eec7dc054 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -351,11 +351,43 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) } - - /* 최종 색깔 */ - vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, UV); - - + if (g_isDiffuseBlur) + { + float4 fAccDiffuse; + + + float fTexel = g_fBluringStrength; + + if (g_isBlurDissolve) + { + fTexel = saturate(g_fBluringStrength * (In.vLifeTime.x / In.vLifeTime.y)); + } + + if (g_isBlurReverseDissolve) + { + fTexel = saturate(g_fBluringStrength * (1 - (In.vLifeTime.x / In.vLifeTime.y))); + } + + for (int x = -2; x <= 2; x++) + { + for (int y = -2; y <= 2; y++) + { + fAccDiffuse += g_DiffuseTexture.Sample(DefaultSampler, UV + float2(x * fTexel, y * fTexel)); + } + } + + fAccDiffuse = fAccDiffuse / 9.0; + + /* 연산 마스크 대입*/ + vMtrlDiffuse = fAccDiffuse; + } + else + { + /* 최종 색깔 */ + vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, UV); + } + + if (g_vColor.a > 0) vMtrlDiffuse = saturate(g_vColor + vMtrlDiffuse); @@ -508,52 +540,55 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) if (fDepthStencilValue <= In.vProjPos.z / In.vProjPos.w + fbias) discard; - Out = BlendedWeight(vMtrlDiffuse, In.vProjPos.w); - //// 색깔 추가할 처리 (이미시브) - float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f); - - + float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f); float2 CenteredUV = In.vTexcoord - 0.5f; + + Out = BlendedWeight(vMtrlDiffuse, In.vProjPos.w); - float fDistance = saturate(length(CenteredUV) / g_fRadius); // 마스크의 크기를 어느정도할지 + if (g_fRadius >= FLT_EPSILON5) + { + float fDistance = saturate(length(CenteredUV) / g_fRadius); // 마스크의 크기를 어느정도할지 - float fSoftEdge = pow(saturate(1.0f - fDistance), g_fSoftenExp) * g_fSoftStrength; //SoftenExp 엣지감쇠지수 , Strength + float fSoftEdge = pow(saturate(1.0f - fDistance), g_fSoftenExp) * g_fSoftStrength; //SoftenExp 엣지감쇠지수 , Strength - float fCore = pow(saturate(1.0 - fDistance * 2.f), max(0.001, g_fCoreBoost)) * g_fCoreBoost; // CoreBust 중심강조 + float fCore = pow(saturate(1.0 - fDistance * 2.f), max(0.001, g_fCoreBoost)) * g_fCoreBoost; // CoreBust 중심강조 - float fEmissive = fSoftEdge + fCore; + float fEmissive = fSoftEdge + fCore; - if (g_isEmissive == true) - { - vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); - } - else - { - vEmissiveMtrl = g_vEmissive; - } + if (g_isEmissive == true) + { + vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); + } + else + { + vEmissiveMtrl = g_vEmissive; + } - float fEmissiveStrength = g_fEmissiveStrength; + float fEmissiveStrength = g_fEmissiveStrength; - if (g_isEmissiveDissolve == true) - { - fEmissiveStrength *= (1.f - In.vLifeTime.x / In.vLifeTime.y); + if (g_isEmissiveDissolve == true) + { + fEmissiveStrength *= (1.f - In.vLifeTime.x / In.vLifeTime.y); - if (fEmissiveStrength <= 0.05f) - fEmissiveStrength = 0; + if (fEmissiveStrength <= 0.05f) + fEmissiveStrength = 0; - } + } - if (g_isEmissiveDissolveReverse == true) - { - fEmissiveStrength *= (In.vLifeTime.x / In.vLifeTime.y); + if (g_isEmissiveDissolveReverse == true) + { + fEmissiveStrength *= (In.vLifeTime.x / In.vLifeTime.y); + } + + Out.vDiffuse += vEmissiveMtrl * fEmissive * fEmissiveStrength; // 이미시브 스트랭스 } + - Out.vDiffuse += vEmissiveMtrl * fEmissive * fEmissiveStrength; // 이미시브 스트랭스 - + Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); return Out; } @@ -630,8 +665,8 @@ struct PS_BLUR_OUT PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) { - PS_BLUR_OUT Out; + vector vMtrlDiffuse; vector vMtrlMask; vector vMtrlNoise; @@ -680,15 +715,12 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) UV = UV + (vMtrlDistortion).rg * g_fNoiseDistortionIntensity; } - - + /* 최종 색깔 */ vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, UV); - - if (g_vColor.a > 0) - vMtrlDiffuse += g_vColor; + vMtrlDiffuse = saturate(g_vColor + vMtrlDiffuse); } else @@ -712,7 +744,8 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r); if (g_isNoiseColor) - vMtrlDiffuse *= vMtrlNoise; + vMtrlDiffuse.rgb *= vMtrlNoise.rgb; + } /* 마스크 */ @@ -725,15 +758,14 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) // 마스크 디스토션 if (g_isDistortion == true) { - float2 UV; // 이미지의 UV값 - + float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iMaskDistortionMoveLerpOption); vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV); //디스토션(노이즈) 텍스쳐로 uv를 왜곡함 vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity; - + } if (g_isMaskUVMove) @@ -748,25 +780,61 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord); + if (g_isMaskBlur) + { + float4 fAccMask; + + + float fTexel = g_fBluringStrength; + + if (g_isBlurDissolve) + { + fTexel = saturate(g_fBluringStrength * (In.vLifeTime.x / In.vLifeTime.y)); + } + + if (g_isBlurReverseDissolve) + { + fTexel = saturate(g_fBluringStrength * (1 - (In.vLifeTime.x / In.vLifeTime.y))); + } + + for (int x = -2; x <= 2; x++) + { + for (int y = -2; y <= 2; y++) + { + fAccMask += g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord + float2(x * fTexel, y * fTexel)); + } + } + + fAccMask = fAccMask / 9.0; + + /* 연산 마스크 대입*/ + vMtrlMask.r = fAccMask; + } + + float fSoftMask; if (g_fSoftMask > FLT_EPSILON5) fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask); - + else + fSoftMask = vMtrlMask.r; + vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask); - + + } else { vMtrlMask.r = 1.f; } - - - if (vMtrlDiffuse.a <= 0.f) - discard; vMtrlDiffuse.a *= g_fDiffuseAlpha; + + if (vMtrlDiffuse.a <= FLT_EPSILON5) + discard; + + if (g_isDissolve == true) { @@ -791,17 +859,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) } } - - // 색깔 추가할 처리 (이미시브) - - //int2 iTexel = int2(In.vPosition.xy); - - //float fDepthStencilValue = g_DepthStencilTexture.Load(int3(iTexel, 0)).r; - - //float fbias = 0.000005f; - - //if (fDepthStencilValue <= In.vProjPos.z / In.vProjPos.w + fbias) - // discard; + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 225bb9fc3..dc6ef7eb1 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -214,6 +214,7 @@ + @@ -352,6 +353,7 @@ + @@ -447,8 +449,13 @@ Effect 5.0 + Effect + 5.0 + + + Effect + 5.0 - Effect 5.0 @@ -485,7 +492,10 @@ Effect 5.0 - + + Effect + 5.0 + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index a661f822a..ab7fb694c 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -385,6 +385,9 @@ {5b287b4f-4f71-4458-85a1-c753fd121c53} + + {c0589f6e-ed9c-4e76-8df2-4f95ce3c7b9a} + @@ -750,6 +753,9 @@ 50.UI\GamePlay_Canvas\Action_Panel\Magic_Item + + 02.GameObjects\Layer_Effect\EffectPool + @@ -1098,9 +1104,6 @@ 02.GameObjects\Env\06.InstancedProp - - - 02.GameObjects\Monster\Goblin 50.UI\GamePlay_Canvas\Action_Panel\Magic_Icon @@ -1113,10 +1116,13 @@ 02.GameObjects\Monster\Goblin - + 50.UI\GamePlay_Canvas\Action_Panel\Magic_Item + + 02.GameObjects\Layer_Effect\EffectPool + diff --git a/Jusin154_Team3D/Editor/Private/Bombard.cpp b/Jusin154_Team3D/Editor/Private/Bombard.cpp index 2af609ee6..2689073e4 100644 --- a/Jusin154_Team3D/Editor/Private/Bombard.cpp +++ b/Jusin154_Team3D/Editor/Private/Bombard.cpp @@ -31,28 +31,16 @@ HRESULT CBombard::Initialize(void* pArg) if (FAILED(Ready_Components(pArg))) return E_FAIL; - if (FAILED(Ready_Child())) - return E_FAIL; - if (FAILED(Load_Directory("../Bin/Resources/Data/Effect/Bombard/"))) + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Bombard"))) return E_FAIL; m_wstrEffectName = L"Bombard"; - CPartObject* pShootPt = Get_PartObject("Bombard_Shoot_Pt"); m_pLight_Projectile = Get_PartObject("Bombard_Projectile"); - CPartObject* pCircle0 = Get_PartObject("Bombard_Circle0"); - - pShootPt->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); - m_pLight_Projectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); - pCircle0->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); - - pCircle0->Set_Visible(true); - pShootPt->Set_Visible(true); - m_pLight_Projectile->Set_Visible(true); - SAFE_ADDREF(m_pLight_Projectile); + m_fDuration = 2.5f; return S_OK; @@ -88,6 +76,44 @@ void CBombard::Late_Update(_float fTimeDelta) } +HRESULT CBombard::Pre_Setting(CGameObject* pObject) +{ + if (pObject == nullptr) + return E_FAIL; + + m_pOwner = pObject; + + if (FAILED(Ready_Child())) + return E_FAIL; + + Reset_EffectParts(); + + m_fAccTime = 0.f; + __super::m_fAccTime = 0.f; + m_fPreAccTime = 0.f; + + + + CPartObject* pShootPt = Get_PartObject("Bombard_Shoot_Pt"); + + CPartObject* pCircle0 = Get_PartObject("Bombard_Circle0"); + + pShootPt->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pLight_Projectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + pCircle0->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + pCircle0->Set_Visible(true); + pShootPt->Set_Visible(true); + + m_pLight_Projectile->Set_Visible(true); + + + m_bVisible = true; + + + return S_OK; +} + HRESULT CBombard::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) { diff --git a/Jusin154_Team3D/Editor/Private/Decendo.cpp b/Jusin154_Team3D/Editor/Private/Decendo.cpp index 3953a1bcb..6b95f01fa 100644 --- a/Jusin154_Team3D/Editor/Private/Decendo.cpp +++ b/Jusin154_Team3D/Editor/Private/Decendo.cpp @@ -32,10 +32,7 @@ HRESULT CDecendo::Initialize(void* pArg) if (FAILED(Ready_Components(pArg))) return E_FAIL; - if (FAILED(Ready_Child())) - return E_FAIL; - - if (FAILED(Load_Directory("../Bin/Resources/Data/Effect/Decendo/"))) + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Decendo"))) return E_FAIL; @@ -44,30 +41,9 @@ HRESULT CDecendo::Initialize(void* pArg) m_pProjectile_Blur = Get_PartObject("Decendo_Proj_Blur"); m_pProjectile = Get_PartObject("Decendo_Proj"); - CPartObject* pCircle0 = Get_PartObject("Decendo_Cricle_S"); - - pCircle0->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); - m_pProjectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); - m_pProjectile_Blur->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); - - pCircle0->Set_Visible(true); - m_pProjectile->Set_Visible(true); - m_pProjectile_Blur->Set_Visible(true); - SAFE_ADDREF(m_pProjectile_Blur); SAFE_ADDREF(m_pProjectile); - //나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 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); - - m_vRotateUp = XMVector3Normalize(m_vRotateUp); - m_fDuration = 2.5f; return S_OK; @@ -88,11 +64,10 @@ void CDecendo::Update(_float fTimeDelta) Update_Event(fTimeDelta); - m_pProjectile_Blur->Get_Component()->Translation(m_vOwnerLook * 0.5f); m_pProjectile->Get_Component()->Translation(m_vOwnerLook * 0.5f); - Get_PartObject()->Trail_Update(m_pProjectile->Get_Component()->Get_XMWorldMatrix(), fTimeDelta); + if (m_fAccTime > XM_2PI) return; @@ -101,7 +76,6 @@ void CDecendo::Update(_float fTimeDelta) m_pProjectile_Blur->Get_Component()->Translation(m_vRotateUp * 0.2f * sinf(m_fAccTime)); m_pProjectile->Get_Component()->Translation(m_vRotateUp * 0.2f * sinf(m_fAccTime)); - } void CDecendo::Late_Update(_float fTimeDelta) @@ -109,10 +83,63 @@ void CDecendo::Late_Update(_float fTimeDelta) if (m_bVisible == false) return; + Get_PartObject()->Trail_Update(m_pProjectile->Get_Component()->Get_XMWorldMatrix(), fTimeDelta); __super::Late_Update(fTimeDelta); } +HRESULT CDecendo::Pre_Setting(CGameObject* pObject) +{ + if (pObject == nullptr) + return E_FAIL; + + /* 부모 할당 */ + m_pOwner = pObject; + + /* 피직스 생성*/ + if (FAILED(Ready_Child())) + return E_FAIL; + + /* 초기 셋팅 초기화 */ + Reset_EffectParts(); + m_fAccTime = 0.f; + __super::m_fAccTime = 0.f; + m_fPreAccTime = 0.f; + + + CPartObject* pCircle0 = Get_PartObject("Decendo_Cricle_S"); + + /* 초기 객체 위치 초기화 */ + pCircle0->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pProjectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pProjectile_Blur->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + /* 초기 객체 비지블 */ + pCircle0->Set_Visible(true); + m_pProjectile->Set_Visible(true); + m_pProjectile_Blur->Set_Visible(true); + + /*트레일 초기화 */ + Get_PartObject()->Set_Visible(true); + 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); + + m_vRotateUp = XMVector3Normalize(m_vRotateUp); + + m_bVisible = true; + + return S_OK; +} + HRESULT CDecendo::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) { @@ -190,6 +217,8 @@ void CDecendo::OnCollision(CGameObject* pOther , void* pDesc) pPair.second->Get_Component()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos); } + + m_pProjectile_Blur->Set_Visible(false); m_pProjectile->Set_Visible(false); @@ -198,9 +227,11 @@ void CDecendo::OnCollision(CGameObject* pOther , void* pDesc) _vector vPlayerPos = m_pOwner->Get_Component()->Get_State(STATE::POSITION); Get_PartObject("Decendo_Down")->Get_Component()->LookAt(vPlayerPos); - + Get_PartObject("Decendo_Smoke")->Get_Component()->LookAt(vPlayerPos); Get_PartObject("Decendo_Cricle_S")->Set_Visible(false); + + Get_PartObject()->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, 0.f, 0.f, 1.f)); Get_PartObject()->Set_Visible(false); m_pPhysHitBox->Set_Dead(); diff --git a/Jusin154_Team3D/Editor/Private/EditEffect.cpp b/Jusin154_Team3D/Editor/Private/EditEffect.cpp index d26ff1afe..a7ad1ea99 100644 --- a/Jusin154_Team3D/Editor/Private/EditEffect.cpp +++ b/Jusin154_Team3D/Editor/Private/EditEffect.cpp @@ -27,8 +27,7 @@ HRESULT CEditEffect::Initialize(void* pArg) if (FAILED(Ready_Components(pArg))) return E_FAIL; - - Set_Visible(false); + m_bVisible = false; return S_OK; } @@ -403,7 +402,6 @@ void CEditEffect::Describe_Entity() const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "DECAL", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" , "UI" }; const char* pEffectType[] = { "EFFECT" , "TRAIL" }; const char* pShaderPass[] = { "DEFAULT" , "NON_NOMALMAP" , "BLUR" , "WEIGHTBLEND" , "NON_WORLD" , "NON_WORLD_BLUR", "ALPHA_BLEND"}; - _int iCurrentItem = static_cast<_int>(m_EffectInfo.eRenderOrder); _int iCurrentType = static_cast<_int>(m_EffectInfo.eEffectType); _int iCurrentPass = static_cast<_int>(m_EffectInfo.eShaderPass); diff --git a/Jusin154_Team3D/Editor/Private/EffectPool.cpp b/Jusin154_Team3D/Editor/Private/EffectPool.cpp new file mode 100644 index 000000000..0f76dfaf9 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/EffectPool.cpp @@ -0,0 +1,232 @@ +#include "pch.h" +#include "EffectPool.h" + +#include "GameInstance.h" +#include "Camera_Debug.h" +#include "Effect_Container.h" +#include "Bombard.h" +#include "NomalJap.h" +#include "Decendo.h" + + +CEffectPool::CEffectPool(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject(pDevice, pContext) +{ +} + +CEffectPool::CEffectPool(const CEffectPool& Prototype) + : CGameObject(Prototype) +{ +} + +HRESULT CEffectPool::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEffectPool::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + if (FAILED(Ready_Effect())) + return E_FAIL; + + return S_OK; +} + +void CEffectPool::Priority_Update(_float fTimeDelta) +{ + for (auto iter = m_ActiveEffectList.begin(); iter != m_ActiveEffectList.end(); ) + { + if (false == (*iter)->Get_Visible()) + { + //SAFE_RELEASE(*iter); + //iter = m_ActiveEffectList.erase(iter); + } + else + { + (*iter)->Priority_Update(fTimeDelta); + ++iter; + } + } +} + +void CEffectPool::Update(_float fTimeDelta) +{ + for (auto iter = m_ActiveEffectList.begin() ; iter != m_ActiveEffectList.end(); ) + { + if (false == (*iter)->Get_Visible()) + { + //SAFE_RELEASE(*iter); + //iter = m_ActiveEffectList.erase(iter); + } + else + { + (*iter)->Update(fTimeDelta); + ++iter; + } + } +} + +void CEffectPool::Late_Update(_float fTimeDelta) +{ + + for (auto iter = m_ActiveEffectList.begin(); iter != m_ActiveEffectList.end(); ) + { + if (false == (*iter)->Get_Visible()) + { + SAFE_RELEASE(*iter); + iter = m_ActiveEffectList.erase(iter); + } + else + { + (*iter)->Late_Update(fTimeDelta); + ++iter; + } + } +} + +HRESULT CEffectPool::Render() +{ + return S_OK; +} + + +HRESULT CEffectPool::Ready_Components() +{ + __super::Ready_Components(nullptr); + return S_OK; +} + +HRESULT CEffectPool::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CEffectPool::Ready_Effect() +{ + + if(FAILED(Create_Effect(SKILL_TYPE::JAP, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + + CNomalJap* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect;} + ))) return E_FAIL; + + + if (FAILED(Create_Effect(SKILL_TYPE::BOMBARD, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + + CBombard* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect;} + ))) return E_FAIL; + + if (FAILED(Create_Effect(SKILL_TYPE::DECENDO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + + CDecendo* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect;} + ))) return E_FAIL; + + + return S_OK; +} + +HRESULT CEffectPool::Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPrototypeLevel, _uint iCloneLevel, function AddPrototypeEvent) +{ + for (_uint i = 0; i < iNumEffect; i++) + { + CEffect_Container* pEffect_Container = AddPrototypeEvent(iPrototypeLevel, iCloneLevel); + + if (pEffect_Container == nullptr) + return E_FAIL; + + m_EffectList[ENUM_CLASS(eType)].push_back(pEffect_Container); + + } + + return S_OK; +} + +HRESULT CEffectPool::Use_Skill(SKILL_TYPE eType, CGameObject* pOwner) +{ + if (pOwner == nullptr) + return S_OK; + + for (auto& pSkill : m_EffectList[ENUM_CLASS(eType)]) + { + if (pSkill->Get_Visible() == true) + continue; + + pSkill->Pre_Setting(pOwner); + + m_ActiveEffectList.push_back(pSkill); + Safe_AddRef(pSkill); + + break; + } + + return S_OK; +} + + +CEffectPool* CEffectPool::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CEffectPool* pInstance = new CEffectPool(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CEffectPool"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CEffectPool::Clone(void* pArg, CGameObject* pOwner) +{ + CEffectPool* pInstance = new CEffectPool(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CEffectPool"); + Safe_Release(pInstance); + } + + return pInstance; +} + + + +void CEffectPool::Free() +{ + __super::Free(); + + for (size_t i = 0; i < ENUM_CLASS(SKILL_TYPE::END); i++) + { + for (auto& pEffect : m_EffectList[i]) + { + SAFE_RELEASE(pEffect); + } + } + + for (auto& pEffect : m_ActiveEffectList) + { + SAFE_RELEASE(pEffect); + } +} + +void CEffectPool::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Effect_Container.cpp b/Jusin154_Team3D/Editor/Private/Effect_Container.cpp index e5d93cd6f..e15551b1b 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Container.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Container.cpp @@ -23,6 +23,8 @@ CEffect_Container::CEffect_Container(const CEffect_Container& rhs) HRESULT CEffect_Container::Initialize_Prototype() { + + return S_OK; } @@ -35,6 +37,9 @@ HRESULT CEffect_Container::Initialize(void* pArg) if (FAILED(Ready_Child())) return E_FAIL; + + m_bVisible = false; + return S_OK; } @@ -157,6 +162,155 @@ HRESULT CEffect_Container::Load_Directory(const _char* pPath) return S_OK; } +HRESULT CEffect_Container::Load_Package(const _char* pPath) +{ + + _string strPerfectFilePath = pPath; + + strPerfectFilePath += ".bin"; + + HANDLE hFile = CreateFileW( + CMyTools::ToWstring(strPerfectFilePath).c_str(), // 파일 이름 + GENERIC_READ, // 읽기 모드 + FILE_SHARE_READ, // 다른 프로세스도 읽기 가능 + NULL, + OPEN_EXISTING, // 기존 파일 열기 + FILE_ATTRIBUTE_NORMAL, + NULL + ); + + + if (hFile == INVALID_HANDLE_VALUE) { + MessageBox(NULL, L"오브젝트 읽기 실패", L"System Message", MB_OK); + return E_FAIL; + } + + // 나중에 패키징할때 패스를 저장할거임 + + + DWORD dwByte(0); + + _int iEffectCount = {}; + + if (!ReadFile(hFile, &iEffectCount, sizeof(_int), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + + for (_int i = 0; i < iEffectCount; i++) + { + size_t iComponentLength = {}; + _char szName[MAX_PATH] = {}; + + if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + if (iComponentLength != 0) + { + if (!ReadFile(hFile, szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + } + + _string strEffectPath = szName; + _string strExt = {}; + _string strEffectName = {}; + + size_t iPos = strEffectPath.rfind('.'); // 뒤에서부터 '/' 검색 + + if (iPos != std::string::npos) + { + strExt += strEffectPath.substr(iPos + 1); + strEffectName = strEffectPath.substr(0, iPos); + } + + size_t pos = strEffectName.rfind('\\'); // 뒤에서부터 '/' 검색 + + if (pos != std::string::npos) + strEffectName = strEffectName.substr(pos + 1); + + if (!strcmp(strExt.c_str(), "trail")) + { + CTrailObject* pTrail = nullptr; + + CPartObject::PARTOBJECT_DESC PartsDesc{}; + + PartsDesc.pParentTransform = m_pTransformCom; + + if (FAILED(Add_PartObject(strEffectName, NEXT_LEVEL, &pTrail, &PartsDesc))) { + assert(false); + return E_FAIL; + } + + + /*이펙트 로드 로드*/ + size_t iPos = {}; + + while ((iPos = strEffectPath.find(".trail")) != std::string::npos) { + strEffectPath.erase(iPos, 6); + }; + + + if (FAILED(pTrail->Load_Trail(strEffectPath.c_str(), LEVEL::EFFECT))) + { + Safe_Release(pTrail); + continue; + } + + Safe_Release(pTrail); + + continue; + } + + + ///////////////////////////// + + CEditEffect* pEditEffect = nullptr; + + CPartObject::PARTOBJECT_DESC PartsDesc{}; + + PartsDesc.pParentTransform = m_pTransformCom; + + /*이펙트 껍데기 생성*/ + + if (FAILED(Add_PartObject(strEffectName, NEXT_LEVEL, &pEditEffect, &PartsDesc))) { + assert(false); + return E_FAIL; + } + + /*이펙트 로드 로드*/ + size_t iPosition = {}; + _string strFilePath = strEffectPath; + + while ((iPosition = strFilePath.find(".bin")) != std::string::npos) { + strFilePath.erase(iPosition, 4); + }; + + + if (FAILED(pEditEffect->Load(strFilePath.c_str(), LEVEL::EFFECT))) + { + Safe_Release(pEditEffect); + continue; + } + + Safe_Release(pEditEffect); + + } + + CloseHandle(hFile); + + return S_OK; +} + +HRESULT CEffect_Container::Pre_Setting(CGameObject* pObject) +{ + return S_OK; +} + HRESULT CEffect_Container::Ready_Components(void* pArg) { CTransform::TRANSFORM_DESC TransformDesc = {}; @@ -189,6 +343,21 @@ HRESULT CEffect_Container::Bind_ShaderResources() return S_OK; } +HRESULT CEffect_Container::Reset_EffectParts() +{ + for (auto& iter : m_PartObjects) + { + CInstance_Model* pInstanceModel = iter.second->Get_Component(); + + if (pInstanceModel == nullptr) + continue; + + pInstanceModel->Instane_Buffer_ReStruct(); + } + + return S_OK; +} + void CEffect_Container::Update_Event(_float fTimeDelta) { diff --git a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp index 83bdb5257..b3271422f 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp @@ -126,6 +126,88 @@ HRESULT CEffect_Editor::Ready_Child() + return S_OK; +} + +HRESULT CEffect_Editor::Packaging(const _char* pDirectoryPath) +{ + _uint iIndex = {}; + + _string strPerfectFilePath = "../Bin/Resources/Data/Effect/Package/"; + _string strDirectoryPath = pDirectoryPath; + + size_t pos = strDirectoryPath.rfind('/'); // 뒤에서부터 '/' 검색 + + if (pos != std::string::npos) + strPerfectFilePath += strDirectoryPath.substr(pos + 1); + + strPerfectFilePath += ".bin"; + + + HANDLE hFile = CreateFile(CMyTools::ToWstring(strPerfectFilePath).c_str(), + GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL + ); + + + if (hFile == INVALID_HANDLE_VALUE) { + MessageBox(NULL, L"패키징 실패", L"System Message", MB_OK); + return E_FAIL; + } + DWORD dwByte; + _int iFileCount = {}; + + for (auto& file : filesystem::directory_iterator(pDirectoryPath)) { + ++iFileCount; + } + + if (!WriteFile(hFile, &iFileCount, sizeof(_int), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + for (const auto& file : filesystem::directory_iterator(pDirectoryPath)) + { + if (file.is_directory()) + continue; + + string ext = file.path().extension().string(); + + if (!(strcmp(ext.c_str(), ".bin") ^ strcmp(ext.c_str(), ".trail"))) + continue; + + _char szFilePath[MAX_PATH] = {}; + + strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str()); + + ///////////////////////////// + + _string strPath = szFilePath; + + + + size_t iComponentLength = strPath.length(); + const _char* pFileComponentPath = strPath.c_str(); + + if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + + if (iComponentLength != 0) + { + if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) { + CloseHandle(hFile); + return E_FAIL; + } + } + + } + + CloseHandle(hFile); + return S_OK; } @@ -637,6 +719,35 @@ void CEffect_Editor::Describe_Entity() } } + GUI::SameLine(); + + if (GUI::Button("PACKAGE DIRECTORY")) + { + if (SUCCEEDED(Packaging(m_strPackageSavePath.c_str()))) + { + MessageBox(NULL, L"패키징 성공", L"System Message", MB_OK); + } + else + { + MessageBox(NULL, L"패키징 실패", L"System Message", MB_OK); + } + } + + GUI::SameLine(); + + if (GUI::Button("LOAD PACKAHE")) + { + if(SUCCEEDED(Load_Package(m_strPackageSavePath.c_str()))) + { + MessageBox(NULL, L"로드 성공", L"System Message", MB_OK); + } + else + { + MessageBox(NULL, L"로드 실패", L"System Message", MB_OK); + } + + } + GUI::InputTextMultiline("TRAIL FILE PATH", m_szTrailBuffer, sizeof(m_szTrailBuffer), ImVec2(250, 25)); m_strTrailSavePath = m_szTrailBuffer; diff --git a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp index 717186f77..1af33ee51 100644 --- a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp @@ -14,6 +14,7 @@ #include "Dummy_PhysXMonster.h" #include "Dummy_PhysXWall.h" #include "Player.h" +#include "EffectPool.h" CLevel_EffectViewer::CLevel_EffectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -47,6 +48,9 @@ HRESULT CLevel_EffectViewer::Initialize() if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_CUBE))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함! + return E_FAIL; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER))) return E_FAIL; @@ -54,6 +58,8 @@ HRESULT CLevel_EffectViewer::Initialize() return E_FAIL; + + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 3360e7650..48bb2791b 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -97,6 +97,7 @@ #include "NomalJap.h" #include "Bombard.h" #include "Decendo.h" +#include "EffectPool.h" #pragma endregion @@ -373,6 +374,7 @@ HRESULT CLoader::Loading_For_UI() return S_OK; }); + Asset_FileLoad("../Bin/Resources/Textures/HUD", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) { @@ -930,6 +932,9 @@ HRESULT CLoader::Loading_For_Effect() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Target::Create(m_pDevice, m_pContext)))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CEffectPool::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Player */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CPlayer::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -938,6 +943,8 @@ HRESULT CLoader::Loading_For_Effect() + + m_strMessage = TEXT("Loading Success!"); m_isFinished = true; diff --git a/Jusin154_Team3D/Editor/Private/NomalJap.cpp b/Jusin154_Team3D/Editor/Private/NomalJap.cpp index 3f05034fa..6c239d104 100644 --- a/Jusin154_Team3D/Editor/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Editor/Private/NomalJap.cpp @@ -4,6 +4,7 @@ #include "GameInstance.h" #include "EditEffect.h" #include "Dummy_PhysXEffectHitBox.h" +#include "TrailObject.h" CNomalJap::CNomalJap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -32,13 +33,18 @@ HRESULT CNomalJap::Initialize(void* pArg) if (FAILED(Ready_Components(pArg))) return E_FAIL; - if (FAILED(Ready_Child())) - return E_FAIL; m_wstrEffectName = L"Nomal_Jap"; - m_PartObjects.begin()->second->Set_Visible(true); - m_PartObjects.begin()->second->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/Jap"))) + return E_FAIL; + + + m_pProjectile_Side = Get_PartObject("JapProjSide"); + m_pProjectile = Get_PartObject("JapProjCircle"); + + SAFE_ADDREF(m_pProjectile); + SAFE_ADDREF(m_pProjectile_Side); m_fDuration = 5.f; @@ -52,12 +58,26 @@ void CNomalJap::Priority_Update(_float fTimeDelta) void CNomalJap::Update(_float fTimeDelta) { + if (m_bVisible == false) return; - + __super::Update(fTimeDelta); Update_Event(fTimeDelta); + + m_pProjectile_Side->Get_Component()->Translation(m_vOwnerLook * 1.2f); + m_pProjectile->Get_Component()->Translation(m_vOwnerLook * 1.2f); + + + + if (m_fAccTime > XM_2PI) + return; + + m_fAccTime += fTimeDelta * 15.f; + + m_pProjectile_Side->Get_Component()->Translation(m_vRotateUp * 0.6f * sinf(m_fAccTime)); + m_pProjectile->Get_Component()->Translation(m_vRotateUp * 0.6f * sinf(m_fAccTime)); } void CNomalJap::Late_Update(_float fTimeDelta) @@ -65,9 +85,60 @@ void CNomalJap::Late_Update(_float fTimeDelta) if (m_bVisible == false) return; + Get_PartObject()->Trail_Update(m_pProjectile->Get_Component()->Get_XMWorldMatrix(), fTimeDelta); + __super::Late_Update(fTimeDelta); } +HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) +{ + if (pObject == nullptr) + return E_FAIL; + + /* 부모 할당 */ + m_pOwner = pObject; + + /* 피직스 생성*/ + if (FAILED(Ready_Child())) + return E_FAIL; + + /* 초기 셋팅 초기화 */ + Reset_EffectParts(); + m_fAccTime = 0.f; + __super::m_fAccTime = 0.f; + m_fPreAccTime = 0.f; + + + /* 초기 객체 위치 초기화 */ + m_pProjectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pProjectile_Side->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + /* 초기 객체 비지블 */ + m_pProjectile->Set_Visible(true); + m_pProjectile_Side->Set_Visible(true); + + /*트레일 초기화 */ + Get_PartObject()->Set_Visible(true); + + 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); + + m_vRotateUp = XMVector3Normalize(m_vRotateUp); + + m_bVisible = true; + + return S_OK; +} + HRESULT CNomalJap::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) { @@ -85,10 +156,20 @@ HRESULT CNomalJap::Ready_Child() XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); + + _vector vOwnerLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); + + _float3 vDir = {}; + + XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); + + XMStoreFloat3(&vDir, vOwnerLook * 0.6f); + + Desc.vRotRPY = { 0.f, 0.f, 0.f }; Desc.iSubKind = 70; - Desc.vDeltaPos = { 0.f, 0.f, 2.f }; - Desc.vLifeTime = { 0.f, 2.f }; + Desc.vDeltaPos = vDir; + Desc.vLifeTime = { 0.f, 1.f }; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) { assert(false); @@ -132,11 +213,18 @@ void CNomalJap::OnCollision(CGameObject* pOther , void* pDesc) for (auto& pPair : m_PartObjects) { + pPair.second->Set_Visible(true); pPair.second->Get_Component()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos); } - m_PartObjects.begin()->second->Set_Visible(false); + Get_PartObject("JapPT0")->Get_Component()->LookAt(m_pOwner->Get_WorldPostion()); + + m_pProjectile_Side->Set_Visible(false); + m_pProjectile->Set_Visible(false); + + Get_PartObject()->Set_Visible(false); + Get_PartObject()->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, 0.f, 0.f, 1.f)); m_pPhysHitBox->Set_Dead(); } @@ -149,6 +237,9 @@ void CNomalJap::Free() // if (m_pPhysHitBox->Get_Depth() == false) // SAFE_RELEASE(m_pPhysHitBox); + Safe_Release(m_pProjectile); + Safe_Release(m_pProjectile_Side); + } void CNomalJap::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index 8bc2bd8c9..341409181 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -21,6 +21,8 @@ #pragma endregion #include "Bombard.h" +#include "Layer.h" +#include "EffectPool.h" CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CUnit(pDevice, pContext) @@ -70,6 +72,10 @@ HRESULT CPlayer::Initialize(void* pArg) m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); + + m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); + SAFE_ADDREF(m_pEffectPool); + return S_OK; } @@ -284,6 +290,8 @@ void CPlayer::Free() SAFE_RELEASE(m_pCamPosition_TopDown_FollowPart); SAFE_RELEASE(m_pCamPosition_TopDown_LookPart); SAFE_RELEASE(m_pCamPosition_ShoulderPart); + + SAFE_RELEASE(m_pEffectPool); } void CPlayer::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/Player_States.cpp b/Jusin154_Team3D/Editor/Private/Player_States.cpp index 5e957002f..48cb896bc 100644 --- a/Jusin154_Team3D/Editor/Private/Player_States.cpp +++ b/Jusin154_Team3D/Editor/Private/Player_States.cpp @@ -20,8 +20,7 @@ #include "State_Combat.h" #pragma endregion -#include "Bombard.h" -#include "Decendo.h" +#include "EffectPool.h" #pragma region States void CPlayer::TestKeyInput(_float fTimeDelta) @@ -143,6 +142,7 @@ HRESULT CPlayer::Behavior_IdleExitCheck() } else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { m_pFSM->Change_State(FSMSTATE::COMBAT); + } else if (m_pGameInstance->Key_Down(DIK_V)) { m_pFSM->Change_State(FSMSTATE::COMBAT); @@ -431,6 +431,9 @@ void CPlayer::Behavior_CombatEnter() else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; + + m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this); + } else if (SUCCEEDED(InputSpell())) { m_pFSM->Enable_State(FSMSTATE::SPELL); @@ -528,10 +531,7 @@ HRESULT CPlayer::Behavior_CombatExitCheck() case STATEANIM::ACCIO: pairAnimInfo = m_Animation[STATEANIM::ACCIO]; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) { - assert(false); - return E_FAIL; - } + m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARD, this); break; @@ -539,10 +539,7 @@ HRESULT CPlayer::Behavior_CombatExitCheck() { pairAnimInfo = m_Animation[STATEANIM::DESCENDO]; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) { - assert(false); - return E_FAIL; - } + m_pEffectPool->Use_Skill(SKILL_TYPE::DECENDO, this); } break; default: diff --git a/Jusin154_Team3D/Editor/Public/Bombard.h b/Jusin154_Team3D/Editor/Public/Bombard.h index 3f5f2e52a..1d6c00da2 100644 --- a/Jusin154_Team3D/Editor/Public/Bombard.h +++ b/Jusin154_Team3D/Editor/Public/Bombard.h @@ -20,6 +20,8 @@ class CBombard final : public CEffect_Container virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; +public: + virtual HRESULT Pre_Setting(CGameObject* pObject) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Editor/Public/Decendo.h b/Jusin154_Team3D/Editor/Public/Decendo.h index 156d4cadd..9c5afcc60 100644 --- a/Jusin154_Team3D/Editor/Public/Decendo.h +++ b/Jusin154_Team3D/Editor/Public/Decendo.h @@ -20,6 +20,8 @@ class CDecendo final : public CEffect_Container virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; +public: + virtual HRESULT Pre_Setting(CGameObject* pObject) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index d7a83e80b..e78adce91 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -18,17 +18,19 @@ namespace Editor enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT }; enum class MAPOBJECT_RENDER_TYPE {NORMAL, DECAL, GLASS}; - enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END }; + enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, HAIR, EYELASH, OUTLINE, END }; enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END }; - enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, END }; + enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, OUTLINE, END }; enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; + enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR ,END }; - enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, END }; + enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, 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 }; } using namespace Editor; diff --git a/Jusin154_Team3D/Editor/Public/EffectPool.h b/Jusin154_Team3D/Editor/Public/EffectPool.h new file mode 100644 index 000000000..2d74d706b --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/EffectPool.h @@ -0,0 +1,45 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CLight; +NS_END + +NS_BEGIN(Editor) + +class CEffectPool final : public CGameObject +{ + +private: + CEffectPool(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEffectPool(const CEffectPool& Prototype); + virtual ~CEffectPool() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; +public: + HRESULT Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPrototypeLevel, _uint iCloneLevel , function AddPrototypeEvent); + HRESULT Use_Skill(SKILL_TYPE eType , CGameObject* pOwner); +private: + list m_EffectList[ENUM_CLASS(SKILL_TYPE::END)] = {}; + list m_ActiveEffectList = {}; +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + HRESULT Ready_Effect(); +public: + static CEffectPool* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END + diff --git a/Jusin154_Team3D/Editor/Public/Effect_Container.h b/Jusin154_Team3D/Editor/Public/Effect_Container.h index af94757a0..10c8ce3c5 100644 --- a/Jusin154_Team3D/Editor/Public/Effect_Container.h +++ b/Jusin154_Team3D/Editor/Public/Effect_Container.h @@ -22,12 +22,15 @@ class CEffect_Container abstract : public CContainerObject virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; public: HRESULT Load_Directory(const _char* pPath); + HRESULT Load_Package(const _char* pPath); + virtual HRESULT Pre_Setting(CGameObject* pObject); protected: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; virtual HRESULT Ready_Components(void* pArg) override; HRESULT Ready_Child(); HRESULT Bind_ShaderResources() override; + HRESULT Reset_EffectParts(); void Update_Event(_float fTimeDelta); diff --git a/Jusin154_Team3D/Editor/Public/Effect_Editor.h b/Jusin154_Team3D/Editor/Public/Effect_Editor.h index 1c58e6652..f0358252f 100644 --- a/Jusin154_Team3D/Editor/Public/Effect_Editor.h +++ b/Jusin154_Team3D/Editor/Public/Effect_Editor.h @@ -33,6 +33,7 @@ class CEffect_Editor final : public CEffect_Container HRESULT Ready_Child(); HRESULT Bind_ShaderResources() override; private: + HRESULT Packaging(const _char* pDirectoryPath); HRESULT ReSaveFile(const _char* pDirectoryPath); void ReadMaterials(const char* pDirectoryName); void ReadMaterial(_wstring wstrFileName, const char* pFilePath); diff --git a/Jusin154_Team3D/Editor/Public/NomalJap.h b/Jusin154_Team3D/Editor/Public/NomalJap.h index bf19461b7..880117493 100644 --- a/Jusin154_Team3D/Editor/Public/NomalJap.h +++ b/Jusin154_Team3D/Editor/Public/NomalJap.h @@ -19,7 +19,8 @@ class CNomalJap final : public CEffect_Container virtual void Priority_Update(_float fTimeDelta) override; virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; - +public: + virtual HRESULT Pre_Setting(CGameObject* pObject) override; private: virtual HRESULT Initialize_Prototype() override; @@ -31,6 +32,15 @@ class CNomalJap final : public CEffect_Container private: _wstring m_wstrEffectName = {}; class CDummy_PhysXEffectHitBox* m_pPhysHitBox = {}; + + class CPartObject* m_pProjectile = {}; + class CPartObject* m_pProjectile_Side = {}; + + _vector m_vRotateUp = {}; + _float m_fAccTime = {}; + _float m_fLerpAmount = {}; + _float m_fTurnValue = {}; + _vector m_vOwnerLook = {}; public: static CNomalJap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Editor/Public/Player.h b/Jusin154_Team3D/Editor/Public/Player.h index b1b36c1da..fb62981d0 100644 --- a/Jusin154_Team3D/Editor/Public/Player.h +++ b/Jusin154_Team3D/Editor/Public/Player.h @@ -87,7 +87,8 @@ class CPlayer final : public CUnit void Behavior_CombatEnter(); HRESULT Behavior_CombatExitCheck(); void Behavior_CombatExit(); - +private: + class CEffectPool* m_pEffectPool = nullptr; #pragma endregion }; 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 f8468ae65..7ca8740fa 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_States.hlsli @@ -37,6 +37,12 @@ RasterizerState RS_Scissor ScissorEnable = true; }; +RasterizerState RS_Front +{ + FillMode = Solid; + CullMode = Front; +}; + DepthStencilState DSS_Default { DepthEnable = true; @@ -44,6 +50,13 @@ DepthStencilState DSS_Default DepthFunc = less_equal; }; +DepthStencilState DSS_OutLine +{ + DepthEnable = true; + DepthWriteMask = Zero; + DepthFunc = less_equal; +}; + DepthStencilState DSS_None { DepthEnable = false; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index f401dc228..664617cb5 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -455,7 +455,7 @@ PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In) vector vInput = g_DiffuseTexture.Sample(PointSampler, In.vTexcoord); //float fMask = g_BloomMaskTexture.Sample(PointSampler, In.vTexcoord).a; float3 vColor = vInput.rgb; - uint iMask = (uint) round(vInput.a * 255.f); // int a = 1 // vBloom.a = (enum / 255); + uint iMask = (uint) round(vInput.a * 255.f); // int a = 1 -> // vBloom.a = (enum / 255); switch (iMask) { diff --git a/Jusin154_Team3D/Engine/Engine_Shader_Defines.hlsli b/Jusin154_Team3D/Engine/Engine_Shader_Defines.hlsli deleted file mode 100644 index ad5294f69..000000000 --- a/Jusin154_Team3D/Engine/Engine_Shader_Defines.hlsli +++ /dev/null @@ -1,366 +0,0 @@ - -vector g_vMtrlDiffuse = 1.f; -vector g_vMtrlAmbient = 1.f; -vector g_vMtrlSpecular = 1.f; - -float PI = 3.14592; - -sampler DefaultSampler = sampler_state -{ - Filter = MIN_MAG_MIP_LINEAR; - AddressU = wrap; - AddressV = wrap; -}; - -sampler ClampSampler = sampler_state -{ - Filter = MIN_MAG_MIP_POINT; - AddressU = clamp; - AddressV = clamp; -}; - -sampler MirrorSampler = sampler_state -{ - Filter = MIN_MAG_MIP_LINEAR; - AddressU = mirror; - AddressV = mirror; -}; - -sampler BorderZeroSampler = sampler_state -{ - Filter = MIN_MAG_MIP_POINT; - AddressU = Border; - AddressV = Border; - BorderColor = float4(0, 0, 0, 0); -}; - -sampler PointSampler = sampler_state -{ - Filter = MIN_MAG_MIP_POINT; - AddressU = wrap; - AddressV = wrap; -}; - -RasterizerState RS_Default -{ - FillMode = Solid; - CullMode = Back; -}; - -RasterizerState RS_Nocull -{ - FillMode = Solid; - CullMode = None; - FrontCounterClockwise = false; - DepthClipEnable = false; -}; - -RasterizerState RS_Nocull_Wireframe -{ - FillMode = Wireframe; - CullMode = None; - FrontCounterClockwise = false; - DepthBias = 0; - SlopeScaledDepthBias = 0.f; - DepthBiasClamp = 0.f; - DepthClipEnable = false; - ScissorEnable = false; - MultisampleEnable = false; - AntialiasedLineEnable = false; -}; - -RasterizerState RS_Scissor -{ - FillMode = Solid; - CullMode = Back; - FrontCounterClockwise = false; - ScissorEnable = true; -}; - -DepthStencilState DSS_Default -{ - DepthEnable = true; - DepthWriteMask = all; - DepthFunc = less_equal; -}; - -DepthStencilState DSS_None -{ - DepthEnable = false; - DepthWriteMask = zero; -}; - -DepthStencilState DSS_Effect -{ - DepthEnable = true; - DepthWriteMask = zero; - DepthFunc = less_equal; - StencilEnable = false; -}; - -BlendState BS_None -{ - BlendEnable[0] = false; -}; - -BlendState BS_AlphaBlend // ALPHA_BLEND -{ - BlendEnable[0] = true; - BlendEnable[1] = true; - BlendEnable[2] = true; - BlendEnable[3] = true; - BlendEnable[4] = true; - BlendEnable[5] = true; - BlendEnable[6] = true; - BlendEnable[7] = true; - - // Ac * Aa + Bc * (1 - Aa); - SrcBlend = Src_Alpha; - DestBlend = Inv_Src_Alpha; - BlendOp = Add; -}; - -BlendState BS_Blend // ADDITIVE_BLEND -{ - BlendEnable[0] = true; - BlendEnable[1] = true; - BlendEnable[2] = true; - BlendEnable[3] = true; - BlendEnable[4] = true; - BlendEnable[5] = true; - BlendEnable[6] = true; - BlendEnable[7] = true; - - // Ac * (1) + Bc * (1); - SrcBlend = one; - DestBlend = one; - BlendOp = Add; -}; - -BlendState BS_UIBlend -{ - BlendEnable[0] = true; - BlendEnable[1] = true; - BlendEnable[2] = true; - BlendEnable[3] = true; - BlendEnable[4] = true; - BlendEnable[5] = true; - BlendEnable[6] = true; - BlendEnable[7] = true; - - SrcBlend = Src_Alpha; - DestBlend = Inv_Src_Alpha; - BlendOp = Add; - - SrcBlendAlpha = One; - DestBlendAlpha = Zero; - BlendOpAlpha = Add; - - RenderTargetWriteMask[0] = 0x0F; // RGBA 모두 출력 -}; - -BlendState BS_WB_Acc -{ - BlendEnable[0] = true; - BlendEnable[1] = true; - BlendEnable[2] = true; - BlendEnable[3] = true; - BlendEnable[4] = true; - BlendEnable[5] = true; - BlendEnable[6] = true; - BlendEnable[7] = true; - - SrcBlend[0] = one; - DestBlend[0] = one; - BlendOp[0] = Add; - - SrcBlend[1] = Zero; - DestBlend[1] = Inv_Src_Alpha; - BlendOp[1] = Add; - - - SrcBlend[2] = one; - DestBlend[2] = one; - BlendOp[2] = Add; -}; - -BlendState BS_WeightBlend -{ - BlendEnable[0] = true; - BlendEnable[1] = true; - BlendEnable[2] = true; - BlendEnable[3] = true; - BlendEnable[4] = true; - BlendEnable[5] = true; - BlendEnable[6] = true; - BlendEnable[7] = true; - - - SrcBlend[0] = Src_Alpha; - DestBlend[0] = Inv_Src_Alpha; - - BlendOp[0] = Add; - - - -}; - -float ShadowVisibility_hwPCF(Texture2D ShadowMap, float4 vLightClip, float2 vShadowMapSize, float bias) -{ - float2 uv = float2(vLightClip.x / vLightClip.w, -vLightClip.y / vLightClip.w) * 0.5f + 0.5f; - float fDepthCenter = saturate(vLightClip.z / vLightClip.w); - float2 vTexel = 1.f / vShadowMapSize; - - float fVisibility = 0.f; - for (int v = -1; v <= 1; ++v) - { - for (int u = -1; u <= 1; ++u) - { - float2 vOffset = float2(u, v) * vTexel; - float fDepth = ShadowMap.Sample(DefaultSampler, uv + vOffset).x; - fVisibility += (fDepthCenter - bias > fDepth) ? 0.f : 1.f; - } - } - return fVisibility / 9.f; -} - -float GetRimLight(float3 vCamPosition, float3 vPosition, float3 vNormal, float fRimPower, float fRimStrength) -{ - float fRimLight = (1 - dot(normalize(vCamPosition - vPosition), vNormal)); - fRimLight = pow(fRimLight, fRimPower); - fRimLight = fRimLight * fRimStrength; - return fRimLight; -} - -float2 Get_MovedUV(float2 vOriginalUV, float fDeltaU, float fDeltaV, uint iIndexU, uint iIndexV) -{ - float2 vDelta = float2(fDeltaU, fDeltaV); - float2 vOffset = float2(iIndexU * fDeltaU, iIndexV * fDeltaV); - return vOriginalUV * vDelta + vOffset; -} - -float2 UV_Cutting(float2 vUV, float2 vUVCutting, int iCurrentFrame) -{ - float2 UV = vUV; // 이미지의 UV값 - - int iTotalFrame = vUVCutting.x * vUVCutting.y; // 이미지의 최대 프레임 (몇 곱하기 몇인지) - - int iFrameX = iCurrentFrame % (int) vUVCutting.x; // 현재 x축의 위치(현재 이미지의 몇번째 칸을 보여줄 지) - int iFrameY = iCurrentFrame / (int) vUVCutting.x; // 현재 y축의 위치(현재 이미지의 몇번째 줄을 보여줄 지) - - float fFreamWidth = 1.0 / vUVCutting.x; // 1.0 나누기 이미지 갯수를 해서 한칸에 얼마나 갈지 정해준다. - float fFreamHeight = 1.0 / vUVCutting.y; // 1.0 나누기 이미지 갯수를 해서 한줄에 얼마나 갈지 정해준다. - - UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; // 먼저 uv를 0~1이 아닌 0~fFrameWidth로 만든 다음에 한칸씩 옆으로 밀어준다. - UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; // 먼저 uv를 0~1이 아닌 0~fFrameHeight로 만든 다음에 한줄씩 밑으로 내려준다. - - return UV; -} - -struct PBR_LIGHT_OUT -{ - float3 vShade; - float3 vSpecular; -}; - -// (Kd F(Lambert)) + (Ks F(cook-torrance)) - -//float LambertDiffuse(float c) -//{ -// return c / PI; -//} - -// F(cook-torrance) -// DFG / (4 (Wo dot N) (Wi dot N)) - -// D(distribution, NormalDistribution function), 표면의 거칠기에 영향을 받는 halfWay vector -// G(Geometry, GeometryFunc), 에너지 보존법칙 적용 -// F(Fresnel-Fresnel equation), 표면 각도에 따른 반사율 - -// F->D -float NDF_ggxtr(float3 n, float3 h, float a) // NormalDistributionGGXTR, (H, halfWay vector), (A, Roughness), (N, Normal?) -{ - float a2 = a * a; - float NdotH = saturate(dot(n, h)); - float NdotH2 = NdotH * NdotH; - - float nom = a2; - float denom = (NdotH2 * (a2 - 1.f) + 1.f); - - denom = PI * denom * denom; - return (nom / denom); -} - -// F->G -// GschlickGGX(n, v, k) -// k는 이하 두개 조명 조건에 따라 가변적임 -// Direct // Kdir -> ((a + 1) * (a + 1)) / 8 // direct lighting 추천 -// IBL Lighting // Kibl -> a * a / 2 // 이미지 기반 조명기법 - -float Geometry_SchlickGGX(float NdotV, float fK) -{ - return NdotV / (NdotV * (1.0f - fK) + fK); -} - -float Geometry_Smith(float3 n, float3 v, float3 l, float k) -{ - // Geometry Obstruction - // 철이 있는, 주로 튀어나온 장애물 - float NdotV = saturate(dot(n, v)); - - // Geometry Shadowing - // 요가 있는, 주로 음푹 들어간 장애물 (그래서 셰도잉) - float NdotL = saturate(dot(n, l)); - - // 요철이 골고루 있다고 가정하고 적당히 섞음 - return Geometry_SchlickGGX(NdotV, k) * Geometry_SchlickGGX(NdotL, k); -} - -// F -> F -float3 Fresnel_Schlick(float cosTheta, float3 F0) -{ - // 모서리 부분의 반사 - return F0 + (1.0f - F0) * pow(1.0f - cosTheta, 5.0f); -} - -PBR_LIGHT_OUT PBR_Lighting( - float3 vNormal, float3 vToView, float3 vToLight, - float3 vAlbedo, float fMetallic, float fRoughness, - float3 vLightColor, float fAttenuation - -) { - PBR_LIGHT_OUT Out; - Out.vShade = 0; - Out.vSpecular = 0; - - float3 vHalfVector = normalize(vToView + vToLight); - float NdotL = saturate(dot(vNormal, vToLight)); - float NdotV = saturate(dot(vNormal, vToView)); - if (NdotL <= 0 || NdotV <= 0) - { - return Out; - } - float fAlpha = max(fRoughness * fRoughness, 0.04f); - float k = ((fRoughness + 1.f) * (fRoughness + 1.f)) / 8.f; - - - float3 F0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic); - - float D = NDF_ggxtr(vNormal, vHalfVector, fAlpha); - float G = Geometry_Smith(vNormal, vToView, vToLight, k); - float3 F = Fresnel_Schlick(saturate(dot(vHalfVector, vToView)), F0); - - float3 vNumerator = D * G * F; - float fDenom = max(4.f * NdotL * NdotV, 1e-7); - float3 specularBRDF = vNumerator / fDenom; - - - float3 kS = F; - float3 kD = (1.f - kS) * (1.f -fMetallic); - - Out.vShade = (kD / PI) * (NdotL * fAttenuation) * vLightColor; - - Out.vSpecular = specularBRDF * vLightColor * fAttenuation * NdotL; - - return Out; -} diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget.cpp index fd6ca4c26..c310f06ed 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget.cpp @@ -104,6 +104,11 @@ void CRenderTarget::Describe_Entity(const _char* pName) GUI::Selectable(pName, &m_isDraw); } +void CRenderTarget::Toggle_RT_Debug() +{ + m_isDraw = !m_isDraw; +} + _bool CRenderTarget::Render_Debug(CShader* pShader, CVIBuffer_Rect* pVIBuffer ,_float fX, _float fY, _float fSizeX, _float fSizeY) { if (m_isDraw == false) { diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp index 5f9241e67..f3a866683 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp @@ -474,6 +474,9 @@ void CRenderTarget_Manager::RenderTarget_Debuger() GUI::Spacing(); GUI::PushItemWidth(80); + if (GUI::Button("ToggleAll")) { + Toggle_RT_Debugger(); + } GUI::DragInt("Target Size X" , &m_iSizeX); GUI::DragInt("Target Size Y", &m_iSizeY); GUI::PopItemWidth(); @@ -498,6 +501,14 @@ void CRenderTarget_Manager::RenderTarget_Debuger() GUI::End(); } +void CRenderTarget_Manager::Toggle_RT_Debugger() +{ + for (auto& [key, pRenderTarget] : m_RenderTargets) + { + pRenderTarget->Toggle_RT_Debug(); + } +} + #endif // _DEBUG CRenderTarget* CRenderTarget_Manager::Find_RenderTarget(const _wstring& strRenderTargetKey) diff --git a/Jusin154_Team3D/Engine/Private/Trail.cpp b/Jusin154_Team3D/Engine/Private/Trail.cpp index 267771708..ae78708f1 100644 --- a/Jusin154_Team3D/Engine/Private/Trail.cpp +++ b/Jusin154_Team3D/Engine/Private/Trail.cpp @@ -178,6 +178,15 @@ void CTrail::Trail_Update(_float fDeltaTime, _fmatrix WorldMatrix) } +void CTrail::Reset_Trail() +{ + ZeroMemory(m_pVertices, sizeof(VTXPOSTEX) * m_iNumVertices); + ZeroMemory(&m_PreHigh, sizeof(_vector) * 2); + ZeroMemory(&m_PreLow, sizeof(_vector) * 2); + m_iNumCount = 0; + m_fAccTime = 0.f; + } + #ifdef _DEBUG HRESULT CTrail::Save_Trail(HANDLE hFile) { diff --git a/Jusin154_Team3D/Engine/Private/Unit.cpp b/Jusin154_Team3D/Engine/Private/Unit.cpp index 9b6a1a073..296b99460 100644 --- a/Jusin154_Team3D/Engine/Private/Unit.cpp +++ b/Jusin154_Team3D/Engine/Private/Unit.cpp @@ -43,11 +43,6 @@ void CUnit::Late_Update(_float fTimeDelta) __super::Late_Update(fTimeDelta); } -HRESULT CUnit::Render() -{ - return S_OK; -} - #ifdef _DEBUG void CUnit::Load_KeyFrame() { @@ -125,11 +120,6 @@ HRESULT CUnit::Ready_Components(void *pArg) return S_OK; } -HRESULT CUnit::Bind_ShaderResources() -{ - return S_OK; -} - void CUnit::Free() { __super::Free(); diff --git a/Jusin154_Team3D/Engine/Public/GameObject.h b/Jusin154_Team3D/Engine/Public/GameObject.h index e97b994af..4130c84f5 100644 --- a/Jusin154_Team3D/Engine/Public/GameObject.h +++ b/Jusin154_Team3D/Engine/Public/GameObject.h @@ -23,6 +23,7 @@ class ENGINE_DLL CGameObject abstract virtual HRESULT Render_Shadow() { return S_OK; } virtual HRESULT Render_Blur() { return S_OK; } virtual HRESULT Render_Bloom() { return S_OK; } + virtual HRESULT Render_OutLine() { return S_OK; } virtual _float Get_Depth(); // z 소팅 할 때 쓰시면 됨 diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget.h b/Jusin154_Team3D/Engine/Public/RenderTarget.h index ef0f42f20..d0e8e5635 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget.h @@ -27,6 +27,7 @@ class CRenderTarget final : public CBase _bool Render_Debug(class CShader* pShader, class CVIBuffer_Rect* pVIBuffer, _float fX, _float fY, _float fSizeX, _float fSizeY); void Ready_Debug(); void Describe_Entity(const _char* pName); + void Toggle_RT_Debug(); #endif private: diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h index 1055e8a4d..72de0e6d5 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h @@ -28,6 +28,7 @@ class CRenderTarget_Manager final : public CBase public: HRESULT Render_RenderTarget_Debug(class CShader* pShader, class CVIBuffer_Rect* pVIBuffer); void RenderTarget_Debuger(); + void Toggle_RT_Debugger(); #endif // _DEBUG #ifdef _DEBUG diff --git a/Jusin154_Team3D/Engine/Public/Trail.h b/Jusin154_Team3D/Engine/Public/Trail.h index 150b76bc4..c578d7ec5 100644 --- a/Jusin154_Team3D/Engine/Public/Trail.h +++ b/Jusin154_Team3D/Engine/Public/Trail.h @@ -19,6 +19,7 @@ class ENGINE_DLL CTrail final : public: void Trail_Update(_float fDeltaTime, _fmatrix WorldMatrix); + void Reset_Trail(); #ifdef _DEBUG HRESULT Save_Trail(HANDLE hFile); diff --git a/Jusin154_Team3D/Engine/Public/Unit.h b/Jusin154_Team3D/Engine/Public/Unit.h index 1b2b036c9..e12116978 100644 --- a/Jusin154_Team3D/Engine/Public/Unit.h +++ b/Jusin154_Team3D/Engine/Public/Unit.h @@ -23,7 +23,6 @@ class ENGINE_DLL CUnit abstract : public CContainerObject virtual void Priority_Update(_float fTimeDelta) override; virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; - virtual HRESULT Render() override; _wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; } #ifdef _DEBUG void Load_KeyFrame(); @@ -72,7 +71,6 @@ class ENGINE_DLL CUnit abstract : public CContainerObject protected: HRESULT Ready_Components(void*pArg); - HRESULT Bind_ShaderResources(); public: virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE;