diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Box/Box b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Box/Box rename to Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinBody b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/GoblinBody similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinBody rename to Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/GoblinBody diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/GoblinHead similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead rename to Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/GoblinHead diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOB_Mage_Head_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOB_Mage_Head_D.png new file mode 100644 index 000000000..72d3d63fc Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOB_Mage_Head_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Body/Body similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body rename to Jusin154_Team3D/Client/Bin/Resources/Models/Human/Body/Body diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Body/Body.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Body/Body.fbx new file mode 100644 index 000000000..a9b67e9ba --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Body/Body.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7586f3029f295dbcb4d0306a07464420af0efc524cf09568464b07d67340a95c +size 3076716 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Body/T_Vendor_DADA_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Body/T_Vendor_DADA_D.png new file mode 100644 index 000000000..bd1d863a5 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Body/T_Vendor_DADA_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Body/T_Vendor_DADA_N.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Body/T_Vendor_DADA_N.png new file mode 100644 index 000000000..88d3686f0 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Body/T_Vendor_DADA_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Hair/Hair similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair rename to Jusin154_Team3D/Client/Bin/Resources/Models/Human/Hair/Hair diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Hair/Hair.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Hair/Hair.fbx new file mode 100644 index 000000000..b30f6ac18 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Hair/Hair.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6bed60c6be5555ed08388845e833b539eb5ca8095be2e7096aad754450f0320 +size 3383676 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Head/Head similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head rename to Jusin154_Team3D/Client/Bin/Resources/Models/Human/Head/Head diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Head/Head.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Head/Head.fbx new file mode 100644 index 000000000..d0d7958de --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Head/Head.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8c2af954e432ef10626e687fc032c826b4042f6ba058e485347273087509b76 +size 2730924 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Head/T_NPC_Young_M_Head_Ivory_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Head/T_NPC_Young_M_Head_Ivory_D.png new file mode 100644 index 000000000..c4b770cdd Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Human/Head/T_NPC_Young_M_Head_Ivory_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Steve/Steve b/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/Steve similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Steve/Steve rename to Jusin154_Team3D/Client/Bin/Resources/Models/Steve/Steve diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/TombProtector b/Jusin154_Team3D/Client/Bin/Resources/Models/TombProtector/TombProtector similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/TombProtector rename to Jusin154_Team3D/Client/Bin/Resources/Models/TombProtector/TombProtector diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Body_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Body_D.png new file mode 100644 index 000000000..b63e5e4a5 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Body_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_D.png new file mode 100644 index 000000000..9d495b121 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_N.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_N.png new file mode 100644 index 000000000..3533f9808 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_N.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_D.png new file mode 100644 index 000000000..bbbb5572a Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_E.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_E.png new file mode 100644 index 000000000..b23efd89f Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_E.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_N.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_N.png new file mode 100644 index 000000000..3c8bca8ba Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_N.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Eye_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Eye_D.png new file mode 100644 index 000000000..df0e9262f Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Eye_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_D.png new file mode 100644 index 000000000..0276f34ab Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_N.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_N.png new file mode 100644 index 000000000..f4280c6f9 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_N.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_D.png new file mode 100644 index 000000000..04895a31f Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_N.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_N.png new file mode 100644 index 000000000..e3d44cbb1 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_N.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Teeth_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Teeth_D.png new file mode 100644 index 000000000..5db401caf Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Teeth_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Teeth_N.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Teeth_N.png new file mode 100644 index 000000000..7c0338fd8 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/T_Troll_Teeth_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/Troll b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/Troll similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/Troll rename to Jusin154_Team3D/Client/Bin/Resources/Models/Troll/Troll diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/Troll.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/Troll.fbx new file mode 100644 index 000000000..94e082474 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Troll/Troll.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b44b64d49d58489c7ac80620cbd2bf5c5827343301d5303bdaa6314b4040634 +size 136314364 diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 5a7fee716..3f63e5e6f 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -303,7 +303,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) vTexcoord.x = In.vTexcoord.x; vTexcoord.y = In.vTexcoord.y + (float)i / g_vResolution.y; - vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(BorderZeroSampler, vTexcoord); + vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); } Out.vBackBuffer += vColor; @@ -329,7 +329,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x; vTexcoord.y = In.vTexcoord.y; - vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(BorderZeroSampler, vTexcoord); + vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl index 408fd8c78..e5ccefe3f 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl @@ -3,6 +3,8 @@ matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; Texture2D g_ColorTexture; +Texture2D g_DiffuseTexture; + struct VS_IN { @@ -48,39 +50,41 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In) Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f); - vector ColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord); + vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord); - if (0.f == ColorTexture.a) + vector vDiffuseTexture = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + + + if (0.f == vColorTexture.a) { discard; } - int iOption = ColorTexture.a * 10; + int iOption = vColorTexture.a * 10; switch (iOption) { case 1: - Out.vBackBuffer.rgb += ColorTexture.rgb; + Out.vBackBuffer.rgb = vColorTexture.rgb; break; case 2: - Out.vBackBuffer.rgb *= ColorTexture.rgb; + Out.vBackBuffer.rgb *= vColorTexture.rgb; break; case 3: - Out.vBackBuffer.rgb -= ColorTexture.rgb; + Out.vBackBuffer.rgb -= vColorTexture.rgb; break; case 4: - Out.vBackBuffer.rgb /= ColorTexture.rgb; + Out.vBackBuffer.rgb /= vColorTexture.rgb; break; case 5: - Out.vBackBuffer.rgb = ColorTexture.rgb; + Out.vBackBuffer.rgb += vColorTexture.rgb; break; default: break; } - - + return Out; } @@ -90,7 +94,7 @@ technique11 DefaultTechnique { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_None, 0); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + SetBlendState(BS_Blend, 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_OUT_LASTCOLOR(); diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index d49417481..2a1929302 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -19,14 +19,34 @@ struct ParticleValue float4 vOriginLook; float4 vOriginTranslation; - float2 fPadding; + float2 vMaskingUVMoveTime; + float2 vDiffuseUVMoveTime; + float2 vAniTime; + + float2 vAniIndex; +}; + +struct ParticleOut +{ + float4 vRight; + float4 vUp; + float4 vLook; + float4 vTranslation; + float2 vLifeTime; + + float2 vMaskingUVMoveTime; + float2 vDiffuseUVMoveTime; + float2 vAniTime; + + float2 vAniIndex; + }; StructuredBuffer g_ParticleBufferInput : register(t0); StructuredBuffer g_ParticleValueBufferInput : register(t1); -RWStructuredBuffer g_ParticleBufferOutput : register(u0); +RWStructuredBuffer g_ParticleBufferOutput : register(u0); cbuffer g_ConstantBuffer : register(b0) // b0 << ì�´ 숫ìž�와 컨스턴트 ì‰�ì�´ë�” ë°”ì�¸ë”©í• ë•Œ ì�¸ë�±ìŠ¤ê°€ ë�™ì�¼í•´ì•¼í•¨ { @@ -49,6 +69,9 @@ void CS_MAIN( ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; + ParticleOut ParticleOut; + + // ë�¼ì�´í”„타임 움ì§�ìž„ particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta; particle.vLifeTime.x += fTimeDelta; @@ -59,6 +82,58 @@ void CS_MAIN( particle.vTranslation.y = 0.f; } - g_ParticleBufferOutput[iIndex] = particle; + + //애니메ì�´ì…˜ ì†�ë�„ , ì�¸ë�±ìФ + particleValue.vAniTime.x += fTimeDelta; + + if (particleValue.vAniTime.x >= particleValue.vAniTime.y) + { + particleValue.vAniTime.x = 0.f; + + particleValue.vAniIndex.x++; + + if (particleValue.vAniIndex.x > particleValue.vAniIndex.y) // 애니메ì�´ì…˜ì—� ë��ì—� 다다ëž�다면 + { + particleValue.vAniIndex.x = 0.f; // ì�¸ë�±ìФ 초기화 + + } + + } + + //마스킹 UV 움ì§�ìž„ 시간 + + particleValue.vMaskingUVMoveTime.x += fTimeDelta; + + if (particleValue.vMaskingUVMoveTime.x >= particleValue.vMaskingUVMoveTime.x) + { + particleValue.vMaskingUVMoveTime.x = 0.f; + } + + + //디퓨즈 UV 움ì§�ìž„ + + particleValue.vDiffuseUVMoveTime.x += fTimeDelta; + + if (particleValue.vDiffuseUVMoveTime.x >= particleValue.vDiffuseUVMoveTime.x) + { + particleValue.vDiffuseUVMoveTime.x = 0.f; + } + + + //아웃풋 대입 + + ParticleOut.vRight = particle.vRight; + ParticleOut.vUp = particle.vUp; + ParticleOut.vLook = particle.vLook; + ParticleOut.vTranslation = particle.vTranslation; + ParticleOut.vLifeTime = particle.vLifeTime; + + ParticleOut.vMaskingUVMoveTime = particleValue.vMaskingUVMoveTime; + ParticleOut.vDiffuseUVMoveTime = particleValue.vDiffuseUVMoveTime; + ParticleOut.vAniTime = particleValue.vAniTime; + ParticleOut.vAniIndex = particleValue.vAniIndex; + + + g_ParticleBufferOutput[iIndex] = ParticleOut; } diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index 6e5da8276..a619d6b65 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -17,6 +17,7 @@ float g_fBlurIntensity; //블러 세기 float4 g_vEmissive; float g_fColorOption; +float g_fEmissiveCutAlpha; bool g_isDiffuse; bool g_isMasking; @@ -98,10 +99,8 @@ struct PS_IN struct PS_OUT { - float4 vDiffuse : SV_TARGET0; - float4 vNormal : SV_TARGET1; - float4 vDepth : SV_TARGET2; - float4 vColor : SV_TARGET3; + float4 vDiffuse: SV_TARGET0; + float4 vColorTarget : SV_TARGET1; }; PS_OUT PS_MAIN(PS_IN In) @@ -119,8 +118,8 @@ PS_OUT PS_MAIN(PS_IN In) float3 vNormal = mul(vMtrlNormal.xyz * 2.f - 1.f, NormalMap_WorldMatrix); - Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f); - Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); + //Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f); + //Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); if (vMtrlDiffuse.a < 0.3f) discard; @@ -187,20 +186,71 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r - vMtrlDisolve.r * (In.vLifeTime.x / In.vLifeTime.y)); - Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); - Out.vDiffuse = vMtrlDiffuse; + Out.vDiffuse = vMtrlDiffuse; + + // 색깔 추가할 처리 (ì�´ë¯¸ì‹œë¸Œ) + if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha ) + Out.vColorTarget = vector(g_vEmissive.rgb, g_fColorOption / 10.f); + else + Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); - // 색깔 추가할 처리 - Out.vColor = vector(g_vEmissive.rgb , g_fColorOption / 10.f); return Out; } -PS_OUT PS_Blur(PS_IN In) +struct VS_BLUR_OUT +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; + float2 vLifeTime : TEXCOORD1; +}; + +VS_BLUR_OUT VS_BLUR(VS_IN In) +{ + VS_BLUR_OUT Out = (VS_BLUR_OUT) 0; + + matrix matWV, matWVP; + + matWV = mul(g_WorldMatrix, g_ViewMatrix); + + float4 vProjPos = vector(In.vPosition, 1.f); + + Out.vPosition = mul(vProjPos, matWVP); + + matWVP = mul(matWV, g_ProjMatrix); + + matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); + + vector vPosition = mul(vector(In.vPosition, 1.f), TransformMatrix); + + Out.vPosition = mul(vPosition, matWVP); + Out.vTexcoord = In.vTexcoord; + Out.vLifeTime = In.vLifeTime; + + + + return Out; +} + +struct PS_BLUR_IN +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; + float2 vLifeTime : TEXCOORD1; + +}; + +struct PS_BLUR_OUT +{ + float4 vDiffuse : SV_TARGET0; +}; + + +PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) { - PS_OUT Out; + PS_BLUR_OUT Out; vector vMtrlDiffuse; vector vMtrlMask; @@ -253,13 +303,8 @@ PS_OUT PS_Blur(PS_IN In) vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r - vMtrlDisolve.r * (In.vLifeTime.x / In.vLifeTime.y)); - Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); - Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity; - // 색깔 추가할 처리 - Out.vColor = vector(g_vEmissive.rgb, g_fColorOption / 10.f); - return Out; } @@ -291,9 +336,9 @@ technique11 DefaultTechnique SetRasterizerState(RS_Nocull); SetDepthStencilState(DSS_Default, 0); SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); + VertexShader = compile vs_5_0 VS_BLUR(); GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Blur(); + PixelShader = compile ps_5_0 PS_BLUR(); } } diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireTile_03_D.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireTile_03_D.png new file mode 100644 index 000000000..a4bb9907a Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireTile_03_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireWisps_01_D.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireWisps_01_D.png new file mode 100644 index 000000000..0c43d2fb9 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireWisps_01_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_01_D.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_01_D.png new file mode 100644 index 000000000..6279966ae Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_01_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_02_D.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_02_D.png new file mode 100644 index 000000000..2aabb2091 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_02_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_Flames8x4_03_D.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_Flames8x4_03_D.png new file mode 100644 index 000000000..495481543 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_Flames8x4_03_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_smokeCloud_Dal_BPF_D.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_smokeCloud_Dal_BPF_D.png index 014be3b50..9ee64826f 100644 Binary files a/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_smokeCloud_Dal_BPF_D.png and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Diffuse/VFX_T_smokeCloud_Dal_BPF_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/Splesh_Mesh/Splesh_Mesh1.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/ParticleMesh/Splesh_Mesh1.fbx similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/Splesh_Mesh/Splesh_Mesh1.fbx rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/ParticleMesh/Splesh_Mesh1.fbx diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinBody.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinBody.bin new file mode 100644 index 000000000..d0c63a25f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinBody.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead.bin new file mode 100644 index 000000000..70cdd40d1 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body.bin new file mode 100644 index 000000000..594d7b2a7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair.bin new file mode 100644 index 000000000..7305034ef Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head.bin new file mode 100644 index 000000000..92616bccf Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Steve/Steve.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Steve/Steve.bin new file mode 100644 index 000000000..4cd475871 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Steve/Steve.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/TombProtector.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/TombProtector.bin new file mode 100644 index 000000000..6662964a2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/TombProtector.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/Troll.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/Troll.bin new file mode 100644 index 000000000..181da1740 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/Troll.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 5a7fee716..3f63e5e6f 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -303,7 +303,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) vTexcoord.x = In.vTexcoord.x; vTexcoord.y = In.vTexcoord.y + (float)i / g_vResolution.y; - vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(BorderZeroSampler, vTexcoord); + vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); } Out.vBackBuffer += vColor; @@ -329,7 +329,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x; vTexcoord.y = In.vTexcoord.y; - vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(BorderZeroSampler, vTexcoord); + vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl index 408fd8c78..e5ccefe3f 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl @@ -3,6 +3,8 @@ matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; Texture2D g_ColorTexture; +Texture2D g_DiffuseTexture; + struct VS_IN { @@ -48,39 +50,41 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In) Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f); - vector ColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord); + vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord); - if (0.f == ColorTexture.a) + vector vDiffuseTexture = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + + + if (0.f == vColorTexture.a) { discard; } - int iOption = ColorTexture.a * 10; + int iOption = vColorTexture.a * 10; switch (iOption) { case 1: - Out.vBackBuffer.rgb += ColorTexture.rgb; + Out.vBackBuffer.rgb = vColorTexture.rgb; break; case 2: - Out.vBackBuffer.rgb *= ColorTexture.rgb; + Out.vBackBuffer.rgb *= vColorTexture.rgb; break; case 3: - Out.vBackBuffer.rgb -= ColorTexture.rgb; + Out.vBackBuffer.rgb -= vColorTexture.rgb; break; case 4: - Out.vBackBuffer.rgb /= ColorTexture.rgb; + Out.vBackBuffer.rgb /= vColorTexture.rgb; break; case 5: - Out.vBackBuffer.rgb = ColorTexture.rgb; + Out.vBackBuffer.rgb += vColorTexture.rgb; break; default: break; } - - + return Out; } @@ -90,7 +94,7 @@ technique11 DefaultTechnique { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_None, 0); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + SetBlendState(BS_Blend, 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_OUT_LASTCOLOR(); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index d49417481..2a1929302 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -19,14 +19,34 @@ struct ParticleValue float4 vOriginLook; float4 vOriginTranslation; - float2 fPadding; + float2 vMaskingUVMoveTime; + float2 vDiffuseUVMoveTime; + float2 vAniTime; + + float2 vAniIndex; +}; + +struct ParticleOut +{ + float4 vRight; + float4 vUp; + float4 vLook; + float4 vTranslation; + float2 vLifeTime; + + float2 vMaskingUVMoveTime; + float2 vDiffuseUVMoveTime; + float2 vAniTime; + + float2 vAniIndex; + }; StructuredBuffer g_ParticleBufferInput : register(t0); StructuredBuffer g_ParticleValueBufferInput : register(t1); -RWStructuredBuffer g_ParticleBufferOutput : register(u0); +RWStructuredBuffer g_ParticleBufferOutput : register(u0); cbuffer g_ConstantBuffer : register(b0) // b0 << ì�´ 숫ìž�와 컨스턴트 ì‰�ì�´ë�” ë°”ì�¸ë”©í• ë•Œ ì�¸ë�±ìŠ¤ê°€ ë�™ì�¼í•´ì•¼í•¨ { @@ -49,6 +69,9 @@ void CS_MAIN( ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; + ParticleOut ParticleOut; + + // ë�¼ì�´í”„타임 움ì§�ìž„ particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta; particle.vLifeTime.x += fTimeDelta; @@ -59,6 +82,58 @@ void CS_MAIN( particle.vTranslation.y = 0.f; } - g_ParticleBufferOutput[iIndex] = particle; + + //애니메ì�´ì…˜ ì†�ë�„ , ì�¸ë�±ìФ + particleValue.vAniTime.x += fTimeDelta; + + if (particleValue.vAniTime.x >= particleValue.vAniTime.y) + { + particleValue.vAniTime.x = 0.f; + + particleValue.vAniIndex.x++; + + if (particleValue.vAniIndex.x > particleValue.vAniIndex.y) // 애니메ì�´ì…˜ì—� ë��ì—� 다다ëž�다면 + { + particleValue.vAniIndex.x = 0.f; // ì�¸ë�±ìФ 초기화 + + } + + } + + //마스킹 UV 움ì§�ìž„ 시간 + + particleValue.vMaskingUVMoveTime.x += fTimeDelta; + + if (particleValue.vMaskingUVMoveTime.x >= particleValue.vMaskingUVMoveTime.x) + { + particleValue.vMaskingUVMoveTime.x = 0.f; + } + + + //디퓨즈 UV 움ì§�ìž„ + + particleValue.vDiffuseUVMoveTime.x += fTimeDelta; + + if (particleValue.vDiffuseUVMoveTime.x >= particleValue.vDiffuseUVMoveTime.x) + { + particleValue.vDiffuseUVMoveTime.x = 0.f; + } + + + //아웃풋 대입 + + ParticleOut.vRight = particle.vRight; + ParticleOut.vUp = particle.vUp; + ParticleOut.vLook = particle.vLook; + ParticleOut.vTranslation = particle.vTranslation; + ParticleOut.vLifeTime = particle.vLifeTime; + + ParticleOut.vMaskingUVMoveTime = particleValue.vMaskingUVMoveTime; + ParticleOut.vDiffuseUVMoveTime = particleValue.vDiffuseUVMoveTime; + ParticleOut.vAniTime = particleValue.vAniTime; + ParticleOut.vAniIndex = particleValue.vAniIndex; + + + g_ParticleBufferOutput[iIndex] = ParticleOut; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index 6e5da8276..4b1805e18 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -13,10 +13,13 @@ float4 g_vCamPosition; vector g_vColor; float2 g_vUVGainAmount; +float2 g_vUVCutting; + float g_fBlurIntensity; //블러 세기 float4 g_vEmissive; float g_fColorOption; +float g_fEmissiveCutAlpha; bool g_isDiffuse; bool g_isMasking; @@ -26,6 +29,24 @@ bool g_isUVMove; float g_fFar; +struct ParticleValue +{ + float4 vRight; + float4 vUp; + float4 vLook; + float4 vTranslation; + float2 vLifeTime; + + float2 vMaskingUVMoveTime; + float2 vDiffuseUVMoveTime; + float2 vAniTime; + + float2 vAniIndex; + +}; + +StructuredBuffer g_ParticleValue : register(t0); + struct VS_IN { float3 vPosition : POSITION; @@ -51,9 +72,10 @@ struct VS_OUT float2 vLifeTime : TEXCOORD1; float4 vWorldPos : TEXCOORD2; float4 vProjPos : TEXCOORD3; + uint iGPUIndex : TEXCOORD4; }; -VS_OUT VS_MAIN(VS_IN In) +VS_OUT VS_MAIN(VS_IN In, uint iGPUIndex : SV_VertexID) { VS_OUT Out = (VS_OUT) 0; @@ -79,7 +101,7 @@ VS_OUT VS_MAIN(VS_IN In) Out.vTexcoord = In.vTexcoord; Out.vLifeTime = In.vLifeTime; Out.vWorldPos = mul(vector(In.vPosition, 1.f), g_WorldMatrix); - + Out.iGPUIndex = iGPUIndex; return Out; } @@ -94,14 +116,13 @@ struct PS_IN float2 vLifeTime : TEXCOORD1; float4 vWorldPos : TEXCOORD2; float4 vProjPos : TEXCOORD3; + uint iGPUIndex : TEXCOORD4; }; struct PS_OUT { - float4 vDiffuse : SV_TARGET0; - float4 vNormal : SV_TARGET1; - float4 vDepth : SV_TARGET2; - float4 vColor : SV_TARGET3; + float4 vDiffuse: SV_TARGET0; + float4 vColorTarget : SV_TARGET1; }; PS_OUT PS_MAIN(PS_IN In) @@ -119,8 +140,8 @@ PS_OUT PS_MAIN(PS_IN In) float3 vNormal = mul(vMtrlNormal.xyz * 2.f - 1.f, NormalMap_WorldMatrix); - Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f); - Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); + //Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f); + //Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); if (vMtrlDiffuse.a < 0.3f) discard; @@ -141,11 +162,21 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vector vMtrlNoise; vector vMtrlDisolve; + float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x; + float2 vDiffuseTime = g_ParticleValue[In.iGPUIndex].vDiffuseUVMoveTime; + float2 vMaskingTime = g_ParticleValue[In.iGPUIndex].vMaskingUVMoveTime; + + float2 vTexcoord = In.vTexcoord; + float2 vUVPerCell = In.vTexcoord / g_vUVCutting; //ì�´ê²Œ 한 셀당 í�¬ê¸° + + vTexcoord.x = vTexcoord.x * vUVPerCell.x + (fAnimIndex.x % g_vUVCutting.x) * vUVPerCell.x; + vTexcoord.y = vTexcoord.y * vUVPerCell.y + (fAnimIndex.x / g_vUVCutting.y) * vUVPerCell.y; + if (g_isUVMove) { - vTexcoord += g_vUVGainAmount * (In.vLifeTime.x / In.vLifeTime.y); + vTexcoord += (g_vUVGainAmount / g_vUVCutting) * (vDiffuseTime.x / vDiffuseTime.y); } if (g_isDiffuse == true) @@ -163,7 +194,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) if (g_isMasking == true) { - vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vTexcoord); + vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, In.vTexcoord); } else { @@ -172,7 +203,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) if (g_isDissolve == true) { - vMtrlDisolve = g_DissolveTexture.Sample(DefaultSampler, vTexcoord); + vMtrlDisolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); } else { @@ -181,37 +212,88 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) if (g_isNoise == true) { - vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vTexcoord); + vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, In.vTexcoord); } vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r - vMtrlDisolve.r * (In.vLifeTime.x / In.vLifeTime.y)); - Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); - Out.vDiffuse = vMtrlDiffuse; + Out.vDiffuse = vMtrlDiffuse; + + // 색깔 추가할 처리 (ì�´ë¯¸ì‹œë¸Œ) + if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha ) + Out.vColorTarget = vector(g_vEmissive.rgb, g_fColorOption / 10.f); + else + Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); - // 색깔 추가할 처리 - Out.vColor = vector(g_vEmissive.rgb , g_fColorOption / 10.f); return Out; } -PS_OUT PS_Blur(PS_IN In) +struct VS_BLUR_OUT +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; + float2 vLifeTime : TEXCOORD1; +}; + +VS_BLUR_OUT VS_BLUR(VS_IN In) +{ + VS_BLUR_OUT Out = (VS_BLUR_OUT) 0; + + matrix matWV, matWVP; + + matWV = mul(g_WorldMatrix, g_ViewMatrix); + + float4 vProjPos = vector(In.vPosition, 1.f); + + Out.vPosition = mul(vProjPos, matWVP); + + matWVP = mul(matWV, g_ProjMatrix); + + matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); + + vector vPosition = mul(vector(In.vPosition, 1.f), TransformMatrix); + + Out.vPosition = mul(vPosition, matWVP); + Out.vTexcoord = In.vTexcoord; + Out.vLifeTime = In.vLifeTime; + + + + return Out; +} + +struct PS_BLUR_IN +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; + float2 vLifeTime : TEXCOORD1; + +}; + +struct PS_BLUR_OUT +{ + float4 vDiffuse : SV_TARGET0; +}; + + +PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) { - PS_OUT Out; + PS_BLUR_OUT Out; vector vMtrlDiffuse; vector vMtrlMask; vector vMtrlNoise; vector vMtrlDisolve; - float2 vTexcoord = In.vTexcoord; + float2 vTexcoord = In.vTexcoord / g_vUVCutting; if (g_isUVMove) { - vTexcoord += g_vUVGainAmount * (In.vLifeTime.x / In.vLifeTime.y); + vTexcoord += g_vUVGainAmount / g_vUVCutting * (In.vLifeTime.x / In.vLifeTime.y); } if (g_isDiffuse == true) @@ -253,13 +335,8 @@ PS_OUT PS_Blur(PS_IN In) vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r - vMtrlDisolve.r * (In.vLifeTime.x / In.vLifeTime.y)); - Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); - Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity; - // 색깔 추가할 처리 - Out.vColor = vector(g_vEmissive.rgb, g_fColorOption / 10.f); - return Out; } @@ -291,9 +368,9 @@ technique11 DefaultTechnique SetRasterizerState(RS_Nocull); SetDepthStencilState(DSS_Default, 0); SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); + VertexShader = compile vs_5_0 VS_BLUR(); GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Blur(); + PixelShader = compile ps_5_0 PS_BLUR(); } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireTile_03_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireTile_03_D.png new file mode 100644 index 000000000..a4bb9907a Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireTile_03_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireWisps_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireWisps_01_D.png new file mode 100644 index 000000000..0c43d2fb9 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FireWisps_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_01_D.png new file mode 100644 index 000000000..6279966ae Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_02_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_02_D.png new file mode 100644 index 000000000..2aabb2091 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_FlamePro_02_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_Flames8x4_03_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_Flames8x4_03_D.png new file mode 100644 index 000000000..495481543 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Diffuse/VFX_T_Flames8x4_03_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Noises/VFX_T_smokeCloud_Dal_BPF_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Noises/VFX_T_smokeCloud_Dal_BPF_D.png new file mode 100644 index 000000000..9ee64826f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Noises/VFX_T_smokeCloud_Dal_BPF_D.png differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index f3b62dc6d..068571263 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -153,9 +153,15 @@ + + + false + false + + @@ -172,7 +178,6 @@ - @@ -204,9 +209,15 @@ + + + false + false + + @@ -220,7 +231,6 @@ - diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 2661f6c0c..c670f29d8 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -160,6 +160,12 @@ {c347da03-98f1-4095-a4e4-2c840c308916} + + {c7e7d3c7-fd26-4035-88b4-11233459559c} + + + {15a9dfe7-f3f7-4906-8bd4-91734f4ddc92} + @@ -309,6 +315,15 @@ 01.Level\60.PhysXLab + + 02.GameObjects\Dummys\PhysXBox + + + 02.GameObjects\Dummys\PhysXMesh + + + 50.UI\GamePlay_Canvas\Loding_Panel\LoadingWidget + @@ -451,6 +466,18 @@ 02.GameObjects\Monster + + 02.GameObjects\Dummys\PhysXBox + + + 02.GameObjects\Dummys\PhysXMesh + + + 50.UI\LoadingWidget + + + 50.UI\GamePlay_Canvas\Loding_Panel\LoadingWidget + diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXBox.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXBox.cpp new file mode 100644 index 000000000..748af56c8 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXBox.cpp @@ -0,0 +1,167 @@ +#include "pch.h" +#include "Dummy_PhysXBox.h" + +#include "GameInstance.h" + + +CDummy_PhysXBox::CDummy_PhysXBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject{ pDevice, pContext } +{ +} + +CDummy_PhysXBox::CDummy_PhysXBox(const CDummy_PhysXBox& rhs) + : CGameObject(rhs) +{ +} + +HRESULT CDummy_PhysXBox::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CDummy_PhysXBox::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +void CDummy_PhysXBox::Priority_Update(_float fTimeDelta) +{ + +} + +void CDummy_PhysXBox::Update(_float fTimeDelta) +{ +} + +void CDummy_PhysXBox::Late_Update(_float fTimeDelta) +{ + //_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]); + //m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this, *vPos, m_pTransformCom->Get_Radius()); +} + +HRESULT CDummy_PhysXBox::Render() +{ + //if (FAILED(Bind_ShaderResources())) { + // return E_FAIL; + //} + + + //_uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + //for (_uint i = 0; i < iNumMeshes; i++) + //{ + // if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { + // return E_FAIL; + // } + // if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) { + // return E_FAIL; + // } + + // if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::SKYBOX)))) { + // return E_FAIL; + // } + + // if (FAILED(m_pModelCom->Render(i))) { + // return E_FAIL; + // } + //} + + + return S_OK; +} + +HRESULT CDummy_PhysXBox::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + BOXSTARTPOS_DESC* pBox = static_cast(pArg); + + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pBox->vPos), 1.f)); + m_pTransformCom->Rotation(pBox->vRotRPY.x, pBox->vRotRPY.y, pBox->vRotRPY.z); + + + { // RIGID_BODY + CRigidBody::RIGIDBODY_DESC Desc{}; + Desc.tRigidDynamicDesc.bIsKinematic = false; + Desc.tRigidDynamicDesc.fDensity = 1000.f; + + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + + m_pActor = m_pGameInstance->Add_DynamicActor(*m_pRigidBody); + if (nullptr == m_pActor) { + assert(false); + return E_FAIL; + } + + } + + return S_OK; +} + +HRESULT CDummy_PhysXBox::Bind_ShaderResources() +{ + //if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + // return E_FAIL; + //} + + //if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + // return E_FAIL; + //} + return S_OK; +} + +CDummy_PhysXBox* CDummy_PhysXBox::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CDummy_PhysXBox* pInstance = new CDummy_PhysXBox(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CDummy_PhysXBox"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CDummy_PhysXBox::Clone(void* pArg, CGameObject* pOwner) +{ + CDummy_PhysXBox* pInstance = new CDummy_PhysXBox(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CDummy_PhysXBox"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CDummy_PhysXBox::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pRigidBody); + //SAFE_RELEASE(m_pModelCom); + //SAFE_RELEASE(m_pShaderCom); +} + +void CDummy_PhysXBox::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXMesh.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXMesh.cpp new file mode 100644 index 000000000..550fde9cb --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXMesh.cpp @@ -0,0 +1,166 @@ +#include "pch.h" +#include "Dummy_PhysXMesh.h" + +#include "GameInstance.h" + + +CDummy_PhysXMesh::CDummy_PhysXMesh(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject{ pDevice, pContext } +{ +} + +CDummy_PhysXMesh::CDummy_PhysXMesh(const CDummy_PhysXMesh& rhs) + : CGameObject(rhs) +{ +} + +HRESULT CDummy_PhysXMesh::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CDummy_PhysXMesh::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +void CDummy_PhysXMesh::Priority_Update(_float fTimeDelta) +{ + +} + +void CDummy_PhysXMesh::Update(_float fTimeDelta) +{ +} + +void CDummy_PhysXMesh::Late_Update(_float fTimeDelta) +{ + //_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]); + //m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this, *vPos, m_pTransformCom->Get_Radius()); +} + +HRESULT CDummy_PhysXMesh::Render() +{ + //if (FAILED(Bind_ShaderResources())) { + // return E_FAIL; + //} + + + //_uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + //for (_uint i = 0; i < iNumMeshes; i++) + //{ + // if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { + // return E_FAIL; + // } + // if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) { + // return E_FAIL; + // } + + // if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::SKYBOX)))) { + // return E_FAIL; + // } + + // if (FAILED(m_pModelCom->Render(i))) { + // return E_FAIL; + // } + //} + + + return S_OK; +} + +HRESULT CDummy_PhysXMesh::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + BOXSTARTPOS_DESC* pBox = static_cast(pArg); + + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pBox->vPos), 1.f)); + m_pTransformCom->Rotation(pBox->vRotRPY.x, pBox->vRotRPY.y, pBox->vRotRPY.z); + + + { // RIGID_BODY + CRigidBody::RIGIDBODY_DESC Desc{}; + Desc.tRigidDynamicDesc.bIsKinematic = false; + Desc.tRigidDynamicDesc.fDensity = 1000.f; + + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + + m_pActor = m_pGameInstance->Add_DynamicActor(*m_pRigidBody); + if (nullptr == m_pActor) { + assert(false); + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CDummy_PhysXMesh::Bind_ShaderResources() +{ + //if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + // return E_FAIL; + //} + + //if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + // return E_FAIL; + //} + return S_OK; +} + +CDummy_PhysXMesh* CDummy_PhysXMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CDummy_PhysXMesh* pInstance = new CDummy_PhysXMesh(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CDummy_PhysXMesh"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CDummy_PhysXMesh::Clone(void* pArg, CGameObject* pOwner) +{ + CDummy_PhysXMesh* pInstance = new CDummy_PhysXMesh(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CDummy_PhysXMesh"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CDummy_PhysXMesh::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pRigidBody); + //SAFE_RELEASE(m_pModelCom); + //SAFE_RELEASE(m_pShaderCom); +} + +void CDummy_PhysXMesh::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/EditEffect.cpp b/Jusin154_Team3D/Editor/Private/EditEffect.cpp index ed63b7d53..841df41e5 100644 --- a/Jusin154_Team3D/Editor/Private/EditEffect.cpp +++ b/Jusin154_Team3D/Editor/Private/EditEffect.cpp @@ -117,8 +117,12 @@ void CEditEffect::Describe_Entity() InstanceDesc.vSizeMin = _float3(1.f, 1.f, 1.f); InstanceDesc.vSizeMax = _float3(1.f, 1.f, 1.f); InstanceDesc.vSpeed = _float2(0.f, 0.f); + InstanceDesc.vAniIndex = _float2(0.f, 32.f); + InstanceDesc.vAniTime = _float2(1.f, 3.f); + InstanceDesc.vDiffuseUVMoveTime = _float2(1.f, 3.f); + InstanceDesc.vMaskingUVMoveTime = _float2(1.f, 3.f); - const char* pRenderNames[] = {"PRIORITY" , "SHADOW", "NONBLEND", "BLUR" , "NONLIGHT", "BLEND" , "UI" }; + const char* pRenderNames[] = {"PRIORITY" , "SHADOW", "NONBLEND", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" , "UI"}; int iCurrentItem = static_cast(m_eRenderOrder); @@ -138,10 +142,15 @@ void CEditEffect::Describe_Entity() GUI::ColorEdit4("Color", (_float*)&m_vColor); - GUI::DragFloat("BlurIntensity", &m_fBlurIntensity , 0.01f , 0.f , 1.f); + GUI::DragFloat("BlurIntensity", &m_fBlurIntensity , 0.005f , 0.f , 1.f); + GUI::DragFloat("EmissiveCutAlpha", &m_fEmissiveCutAlpha, 0.005f, 0.f, 1.f); + GUI::ColorEdit4("Emissive", (_float*)&m_vEmissive); GUI::InputFloat("ColorTargetOption", &m_fColorOption); + GUI::InputFloat2("UVCutting", (_float*)& m_vUVCutting); + + GUI::DragFloat2("vUVGainAmount", (_float*)&m_vUVGainAmount , 0.01f); @@ -152,7 +161,6 @@ void CEditEffect::Describe_Entity() //¶óÀÌÇÁ ŸÀÓ¿¡ ÀÇÇØ¼­°¡ ¾Æ´Ñ °ø¿ë½Ã°£À¸·Î Á¦¾îÇØ¾ßÇÔ //UVÀß¶ó¼­ Àû¿ëÇÒ ¼ö ÀÖµµ·Ï - //ºí·¯ ¿þÀÌÆ®µµ ¼³Á¤ÇÒ ¼ö ÀÖµµ·Ï if (GUI::TreeNode("MODEL")) diff --git a/Jusin154_Team3D/Editor/Private/EffectObject.cpp b/Jusin154_Team3D/Editor/Private/EffectObject.cpp index 4125c14d5..e7c676042 100644 --- a/Jusin154_Team3D/Editor/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectObject.cpp @@ -46,6 +46,11 @@ HRESULT CEffectObject::Render() } + //¹ÙÀεùÇÑ ¹öÆÛ ÃʱâÈ­ + + ID3D11ShaderResourceView* pResetSRV[1] = { nullptr }; + m_pContext->CSSetShaderResources(0, 1, pResetSRV); + return S_OK; } @@ -74,6 +79,8 @@ HRESULT CEffectObject::Render_Blur() } + + return S_OK; } @@ -93,18 +100,23 @@ HRESULT CEffectObject::Bind_ShaderResources() if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_isDiffuse, sizeof(_bool)))) { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_isMasking", &m_isMasking, sizeof(_bool)))) { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_isDissolve", &m_isDissolve, sizeof(_bool)))) { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_isNoise, sizeof(_bool)))) { return E_FAIL; - } + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_isUVMove", &m_isUVMove, sizeof(_bool)))) { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_vColor, sizeof(_float4)))) { return E_FAIL; } @@ -117,11 +129,20 @@ HRESULT CEffectObject::Bind_ShaderResources() return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveCutAlpha", &m_fEmissiveCutAlpha, sizeof(_float)))) { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVGainAmount", &m_vUVGainAmount, sizeof(_float2)))) { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVCutting", &m_vUVCutting, sizeof(_float2)))) { + return E_FAIL; + } + + if(FAILED(m_pInstance_ModelCom->Bind_CS_Output(0))) + return E_FAIL; if (m_pDiffuse_TextureCom != nullptr) { diff --git a/Jusin154_Team3D/Editor/Private/Level_Loading.cpp b/Jusin154_Team3D/Editor/Private/Level_Loading.cpp index ad3efb73f..f8f1dca2e 100644 --- a/Jusin154_Team3D/Editor/Private/Level_Loading.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_Loading.cpp @@ -8,6 +8,8 @@ #include "Level_ObjectViewer.h" #include "Level_EffectViewer.h" #include "Level_MapViewer.h" +#include "Level_PhysXLab.h" + CLevel_Loading::CLevel_Loading(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -57,9 +59,9 @@ void CLevel_Loading::Update(_float fTimeDelta) case LEVEL::EFFECT: pNewLevel = CLevel_EffectViewer::Create(m_pDevice, m_pContext, m_eNextLevelID); break; - //case LEVEL::SKIllSTUDIO: - // pNewLevel = CLevel_SkillStudio::Create(m_pDevice, m_pContext, m_eNextLevelID); - // break; + case LEVEL::PHYSX: + pNewLevel = CLevel_PhysXLab::Create(m_pDevice, m_pContext, m_eNextLevelID); + break; //case LEVEL::PARTICLE: // pNewLevel = CLevel_ParticleViewer::Create(m_pDevice, m_pContext, m_eNextLevelID); // break; diff --git a/Jusin154_Team3D/Editor/Private/Level_Logo.cpp b/Jusin154_Team3D/Editor/Private/Level_Logo.cpp index d2f696d5b..7b3736fd5 100644 --- a/Jusin154_Team3D/Editor/Private/Level_Logo.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_Logo.cpp @@ -38,10 +38,10 @@ void CLevel_Logo::Update(_float fTimeDelta) if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::EFFECT)))) return; } - //else if (GUI::Button("Skill Editor", { 100, 100 })) { - // if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::SKIllSTUDIO)))) - // return; - //} + else if (GUI::Button("PhysX Simulator", { 100, 100 })) { + if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::PHYSX)))) + return; + } //else if (GUI::Button("Particle Editor", { 100, 100 })) { // if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::PARTICLE)))) // return; diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index 20a9d21a3..e6175746c 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -132,42 +132,26 @@ void CLevel_ObjectViewer::Add_Human() void CLevel_ObjectViewer::Show_ModelFilePath() { - /*GUI::Begin("Model_List"); + GUI::Begin("Model_List"); if(GUI::BeginTabBar("Model_List")) { - if (GUI::BeginTabItem("Assimp_Model")) - { - if (m_pGameInstance->ModelFilePathCount() > 0) - { - for (_uint i = 0; i < m_pGameInstance->ModelFilePathCount(); i++) - { - GUI::Text(m_pGameInstance->Load_ModelFilePath(i)); - GUI::SameLine(); - - std::string label = "Binary##" + std::to_string(i); - if (GUI::Button(label.c_str())) - { - m_pGameInstance->SaveAssimpModel(m_pGameInstance->Load_ModelFilePath(i)); - } - } - GUI::EndTabItem(); - } - } - - if (GUI::BeginTabItem("Binary_Model")) + if (GUI::BeginTabItem("Model")) { if (m_pGameInstance->BinaryModelFilePathCount() > 0) { for (_uint i = 0; i < m_pGameInstance->BinaryModelFilePathCount(); i++) { - GUI::Text(m_pGameInstance->Load_BinaryModelFilePath(i)); + if (GUI::Button(m_pGameInstance->Load_BinaryModelFilePath(i))) + { + + } } } GUI::EndTabItem(); } } GUI::EndTabBar(); - GUI::End();*/ + GUI::End(); } void CLevel_ObjectViewer::Show_AnimList() diff --git a/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp b/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp index a4f23480e..19a0e36d8 100644 --- a/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp @@ -1,2 +1,122 @@ #include "pch.h" -#include "Level_PhysXLab.h" \ No newline at end of file +#include "Level_PhysXLab.h" +#include "GameInstance.h" + +#include "Level_Loading.h" +#include "DebugCamera.h" +#include "Terrain.h" +#include "Dummy_PhysXBox.h" + +CLevel_PhysXLab::CLevel_PhysXLab(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) + : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } +{ + +} + +void CLevel_PhysXLab::Update(_float fTimeDelta) +{ + +} + +HRESULT CLevel_PhysXLab::Render() +{ + SetWindowText(g_hWnd, TEXT("PhysXEditor·¹º§ÀÔ´Ï´Ù")); + GUI::ShowDemoWindow(); + return S_OK; +} + +HRESULT CLevel_PhysXLab::Initialize() +{ + if (FAILED(Ready_Layer_Light())) + return E_FAIL; + + if (FAILED(Ready_Layer_Camera(LAYER_CAMERA))) { + return E_FAIL; + } + + if (FAILED(Ready_Layer_Terrain(TEXT("Layer_Terrain")))) { + return E_FAIL; + } + + if (FAILED(Ready_Layer_PhysXObjects(TEXT("Layer_PhysXObject")))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CLevel_PhysXLab::Ready_Layer_Light() +{ + LIGHT_DESC LightDesc{}; + + LightDesc.eType = LIGHT::DIRECTIONAL; + LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); + LightDesc.vAmbient = _float4(0.8f, 0.8f, 0.8f, 0.f); + LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); + LightDesc.vDirection = _float4(1.f, -1.f, 1.f, 0.f); + + if (FAILED(m_pGameInstance->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) { + return E_FAIL; + } + return S_OK; +} + +HRESULT CLevel_PhysXLab::Ready_Layer_Camera(const _wstring& strLayerTag) +{ + CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{}; + CameraDesc.fFovy = XMConvertToRadians(60.0f); + CameraDesc.fNear = 0.1f; + CameraDesc.fFar = 500.f; + CameraDesc.vEye = _float3(0.f, 10.f, -10.f); + CameraDesc.vAt = _float3(0.f, 0.f, 0.f); + CameraDesc.fSpeedPerSec = 2.f; + CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f); + CameraDesc.fMouseSensor = 0.1f; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, + strLayerTag, &CameraDesc))) + return E_FAIL; + + return S_OK; +} + +HRESULT CLevel_PhysXLab::Ready_Layer_Terrain(const _wstring& strLayerTag) +{ + + return S_OK; +} + +HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag) +{ + for (int i = 0; i < 50; ++i) { + CDummy_PhysXBox::BOXSTARTPOS_DESC Desc{}; + Desc.vPos = { m_pGameInstance->Random_Float(0.f, 30.f), m_pGameInstance->Random_Float(3.f, 33.f), m_pGameInstance->Random_Float(0.f, 30.f) }; + Desc.vRotRPY = { m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI) }; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) { + return E_FAIL; + } + } + + return S_OK; +} + +CLevel_PhysXLab* CLevel_PhysXLab::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) +{ + CLevel_PhysXLab* pInstance = new CLevel_PhysXLab(pDevice, pContext, eLevelID); + + if (FAILED(pInstance->Initialize())) + { + MSG_BOX("Failed to Created : CLevel_PhysXLab"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + + +void CLevel_PhysXLab::Free() +{ + __super::Free(); +} diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 3d7204c73..299067d17 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -14,8 +14,6 @@ #include "Hair.h" #include "Dummy_Goblin.h" #include "Monster.h" -#include - #pragma endregion #pragma region UI @@ -59,6 +57,12 @@ #pragma endregion +#pragma region PHYSX_HEADER + +#include "Dummy_PhysXBox.h" + +#pragma endregion + CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : m_pDevice{ pDevice } , m_pContext{ pContext } @@ -125,9 +129,9 @@ HRESULT CLoader::Loading() case LEVEL::EFFECT: hr = Loading_For_Effect(); break; - //case LEVEL::SKIllSTUDIO: - // hr = Loading_For_SkillStudio(); - // break; + case LEVEL::PHYSX: + hr = Loading_For_PhysXLevel(); + break; //case LEVEL::PARTICLE: // hr = Loading_For_Particle(); // break; @@ -471,6 +475,46 @@ HRESULT CLoader::Loading_For_Effect() return S_OK; } +HRESULT CLoader::Loading_For_PhysXLevel() +{ + m_strMessage = TEXT("PhysX Bodies Loading.."); + + { + CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{}; + Desc.tRigidDynamicDesc.bExclusive = false; + Desc.tRigidDynamicDesc.vhalfGeometryInfo = { 0.5f, 0.5f, 0.5f }; + Desc.tRigidDynamicDesc.vMatInfo = { 0.5f, 0.5f, 0.6f }; + Desc.tRigidDynamicDesc.ePxShapeFlag = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; + + m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody::Create(m_pDevice, m_pContext, Desc)); + } + //{ + // CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{}; + // Desc.tRigidStaticDesc.pMesh; + // Desc.tRigidStaticDesc.vMatInfo = { 0.5f, 0.5f, 0.6f }; + // Desc.tRigidStaticDesc.pMeshKey = TEXT("PHYSX_STATIC_MESH"); + //} + + m_strMessage = TEXT("Texture Loading.."); + + m_strMessage = TEXT("Model Loading.."); + + m_strMessage = TEXT("Shader Loading.."); + + m_strMessage = TEXT("Prototype Loading.."); + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXBox::Create(m_pDevice, m_pContext)))){ + return E_FAIL; + } + + m_strMessage = TEXT("Loading Success!"); + + m_isFinished = true; + + + return S_OK; +} + HRESULT CLoader::Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function AddPrototypeEvent) { for (const auto& file : filesystem::directory_iterator(pDirectoryPath)) @@ -504,44 +548,41 @@ HRESULT CLoader::Loading_For_ObjectViewer() m_strMessage = TEXT("Model Loading.."); - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinBody_Model"), - CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Goblin/GoblinBody.fbx", MODEL::ANIM, XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity(), 0)))) if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_HumanBody_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Body", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Body.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_HumanHead_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Head", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Head.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_HumanHair_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Hair", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Hair.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinHead_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Goblin/GoblinHead", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Goblin/GoblinHead.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) return E_FAIL; - m_strMessage = TEXT("Shader Loading.."); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinBody_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Goblin/GoblinBody", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Goblin/GoblinBody.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Steve_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Steve/Steve",XMMatrixScaling(0.01f,0.01f,0.01f)* XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Steve/Steve.bin",XMMatrixScaling(0.01f,0.01f,0.01f)* XMMatrixIdentity())))) return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/TombProtector/TombProtector", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/TombProtector/TombProtector.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Troll/Troll", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Troll/Troll.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) return E_FAIL; + m_strMessage = TEXT("Shader Loading.."); + m_strMessage = TEXT("Prototype Loading.."); /* For.Prototype_GameObject_RootModelPart */ diff --git a/Jusin154_Team3D/Editor/Private/LoadingWidget.cpp b/Jusin154_Team3D/Editor/Private/LoadingWidget.cpp index 0708424fb..41bbeb500 100644 --- a/Jusin154_Team3D/Editor/Private/LoadingWidget.cpp +++ b/Jusin154_Team3D/Editor/Private/LoadingWidget.cpp @@ -11,7 +11,7 @@ CLoadingWidget::CLoadingWidget(const CLoadingWidget& rhs) :CElementObject(rhs) { } - + HRESULT CLoadingWidget::Initialize_Prototype() { return S_OK; diff --git a/Jusin154_Team3D/Editor/Private/Loading_Panel.cpp b/Jusin154_Team3D/Editor/Private/Loading_Panel.cpp index 1905bb192..817ad6b17 100644 --- a/Jusin154_Team3D/Editor/Private/Loading_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Loading_Panel.cpp @@ -99,7 +99,7 @@ HRESULT CLoading_Panel::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + if (FAILED(m_pTextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) { return E_FAIL; } @@ -175,7 +175,7 @@ void CLoading_Panel::Free() { __super::Free(); - SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pTextureCom); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Public/Dummy_PhysXBox.h b/Jusin154_Team3D/Editor/Public/Dummy_PhysXBox.h new file mode 100644 index 000000000..706670cd6 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Dummy_PhysXBox.h @@ -0,0 +1,53 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +class CRigidBody; +NS_END + +NS_BEGIN(Editor) + +class CDummy_PhysXBox final : public CGameObject +{ +public: + typedef struct tagBoxStartPos + { + _float3 vPos = {}; + _float3 vRotRPY = {}; + }BOXSTARTPOS_DESC; +private: + CDummy_PhysXBox(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CDummy_PhysXBox(const CDummy_PhysXBox& rhs); + virtual ~CDummy_PhysXBox() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + CRigidBody* m_pRigidBody = { nullptr }; + const PSX::PxRigidDynamic* m_pActor = { nullptr }; + //CModel* m_pModelCom = { nullptr }; + //CShader* m_pShaderCom = { nullptr }; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Bind_ShaderResources() override; + +public: + static CDummy_PhysXBox* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Dummy_PhysXMesh.h b/Jusin154_Team3D/Editor/Public/Dummy_PhysXMesh.h new file mode 100644 index 000000000..c667ebe37 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Dummy_PhysXMesh.h @@ -0,0 +1,53 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +class CRigidBody; +NS_END + +NS_BEGIN(Editor) + +class CDummy_PhysXMesh final : public CGameObject +{ +public: + typedef struct tagBoxStartPos + { + _float3 vPos = {}; + _float3 vRotRPY = {}; + }BOXSTARTPOS_DESC; +private: + CDummy_PhysXMesh(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CDummy_PhysXMesh(const CDummy_PhysXMesh& rhs); + virtual ~CDummy_PhysXMesh() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + CRigidBody* m_pRigidBody = { nullptr }; + const PSX::PxRigidDynamic* m_pActor = { nullptr }; + //CModel* m_pModelCom = { nullptr }; + //CShader* m_pShaderCom = { nullptr }; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Bind_ShaderResources() override; + +public: + static CDummy_PhysXMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index 64370a8f8..f8b31c8d5 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -11,7 +11,7 @@ namespace Editor const unsigned int g_iWinSizeX = 1920; const unsigned int g_iWinSizeY = 1080; - enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT, MAP,UI, EFFECT, END }; + enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT, MAP,UI, EFFECT, PHYSX, END }; enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END }; enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END }; diff --git a/Jusin154_Team3D/Editor/Public/EffectObject.h b/Jusin154_Team3D/Editor/Public/EffectObject.h index 1c54d8042..f9886e8da 100644 --- a/Jusin154_Team3D/Editor/Public/EffectObject.h +++ b/Jusin154_Team3D/Editor/Public/EffectObject.h @@ -43,6 +43,7 @@ class CEffectObject abstract : public CGameObject _float4 m_vColor = { 0.f ,0.f ,0.f ,1.f }; _float2 m_vUVGainAmount = {}; + _float2 m_vUVCutting = {1.f ,1.f}; _bool m_isDiffuse = {}; _bool m_isMasking = {}; @@ -54,8 +55,10 @@ class CEffectObject abstract : public CGameObject _float4 m_vEmissive = { 0.f ,0.f ,0.f ,0.f}; _float m_fColorOption = {}; _float m_fBlurIntensity = {}; + _float m_fEmissiveCutAlpha = {}; - RENDER m_eRenderOrder = {RENDER::NONLIGHT}; + + RENDER m_eRenderOrder = {RENDER::EFFECT}; public: virtual void Free() override; diff --git a/Jusin154_Team3D/Editor/Public/Level_PhysXLab.h b/Jusin154_Team3D/Editor/Public/Level_PhysXLab.h index f01c7977b..2bca2fc94 100644 --- a/Jusin154_Team3D/Editor/Public/Level_PhysXLab.h +++ b/Jusin154_Team3D/Editor/Public/Level_PhysXLab.h @@ -1,5 +1,32 @@ #pragma once -class CLevel_PhysXLab + +#include "Editor_Define.h" +#include "Level.h" + +NS_BEGIN(Editor) + +class CLevel_PhysXLab final : public CLevel { +private: + CLevel_PhysXLab(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); + virtual ~CLevel_PhysXLab() = default; + +public: + virtual void Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + virtual HRESULT Initialize() override; + HRESULT Ready_Layer_Light(); + HRESULT Ready_Layer_Camera(const _wstring& strLayerTag); + HRESULT Ready_Layer_Terrain(const _wstring& strLayerTag); + HRESULT Ready_Layer_PhysXObjects(const _wstring& strLayerTag); + + + +public: + static CLevel_PhysXLab* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); + virtual void Free() override; }; +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Loader.h b/Jusin154_Team3D/Editor/Public/Loader.h index bef28bb73..9546ada00 100644 --- a/Jusin154_Team3D/Editor/Public/Loader.h +++ b/Jusin154_Team3D/Editor/Public/Loader.h @@ -47,6 +47,7 @@ class CLoader final : public CBase HRESULT Loading_For_MapViewer(); HRESULT Loading_For_UI(); HRESULT Loading_For_Effect(); + HRESULT Loading_For_PhysXLevel(); private: HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function AddPrototypeEvent); diff --git a/Jusin154_Team3D/Editor/Public/MiniMap_Panel.h b/Jusin154_Team3D/Editor/Public/MiniMap_Panel.h index 2468c378d..cb4408cef 100644 --- a/Jusin154_Team3D/Editor/Public/MiniMap_Panel.h +++ b/Jusin154_Team3D/Editor/Public/MiniMap_Panel.h @@ -31,7 +31,7 @@ class CMiniMap_Panel final : public CPanelObject virtual HRESULT Initialize(void* pArg) override; private: - CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pTextureCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pMission_KeyHold = { nullptr }; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 5a7fee716..3f63e5e6f 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -303,7 +303,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) vTexcoord.x = In.vTexcoord.x; vTexcoord.y = In.vTexcoord.y + (float)i / g_vResolution.y; - vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(BorderZeroSampler, vTexcoord); + vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(ClampSampler, vTexcoord); } Out.vBackBuffer += vColor; @@ -329,7 +329,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x; vTexcoord.y = In.vTexcoord.y; - vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(BorderZeroSampler, vTexcoord); + vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl index 408fd8c78..e5ccefe3f 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_LastColor.hlsl @@ -3,6 +3,8 @@ matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; Texture2D g_ColorTexture; +Texture2D g_DiffuseTexture; + struct VS_IN { @@ -48,39 +50,41 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In) Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f); - vector ColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord); + vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord); - if (0.f == ColorTexture.a) + vector vDiffuseTexture = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + + + if (0.f == vColorTexture.a) { discard; } - int iOption = ColorTexture.a * 10; + int iOption = vColorTexture.a * 10; switch (iOption) { case 1: - Out.vBackBuffer.rgb += ColorTexture.rgb; + Out.vBackBuffer.rgb = vColorTexture.rgb; break; case 2: - Out.vBackBuffer.rgb *= ColorTexture.rgb; + Out.vBackBuffer.rgb *= vColorTexture.rgb; break; case 3: - Out.vBackBuffer.rgb -= ColorTexture.rgb; + Out.vBackBuffer.rgb -= vColorTexture.rgb; break; case 4: - Out.vBackBuffer.rgb /= ColorTexture.rgb; + Out.vBackBuffer.rgb /= vColorTexture.rgb; break; case 5: - Out.vBackBuffer.rgb = ColorTexture.rgb; + Out.vBackBuffer.rgb += vColorTexture.rgb; break; default: break; } - - + return Out; } @@ -90,7 +94,7 @@ technique11 DefaultTechnique { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_None, 0); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + SetBlendState(BS_Blend, 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_OUT_LASTCOLOR(); diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index d49417481..2a1929302 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -19,14 +19,34 @@ struct ParticleValue float4 vOriginLook; float4 vOriginTranslation; - float2 fPadding; + float2 vMaskingUVMoveTime; + float2 vDiffuseUVMoveTime; + float2 vAniTime; + + float2 vAniIndex; +}; + +struct ParticleOut +{ + float4 vRight; + float4 vUp; + float4 vLook; + float4 vTranslation; + float2 vLifeTime; + + float2 vMaskingUVMoveTime; + float2 vDiffuseUVMoveTime; + float2 vAniTime; + + float2 vAniIndex; + }; StructuredBuffer g_ParticleBufferInput : register(t0); StructuredBuffer g_ParticleValueBufferInput : register(t1); -RWStructuredBuffer g_ParticleBufferOutput : register(u0); +RWStructuredBuffer g_ParticleBufferOutput : register(u0); cbuffer g_ConstantBuffer : register(b0) // b0 << ì�´ 숫ìž�와 컨스턴트 ì‰�ì�´ë�” ë°”ì�¸ë”©í• ë•Œ ì�¸ë�±ìŠ¤ê°€ ë�™ì�¼í•´ì•¼í•¨ { @@ -49,6 +69,9 @@ void CS_MAIN( ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; + ParticleOut ParticleOut; + + // ë�¼ì�´í”„타임 움ì§�ìž„ particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta; particle.vLifeTime.x += fTimeDelta; @@ -59,6 +82,58 @@ void CS_MAIN( particle.vTranslation.y = 0.f; } - g_ParticleBufferOutput[iIndex] = particle; + + //애니메ì�´ì…˜ ì†�ë�„ , ì�¸ë�±ìФ + particleValue.vAniTime.x += fTimeDelta; + + if (particleValue.vAniTime.x >= particleValue.vAniTime.y) + { + particleValue.vAniTime.x = 0.f; + + particleValue.vAniIndex.x++; + + if (particleValue.vAniIndex.x > particleValue.vAniIndex.y) // 애니메ì�´ì…˜ì—� ë��ì—� 다다ëž�다면 + { + particleValue.vAniIndex.x = 0.f; // ì�¸ë�±ìФ 초기화 + + } + + } + + //마스킹 UV 움ì§�ìž„ 시간 + + particleValue.vMaskingUVMoveTime.x += fTimeDelta; + + if (particleValue.vMaskingUVMoveTime.x >= particleValue.vMaskingUVMoveTime.x) + { + particleValue.vMaskingUVMoveTime.x = 0.f; + } + + + //디퓨즈 UV 움ì§�ìž„ + + particleValue.vDiffuseUVMoveTime.x += fTimeDelta; + + if (particleValue.vDiffuseUVMoveTime.x >= particleValue.vDiffuseUVMoveTime.x) + { + particleValue.vDiffuseUVMoveTime.x = 0.f; + } + + + //아웃풋 대입 + + ParticleOut.vRight = particle.vRight; + ParticleOut.vUp = particle.vUp; + ParticleOut.vLook = particle.vLook; + ParticleOut.vTranslation = particle.vTranslation; + ParticleOut.vLifeTime = particle.vLifeTime; + + ParticleOut.vMaskingUVMoveTime = particleValue.vMaskingUVMoveTime; + ParticleOut.vDiffuseUVMoveTime = particleValue.vDiffuseUVMoveTime; + ParticleOut.vAniTime = particleValue.vAniTime; + ParticleOut.vAniIndex = particleValue.vAniIndex; + + + g_ParticleBufferOutput[iIndex] = ParticleOut; } diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index 977124e60..f1f28be21 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -238,7 +238,7 @@ {5c89d610-7e57-40a5-bc65-04e5fa25df89} - + {b20c0397-6254-4350-bc83-ee695f9fd012} @@ -454,7 +454,7 @@ 02.Element\02.Component\02.VIBuffer\Terrain - 03.Management\21.PhysX_Manager\CCT + 02.Element\02.Component\08.Character_Controller 02.Element\01.GameObject\50.UI\CanvasObject @@ -1035,7 +1035,7 @@ 02.Element\02.Component\07.RigidBody - 03.Management\21.PhysX_Manager\CCT + 02.Element\02.Component\08.Character_Controller 02.Element\01.GameObject\50.UI\CanvasObject diff --git a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp index 82505c03b..141329b12 100644 --- a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp +++ b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp @@ -33,7 +33,7 @@ HRESULT CComputeShader::Initialize(const _tchar* pShaderFilePath, const _char* p return S_OK; } -HRESULT CComputeShader::Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer) +D3D11_MAPPED_SUBRESOURCE CComputeShader::Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer) { //VBBuffer-> dynamic , pConstantBuffer-> dynamic , m_pInputBuffer, m_pOutputBuffer-> default , m_pStagingBuffer-> Staging @@ -71,28 +71,22 @@ HRESULT CComputeShader::Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGrou //µðÆúÆ®-> ½ºÅ×ÀÌ¡ ¹öÆÛ´Â º¹»ç°¡ °¡´ÉÇÔ (´ÙÀ̳ª¹ÍÀº cpu ±â¹ÝÀÌ¶ó º¹»ç ¾ÈµÊ) //0¹ø ½ºÅ×ÀÌ¡ ¹öÆÛ°¡ ¾Æ¿ìDz ½ºÅ×ÀÌ¡ ¹öÆÛ¿Í °°À½ - m_pContext->CopyResource(m_pStagingBuffer[0], m_pOutputBuffer); + m_pContext->CopyResource(m_pOutputStagingBuffer, m_pOutputBuffer); //½ºÅ×ÀÌ¡ ¹öÆÛ¸¦ ¿­¾î¼­ Ä«ÇÇÇÔ D3D11_MAPPED_SUBRESOURCE StagingSubResource = {}; - D3D11_MAPPED_SUBRESOURCE OutSubResource = {}; + //D3D11_MAPPED_SUBRESOURCE OutSubResource = {}; - if (SUCCEEDED(m_pContext->Map(m_pStagingBuffer[0], 0, D3D11_MAP_READ, 0, &StagingSubResource))) + if (SUCCEEDED(m_pContext->Map(m_pOutputStagingBuffer, 0, D3D11_MAP_READ, 0, &StagingSubResource))) { - if (SUCCEEDED(m_pContext->Map(ppBuffers[0], 0, D3D11_MAP_WRITE_DISCARD, 0, &OutSubResource))) - { - memcpy(OutSubResource.pData, StagingSubResource.pData, m_iOutputStructStride * m_iNumElement); // ¾Æ¿ôDz ¹öÆÛ¿¡ µé¾î¿Â °ªµéÀ» ÀüºÎ º¹»çÇÑ´Ù. - - m_pContext->Unmap(ppBuffers[0], 0); - } - - m_pContext->Unmap(m_pStagingBuffer[0], 0); + + m_pContext->Unmap(m_pOutputStagingBuffer, 0); } Reset(); - return S_OK; + return StagingSubResource; } void CComputeShader::Bind_SRV(_uint iIndex) @@ -107,13 +101,21 @@ void CComputeShader::Bind_UAV(_uint iIndex) m_pContext->CSSetUnorderedAccessViews(iIndex, 1, &m_pOutputUAV, nullptr); } +void CComputeShader::Bind_OutPut_SRV(_uint iIndex) +{ + m_pContext->CSSetShaderResources(iIndex, // ½ÃÀÛ½½·Ô ¹øÈ£ + 1, // ¹öÆÛ °³¼ö + &m_pOutputSRV); // ¹öÆÛ ½ÃÀÛ ÁÖ¼Ò +} + void CComputeShader::Reset() { //´ÙÀ½ ·£´õ¸µ ÆÐ½º¿¡ ¿¬°üµÇÁö ¾Êµµ·Ï ÃʱâÈ­ ID3D11UnorderedAccessView* pResetUAV[1] = { nullptr }; - ID3D11ShaderResourceView* pResetSRV[1] = { nullptr }; + ID3D11ShaderResourceView* pResetSRV[2] = { nullptr, nullptr }; + m_pContext->CSSetUnorderedAccessViews(0, 1, pResetUAV, nullptr); - m_pContext->CSSetShaderResources(0, 1, pResetSRV); + m_pContext->CSSetShaderResources(0, 2, pResetSRV); m_pContext->CSSetShader(nullptr, nullptr, 0); } @@ -156,6 +158,7 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iNumInputBuffer, _ m_pStagingBuffer.push_back(pStagingBuffer); } + //¾Æ¿ôDz ¹öÆÛ D3D11_BUFFER_DESC Bufferdesc = {}; Bufferdesc.ByteWidth = m_iOutputStructStride * iNumElement; @@ -170,7 +173,19 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iNumInputBuffer, _ if(FAILED(m_pDevice->CreateBuffer(&Bufferdesc, nullptr, &m_pOutputBuffer))) return E_FAIL; + //¾Æ¿ôDz ½ºÅ×ÀÌ¡ ¹öÆÛ + D3D11_BUFFER_DESC OutPutStagingBufferDesc = {}; + OutPutStagingBufferDesc.Usage = D3D11_USAGE_STAGING; // ½ºÅ×ÀÌ¡ ¹öÆÛ + OutPutStagingBufferDesc.ByteWidth = m_iOutputStructStride * iNumElement; + OutPutStagingBufferDesc.StructureByteStride = m_iOutputStructStride; + OutPutStagingBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; + if (FAILED(m_pDevice->CreateBuffer(&OutPutStagingBufferDesc, nullptr, &m_pOutputStagingBuffer))) + return E_FAIL; + + + + return S_OK; @@ -188,7 +203,9 @@ HRESULT CComputeShader::CreateResurceViews(_uint iNumElement, _uint iNumInputBuf srvDesc.Format = DXGI_FORMAT_UNKNOWN; srvDesc.BufferEx.FirstElement = 0; srvDesc.BufferEx.NumElements = iNumElement; - m_pDevice->CreateShaderResourceView(m_pInputBuffer[i], &srvDesc, &pSrv); + + if (FAILED(m_pDevice->CreateShaderResourceView(m_pInputBuffer[i], &srvDesc, &pSrv))) + return E_FAIL; m_pInputSRV.push_back(pSrv); @@ -200,7 +217,20 @@ HRESULT CComputeShader::CreateResurceViews(_uint iNumElement, _uint iNumInputBuf uavDesc.Format = DXGI_FORMAT_UNKNOWN; uavDesc.Buffer.FirstElement = 0; uavDesc.Buffer.NumElements = iNumElement; - m_pDevice->CreateUnorderedAccessView(m_pOutputBuffer, &uavDesc, &m_pOutputUAV); + + if(FAILED(m_pDevice->CreateUnorderedAccessView(m_pOutputBuffer, &uavDesc, &m_pOutputUAV))) + return E_FAIL; + + //OUTPUT + + D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; + srvDesc.Format = DXGI_FORMAT_UNKNOWN; // StructuredBuffer´Â UNKNOWN + srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; + srvDesc.Buffer.NumElements = iNumElement; + srvDesc.BufferEx.FirstElement = 0; + + if (FAILED(m_pDevice->CreateShaderResourceView(m_pOutputBuffer, &srvDesc, &m_pOutputSRV))) + return E_FAIL; return S_OK; } diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index ad9b1f821..1070a60d9 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -90,10 +90,10 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De if (nullptr == m_pCollider_Manager) { return E_FAIL; } - //m_pPhysX_Manager = CPhysX_Manager::Create(*ppDevice, *ppContext); - //if (nullptr == m_pPhysX_Manager) { - // return E_FAIL; - //} + m_pPhysX_Manager = CPhysX_Manager::Create(*ppDevice, *ppContext); + if (nullptr == m_pPhysX_Manager) { + return E_FAIL; + } return S_OK; } @@ -117,7 +117,7 @@ void CGameInstance::Update_Engine(_float fTimeDelta) m_pLevel_Manager->Update(fTimeDelta); m_pObject_Manager->Clear_DeadObj(); - //m_pPhysX_Manager->Update(fTimeDelta); + m_pPhysX_Manager->Update(fTimeDelta); //m_pObstacle_Manager->Refresh_Region(); } @@ -450,6 +450,11 @@ HRESULT CGameInstance::Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilVi return m_pRenderTarget_Manager->Begin_MRT(strMRTTag, pDSV); } +HRESULT CGameInstance::Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV) +{ + return m_pRenderTarget_Manager->Begin_MRT_Include_BackBuffer(strMRTTag, pDSV); +} + HRESULT CGameInstance::End_MRT() { return m_pRenderTarget_Manager->End_MRT(); diff --git a/Jusin154_Team3D/Engine/Private/GameObject.cpp b/Jusin154_Team3D/Engine/Private/GameObject.cpp index 48ddbc7ba..df233fc89 100644 --- a/Jusin154_Team3D/Engine/Private/GameObject.cpp +++ b/Jusin154_Team3D/Engine/Private/GameObject.cpp @@ -78,7 +78,7 @@ HRESULT CGameObject::Add_Asset_Component(_uint iTargetLevel, const _wstring strP if (ppOut != nullptr) { *ppOut = pComponent; - Safe_AddRef(pComponent); + SAFE_ADDREF(pComponent); } diff --git a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp index 096218835..c78c04e27 100644 --- a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp @@ -176,7 +176,7 @@ HRESULT CInstance_Model::Initialize(void* pArg) }; m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext, - L"../Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl", "CS_MAIN", m_iNumInstance, 2, sizeof(VTX_INSTANCE_PARTICLE), CS_Strides); + L"../Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl", "CS_MAIN", m_iNumInstance, 2, sizeof(CS_PARTICLE_OUT), CS_Strides); if (m_pComputeShader == nullptr) return E_FAIL; @@ -211,8 +211,19 @@ void CInstance_Model::Drop(_float fTimeDelta) }; - m_pComputeShader->Dispatch(0, 0, _float3((_float)iGroupCountX, 1.f, 1.f), CSBuffers, m_pConstantBuffer); + D3D11_MAPPED_SUBRESOURCE OutSubResource = {}; + D3D11_MAPPED_SUBRESOURCE VBInstanceResource = {}; + OutSubResource = m_pComputeShader->Dispatch(0, 0, _float3((_float)iGroupCountX, 1.f, 1.f), CSBuffers, m_pConstantBuffer); + + if (SUCCEEDED(m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_DISCARD, 0, &VBInstanceResource))) + { + memcpy(VBInstanceResource.pData, OutSubResource.pData, m_iInstanceStride * m_InstanceDesc.iNumInstance); // ¾Æ¿ôDz ¹öÆÛ¿¡ µé¾î¿Â °ªµéÀ» ÀüºÎ º¹»çÇÑ´Ù. + + m_pContext->Unmap(m_pVBInstance, 0); + } + + //TODO:: º§·ù¹öÆÛ °»½Å ÇØ¾ßÇÔ , OutPut¹öÆÛ µÎ°³¸¸µé¾î¾ßÇÒµí.. } @@ -287,10 +298,13 @@ void CInstance_Model::Instane_Buffer_ReStruct() //¶óÀÌÇÁ ŸÀÓ ¼³Á¤ pVertices[i].vLifeTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vLifeTime.x, m_InstanceDesc.vLifeTime.y)); - - + + pParticleValues[i].vAniTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vAniTime.x, m_InstanceDesc.vAniTime.y)); + pParticleValues[i].vMaskingUVMoveTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vMaskingUVMoveTime.x, m_InstanceDesc.vMaskingUVMoveTime.y)); + pParticleValues[i].vDiffuseUVMoveTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vDiffuseUVMoveTime.x, m_InstanceDesc.vDiffuseUVMoveTime.y)); pParticleValues[i].fSpeed = m_pGameInstance->Random_Float(m_InstanceDesc.vSpeed.x, m_InstanceDesc.vSpeed.y); pParticleValues[i].fRotaionSpeed = m_pGameInstance->Random_Float(m_InstanceDesc.vRotationSpeed.x, m_InstanceDesc.vRotationSpeed.y); + pParticleValues[i].vAniIndex = _float2(0.f, m_InstanceDesc.vAniIndex.y); memcpy(&pParticleValues[i].vOriginRight, SRMatrix.m[0], sizeof(_float4)); memcpy(&pParticleValues[i].vOriginUp, SRMatrix.m[1], sizeof(_float4)); @@ -307,6 +321,17 @@ void CInstance_Model::Instane_Buffer_ReStruct() } +HRESULT CInstance_Model::Bind_CS_Output(_uint Index) +{ + if (m_pComputeShader == nullptr) + return E_FAIL; + + m_pComputeShader->Bind_OutPut_SRV(Index); + + return S_OK; +} + + #ifdef EDITOR_PROJECT CInstance_Model* CInstance_Model::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex) @@ -409,6 +434,25 @@ void CInstance_Model::Describe_Entity() Instane_Buffer_ReStruct(); } + if (ImGui::DragFloat2("DiffuseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDiffuseUVMoveTime))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat2("MaskingUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vMaskingUVMoveTime))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat2("AniTime", reinterpret_cast<_float*>(&m_InstanceDesc.vAniTime))) + { + Instane_Buffer_ReStruct(); + } + if (ImGui::DragFloat2("AniIndex", reinterpret_cast<_float*>(&m_InstanceDesc.vAniIndex))) + { + Instane_Buffer_ReStruct(); + } + ImGui::TreePop(); } diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp index 9d94115a1..7ad016816 100644 --- a/Jusin154_Team3D/Engine/Private/Material.cpp +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -113,7 +113,7 @@ HRESULT CMaterial::Read_MaterialFile(const _char* pMaterialFilePath, const _char if (!file.is_open()) { - MSG_BOX("Failed to Open Materail File"); + //MSG_BOX("Failed to Open Materail File"); //return E_FAIL; return S_OK; } diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 6ca5896fa..51a9a79a4 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -388,8 +388,9 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p if (!file.is_open()) { - MSG_BOX("Failed to Open Mesh File"); - return E_FAIL; + //MSG_BOX("Failed to Open Mesh File"); + /* LOD */ + return S_OK; } string strText = {}; @@ -827,13 +828,25 @@ HRESULT CModel::Initialize_Prototype() HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix) { - if (!LoadData(pModelFilePath)) + _char szTextureFileName[MAX_PATH] = {}; + _char szDir[MAX_PATH] = {}; + _char szName[MAX_PATH] = {}; + _char szEXT[MAX_PATH] = {}; + _splitpath_s(pModelFilePath, nullptr, 0, szDir, MAX_PATH, szName, MAX_PATH, szEXT, MAX_PATH); + + if (strcmp(".bin", szEXT) == 0) + { + LoadData(pModelFilePath); + } + else if (strcmp(".fbx", szEXT) == 0) { _char Temp[256]; - strcpy_s(Temp, pModelFilePath); - strcat_s(Temp,".fbx"); - Assimp_Model_Load(Temp, eType, PreTransformMatrix, 0); - SaveAssimpModel(pModelFilePath); + strcpy_s(Temp, szDir); + strcat_s(Temp, szName); + strcat_s(Temp, ".bin"); + Assimp_Model_Load(pModelFilePath, eType, PreTransformMatrix, 0); + SaveAssimpModel(Temp); + return S_OK; } m_pSaveModel = m_pGameInstance->Load_SaveModel(pModelFilePath); diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index 927708fda..7cb66e0dd 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -10,8 +10,10 @@ static PSX::PxTransform XMWorldToPx(const _matrix& WorldMatrix) _vector vPos, vRotq, vScale; XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix); + vRotq = XMQuaternionNormalize(vRotq); + PSX::PxTransform out; - XMStoreFloat3((_float3*)&out.p, WorldMatrix.r[3]); + XMStoreFloat3((_float3*)&out.p, vPos); XMStoreFloat4((_float4*)&out.q, vRotq); return out; @@ -78,13 +80,15 @@ const PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody) } - PSX::PxRigidStatic* pActor = m_pPhysics->createRigidStatic(pxWorldMatrix); pPxMeshGeometry; + PSX::PxRigidStatic* pActor = m_pPhysics->createRigidStatic(pxWorldMatrix); PSX::PxShape* pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *RigidBody.Get_PxMaterial()); pShape->setFlag(PSX::PxShapeFlag::eSCENE_QUERY_SHAPE, true); pShape->setFlag(PSX::PxShapeFlag::eSIMULATION_SHAPE, true); - - pActor->attachShape(*pShape); + + pActor->userData = &RigidBody; + m_RigidBodys.emplace_back(&RigidBody, pActor); + m_pScene->addActor(*pActor); return pActor; } @@ -133,9 +137,9 @@ HRESULT CPhysX_Manager::Create_TriangleMesh(const _wstring& wstrMeshKey, CMesh* return E_FAIL; } -PSX::PxTriangleMesh* CPhysX_Manager::Find_TriangleMesh(const _wstring& wstrFilePath) +PSX::PxTriangleMesh* CPhysX_Manager::Find_TriangleMesh(const _wstring& wstrMeshKey) { - map<_wstring, PSX::PxTriangleMesh*>::iterator iter = m_TriangleMeshes.find(wstrFilePath); + map<_wstring, PSX::PxTriangleMesh*>::iterator iter = m_TriangleMeshes.find(wstrMeshKey); if (iter != m_TriangleMeshes.end()) { return iter->second; } @@ -186,6 +190,9 @@ void CPhysX_Manager::Update_Dynamic() PSX::PxRigidDynamic* pActorDynamic = ppActiveActors[i]->is(); if (nullptr != pActorDynamic) { + if (nullptr == ppActiveActors[i]->userData) { + continue; + } CTransform* pTransform = ((CRigidBody*)ppActiveActors[i]->userData)->Get_PxTransformPtr(); PSX::PxTransform pPrevPxTransform; @@ -220,13 +227,13 @@ PSX::PxController* CPhysX_Manager::Add_BoxController(PSX::PxBoxControllerDesc& D PSX::PxController* pController = { nullptr }; pController = m_pCCTManager->createController(Desc); - //pController-> + return pController; } PSX::PxController* CPhysX_Manager::Get_Controller(_uint iControllerIndex) { - return nullptr; + return m_pCCTManager->getController((PSX::PxU32)iControllerIndex); } void CPhysX_Manager::ReleaseController(_uint iControllerIndex) @@ -253,7 +260,6 @@ HRESULT CPhysX_Manager::PurgeAllController() HRESULT CPhysX_Manager::Initialize() { - m_pFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, m_AllocatorCallBack, m_ErrorCallBack); if (nullptr == m_pFoundation) { assert(false); @@ -266,17 +272,23 @@ HRESULT CPhysX_Manager::Initialize() { // ¾À ¼¼ÆÃ - m_ToleranceScale.length = 1.f; - m_ToleranceScale.speed = GRAVITY; + m_ToleranceScale.length = 1.f; // 1 meter + m_ToleranceScale.speed = GRAVITY; // + m_pPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *m_pFoundation, m_ToleranceScale, true, m_pPvd); m_pCookingParam = new PSX::PxCookingParams(m_pPhysics->getTolerancesScale()); PSX::PxSceneDesc sceneDesc = { m_pPhysics->getTolerancesScale() }; - sceneDesc.gravity = PSX::PxVec3(0.f, GRAVITY, 0.f); + sceneDesc.gravity = PSX::PxVec3(0.f, -GRAVITY, 0.f); - sceneDesc.cpuDispatcher = m_pDispatcher = PSX::PxDefaultCpuDispatcherCreate(2/*cpu ÄÚ¾î °¹¼ö*/); + m_pDispatcher = PSX::PxDefaultCpuDispatcherCreate(2/*cpu ÄÚ¾î °¹¼ö*/); + if (nullptr == m_pDispatcher) { + assert(false); + return E_FAIL; + } + sceneDesc.cpuDispatcher = m_pDispatcher; sceneDesc.filterShader = PSX::PxDefaultSimulationFilterShader; @@ -298,26 +310,47 @@ HRESULT CPhysX_Manager::Initialize() pPvdClient->setScenePvdFlag(PSX::PxPvdSceneFlag::eTRANSMIT_SCENEQUERIES, true); } + //physx::PxMaterial* pMaterial = m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f); + //physx::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *pMaterial); + //m_pScene->addActor(*pGroundPlane); + + //{ + + // float halfExtent = .5f; + // physx::PxShape* shape = m_pPhysics->createShape(physx::PxSphereGeometry(halfExtent), *pMaterial); + // physx::PxU32 size = 100; + // physx::PxTransform pxTransform(physx::PxVec3(0)); + + // for (physx::PxU32 i = 0; i < size; i++) { + // for (physx::PxU32 j = 0; j < size - i; j++) { + // physx::PxTransform localTm(physx::PxVec3(physx::PxReal(j * 2) - physx::PxReal(size - i) + 100, physx::PxReal(i * 2 + 1), 0) * halfExtent); + // physx::PxRigidDynamic* body = m_pPhysics->createRigidDynamic(pxTransform.transform(localTm)); + // body->attachShape(*shape); + // physx::PxRigidBodyExt::updateMassAndInertia(*body, 10.0f); + // m_pScene->addActor(*body); + // } + // } + //} + return S_OK; } HRESULT CPhysX_Manager::Connect_DebugServer() { // ³×Æ®¿öÅ© µð¹ö°Å Àü¼Û°´Ã¼ »ý¼º - PSX::PxPvdTransport* pTransport = PSX::PxDefaultPvdSocketTransportCreate("127.0.0.1", 5425, 10); - if (nullptr == pTransport) { + m_pTransport = PSX::PxDefaultPvdSocketTransportCreate("127.0.0.1", 5425, 10); + if (nullptr == m_pTransport) { assert(false); return E_FAIL; } m_pPvd = PSX::PxCreatePvd(*m_pFoundation); if (nullptr == m_pPvd) { - pTransport->release(); + m_pTransport->release(); assert(false); return E_FAIL; } - m_pPvd->connect(*pTransport, PSX::PxPvdInstrumentationFlag::eALL); - pTransport->release(); + m_pPvd->connect(*m_pTransport, PSX::PxPvdInstrumentationFlag::eALL); return S_OK; } @@ -365,11 +398,14 @@ void CPhysX_Manager::Free() m_pPvd->release(); m_pPvd = nullptr; } + if (nullptr != m_pTransport) { + m_pTransport->release(); m_pTransport = nullptr; + } + if (nullptr != m_pFoundation) { m_pFoundation->release(); m_pFoundation = nullptr; } - __super::Free(); SAFE_RELEASE(m_pDevice); diff --git a/Jusin154_Team3D/Engine/Private/Picking.cpp b/Jusin154_Team3D/Engine/Private/Picking.cpp index 9cb0fe6cb..9d4ab103a 100644 --- a/Jusin154_Team3D/Engine/Private/Picking.cpp +++ b/Jusin154_Team3D/Engine/Private/Picking.cpp @@ -49,7 +49,8 @@ void CPicking::Update() m_pGameInstance->Copy_RenderTarget(TEXT("Target_Depth"), m_pTexture2D); D3D11_MAPPED_SUBRESOURCE SubResource{}; - m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_READ_WRITE, 0, &SubResource); + if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_READ_WRITE, 0, &SubResource))) + return; memcpy(m_pPixels, SubResource.pData, sizeof(_float4) * m_iNumPixels); diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp index 3c53c61b6..5460b242e 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp @@ -23,6 +23,7 @@ HRESULT CRenderTarget_Manager::Add_RenderTarget(const _wstring& strRenderTargetK m_RenderTargets.emplace(strRenderTargetKey, pRenderTarget); + return S_OK; } @@ -62,6 +63,7 @@ HRESULT CRenderTarget_Manager::Begin_MRT(const _wstring& strMultiRenderTargetKey ID3D11RenderTargetView* pRenderTargetViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = {}; m_pContext->OMSetRenderTargets(0, nullptr, nullptr); + if (nullptr != pDSV) { m_pContext->ClearDepthStencilView(pDSV, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.f, 0); } @@ -79,6 +81,39 @@ HRESULT CRenderTarget_Manager::Begin_MRT(const _wstring& strMultiRenderTargetKey return S_OK; } +HRESULT CRenderTarget_Manager::Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV) +{ + m_pContext->OMGetRenderTargets(1, &m_pBackBufferRTV, &m_pOriginalDSV); + + list* pMRTList = Find_MRT(strMRTTag); + + if (nullptr == pMRTList) + return E_FAIL; + + _uint iNumRenderTargets = { 0 }; + ID3D11RenderTargetView* pRenderTargetViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = {}; + + m_pContext->OMSetRenderTargets(0, nullptr, nullptr); + + if (nullptr != pDSV) { + m_pContext->ClearDepthStencilView(pDSV, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.f, 0); + } + + pRenderTargetViews[iNumRenderTargets++] = m_pBackBufferRTV; + + for (auto& pRenderTarget : *pMRTList) + { + pRenderTarget->Clear(); + pRenderTargetViews[iNumRenderTargets++] = pRenderTarget->Get_RTV(); + } + if (0 == iNumRenderTargets) { + return E_FAIL; + } + + m_pContext->OMSetRenderTargets(iNumRenderTargets, pRenderTargetViews, (nullptr == pDSV) ? m_pOriginalDSV : pDSV); + + return S_OK; +} HRESULT CRenderTarget_Manager::Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D) { CRenderTarget* pRenderTarget = Find_RenderTarget(strTargetTag); @@ -91,6 +126,7 @@ HRESULT CRenderTarget_Manager::Copy_RenderTarget(const _wstring& strTargetTag, I return S_OK; } + HRESULT CRenderTarget_Manager::End_MRT() { ID3D11RenderTargetView* pRenderTargets[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = { m_pBackBufferRTV }; @@ -137,6 +173,7 @@ HRESULT CRenderTarget_Manager::Render_RenderTarget_Debug(const _wstring& strMRTT return S_OK; } + #endif // _DEBUG CRenderTarget* CRenderTarget_Manager::Find_RenderTarget(const _wstring& strRenderTargetKey) diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index 3f44d493d..ab9d56085 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -110,6 +110,7 @@ void CRenderer::Render() Render_LightAcc(); Render_Blur(); Render_Combined(); + Render_Effect(); Render_NonLight(); Render_Blend(); Render_UI(); @@ -300,8 +301,6 @@ void CRenderer::Render_Combined() if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_X"), m_pShader, "g_BlurXTexture"))) { return; } - - } m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::COMBINED)); @@ -310,6 +309,28 @@ void CRenderer::Render_Combined() m_pVIBuffer->Render(); } +void CRenderer::Render_Effect() +{ + if (FAILED(m_pGameInstance->Begin_MRT_Include_BackBuffer(TEXT("MRT_Color")))) { + return; + } + + for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::EFFECT)]) + { + if (nullptr != pRenderObject) + pRenderObject->Render(); + + SAFE_RELEASE(pRenderObject); + } + + m_RenderObjects[ENUM_CLASS(RENDER::EFFECT)].clear(); + + + if (FAILED(m_pGameInstance->End_MRT())) { + return; + } +} + void CRenderer::Render_NonLight() { for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::NONLIGHT)]) @@ -417,18 +438,15 @@ void CRenderer::Render_LastColor() { // Bind_Resorces - m_pShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix); - m_pShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix); - m_pShader->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix); - m_pShader->Bind_Matrix("g_invMatView", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW_INV)); - m_pShader->Bind_Matrix("g_invmatProj", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ_INV)); + m_pLastColorShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix); + m_pLastColorShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix); + m_pLastColorShader->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix); - - if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Color"), m_pShader, "g_ColorTexture"))) { + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Color"), m_pLastColorShader, "g_ColorTexture"))) { return; } - m_pShader->Begin(ENUM_CLASS(0)); + m_pLastColorShader->Begin(0); m_pVIBuffer->Bind_Resources(); m_pVIBuffer->Render(); @@ -514,6 +532,9 @@ void CRenderer::Render_Debug() if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(TEXT("MRT_Blur_X"), m_pShader, m_pVIBuffer))){ return; } + if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(TEXT("MRT_Color"), m_pShader, m_pVIBuffer))) { + return; + } } #endif @@ -632,6 +653,11 @@ HRESULT CRenderer::Initialize() return E_FAIL; } + /* MRT_Color */ + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Color"), TEXT("Target_Color")))) { + return E_FAIL; + } + } m_pShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, TEXT("FX_DEFERRED"), nullptr, nullptr); if (nullptr == m_pShader) { @@ -657,37 +683,37 @@ HRESULT CRenderer::Initialize() XMStoreFloat4x4(&m_ProjMatrix, XMMatrixOrthographicLH(Viewport.Width, Viewport.Height, 0.f, 1.f)); #ifdef _DEBUG - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Diffuse"), 75.f, 75.f, 150.0f, 150.0f))) { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Normal"), 75.f, 225.f, 150.0f, 150.0f))) { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Shade"), 225.f, 75.f, 150.0f, 150.0f))) { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Specular"), 225.f, 225.f, 150.0f, 150.0f))) { + //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Diffuse"), 75.f, 75.f, 150.0f, 150.0f))) { + // return E_FAIL; + //} + //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Normal"), 75.f, 225.f, 150.0f, 150.0f))) { + // return E_FAIL; + //} + //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Shade"), 225.f, 75.f, 150.0f, 150.0f))) { + // return E_FAIL; + //} + //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Specular"), 225.f, 225.f, 150.0f, 150.0f))) { + // return E_FAIL; + //} + + if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Color"), 375.f, 225.f, 450.f, 450.0f))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Color"), 375.f, 75.f, 150.0f, 150.0f))) { - return E_FAIL; - } + //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Shadow"), Viewport.Width - 150.0f, 150.0f, 300.f, 300.f))) { + // return E_FAIL; + //} + //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_PreShadow"), Viewport.Width - 150.0f, Viewport.Height - 150.0f, 300.f, 300.f))) { + // return E_FAIL; + //} - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Shadow"), Viewport.Width - 150.0f, 150.0f, 300.f, 300.f))) { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_PreShadow"), Viewport.Width - 150.0f, Viewport.Height - 150.0f, 300.f, 300.f))) { - return E_FAIL; - } + //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur"), 150.0f, Viewport.Height - 150.0f, 300.f, 300.f))) { + // return E_FAIL; + //} - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur"), 150.0f, Viewport.Height - 150.0f, 300.f, 300.f))) { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur_X"), Viewport.Width * 0.75f, Viewport.Height * 0.75f, Viewport.Width * 0.5f, Viewport.Height * 0.5f))) { - return E_FAIL; - } + //if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur_X"), Viewport.Width * 0.75f, Viewport.Height * 0.75f, Viewport.Width * 0.5f, Viewport.Height * 0.5f))) { + // return E_FAIL; + //} diff --git a/Jusin154_Team3D/Engine/Private/RigidBody.cpp b/Jusin154_Team3D/Engine/Private/RigidBody.cpp index 36c12bb51..2ac92547e 100644 --- a/Jusin154_Team3D/Engine/Private/RigidBody.cpp +++ b/Jusin154_Team3D/Engine/Private/RigidBody.cpp @@ -6,8 +6,6 @@ CRigidBody::CRigidBody(ID3D11Device* pDevice, ID3D11DeviceContext* pContext): CComponent(pDevice, pContext) { - SAFE_ADDREF(pDevice); - SAFE_ADDREF(pContext); } CRigidBody::CRigidBody(const CRigidBody& rhs): @@ -16,10 +14,11 @@ CRigidBody::CRigidBody(const CRigidBody& rhs): m_eActorType(rhs.m_eActorType), m_vhalfGeometryInfo(rhs.m_vhalfGeometryInfo), m_pShape(rhs.m_pShape), - m_pMeshKey(rhs.m_pMeshKey) + m_pMeshKey(rhs.m_pMeshKey), + m_bExclusive(rhs.m_bExclusive), + m_bKinematic(rhs.m_bKinematic) { - m_pMaterial->acquireReference(); - m_pShape->acquireReference(); + } HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc) @@ -32,7 +31,8 @@ HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc) case ACTOR::SPHERE: m_pMaterial = m_pGameInstance->Get_Material(Desc.tRigidDynamicDesc.vMatInfo); m_vhalfGeometryInfo = Desc.tRigidDynamicDesc.vhalfGeometryInfo; - m_pShape = m_pGameInstance->Create_Shape(m_eActorType, m_vhalfGeometryInfo, *m_pMaterial, Desc.tRigidDynamicDesc.bExclusive, Desc.tRigidDynamicDesc.ePxShapeFlag); + m_bExclusive = Desc.tRigidDynamicDesc.bExclusive; + m_pShape = m_pGameInstance->Create_Shape(m_eActorType, m_vhalfGeometryInfo, *m_pMaterial, m_bExclusive, Desc.tRigidDynamicDesc.ePxShapeFlag); if (nullptr == m_pShape) { assert(false); m_pMaterial->release(); @@ -54,7 +54,6 @@ HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc) default: break; } - return S_OK; } @@ -65,6 +64,9 @@ HRESULT CRigidBody::Initialize(void* pArg) if (FAILED(__super::Initialize(pArg))) { return E_FAIL; } + if (true == m_bExclusive) { + return E_FAIL; + } m_pTransform = m_pOwner->Get_Component(); SAFE_ADDREF(m_pTransform); @@ -75,7 +77,7 @@ HRESULT CRigidBody::Initialize(void* pArg) case Engine::ACTOR::CAPSULE: case Engine::ACTOR::SPHERE: m_fDensity = pDesc->tRigidDynamicDesc.fDensity; - m_bKenematic = pDesc->tRigidDynamicDesc.bIsKinematic; + m_bKinematic = pDesc->tRigidDynamicDesc.bIsKinematic; m_pRigidBody = m_pGameInstance->Add_DynamicActor(*this); break; case Engine::ACTOR::PLANE: @@ -124,15 +126,6 @@ void CRigidBody::Free() { __super::Free(); - if (nullptr != m_pMaterial) { - m_pMaterial->release(); - m_pMaterial = nullptr; - } - if (nullptr != m_pShape) { - m_pShape->release(); - m_pShape = nullptr; - } - SAFE_RELEASE(m_pTransform); } diff --git a/Jusin154_Team3D/Engine/Public/ComputeShader.h b/Jusin154_Team3D/Engine/Public/ComputeShader.h index 5d61cdf3b..bb631d76c 100644 --- a/Jusin154_Team3D/Engine/Public/ComputeShader.h +++ b/Jusin154_Team3D/Engine/Public/ComputeShader.h @@ -15,8 +15,8 @@ class ENGINE_DLL CComputeShader final : public CBase public: HRESULT Initialize(const _tchar* pShaderFilePath, const _char* pStartFunctionName, _uint iNumElement, _uint iNumInputBuffer, _uint iOutputStructStride, _uint iInputStructStride[]); public: - HRESULT Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer = nullptr); - + D3D11_MAPPED_SUBRESOURCE Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer = nullptr); + void Bind_OutPut_SRV(_uint iIndex); private: void Bind_SRV(_uint iIndex); void Bind_UAV(_uint iIndex); @@ -39,8 +39,11 @@ class ENGINE_DLL CComputeShader final : public CBase ID3D11Buffer* m_pOutputBuffer = nullptr; vector m_pStagingBuffer = {}; + ID3D11Buffer* m_pOutputStagingBuffer = {}; ID3D11ComputeShader* m_pComputeShader = nullptr; + ID3D11ShaderResourceView* m_pOutputSRV = { nullptr }; + private: _uint m_iNumElement = 0; // Àμö °³¼ö _uint m_iNumInputBuffer = 0; // ÀÎDz ¹öÆÛÀÇ °³¼ö diff --git a/Jusin154_Team3D/Engine/Public/ContainerObject.h b/Jusin154_Team3D/Engine/Public/ContainerObject.h index b9e0c94f2..0c9339555 100644 --- a/Jusin154_Team3D/Engine/Public/ContainerObject.h +++ b/Jusin154_Team3D/Engine/Public/ContainerObject.h @@ -50,8 +50,10 @@ class ENGINE_DLL CContainerObject abstract : public CGameObject SAFE_RELEASE(pPartObject); return E_FAIL; } - *ppOut = pPartObject; - SAFE_ADDREF(pPartObject); + if (nullptr != ppOut) { + *ppOut = pPartObject; + SAFE_ADDREF(pPartObject); + } return S_OK; } diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index ba6ab196a..0ccf0fa01 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -5,7 +5,7 @@ NS_BEGIN(Engine) enum class STATE { RIGHT, UP, LOOK, POSITION, END }; enum class LIGHT { DIRECTIONAL, POINT, SPOT, END }; enum class COLLIDER { AABB, OBB, SPHERE, END }; -enum class RENDER { PRIORITY, SHADOW, NONBLEND, BLUR, NONLIGHT, BLEND, UI, END }; +enum class RENDER { PRIORITY, SHADOW, NONBLEND, BLUR, NONLIGHT, EFFECT ,BLEND, UI, END }; enum class RAY { LOCAL, WORLD, END }; enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END }; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Macro.h b/Jusin154_Team3D/Engine/Public/Engine_Macro.h index d037b4572..f25f1d8f5 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Macro.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Macro.h @@ -79,7 +79,9 @@ //} #define FLT_EPSILON3 1.192092896e-03F #define FLT_EPSILON5 1.192092896e-05F -#define GRAVITY -9.81f + +// GRAVITY ì�Œìˆ˜ 박으면 피ì§�스 로드 실패함 +#define GRAVITY 9.81f constexpr unsigned int g_iMaxShadowWidth = 16384; constexpr unsigned int g_iMaxShadowHeight = 9216; diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index d5a70c422..e156ec191 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -146,6 +146,7 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Add_RenderTarget(const _wstring& strRenderTargetKey, _uint iSizeX, _uint iSizeY, DXGI_FORMAT ePixelFormat, const _float4& vClearColor); HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey); HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr); + HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr); HRESULT End_MRT(); HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName); HRESULT Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D); diff --git a/Jusin154_Team3D/Engine/Public/Instance_Model.h b/Jusin154_Team3D/Engine/Public/Instance_Model.h index ffaa18034..15eb899d7 100644 --- a/Jusin154_Team3D/Engine/Public/Instance_Model.h +++ b/Jusin154_Team3D/Engine/Public/Instance_Model.h @@ -21,31 +21,56 @@ class ENGINE_DLL CInstance_Model final : public CComponent _float3 vCenter = {}; // ¼¾ÅÍ À§Ä¡ _float3 vRange = {}; // À§Ä¡ ¹üÀ§ + _float2 vMaskingUVMoveTime = {}; + _float2 vDiffuseUVMoveTime = {}; + _float2 vAniTime = {}; + _float2 vAniIndex = {}; + }INSTANCE_DESC; typedef struct tagCSParticleDesc { - _float fTimeDelta; - _float fPadding; - _float fPadding2; - _float fPadding3; + _float fTimeDelta = {}; + _float fPadding = {}; + _float fPadding2 = {}; + _float fPadding3 = {}; }CS_PARTICLE_DESC; typedef struct tagCSParticleValueDesc { - _float fSpeed; - _float fRotaionSpeed; + _float fSpeed = {}; + _float fRotaionSpeed = {}; - _float4 vOriginRight; - _float4 vOriginUp; - _float4 vOriginLook; - _float4 vOriginTranslation; + _float4 vOriginRight = {}; + _float4 vOriginUp = {}; + _float4 vOriginLook = {}; + _float4 vOriginTranslation = {}; - _float2 fPadding; + _float2 vMaskingUVMoveTime = {}; + _float2 vDiffuseUVMoveTime = {}; + _float2 vAniTime = {}; + + _float2 vAniIndex = {}; }CS_PARTICLE_VALUE_DESC; + + struct ParticleOut + { + _float4 vRight = {}; + _float4 vUp = {}; + _float4 vLook = {}; + _float4 vTranslation = {}; + _float2 vLifeTime = {}; + + _float2 vMaskingUVMoveTime = {}; + _float2 vDiffuseUVMoveTime = {}; + _float2 vAniTime = {}; + + _float2 vAniIndex = {}; + + }CS_PARTICLE_OUT; public: CInstance_Model(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CInstance_Model(const CInstance_Model& rhs); @@ -63,6 +88,7 @@ class ENGINE_DLL CInstance_Model final : public CComponent HRESULT Render(_uint iMeshIndx); void Instane_Buffer_ReStruct(); _uint Get_NumMeshes() const { return m_iNumMeshes; } + HRESULT Bind_CS_Output(_uint Index); private: #ifdef EDITOR_PROJECT HRESULT Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex); diff --git a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h index 04a3d2322..8d6a6eeed 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h +++ b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h @@ -27,7 +27,7 @@ class CPhysX_Manager final : public CBase PSX::PxShape* Create_Shape(ACTOR eType, _float3& vhalfGeometryInfo, PSX::PxMaterial& pxMaterial, _bool bExclusive, PSX::PxShapeFlags ePxShapeFlag); HRESULT Create_TriangleMesh(const _wstring& wstrMeshKey, CMesh* pMesh); - PSX::PxTriangleMesh* Find_TriangleMesh(const _wstring& wstrFilePath); + PSX::PxTriangleMesh* Find_TriangleMesh(const _wstring& wstrMeshKey); void Update(_float fTimeDelta); void ClearScene(); @@ -65,6 +65,8 @@ class CPhysX_Manager final : public CBase PSX::PxControllerManager* m_pCCTManager = { nullptr }; // ÇÇÁ÷½º ij¸¯ÅÍ ÄÁÆ®·Ñ·¯¸¦ ÀüºÎ ÃßÀûÇÏ°í ¸Å´Ï¡ÇÔ PSX::PxPvd* m_pPvd = { nullptr }; // ÇÇÁ÷½º ½Ã¹Ä·¹ÀÌ¼Ç µð¹ö±ëÀ» À§ÇÑ µµ±¸ PSX::PxCookingParams* m_pCookingParam = { nullptr }; + PSX::PxPvdTransport* m_pTransport = { nullptr }; + list> m_RigidBodys = { }; diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h index 6a21668de..58e4d421f 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h @@ -13,6 +13,7 @@ class CRenderTarget_Manager final : public CBase HRESULT Add_RenderTarget(const _wstring& strRenderTargetKey, _uint iSizeX, _uint iSizeY, DXGI_FORMAT ePixelFormat, const _float4& vClearColor); HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey); HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV); + HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV); HRESULT End_MRT(); HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName); HRESULT Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D); diff --git a/Jusin154_Team3D/Engine/Public/Renderer.h b/Jusin154_Team3D/Engine/Public/Renderer.h index a7904dccb..0bf44c262 100644 --- a/Jusin154_Team3D/Engine/Public/Renderer.h +++ b/Jusin154_Team3D/Engine/Public/Renderer.h @@ -58,6 +58,7 @@ class CRenderer final : public CBase void Render_LightAcc(); void Render_Blur(); void Render_Combined(); + void Render_Effect(); void Render_NonLight(); void Render_Blend(); void Render_UI(); diff --git a/Jusin154_Team3D/Engine/Public/RigidBody.h b/Jusin154_Team3D/Engine/Public/RigidBody.h index 81fcb3941..06178f4b6 100644 --- a/Jusin154_Team3D/Engine/Public/RigidBody.h +++ b/Jusin154_Team3D/Engine/Public/RigidBody.h @@ -72,7 +72,7 @@ class ENGINE_DLL CRigidBody final : public CComponent const PSX::PxMaterial* Get_PxMaterial() const { return m_pMaterial; } _float Get_Density() const { return m_fDensity; } - _bool Is_Kinematic() const { return m_bKenematic; } + _bool Is_Kinematic() const { return m_bKinematic; } private: ACTOR m_eActorType = ACTOR::END; @@ -81,7 +81,8 @@ class ENGINE_DLL CRigidBody final : public CComponent PSX::PxShape* m_pShape = { nullptr }; // ÇÇÁ÷½º °´Ã¼ÀÇ ¸ð¾ç ( ¸ÓÅ׸®¾ó·Î ¸¸µé¾îÁü ) _float3 m_vhalfGeometryInfo = {}; CTransform* m_pTransform = { nullptr }; - _bool m_bKenematic = { false }; + _bool m_bKinematic = { false }; + _bool m_bExclusive = { false }; _float m_fDensity = { 1000.f }; const _tchar* m_pMeshKey = { nullptr };