diff --git a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp index 955b6ca8b..7c3a1370d 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp @@ -188,7 +188,7 @@ void CCallBack_EffectHitBox_HitReport::Set_CurrentSlop() float fAngleRad = acosf(fDot); float fAngleDeg = XMConvertToDegrees(fAngleRad); - m_pController->Set_CurrentSlope(fAngleDeg); + m_pController->Set_CurrentSlope(fAngleDeg, m_vClimbNormal); } } diff --git a/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp index 23a1f002c..f01606d87 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp @@ -165,7 +165,7 @@ void CCallBack_Monster_HitReport::Set_CurrentSlop() float fAngleRad = acosf(fDot); float fAngleDeg = XMConvertToDegrees(fAngleRad); - m_pController->Set_CurrentSlope(fAngleDeg); + m_pController->Set_CurrentSlope(fAngleDeg, m_vClimbNormal); } } diff --git a/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp index 77359c111..25d73a42d 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp @@ -159,7 +159,7 @@ void CCallBack_Playable_HitReport::Set_CurrentSlop() float fAngleRad = acosf(fDot); float fAngleDeg = XMConvertToDegrees(fAngleRad); - m_pController->Set_CurrentSlope(fAngleDeg); + m_pController->Set_CurrentSlope(fAngleDeg, m_vClimbNormal); } } diff --git a/Jusin154_Team3D/Client/Private/CallBack_Troll_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Troll_HitReport.cpp index 774ef1157..b02ab6ead 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Troll_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Troll_HitReport.cpp @@ -190,7 +190,7 @@ void CCallBack_Troll_HitReport::Set_CurrentSlop() float fAngleRad = acosf(fDot); float fAngleDeg = XMConvertToDegrees(fAngleRad); - m_pController->Set_CurrentSlope(fAngleDeg); + m_pController->Set_CurrentSlope(fAngleDeg, m_vClimbNormal); } } diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index c529b2c82..79cafe137 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -192,6 +192,7 @@ HRESULT CGoblin::Render() } m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp index 4daa2170f..935b8fe42 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp @@ -194,6 +194,7 @@ HRESULT CGoblin_Mage::Render() } m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp index e8217be39..f301858af 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp @@ -179,6 +179,7 @@ HRESULT CGoblin_Spector::Render() } m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index c07c35007..89f4b5e16 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -345,7 +345,7 @@ HRESULT CLoader::Loading_For_GamePlay() isLoad_Background = false; #endif // #ifdef 기무리 - isLoad_Background = flase; + isLoad_Background = true; #endif // #ifdef 인혁 isLoad_Background = false; diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 1568fe1ab..08b405243 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -272,6 +272,7 @@ HRESULT CPlayer::Render() m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Ranrok.cpp b/Jusin154_Team3D/Client/Private/Ranrok.cpp index beca57f86..3433337cf 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok.cpp @@ -203,6 +203,7 @@ HRESULT CRanrok::Render() } m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index aaf4bf77d..25420d13a 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -199,6 +199,7 @@ HRESULT CTroll::Render() } m_pModelCom->Bind_OutPut_SRV_VS(26, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; @@ -278,6 +279,7 @@ HRESULT CTroll::Render_OutLine() } m_pModelCom->Bind_OutPut_SRV_VS(26, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 6b8a4a2e6..05ce2cc23 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -326,6 +326,13 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In) } float4 vBlurredColor = vAccColorSum / max(fAccWeight, FLT_EPSILON5); float2 vBlurredVelo = vAccVeloSum / max(fAccWeight, FLT_EPSILON5); + + if (length(vAccVeloSum) < FLT_EPSILON5) + { + Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, vCenterUV); + Out.vVelocity = float2(0.5f, 0.5f); + return Out; + } Out.vColor = vBlurredColor; Out.vVelocity = vBlurredVelo * 0.5f + 0.5f; return Out; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl index 0f5360124..120ade77d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl @@ -54,6 +54,7 @@ Texture2D g_Maya_Specular_RoughnessTexture; Texture2D g_AnisotropyTexture; StructuredBuffer g_BoneBuffer : register(t26); +StructuredBuffer g_PrevBoneBuffer : register(t27); Texture2D g_SurfaceParamsTexture; @@ -132,8 +133,19 @@ VS_OUT VS_MAIN(VS_IN In) g_BoneBuffer[In.vBlendIndex.z].LocalCombined) * w.z + mul(g_OffsetMatrix[In.vBlendIndex.w], g_BoneBuffer[In.vBlendIndex.w].LocalCombined) * w.w; + + matrix PrevBoneMatrix = + mul(g_OffsetMatrix[In.vBlendIndex.x], + g_PrevBoneBuffer[In.vBlendIndex.x].LocalCombined) * w.x + + mul(g_OffsetMatrix[In.vBlendIndex.y], + g_PrevBoneBuffer[In.vBlendIndex.y].LocalCombined) * w.y + + mul(g_OffsetMatrix[In.vBlendIndex.z], + g_PrevBoneBuffer[In.vBlendIndex.z].LocalCombined) * w.z + + mul(g_OffsetMatrix[In.vBlendIndex.w], + g_PrevBoneBuffer[In.vBlendIndex.w].LocalCombined) * w.w; vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); + vector vPrevPosition = mul(vector(In.vPosition, 1.f), PrevBoneMatrix); vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix); vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix); vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix); @@ -154,7 +166,7 @@ VS_OUT VS_MAIN(VS_IN In) Out.vTexcoord = In.vTexcoord; Out.vWorldPos = mul(vPosition, g_WorldMatrix); Out.vProjPos = Out.vPosition; - Out.vPrevProjPos = mul(vector(In.vPosition, 1.f), matPrevWVP); + Out.vPrevProjPos = mul(vPrevPosition, matPrevWVP); return Out; } @@ -176,11 +188,24 @@ VS_OUT VS_MAIN_OUTLINE_READ(VS_IN In) + mul(g_OffsetMatrix[In.vBlendIndex.w], g_BoneBuffer[In.vBlendIndex.w].LocalCombined) * w.w; + matrix PrevBoneMatrix = + mul(g_OffsetMatrix[In.vBlendIndex.x], + g_PrevBoneBuffer[In.vBlendIndex.x].LocalCombined) * w.x + + mul(g_OffsetMatrix[In.vBlendIndex.y], + g_PrevBoneBuffer[In.vBlendIndex.y].LocalCombined) * w.y + + mul(g_OffsetMatrix[In.vBlendIndex.z], + g_PrevBoneBuffer[In.vBlendIndex.z].LocalCombined) * w.z + + mul(g_OffsetMatrix[In.vBlendIndex.w], + g_PrevBoneBuffer[In.vBlendIndex.w].LocalCombined) * w.w; + vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); + vector vPrevPosition = mul(vector(In.vPosition, 1.f), PrevBoneMatrix); vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix); + vector vPrevNormal = mul(vector(In.vNormal, 0.f), PrevBoneMatrix); vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix); vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix); vPosition.xyz += (vNormal.xyz * g_fOutLineThickness).xyz; + vPrevPosition.xyz += (vPrevNormal.xyz * g_fOutLineThickness).xyz; matrix matWV, matWVP; @@ -198,7 +223,7 @@ VS_OUT VS_MAIN_OUTLINE_READ(VS_IN In) Out.vTexcoord = In.vTexcoord; Out.vWorldPos = mul(vPosition, g_WorldMatrix); Out.vProjPos = Out.vPosition; - Out.vPrevProjPos = mul(vPosition, matPrevWVP); + Out.vPrevProjPos = mul(vPrevPosition, matPrevWVP); return Out; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index 025e8ccf2..e66653ba8 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -72,6 +72,7 @@ Texture2D g_AnisotropyTexture : register(t30); StructuredBuffer g_BoneBuffer : register(t31); +StructuredBuffer g_PrevBoneBuffer : register(t32); int g_iBinded_Texture[27]; @@ -133,8 +134,20 @@ VS_OUT VS_MAIN(VS_IN In) g_BoneBuffer[In.vBlendIndex.w].LocalCombined) * w.w; + matrix PrevBoneMatrix = + mul(g_OffsetMatrix[In.vBlendIndex.x], + g_PrevBoneBuffer[In.vBlendIndex.x].LocalCombined) * w.x + + mul(g_OffsetMatrix[In.vBlendIndex.y], + g_PrevBoneBuffer[In.vBlendIndex.y].LocalCombined) * w.y + + mul(g_OffsetMatrix[In.vBlendIndex.z], + g_PrevBoneBuffer[In.vBlendIndex.z].LocalCombined) * w.z + + mul(g_OffsetMatrix[In.vBlendIndex.w], + g_PrevBoneBuffer[In.vBlendIndex.w].LocalCombined) * w.w; + + float4 skinnedPos = mul(float4(In.vPosition, 1.f), BoneMatrix); + float4 skinnedPrevPos = mul(float4(In.vPosition, 1.f), PrevBoneMatrix); float3 skinnedNormal = mul(float4(In.vNormal, 0.f), BoneMatrix).xyz; float3 skinnedTangent = mul(float4(In.vTangent, 0.f), BoneMatrix).xyz; float3 skinnedBinormal = mul(float4(In.vBinormal, 0.f), BoneMatrix).xyz; @@ -154,11 +167,7 @@ VS_OUT VS_MAIN(VS_IN In) Out.vTexcoord = In.vTexcoord; Out.vWorldPos = mul(skinnedPos, g_WorldMatrix); Out.vProjPos = Out.vPosition; - Out.vPrevProjPos = mul(skinnedPos, matPrevWVP); - - Out.vTexcoord = In.vTexcoord; - Out.vProjPos = Out.vPosition; - Out.vPrevProjPos = mul(skinnedPos, matPrevWVP); + Out.vPrevProjPos = mul(skinnedPrevPos, matPrevWVP); return Out; } @@ -194,11 +203,24 @@ VS_OUT_OUTLINE VS_MAIN_OUTLINE(VS_IN In) + mul(g_OffsetMatrix[In.vBlendIndex.w], g_BoneBuffer[In.vBlendIndex.w].LocalCombined) * w.w; + matrix PrevBoneMatrix = + mul(g_OffsetMatrix[In.vBlendIndex.x], + g_PrevBoneBuffer[In.vBlendIndex.x].LocalCombined) * w.x + + mul(g_OffsetMatrix[In.vBlendIndex.y], + g_PrevBoneBuffer[In.vBlendIndex.y].LocalCombined) * w.y + + mul(g_OffsetMatrix[In.vBlendIndex.z], + g_PrevBoneBuffer[In.vBlendIndex.z].LocalCombined) * w.z + + mul(g_OffsetMatrix[In.vBlendIndex.w], + g_PrevBoneBuffer[In.vBlendIndex.w].LocalCombined) * w.w; + vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); + vector vPrevPosition = mul(vector(In.vPosition, 1.f), PrevBoneMatrix); vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix); + vector vPrevNormal = mul(vector(In.vNormal, 0.f), PrevBoneMatrix); vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix); vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix); vPosition.xyz += (vNormal.xyz * g_fOutLineThickness).xyz; + vPrevPosition.xyz += (vPrevNormal.xyz * g_fOutLineThickness).xyz; matrix matWV, matWVP; @@ -216,7 +238,7 @@ VS_OUT_OUTLINE VS_MAIN_OUTLINE(VS_IN In) Out.vTexcoord = In.vTexcoord; Out.vWorldPos = mul(vPosition, g_WorldMatrix); Out.vProjPos = Out.vPosition; - Out.vPrevProjPos = mul(vPosition, matPrevWVP); + Out.vPrevProjPos = mul(vPrevPosition, matPrevWVP); return Out; } struct VS_OUT_CAPTUREDMODEL diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl index 7a5cdb835..75dc56f2d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl @@ -1,6 +1,7 @@ #include "Engine_Shader_Defines.hlsli" matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; +float4x4 g_PrevWorldMatrix, g_PrevViewMatrix, g_PrevProjMatrix; Texture2D g_DiffuseTexture; Texture2D g_NormalTexture; @@ -34,6 +35,7 @@ struct VS_OUT float2 vTexcoord : TEXCOORD0; float4 vWorldPos : TEXCOORD2; float4 vProjPos : TEXCOORD3; + float4 vPrevProjPos : TEXCOORD4; }; VS_OUT VS_MAIN(VS_IN In, uint iGPUIndex : SV_InstanceID) @@ -41,12 +43,17 @@ VS_OUT VS_MAIN(VS_IN In, uint iGPUIndex : SV_InstanceID) VS_OUT Out = (VS_OUT) 0; matrix matW, matWV, matWVP; + matrix matPrevW, matPrevWV, matPrevWVP; row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); matW = TransformMatrix; matWV = mul(matW, g_ViewMatrix); matWVP = mul(matWV, g_ProjMatrix); + + matPrevW = TransformMatrix; + matPrevWV = mul(matW, g_ViewMatrix); + matPrevWVP = mul(matWV, g_ProjMatrix); vector vPosition = mul(vector(In.vPosition, 1.f), matWVP); @@ -57,6 +64,7 @@ VS_OUT VS_MAIN(VS_IN In, uint iGPUIndex : SV_InstanceID) Out.vTexcoord = In.vTexcoord; Out.vWorldPos = mul(vector(In.vPosition, 1.f), matW); Out.vProjPos = vPosition; + Out.vPrevProjPos = mul(vector(In.vPosition, 1.f), matPrevWVP); return Out; } @@ -70,6 +78,7 @@ struct PS_IN float2 vTexcoord : TEXCOORD0; float4 vWorldPos : TEXCOORD2; float4 vProjPos : TEXCOORD3; + float4 vPrevProjPos : TEXCOORD4; }; struct PS_OUT @@ -79,6 +88,7 @@ struct PS_OUT float4 vDepth : SV_TARGET2; float4 vColor : SV_Target3; float4 vSurface : SV_Target4; + float2 vVelocityUV : SV_Target5; }; PS_OUT PS_MAIN(PS_IN In) @@ -102,7 +112,8 @@ PS_OUT PS_MAIN(PS_IN In) Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, g_fUsingSurfaceParams, 0.0f); Out.vColor = float4(0.f, 0.f, 0.f, 1.f); Out.vSurface = float4(g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord).xy, 1.f, 1.f); - + Out.vVelocityUV = CalcVelocityUV(In.vProjPos, In.vPrevProjPos); + return Out; } diff --git a/Jusin154_Team3D/Editor/Private/DummyObject.cpp b/Jusin154_Team3D/Editor/Private/DummyObject.cpp index 8f295578b..f7f91eed9 100644 --- a/Jusin154_Team3D/Editor/Private/DummyObject.cpp +++ b/Jusin154_Team3D/Editor/Private/DummyObject.cpp @@ -81,6 +81,7 @@ HRESULT CDummyObject::Render() m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Goblin.cpp b/Jusin154_Team3D/Editor/Private/Goblin.cpp index 3f74967be..1ed7a6271 100644 --- a/Jusin154_Team3D/Editor/Private/Goblin.cpp +++ b/Jusin154_Team3D/Editor/Private/Goblin.cpp @@ -163,6 +163,7 @@ HRESULT CGoblin::Render() } m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Goblin_Spector.cpp b/Jusin154_Team3D/Editor/Private/Goblin_Spector.cpp index bc00d8faf..09e6d84a6 100644 --- a/Jusin154_Team3D/Editor/Private/Goblin_Spector.cpp +++ b/Jusin154_Team3D/Editor/Private/Goblin_Spector.cpp @@ -134,6 +134,7 @@ HRESULT CGoblin_Spector::Render() } m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index 58b6ba471..8893229c5 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -176,6 +176,7 @@ HRESULT CPlayer::Render() } m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Troll.cpp b/Jusin154_Team3D/Editor/Private/Troll.cpp index 15e4370cf..3b1493807 100644 --- a/Jusin154_Team3D/Editor/Private/Troll.cpp +++ b/Jusin154_Team3D/Editor/Private/Troll.cpp @@ -207,6 +207,7 @@ HRESULT CTroll::Render() } m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 6b8a4a2e6..05ce2cc23 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -326,6 +326,13 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In) } float4 vBlurredColor = vAccColorSum / max(fAccWeight, FLT_EPSILON5); float2 vBlurredVelo = vAccVeloSum / max(fAccWeight, FLT_EPSILON5); + + if (length(vAccVeloSum) < FLT_EPSILON5) + { + Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, vCenterUV); + Out.vVelocity = float2(0.5f, 0.5f); + return Out; + } Out.vColor = vBlurredColor; Out.vVelocity = vBlurredVelo * 0.5f + 0.5f; return Out; diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp index 891419287..cdbbbbff8 100644 --- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp +++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "Character_Controller.h" #include "GameInstance.h" +#include "GameObject.h" CPhysX_CctQueryFilterCallback CCharacter_Controller::s_QueryFilterCallback_IGNORE_Shield = {}; @@ -158,20 +159,25 @@ HRESULT CCharacter_Controller::ConvertToDO(CRigidBody_Dynamic& BodyOriginal) return S_OK; } -void CCharacter_Controller::Set_OnGroundFlag(_bool bOnGround) +void CCharacter_Controller::Set_OnGroundFlag(_bool bFlag) { m_iIsOnGround = iCoyote_Counter; + m_bSlide = false; + //if (m_fCurrentSlopeDegree < m_fWalkableSlopeDegree * 0.5f) { + // m_bSlide = false; + //} } -void CCharacter_Controller::Set_CurrentSlope(_float fSlope) +void CCharacter_Controller::Set_CurrentSlope(_float fSlope, _float3& CurrentSlopeNormal) { m_fCurrentSlopeDegree = fSlope; + XMStoreFloat3(&m_vLastClimbNormal, XMVector3Normalize(XMLoadFloat3(&CurrentSlopeNormal))); } void CCharacter_Controller::Rewind_Grounded() { if (m_eBeforeCollisionFlags.isSet(PSX::PxControllerCollisionFlag::eCOLLISION_DOWN)) { - m_iIsOnGround = iCoyote_Counter; + Set_OnGroundFlag(true); return; } m_iIsOnGround -= 1; @@ -233,7 +239,10 @@ _bool CCharacter_Controller::UpdateGroundByCast(_float fTimeDelta) _vector vCurrentMomentum = m_pTransform->Get_CurrentMomentum(); m_pTransform->Set_CurrentMomentum( XMVectorSetY(vCurrentMomentum, fCurrentMomentumY) ); - m_iIsOnGround = iCoyote_Counter; + Set_OnGroundFlag(true); + if (m_fCurrentSlopeDegree < m_fWalkableSlopeDegree * 0.5f) { + m_bSlide = false; + } } break; default: @@ -257,13 +266,11 @@ void CCharacter_Controller::Move(_float fTimeDelta) m_pTransform->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * m_fGravity * fTimeDelta, 0.f, 0.f)); } else if ((iCoyote_Counter) >= m_iIsOnGround) { - UpdateGroundByCast(fTimeDelta); // 바닥에 플레이어 붙이게 함 + UpdateGroundByCast(fTimeDelta);// 바닥에 플레이어 붙이게 함 } else if (m_fCurrentSlopeDegree > m_fWalkableSlopeDegree) { // 너무 가파른 경사: 중력 m_pTransform->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f)); - } - else { - // 아니면 안함 + m_bSlide = true; } } XMStoreFloat3((_float3*)&pxVecMomentum, m_pTransform->Get_CurrentMomentum()); @@ -489,6 +496,8 @@ void CCharacter_Controller::Describe_Entity() GUIHelpMarker("A capsule is affected by its lower sphere and tends to generate an up vector on steps.\nIn eEASY, the up vector is combined with the step offset, allowing easier climbing; in eCONSTRAINED, the up vector is removed during step detection and only the step offset is used."); } } + GUI::Checkbox("IsSlide", &m_bSlide); + GUI::Text("SlopeNormal %.1f, %.1f, %.1f", m_vLastClimbNormal.x, m_vLastClimbNormal.y, m_vLastClimbNormal.z); GUI::Text("%.1f", m_fCurrentSlopeDegree); GUI::Text("%.1f", m_fWalkableSlopeDegree); GUI::SameLine(); if (GUI::SliderFloat("m_fWalkableSlopeDegree", &m_fWalkableSlopeDegree, 0.0f, 90.f)) { m_pController->setSlopeLimit(cosf(XMConvertToRadians(m_fWalkableSlopeDegree))); diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 733d04233..48ff6fecc 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -1505,7 +1505,13 @@ HRESULT CModel::Create_BoneMatrixVB() desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; HRESULT hr = m_pDevice->CreateBuffer(&desc, nullptr, &m_pBoneMatrixBuffer); - + if (FAILED(hr)) { + return E_FAIL; + } + hr = m_pDevice->CreateBuffer(&desc, nullptr, &m_pPrevBoneMatrixBuffer); + if (FAILED(hr)) { + return E_FAIL; + } D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc{}; uavDesc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER; @@ -1513,11 +1519,9 @@ HRESULT CModel::Create_BoneMatrixVB() uavDesc.Buffer.FirstElement = 0; uavDesc.Buffer.NumElements = (_uint)m_Bones.size(); - m_pDevice->CreateUnorderedAccessView( - m_pBoneMatrixBuffer, - &uavDesc, - &m_pBoneMatrixUAV - ); + if(FAILED(m_pDevice->CreateUnorderedAccessView(m_pBoneMatrixBuffer, &uavDesc, &m_pBoneMatrixUAV))){ + return E_FAIL; + } D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc1 = {}; srvDesc1.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; @@ -1525,8 +1529,13 @@ HRESULT CModel::Create_BoneMatrixVB() srvDesc1.Buffer.FirstElement = 0; srvDesc1.Buffer.NumElements = (_uint)m_Bones.size(); - if (FAILED(m_pDevice->CreateShaderResourceView(m_pBoneMatrixBuffer, &srvDesc1, &m_pBoneMatrixSRV))) + if (FAILED(m_pDevice->CreateShaderResourceView(m_pBoneMatrixBuffer, &srvDesc1, &m_pBoneMatrixSRV))){ return E_FAIL; + } + + if (FAILED(m_pDevice->CreateShaderResourceView(m_pPrevBoneMatrixBuffer, &srvDesc1, &m_pPrevBoneMatrixSRV))){ + return E_FAIL; + } return S_OK; @@ -1621,6 +1630,9 @@ HRESULT CModel::Create_Local() void CModel::ComputeAnimation(_uint AnimIndex,_uint MeshIndex) { + // MotionBlurr용 버퍼 카피 + m_pContext->CopyResource(m_pPrevBoneMatrixBuffer, m_pBoneMatrixBuffer); + ComputeLocal(AnimIndex,MeshIndex); if (m_pComputeShader == nullptr) @@ -1756,6 +1768,13 @@ void CModel::Bind_OutPut_SRV_VS(_uint iIndex, _uint iBufferIndex) &m_pBoneMatrixSRV); } +void CModel::Bind_OutPut_SRV_VS_Prev(_uint iIndex, _uint iBufferIndex) +{ + m_pContext->VSSetShaderResources(iIndex, + 1, // 버퍼 개수 + &m_pPrevBoneMatrixSRV); +} + #ifdef _DEBUG HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix, _uint iLevel) @@ -2330,10 +2349,12 @@ void CModel::Free() SAFE_RELEASE(m_pParentBuffer); SAFE_RELEASE(m_pBoneLocalBuffer); SAFE_RELEASE(m_pBoneMatrixBuffer); + SAFE_RELEASE(m_pPrevBoneMatrixBuffer); SAFE_RELEASE(m_pLocalMatrixBuffer); - SAFE_RELEASE(m_pParentSRV); + SAFE_RELEASE(m_pParentSRV); SAFE_RELEASE(m_pBoneLocalSRV); SAFE_RELEASE(m_pBoneMatrixSRV); + SAFE_RELEASE(m_pPrevBoneMatrixSRV); SAFE_RELEASE(m_pBoneMatrixUAV); SAFE_RELEASE(m_pLocalMatrixSRV); SAFE_RELEASE(m_pLocalMatrixUAV); diff --git a/Jusin154_Team3D/Engine/Private/Shader.cpp b/Jusin154_Team3D/Engine/Private/Shader.cpp index 2125605fb..2a7f912f7 100644 --- a/Jusin154_Team3D/Engine/Private/Shader.cpp +++ b/Jusin154_Team3D/Engine/Private/Shader.cpp @@ -223,9 +223,6 @@ HRESULT CShader::Begin(_uint iPassIndex) m_pContext->IASetInputLayout(m_InputLayouts[iPassIndex]); - /* Apply를 반드시 호출해야만 쉐이더로 그려진다. */ - /* Apply이전에 쉐이더에 전달할 모든 데이터들을 다 던져놓아야한다. */ - m_pEffect->GetTechniqueByIndex(0)->GetPassByIndex(iPassIndex)->Apply(0, m_pContext); return S_OK; diff --git a/Jusin154_Team3D/Engine/Public/Character_Controller.h b/Jusin154_Team3D/Engine/Public/Character_Controller.h index 6909ad91c..4f07f54a3 100644 --- a/Jusin154_Team3D/Engine/Public/Character_Controller.h +++ b/Jusin154_Team3D/Engine/Public/Character_Controller.h @@ -68,10 +68,12 @@ class ENGINE_DLL CCharacter_Controller final : _float3 Get_Volume(); HRESULT ConvertToDO(class CRigidBody_Dynamic& BodyOriginal); - void Set_OnGroundFlag(_bool bOnGround); + _float3 Get_LastSlopeNormal() { return m_vLastClimbNormal; }; + void Set_OnGroundFlag(_bool bFlag); + _bool IsSliding() { return m_bSlide; }; _bool IsGravity() { return m_bGravity; } void SetGravity(_bool bCondition) { m_bGravity = bCondition; }; - void Set_CurrentSlope(_float fSlope); + void Set_CurrentSlope(_float fSlope, _float3& CurrentSlopeNormal); void Rewind_Grounded(); _bool IsActive() const { return m_bActive; } void SetActive(_bool bCondition) { m_bActive = bCondition; } @@ -95,6 +97,8 @@ class ENGINE_DLL CCharacter_Controller final : PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {}; _bool m_bActive = { true }; _bool m_bGravity = { true }; + _bool m_bSlide = { false }; + _float3 m_vLastClimbNormal = { 0.f, 1.f - FLT_EPSILON, 0.f };; #ifdef _DEBUG unique_ptr m_pMainShape = { nullptr }; unique_ptr m_pSubShape = { nullptr }; diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 2e41c7a4b..c8a08f89c 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -98,6 +98,7 @@ class ENGINE_DLL CModel final : public CComponent void ComputeAnimation(_uint AnimIndex, _uint MeshIndex); void ComputeLocal(_uint AnimIndex, _uint MeshIndex); void Bind_OutPut_SRV_VS(_uint iIndex, _uint iBufferIndex); + void Bind_OutPut_SRV_VS_Prev(_uint iIndex, _uint iBufferIndex); void ComputeAnimation_Second(_uint AnimIndex); void InItialize_BoneIndex(); @@ -229,17 +230,19 @@ class ENGINE_DLL CModel final : public CComponent ID3D11Buffer* m_pConstantBuffer = { nullptr }; ID3D11Buffer* m_pParentBuffer = { nullptr }; ID3D11Buffer* m_pBoneMatrixBuffer = { nullptr }; + ID3D11Buffer* m_pPrevBoneMatrixBuffer = { nullptr }; ID3D11Buffer* m_pBoneLocalBuffer = { nullptr }; ID3D11Buffer* m_pLocalMatrixBuffer = { nullptr }; - ID3D11ShaderResourceView* m_pParentSRV = {}; - ID3D11ShaderResourceView* m_pBoneLocalSRV = {}; - ID3D11ShaderResourceView* m_pBoneMatrixSRV = {}; - ID3D11ShaderResourceView* m_pLocalMatrixSRV = {}; + ID3D11ShaderResourceView* m_pParentSRV = { nullptr }; + ID3D11ShaderResourceView* m_pBoneLocalSRV = { nullptr }; + ID3D11ShaderResourceView* m_pBoneMatrixSRV = { nullptr }; + ID3D11ShaderResourceView* m_pPrevBoneMatrixSRV = { nullptr }; + ID3D11ShaderResourceView* m_pLocalMatrixSRV = { nullptr }; - ID3D11UnorderedAccessView* m_pBoneMatrixUAV = {}; - ID3D11UnorderedAccessView* m_pLocalMatrixUAV = {}; + ID3D11UnorderedAccessView* m_pBoneMatrixUAV = { nullptr }; + ID3D11UnorderedAccessView* m_pLocalMatrixUAV = { nullptr }; #pragma endregion