From bba4268e896ac5ceed0629311a4e0c45ae6fd7c7 Mon Sep 17 00:00:00 2001 From: GiJungSUk Date: Fri, 21 Nov 2025 21:54:53 +0900 Subject: [PATCH] 1121_2154 --- .../ShaderFiles/Shader_Particle_Compute.hlsl | 37 +++- .../Resources/Data/Effect/BasicParticle2.bin | 4 +- .../Resources/Data/Effect/BlustParticle.bin | 4 +- .../Resources/Data/Effect/FireProjectile.bin | 3 - .../Editor/Bin/Resources/Data/Effect/Ice.bin | 3 - .../Bin/Resources/Data/Effect/JapImpact.bin | 4 +- .../Bin/Resources/Data/Effect/JapLight.bin | 3 + .../Resources/Data/Effect/JapParticle1.bin | 3 + .../Resources/Data/Effect/JapProjectile.bin | 4 +- .../Resources/Data/Effect/JapProjectile2.bin | 3 + .../Data/Effect/LightProjectile1.bin | 4 +- .../Data/Effect/LightProjectile2.bin | 4 +- .../Data/Effect/LightProjectileCircle1.bin | 4 +- .../Data/Effect/LightProjectileMiddle.bin | 4 +- .../Resources/Data/Effect/MagicProjectile.bin | 4 +- .../Resources/Data/Effect/Package/Jap2.bin | 3 + .../Resources/Data/Effect/Package/Jap3.bin | 3 + .../Bin/Resources/Data/Effect/Smoke0.bin | 3 - .../Bin/Resources/Data/Effect/Smoke1.bin | 3 + .../Editor/Bin/Resources/Data/Effect/Test.bin | 4 +- .../Data/Effect/임시공간/BasicParticle2.bin | 4 +- .../Data/Effect/임시공간/BlustParticle.bin | 4 +- .../Data/Effect/임시공간/FireProjectile.bin | 3 - .../Resources/Data/Effect/임시공간/Ice.bin | 3 - .../Data/Effect/임시공간/JapImpact.bin | 4 +- .../Data/Effect/임시공간/JapLight.bin | 3 + .../Data/Effect/임시공간/JapParticle1.bin | 3 + .../Data/Effect/임시공간/JapProjectile.bin | 4 +- .../Data/Effect/임시공간/JapProjectile2.bin | 3 + .../Data/Effect/임시공간/LightProjectile1.bin | 4 +- .../Data/Effect/임시공간/LightProjectile2.bin | 4 +- .../임시공간/LightProjectileCircle1.bin | 4 +- .../Effect/임시공간/LightProjectileMiddle.bin | 4 +- .../Data/Effect/임시공간/MagicProjectile.bin | 4 +- .../Data/Effect/임시공간/Projectile0.bin | 3 - .../Resources/Data/Effect/임시공간/Smoke0.bin | 3 - .../Resources/Data/Effect/임시공간/Smoke1.bin | 3 + .../Resources/Data/Effect/임시공간/Test.bin | 3 + .../Data/Effect/임시공간/TrailTest.bin | 3 - .../ShaderFiles/Engine_Shader_Functions.hlsli | 48 +++++ .../ShaderFiles/Shader_Particle_Compute.hlsl | 37 +++- .../ShaderFiles/Shader_VtxModelInstance.hlsl | 171 ++++++++++++------ Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp | 2 +- .../Editor/Private/Dummy_PhysXPlayable.cpp | 12 ++ Jusin154_Team3D/Editor/Private/EditEffect.cpp | 37 ++-- .../Editor/Private/EffectObject.cpp | 83 ++++++--- .../Editor/Private/Effect_Editor.cpp | 6 +- Jusin154_Team3D/Editor/Private/NomalJap.cpp | 4 +- Jusin154_Team3D/Editor/Private/TestEffect.cpp | 2 +- .../Editor/Private/TrailObject.cpp | 2 + Jusin154_Team3D/Editor/Public/EffectObject.h | 10 + .../ShaderFiles/Engine_Shader_Functions.hlsli | 48 +++++ .../ShaderFiles/Shader_Particle_Compute.hlsl | 37 +++- .../Engine/Private/ComputeShader.cpp | 2 +- .../Engine/Private/Instance_Model.cpp | 27 ++- Jusin154_Team3D/Engine/Public/ComputeShader.h | 2 +- .../Engine/Public/Instance_Model.h | 21 ++- 57 files changed, 530 insertions(+), 191 deletions(-) delete mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/FireProjectile.bin delete mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ice.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapLight.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapParticle1.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile2.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap2.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap3.bin delete mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke0.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke1.bin delete mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/FireProjectile.bin delete mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Ice.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapLight.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapParticle1.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile2.bin delete mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Projectile0.bin delete mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke0.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke1.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Test.bin delete mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/TrailTest.bin 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 0dea26c43..4212f3194 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -1,5 +1,4 @@ - -float PI = 3.141592; +#include "Engine_Shader_Functions.hlsli" struct Particle { @@ -30,7 +29,8 @@ struct ParticleValue float2 vAniIndex; float fGravity; - float3 vSinAmount; + float3 vSinAmount; + float3 vDeltaAngle; }; @@ -48,6 +48,11 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐 bool isDrop; bool isMoveForward; bool isSinWave; + + bool IsTurn; + bool isPadding1; + bool isPadding2; + bool isPadding3; float fTimeDelta; float fPadding1; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다. @@ -74,8 +79,6 @@ void CS_MAIN( { if (isLoop == false) { - - return; } @@ -92,7 +95,7 @@ void CS_MAIN( if (isMoveForward) { - float4 vVelocity = vector(normalize(particleValue.vOriginLook.xyz) * particleValue.fSpeed, 1.f); + float4 vVelocity = vector(normalize(particle.vLook.xyz) * particleValue.fSpeed, 1.f); particle.vTranslation += vVelocity * fTimeDelta; } @@ -107,6 +110,28 @@ void CS_MAIN( { particle.vTranslation += vector( sin(particle.vLifeTime.x * 3.141592 * 2.f) * particleValue.vSinAmount, 0.f); } + + if (IsTurn == true) + { + /* ROTATE */ + float4x4 RotateXMat = RotateX(particleValue.vDeltaAngle.x * fTimeDelta); + float4x4 RotateYMat = RotateY(particleValue.vDeltaAngle.y * fTimeDelta); + float4x4 RotateZMat = RotateZ(particleValue.vDeltaAngle.z * fTimeDelta); + + + float4x4 CombinedRotMat = mul(RotateZMat, mul(RotateYMat, RotateXMat)); + + float4x4 CurRotatemat = {particle.vRight, particle.vUp, particle.vLook, vector(0.f , 0.f, 0.f, 1.f)}; + + + + CurRotatemat = mul(CombinedRotMat, CurRotatemat); + + particle.vRight = CurRotatemat[0].xyzw; + particle.vUp = CurRotatemat[1].xyzw; + particle.vLook = CurRotatemat[2].xyzw; + + } //애니메이션 속도 , 인덱스 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin index 6183fa29e..6fcefc8cb 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BasicParticle2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2555c12dba2f21a7e6665e808215b101554346d4d4188a0492e820092cb14977 -size 606 +oid sha256:33324ff2060094ec06bbc3f5e4f961fc8590a2c9b96f3cb8117099b7bead139f +size 642 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin index a846374c5..6cc4cd5ae 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BlustParticle.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:78c6852c3ec3ad9c51c2d509e16ec3304fbd98540971931caeab1f1bc68c0697 -size 606 +oid sha256:cfb9dbdea82faf9d7292fc8e27cc27ddf3885e6980b51f903047b5a80a143903 +size 587 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/FireProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/FireProjectile.bin deleted file mode 100644 index 200c53dfb..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/FireProjectile.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bdb7c592a817c35876780fe2dab7490ec8c5849e3e952abe27a67da358111e0e -size 636 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ice.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ice.bin deleted file mode 100644 index edd508f8f..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ice.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:35cd480b8bfa4770b41f97451a691de39f33b5a985890648f18daacf4cc348c7 -size 529 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapImpact.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapImpact.bin index 105617a53..68742a413 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapImpact.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapImpact.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:828c5c1282287b21341ca4cc866b70f4507da74bcfef21e80f56c1ed0c97a327 -size 659 +oid sha256:655010e74ac2158c2e6e170b3227b999e7bb79c6d4ddb47711977ea2d3b45f6c +size 695 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapLight.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapLight.bin new file mode 100644 index 000000000..1232f54a1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapLight.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c1159a04cf6e0047408eac52f4c6cd97b870b366ebe1d8467d53be145bf4abc +size 640 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapParticle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapParticle1.bin new file mode 100644 index 000000000..64eb0211d --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapParticle1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a17db24b692c3fb97b865374497a88e3d40f752d6ca48f9e63698fa24a3ef36 +size 588 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile.bin index c5fcd5952..e335f47c4 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f4a18da098b58c4f873061ac055c96293ea49b224c2399554f6b66e75fed9e8a -size 642 +oid sha256:bf41ba2f46bf12e91ae80a9c4a113a3fcc257f0ec7f1008b429208ef2bdae03a +size 678 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile2.bin new file mode 100644 index 000000000..401729889 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/JapProjectile2.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c71e23d34b8e56af41a35bac92e7ac43f3863b948ac9b2e976400834c26d86b2 +size 635 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin index d0836eddc..5f1be16de 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0176747fde1a4de3b5993b84176737660b36aec02e85c4e17a14ce87cfd30f5e -size 595 +oid sha256:675facff7ddb1f7a87ffb6922d81096875882a994f9d3bbc23b40f3dc0072184 +size 631 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin index 40b1db580..fee26ef6d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectile2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:be6c55af6431d3dc243574715c75817a5e42690c33bc08fbf72f692cf0de4fb7 -size 605 +oid sha256:a9a07e170e2ba63cd9d51f2815302bc8ff4ee342dfa6c3ca735c98801e7b7a6d +size 641 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin index 35a738020..45cb6facd 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileCircle1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:66d01cfcb231ffc12115f17e77894ddfe1cd179c5d16c7613fd689a7ddc05cb2 -size 550 +oid sha256:f9e01835b6ca1bf0901bd5a435186a2bf211597a50a8e77ef66df9f502bee2c6 +size 586 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin index 9c6a67e85..0504e4a3d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LightProjectileMiddle.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e75c29761f461e275e42fb74cf608a11b31c76d0e1d504cf7926a1b9211db74 -size 607 +oid sha256:fec289dab288362787c36d9a187219f61babb97a6dcabd00aad046f5a3965e03 +size 643 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MagicProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MagicProjectile.bin index 78a0bf3a2..1d47abd1c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MagicProjectile.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MagicProjectile.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1a6a790f7299ea457a56c0c9a711e3b10ed2905eb86a10946be78704305a09cc -size 634 +oid sha256:cbe853fd71b771fdc12c4c15ac66ee5d39d7a1baad42bfaa83339eac98514025 +size 670 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap2.bin new file mode 100644 index 000000000..4bf1f68b3 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap2.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6091a75b6a0306f07a76699af2d033104315ec52205cdfdd3f633cd9a36ea77d +size 174 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap3.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap3.bin new file mode 100644 index 000000000..20aafc905 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Jap3.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58315360932a699e60721381028c74c9e28f29dd38e8ceaf0c501ee056d7bf0c +size 228 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke0.bin deleted file mode 100644 index 070ef03e6..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke0.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:642666d3fbe73ddb73f32e1d8647b81b79d90fe2cd00fbb315f117b546194fc8 -size 606 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke1.bin new file mode 100644 index 000000000..ae894bd68 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Smoke1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3db2fd3373fcd0498c2511579f370a9c7e0f379bd31fd0cc5d2a86e970442387 +size 640 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin index f12d2d4ac..247628033 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a9e94f9b76f314c1d3b6537ac73ab2035247c6cff7cca94ba355313569eba2d3 -size 642 +oid sha256:da59ec056c37de150309c542ddd431a058c8b20eaad6302c0e7a2a0c852f453e +size 635 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle2.bin index d3e2ee6f1..d5749ac8c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BasicParticle2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a1b8dbceb9ca07dc22e4737226a682a7a8db90860fe75ee7451d90ba30941797 -size 606 +oid sha256:c6a85af24f40fd29ac155d818851d15f21659aa5cd339c34b3b2daaf2833f446 +size 614 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BlustParticle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BlustParticle.bin index 11d068b9d..8c8f9cfc9 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BlustParticle.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/BlustParticle.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:632fe36b935690a2838c92bb8be312d5d763a171423cae41e99dcfd8ba0bd445 -size 606 +oid sha256:2e5b06298607ab3b2e70a7e5cb1d60fc1c3e42985f4c3329a9b0adfd99694b70 +size 559 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/FireProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/FireProjectile.bin deleted file mode 100644 index 382829e76..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/FireProjectile.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7ded4807087aa32efaf780f2466e9bcd25dbf771c61e58eeb30b4ec1fbc9f451 -size 636 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Ice.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Ice.bin deleted file mode 100644 index 7523b1838..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Ice.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba8f4656956e753b0378a2d8f6ce2f8dfa73014e885a59e8890cdedfd28daad2 -size 529 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapImpact.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapImpact.bin index 105617a53..c38e43cca 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapImpact.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapImpact.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:828c5c1282287b21341ca4cc866b70f4507da74bcfef21e80f56c1ed0c97a327 -size 659 +oid sha256:578d053ea11ef3573689b4b3f5ae2ab9e7a0b2773cd20b98364c8cf815cfef7a +size 667 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapLight.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapLight.bin new file mode 100644 index 000000000..1da980370 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapLight.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45a4ae620b249fa4a7d0a11b57c991c9292b6516dedb004233917fcb236491a4 +size 612 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapParticle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapParticle1.bin new file mode 100644 index 000000000..bd0cd594d --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapParticle1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8a69fbf03cf611f14d120b4233281c5441c141cce967a34bb0a0ffb5d75421e +size 560 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile.bin index 049eb352e..e9c00fe41 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b219de38477c95013742c4d3110c679380c3e147589a067ab8d2aceaeaf0c440 -size 642 +oid sha256:c937129c7c7b817fa5da26f31114fa6196d2a9a636249c080f88a227fc19b4f9 +size 650 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile2.bin new file mode 100644 index 000000000..e5a43541e --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/JapProjectile2.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29e377b84488c530efa60ca6849215cd252a41617e214144acf39ec440166799 +size 607 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile1.bin index c15925e85..d8e15f979 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:937ae454ea27b326ccc519afd84314adab8c658009e609f8217c525d26cdfb72 -size 595 +oid sha256:985580cbc2a60ad0adf44066bf6289113cfee5a060b116d8212ee7229bdf5fdf +size 603 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile2.bin index 5225655a0..ead06d755 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectile2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:51af73356e47c2cfed59bd5d09728335e3cee1311e0790610c68cf86d8f32f83 -size 605 +oid sha256:90807d935e97d1397e0e06268ae8033f31e56b8555cfa5ebb754d75ba53605ec +size 613 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileCircle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileCircle1.bin index 759a4f369..45b3ae031 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileCircle1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileCircle1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d81d1f57e021bd726103dbc896bca49c1cfcadac7366ca055b1067b9361132c1 -size 550 +oid sha256:0d84e7ef14cc880db3ecc1c9f7401ead81900aab6d2abe6347017e06c53aa13a +size 558 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileMiddle.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileMiddle.bin index 68b463e39..48ba557a3 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileMiddle.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/LightProjectileMiddle.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:26f5717dbfd5055a0b606134b5dd343e3f77bc02c3acfb3bbf50d3ecc1015bfd -size 607 +oid sha256:283dc1ff9d9586506d5da462122cdc817d08df43e388a08f87081c06e0bc2441 +size 615 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/MagicProjectile.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/MagicProjectile.bin index ce9742895..30134e743 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/MagicProjectile.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/MagicProjectile.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7806c0cc6f06d1b5dde93aeb8da7b7e36ead2684b56d9697d445c4e1781bd975 -size 634 +oid sha256:49b7312bb19a14fce3ec8db147e5375020a319946e2f258070dc542f1c68bda7 +size 642 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Projectile0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Projectile0.bin deleted file mode 100644 index 9119bfe76..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Projectile0.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1b72b06e1ce45740d09f46a051b0f99a4aaa53f057af0bc8ffbd74b78cd18b6f -size 633 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke0.bin deleted file mode 100644 index 070ef03e6..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke0.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:642666d3fbe73ddb73f32e1d8647b81b79d90fe2cd00fbb315f117b546194fc8 -size 606 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke1.bin new file mode 100644 index 000000000..240b21e2f --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Smoke1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea5374fad8d511a6af141b7349968fc2d3c1830c799cd8fdda51a9ccf53ee127 +size 612 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Test.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Test.bin new file mode 100644 index 000000000..154bcc41b --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/Test.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b1f81d39c4b0cb910417a9cf43895bc1e2aa28300469c89ead3d368700ce97a +size 607 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/TrailTest.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/TrailTest.bin deleted file mode 100644 index a727116fa..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/임시공간/TrailTest.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a855f032a53ad0b5a1efd023bb02e4ffa10df3deeced2e5fd049a15615adfefc -size 550 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli index f16a08d3c..6a7c952fc 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -181,5 +181,53 @@ float3 DecodeNormalFromRG(Texture2D NormalMap, SamplerState Samp, float2 uv) return normalize(n); } +float4x4 RotateX(float fAngle) +{ + float fCos = cos(radians(fAngle)); + float fSin = sin(radians(fAngle)); + + float4x4 RotateXMat = + { + 1, 0, 0, 0, + 0, fCos, -fSin, 0, + 0, fSin, fCos, 0, + 0, 0, 0, 1, + }; + + return RotateXMat; +} + +float4x4 RotateY(float fAngle) +{ + float fCos = cos(radians(fAngle)); + float fSin = sin(radians(fAngle)); + + float4x4 RotateYMat = + { + fCos , 0, fSin, 0, + 0 , 1, 0, 0, + -fSin , 0, fCos, 0, + 0 , 0, 0, 1 + }; + + return RotateYMat; +} + +float4x4 RotateZ(float fAngle) +{ + float fCos = cos(radians(fAngle)); + float fSin = sin(radians(fAngle)); + + float4x4 RotateZMat = + { + fCos, -fSin, 0, 0, + fSin, fCos, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1, + }; + + return RotateZMat; +} + #endif // ENGINE_SHADER_FUNCTIONS_HLSLI 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 0dea26c43..4212f3194 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -1,5 +1,4 @@ - -float PI = 3.141592; +#include "Engine_Shader_Functions.hlsli" struct Particle { @@ -30,7 +29,8 @@ struct ParticleValue float2 vAniIndex; float fGravity; - float3 vSinAmount; + float3 vSinAmount; + float3 vDeltaAngle; }; @@ -48,6 +48,11 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐 bool isDrop; bool isMoveForward; bool isSinWave; + + bool IsTurn; + bool isPadding1; + bool isPadding2; + bool isPadding3; float fTimeDelta; float fPadding1; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다. @@ -74,8 +79,6 @@ void CS_MAIN( { if (isLoop == false) { - - return; } @@ -92,7 +95,7 @@ void CS_MAIN( if (isMoveForward) { - float4 vVelocity = vector(normalize(particleValue.vOriginLook.xyz) * particleValue.fSpeed, 1.f); + float4 vVelocity = vector(normalize(particle.vLook.xyz) * particleValue.fSpeed, 1.f); particle.vTranslation += vVelocity * fTimeDelta; } @@ -107,6 +110,28 @@ void CS_MAIN( { particle.vTranslation += vector( sin(particle.vLifeTime.x * 3.141592 * 2.f) * particleValue.vSinAmount, 0.f); } + + if (IsTurn == true) + { + /* ROTATE */ + float4x4 RotateXMat = RotateX(particleValue.vDeltaAngle.x * fTimeDelta); + float4x4 RotateYMat = RotateY(particleValue.vDeltaAngle.y * fTimeDelta); + float4x4 RotateZMat = RotateZ(particleValue.vDeltaAngle.z * fTimeDelta); + + + float4x4 CombinedRotMat = mul(RotateZMat, mul(RotateYMat, RotateXMat)); + + float4x4 CurRotatemat = {particle.vRight, particle.vUp, particle.vLook, vector(0.f , 0.f, 0.f, 1.f)}; + + + + CurRotatemat = mul(CombinedRotMat, CurRotatemat); + + particle.vRight = CurRotatemat[0].xyzw; + particle.vUp = CurRotatemat[1].xyzw; + particle.vLook = CurRotatemat[2].xyzw; + + } //애니메이션 속도 , 인덱스 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index 01cc9d648..8b583a521 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -17,6 +17,10 @@ struct ParticleValue float2 vAniTime; float2 vAniIndex; + float fGravity; + + float3 vSinAmount; + float3 vDeltaAngle; }; @@ -83,6 +87,11 @@ bool g_isNoiseUVMove; bool g_isReverseDissolve; bool g_isEmissiveDissolve; +bool g_isMaskClampSample; + +bool g_isNoiseColor; +bool g_isNoiseAlpha; +bool g_isNomalDissolve; float g_fFar; @@ -161,7 +170,7 @@ VS_OUT VS_MAIN(VS_IN In, uint iGPUIndex : SV_InstanceID) matrix matW, matWV, matWVP; - matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); + row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); matW = mul(TransformMatrix, g_WorldMatrix); matWV = mul(matW, g_ViewMatrix); @@ -230,6 +239,7 @@ PS_OUT BlendedWeight(vector fDiffuse, float fLinearZ) float fWeight = clamp(pow(fLinearZ, -2.5f), 1.0f, 1000.0f); + Out.vDiffuse = vector(vColor.rgb * fAlpha, fAlpha) * fWeight; @@ -277,7 +287,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vector vMtrlDissolve; vector vMtrlDistortion; - float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x; + float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x; float2 vDiffuseTime = g_ParticleValue[In.iGPUIndex].vDiffuseUVMoveTime; float2 vMaskingTime = g_ParticleValue[In.iGPUIndex].vMaskingUVMoveTime; float2 vNoiseUVMoveTime = g_ParticleValue[In.iGPUIndex].vNoiseUVMoveTime; @@ -287,7 +297,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) { float2 UV; // 이미지의 UV값 - UV = UV_Cutting(In.vTexcoord, g_vUVCutting, int(fAnimIndex.x)); + UV = UV_Cutting(In.vTexcoord, g_vUVCutting, int(fAnimIndex)); if (g_isDiffuseUVMove) { @@ -334,13 +344,18 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) if(g_isNoise) { - float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iNoiseMoveLerpOption); + float2 vNoiseUV = In.vTexcoord; + + if (g_isNoiseUVMove == true) + vNoiseUV = In.vTexcoord + SelectLerpUV(g_vNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iNoiseMoveLerpOption); vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV); - vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r); + if (g_isNoiseAlpha) + vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r); - vMtrlDiffuse *= vMtrlNoise; + if (g_isNoiseColor) + vMtrlDiffuse *= vMtrlNoise; } /* 마스크 */ @@ -348,7 +363,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) { float2 vMaskTexcoord = In.vTexcoord; - vMaskTexcoord = UV_Cutting(In.vTexcoord, g_vUVMaskCutting, int(fAnimIndex.x)); + vMaskTexcoord = UV_Cutting(In.vTexcoord, g_vUVMaskCutting, int(fAnimIndex)); // 마스크 디스토션 if (g_isDistortion == true) @@ -370,8 +385,10 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vMaskTexcoord += SelectLerpUV(g_vMaskingUVGainAmount / g_vUVMaskCutting, (vMaskingTime.x / vMaskingTime.y), g_iMaskMoveLerpOption); } - vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord); - + if (g_isMaskClampSample == true) + vMtrlMask = g_MaskingTexture.Sample(ClampSampler, vMaskTexcoord); + else + vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord); } else { @@ -387,35 +404,31 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) if (vMtrlDiffuse.a <= 0.f) discard; + vMtrlDiffuse.a *= g_fDiffuseAlpha; + if (g_isDissolve == true) { - vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); - - if(g_isReverseDissolve == true) + if (g_isNomalDissolve) { - if (vMtrlDissolve.r >= (In.vLifeTime.x / In.vLifeTime.y)) - discard; + vMtrlDiffuse.a *= (0.95f - In.vLifeTime.x / In.vLifeTime.y); } else { - if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y)) - discard; + vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); + + if (g_isReverseDissolve == true) + { + if (vMtrlDissolve.r >= (In.vLifeTime.x / In.vLifeTime.y)) + discard; + } + else + { + if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y)) + discard; + } } - - - } - vMtrlDiffuse.a *= g_fDiffuseAlpha; - - // 색깔 추가할 처리 (이미시브) - - float4 vEmissiveMtrl = vector(0.f ,0.f ,0.f ,0.f); - - if (g_isEmissive == true) - { - vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); - } int2 iTexel = int2(In.vPosition.xy); @@ -430,22 +443,36 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) Out = BlendedWeight(vMtrlDiffuse, In.vProjPos.w); + // 색깔 추가할 처리 (이미시브) + + float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f); + + if (g_isEmissive == true) + { + vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); + } + else + { + vEmissiveMtrl = g_vEmissive; + } + float fEmissiveCutAlpha = g_fEmissiveCutAlpha; + + if (g_fEmissiveCutAlpha >= vMtrlDiffuse.a) + { + + Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); + + return Out; + } if (g_isEmissiveDissolve == true) { - fEmissiveCutAlpha += (In.vLifeTime.x / In.vLifeTime.y) / 2; + vEmissiveMtrl *= (1.f - In.vLifeTime.x / In.vLifeTime.y); } - - float fSmoothAlpha = smoothstep(fEmissiveCutAlpha - 0.1f, fEmissiveCutAlpha + 0.1f, vMtrlDiffuse.a); - - - float3 vEmissiveColor = g_vEmissive.rgb * g_vEmissive.a + vEmissiveMtrl.rgb * (1 - g_vEmissive.a); - - Out.vColorTarget = vector(vEmissiveColor * fSmoothAlpha, vMtrlDiffuse.a); - - + Out.vColorTarget = pow(vEmissiveMtrl, 2.2f); + return Out; } @@ -563,13 +590,18 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) if (g_isNoise) { - float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iNoiseMoveLerpOption); + float2 vNoiseUV = In.vTexcoord; + + if(g_isNoiseUVMove == true) + vNoiseUV = In.vTexcoord + SelectLerpUV(g_vNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iNoiseMoveLerpOption); vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV); - vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r); + if (g_isNoiseAlpha) + vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r); - vMtrlDiffuse *= vMtrlNoise; + if (g_isNoiseColor) + vMtrlDiffuse *= vMtrlNoise; } /* 마스크 */ @@ -599,7 +631,10 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) vMaskTexcoord += SelectLerpUV(g_vMaskingUVGainAmount / g_vUVMaskCutting, (vMaskingTime.x / vMaskingTime.y), g_iMaskMoveLerpOption); } - vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord); + if (g_isMaskClampSample == true) + vMtrlMask = g_MaskingTexture.Sample(ClampSampler, vMaskTexcoord); + else + vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord); } else @@ -616,38 +651,58 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In) if (vMtrlDiffuse.a <= 0.f) discard; + vMtrlDiffuse.a *= g_fDiffuseAlpha; + if (g_isDissolve == true) { vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); - if (g_isReverseDissolve == true) + if (g_isNomalDissolve) { - if (vMtrlDissolve.r >= (In.vLifeTime.x / In.vLifeTime.y)) - discard; + vMtrlDiffuse.a *= (0.95f - In.vLifeTime.x / In.vLifeTime.y); } else { - if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y)) - discard; + vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); + + if (g_isReverseDissolve == true) + { + if (vMtrlDissolve.r >= (In.vLifeTime.x / In.vLifeTime.y)) + discard; + } + else + { + if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y)) + discard; + } } - } - vMtrlDiffuse.a *= g_fDiffuseAlpha; + // 색깔 추가할 처리 (이미시브) - // 색깔 추가할 처리 (이미시브) - - vector vEmissive; + + float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f); - float fSmoothAlpha = smoothstep(g_fEmissiveCutAlpha - 0.02f, g_fEmissiveCutAlpha + 0.02f, vMtrlDiffuse.a); - + if (g_isEmissive == true) + { + vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); + } + + float fEmissiveCutAlpha = g_fEmissiveCutAlpha; + + float fSmoothAlpha = smoothstep(fEmissiveCutAlpha - 0.3f, fEmissiveCutAlpha + 0.3f, vMtrlDiffuse.a); + + + if (g_isEmissiveDissolve == true) + { + fSmoothAlpha *= (1.f - In.vLifeTime.x / In.vLifeTime.y); + } + float3 vEmissiveColor = g_vEmissive.rgb * g_vEmissive.a + vEmissiveMtrl.rgb * (1 - g_vEmissive.a); - vEmissive = vector(vEmissiveColor * fSmoothAlpha, vMtrlDiffuse.a); - - Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity + vEmissive; + Out.vDiffuse = vector(vMtrlDiffuse.rgb * g_fBlurIntensity, vMtrlDiffuse.a); /** vector(vEmissiveColor * fSmoothAlpha, vMtrlDiffuse.a);*/ return Out; } diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp index 7c38a9b85..d30f3d89e 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_Cube.cpp @@ -62,7 +62,7 @@ HRESULT CDummy_Cube::Render() return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::SKYBOX)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp index 3939b3eef..9983ecb9b 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp @@ -4,6 +4,8 @@ #include "GameInstance.h" #include "NomalJap.h" +#include "TrailObject.h" + CDummy_PhysXPlayable::CDummy_PhysXPlayable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext): CGameObject(pDevice, pContext) { @@ -113,6 +115,16 @@ HRESULT CDummy_PhysXPlayable::Initialize(void* pArg) m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); + CPartObject::PARTOBJECT_DESC PartsDesc{}; + + PartsDesc.pParentTransform = m_pTransformCom; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, &PartsDesc, this))) { + assert(false); + return E_FAIL; + } + + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/EditEffect.cpp b/Jusin154_Team3D/Editor/Private/EditEffect.cpp index b0b1bd29d..8169c54e9 100644 --- a/Jusin154_Team3D/Editor/Private/EditEffect.cpp +++ b/Jusin154_Team3D/Editor/Private/EditEffect.cpp @@ -41,8 +41,8 @@ void CEditEffect::Priority_Update(_float fTimeDelta) void CEditEffect::Update(_float fTimeDelta) { - if (m_bVisible == false) - return; + //if (m_bVisible == false) + // return; if (m_pInstance_ModelCom == nullptr) return; @@ -573,6 +573,7 @@ void CEditEffect::Describe_Entity() GUI::InputFloat2("MaskUVCutting", (_float*)&m_EffectInfo.vUVMaskCutting); GUI::Checkbox("MaskUVMove", &m_EffectInfo.isMaskUVMove); + GUI::Checkbox("MaskClampSample", &m_EffectInfo.isMaskClampSample); ImGui::PushItemWidth(80); GUI::DragFloat2("MaskingUVGainAmount", (_float*)&m_EffectInfo.vMaskingUVGainAmount, 0.01f); @@ -614,7 +615,7 @@ void CEditEffect::Describe_Entity() { if (GUI::TreeNode("DISSOLV_TEX")) { - + GUI::Checkbox("Nomal Dissolve", &m_EffectInfo.isNomalDissolve); GUI::Checkbox("Reverse Dissolve", &m_EffectInfo.isReverseDissolve); _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "DISSOLVE_TEXTURE", (CComponent**)&m_pDissolve_TextureCom, nullptr, this); @@ -689,7 +690,8 @@ void CEditEffect::Describe_Entity() { if (GUI::TreeNode("NOISE")) { - + GUI::Checkbox("NoiseColor", &m_EffectInfo.isNoiseColor); + GUI::Checkbox("NoiseAlpha", &m_EffectInfo.isNoiseAlpha); GUI::Checkbox("NoiseMove", &m_EffectInfo.isNoiseUVMove); ImGui::PushItemWidth(80); @@ -721,21 +723,22 @@ void CEditEffect::Describe_Entity() GUI::TreePop(); } + ImGui::Begin("Simple Plot"); + + + ImGui::PlotLines("Value", m_ValueVector.data(), (int)m_ValueVector.size(), 0, nullptr, FLT_MAX, FLT_MAX, ImVec2(0, 100)); + + GUI::InputFloat("InputValue", &m_fInputValue); + + if (GUI::Button("AddValue")) + { + m_ValueVector.push_back(m_fInputValue); + } + + ImGui::End(); + } - ImGui::Begin("Simple Plot"); - - // samples.data()와 개수, optional offset 인덱스 등 넘길 수 있음 - ImGui::PlotLines("Value", m_ValueVector.data(), (int)m_ValueVector.size(), 0, nullptr, FLT_MAX, FLT_MAX, ImVec2(0, 100)); - - GUI::InputFloat("InputValue", &m_fInputValue); - - if (GUI::Button("AddValue")) - { - m_ValueVector.push_back(m_fInputValue); - } - - ImGui::End(); GUI::Separator(); GUI::Spacing(); diff --git a/Jusin154_Team3D/Editor/Private/EffectObject.cpp b/Jusin154_Team3D/Editor/Private/EffectObject.cpp index e5e85b552..5a35bd159 100644 --- a/Jusin154_Team3D/Editor/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectObject.cpp @@ -40,11 +40,13 @@ HRESULT CEffectObject::Render() return E_FAIL; } + if (FAILED(m_pInstance_ModelCom->Bind_CS_Output(5, 1))) + return E_FAIL; + if (FAILED(m_pGameInstance->Bind_DepthStencil(m_pShaderCom, "g_DepthStencilTexture"))) return E_FAIL; - if (FAILED(m_pInstance_ModelCom->Bind_CS_Output(5, 1))) - return E_FAIL; + if (FAILED(m_pInstance_ModelCom->Render(i))) @@ -76,6 +78,7 @@ HRESULT CEffectObject::Render_Blur() for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::BLUR)))) { return E_FAIL; @@ -446,11 +449,13 @@ HRESULT CEffectObject::LoadPre(const _char* pFilePath, LEVEL eLevel) m_strDiffuseName = szName; + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDiffuseName), + reinterpret_cast(&m_pDiffuse_TextureCom)))) + return E_FAIL; + } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDiffuseName), - reinterpret_cast(&m_pDiffuse_TextureCom)))) - return E_FAIL; + } if (m_EffectInfo.isNoise) @@ -471,11 +476,13 @@ HRESULT CEffectObject::LoadPre(const _char* pFilePath, LEVEL eLevel) } m_strNoiseName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNoiseName), + reinterpret_cast(&m_pNoise_TextureCom)))) + return E_FAIL; } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNoiseName), - reinterpret_cast(&m_pNoise_TextureCom)))) - return E_FAIL; + } if (m_EffectInfo.isMasking) @@ -497,11 +504,13 @@ HRESULT CEffectObject::LoadPre(const _char* pFilePath, LEVEL eLevel) } m_strMaskingName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strMaskingName), + reinterpret_cast(&m_pMasking_TextureCom)))) + return E_FAIL; } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strMaskingName), - reinterpret_cast(&m_pMasking_TextureCom)))) - return E_FAIL; + } if (m_EffectInfo.isDissolve) @@ -521,11 +530,13 @@ HRESULT CEffectObject::LoadPre(const _char* pFilePath, LEVEL eLevel) } m_strDissolveName = szName; + + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDissolveName), + reinterpret_cast(&m_pDissolve_TextureCom)))) + return E_FAIL; } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDissolveName), - reinterpret_cast(&m_pDissolve_TextureCom)))) - return E_FAIL; } if (m_EffectInfo.isEmissive) @@ -545,11 +556,13 @@ HRESULT CEffectObject::LoadPre(const _char* pFilePath, LEVEL eLevel) } m_strEmissiveName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strEmissiveName), + reinterpret_cast(&m_pEmissive_TextureCom)))) + return E_FAIL; } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strEmissiveName), - reinterpret_cast(&m_pEmissive_TextureCom)))) - return E_FAIL; + } if (m_EffectInfo.isDistortion) @@ -569,11 +582,13 @@ HRESULT CEffectObject::LoadPre(const _char* pFilePath, LEVEL eLevel) } m_strDistortionName = szName; + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDistortionName), + reinterpret_cast(&m_pDistortion_TextureCom)))) + return E_FAIL; } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDistortionName), - reinterpret_cast(&m_pDistortion_TextureCom)))) - return E_FAIL; + } size_t iComponentLength = {}; @@ -592,11 +607,13 @@ HRESULT CEffectObject::LoadPre(const _char* pFilePath, LEVEL eLevel) } m_strModelName = szName; + + + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strModelName), + reinterpret_cast(&m_pInstance_ModelCom)))) + return E_FAIL;; } - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strModelName), - reinterpret_cast(&m_pInstance_ModelCom)))) - return E_FAIL;; m_pInstance_ModelCom->PreLoad(hFile); @@ -663,8 +680,22 @@ HRESULT CEffectObject::Bind_ShaderResources() if (FAILED(m_pShaderCom->Bind_RawValue("g_isEmissiveDissolve", &m_EffectInfo.isEmissiveDissolve, sizeof(_bool)))) { return E_FAIL; } - - + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskClampSample", &m_EffectInfo.isMaskClampSample, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseColor", &m_EffectInfo.isNoiseColor, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseAlpha", &m_EffectInfo.isNoiseAlpha, sizeof(_bool)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_isNomalDissolve", &m_EffectInfo.isNomalDissolve, sizeof(_bool)))) { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_EffectInfo.vColor, sizeof(_float4)))) { return E_FAIL; @@ -730,6 +761,8 @@ HRESULT CEffectObject::Bind_ShaderResources() return E_FAIL; } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDiffuseAlpha", &m_EffectInfo.fDiffuseAlpha, sizeof(_float)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp index dd458cfff..2d06336bb 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp @@ -152,8 +152,10 @@ HRESULT CEffect_Editor::ReSaveFile(const _char* pDirectoryPath) - if (FAILED(Add_PartObject("ReSaveFile" + iIndex++ , ENUM_CLASS(LEVEL::EFFECT), &pEditEffect, &PartsDesc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, TEXT("Layer_Effect"), &PartsDesc, this , &pEditEffect))) { + assert(false); return E_FAIL; + } if (FAILED(pEditEffect->LoadPre(szFilePath, LEVEL::EFFECT))) { @@ -172,7 +174,7 @@ HRESULT CEffect_Editor::ReSaveFile(const _char* pDirectoryPath) pEditEffect->Save_Effect(strPath.c_str()); - Safe_Release(pEditEffect); + pEditEffect->Set_Dead(); } return S_OK; diff --git a/Jusin154_Team3D/Editor/Private/NomalJap.cpp b/Jusin154_Team3D/Editor/Private/NomalJap.cpp index 6f32e0139..73caa4978 100644 --- a/Jusin154_Team3D/Editor/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Editor/Private/NomalJap.cpp @@ -35,7 +35,7 @@ HRESULT CNomalJap::Initialize(void* pArg) if (FAILED(Ready_Child())) return E_FAIL; - Load_Package("../Bin/Resources/Data/Effect/Package/Jap"); + Load_Package("../Bin/Resources/Data/Effect/Package/Jap3"); m_wstrEffectName = L"Nomal_Jap"; @@ -89,7 +89,7 @@ HRESULT CNomalJap::Ready_Child() Desc.vRotRPY = { 0.f, 0.f, 0.f }; Desc.iSubKind = 70; - Desc.vDeltaPos = { 0.f, 0.f, 1.f }; + Desc.vDeltaPos = { 0.f, 0.f, 2.f }; Desc.vLifeTime = { 0.f, 2.f }; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this , &m_pPhysHitBox))) { diff --git a/Jusin154_Team3D/Editor/Private/TestEffect.cpp b/Jusin154_Team3D/Editor/Private/TestEffect.cpp index 89d9d462c..c8960fd4f 100644 --- a/Jusin154_Team3D/Editor/Private/TestEffect.cpp +++ b/Jusin154_Team3D/Editor/Private/TestEffect.cpp @@ -44,7 +44,7 @@ void CTestEffect::Update(_float fTimeDelta) void CTestEffect::Late_Update(_float fTimeDelta) { if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { - m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this); + m_pGameInstance->Add_RenderGroup(RENDER::EFFECT, this); } } diff --git a/Jusin154_Team3D/Editor/Private/TrailObject.cpp b/Jusin154_Team3D/Editor/Private/TrailObject.cpp index 720c3702b..3b8fe79eb 100644 --- a/Jusin154_Team3D/Editor/Private/TrailObject.cpp +++ b/Jusin154_Team3D/Editor/Private/TrailObject.cpp @@ -28,6 +28,8 @@ HRESULT CTrailObject::Initialize(void* pArg) if (FAILED(Ready_Components(pArg))) return E_FAIL; + //Load_Trail("") + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Public/EffectObject.h b/Jusin154_Team3D/Editor/Public/EffectObject.h index ec1d91554..2f68f9053 100644 --- a/Jusin154_Team3D/Editor/Public/EffectObject.h +++ b/Jusin154_Team3D/Editor/Public/EffectObject.h @@ -51,6 +51,7 @@ class CEffectObject abstract : public CPartObject _bool isMaskUVMove = {}; _bool isBlur = {}; _bool isBillboard = {}; + _float4 vEmissive = { 0.f ,0.f ,0.f ,0.f }; _float fDiffuseAlpha = { 1.f }; @@ -67,6 +68,11 @@ class CEffectObject abstract : public CPartObject _bool isEmissiveDissolve = { false }; + _bool isMaskClampSample = { false }; + _bool isNoiseColor = { false }; + _bool isNoiseAlpha = { false }; + _bool isNomalDissolve = {}; + }EFFECT_INFO; typedef struct tagPreEffectInfo @@ -116,6 +122,10 @@ class CEffectObject abstract : public CPartObject _bool isReverseDissolve = {}; EFFECT_TYPE eEffectType = { EFFECT_TYPE::EFFECT }; _bool isEmissiveDissolve = { false }; + _bool isMaskClampSample = { false }; + _bool isNoiseColor = { false }; + _bool isNoiseAlpha = { false }; + _bool isNomalDissolve = {}; }PRE_EFFECT_INFO; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli index f16a08d3c..6a7c952fc 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -181,5 +181,53 @@ float3 DecodeNormalFromRG(Texture2D NormalMap, SamplerState Samp, float2 uv) return normalize(n); } +float4x4 RotateX(float fAngle) +{ + float fCos = cos(radians(fAngle)); + float fSin = sin(radians(fAngle)); + + float4x4 RotateXMat = + { + 1, 0, 0, 0, + 0, fCos, -fSin, 0, + 0, fSin, fCos, 0, + 0, 0, 0, 1, + }; + + return RotateXMat; +} + +float4x4 RotateY(float fAngle) +{ + float fCos = cos(radians(fAngle)); + float fSin = sin(radians(fAngle)); + + float4x4 RotateYMat = + { + fCos , 0, fSin, 0, + 0 , 1, 0, 0, + -fSin , 0, fCos, 0, + 0 , 0, 0, 1 + }; + + return RotateYMat; +} + +float4x4 RotateZ(float fAngle) +{ + float fCos = cos(radians(fAngle)); + float fSin = sin(radians(fAngle)); + + float4x4 RotateZMat = + { + fCos, -fSin, 0, 0, + fSin, fCos, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1, + }; + + return RotateZMat; +} + #endif // ENGINE_SHADER_FUNCTIONS_HLSLI 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 0dea26c43..4212f3194 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -1,5 +1,4 @@ - -float PI = 3.141592; +#include "Engine_Shader_Functions.hlsli" struct Particle { @@ -30,7 +29,8 @@ struct ParticleValue float2 vAniIndex; float fGravity; - float3 vSinAmount; + float3 vSinAmount; + float3 vDeltaAngle; }; @@ -48,6 +48,11 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐 bool isDrop; bool isMoveForward; bool isSinWave; + + bool IsTurn; + bool isPadding1; + bool isPadding2; + bool isPadding3; float fTimeDelta; float fPadding1; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다. @@ -74,8 +79,6 @@ void CS_MAIN( { if (isLoop == false) { - - return; } @@ -92,7 +95,7 @@ void CS_MAIN( if (isMoveForward) { - float4 vVelocity = vector(normalize(particleValue.vOriginLook.xyz) * particleValue.fSpeed, 1.f); + float4 vVelocity = vector(normalize(particle.vLook.xyz) * particleValue.fSpeed, 1.f); particle.vTranslation += vVelocity * fTimeDelta; } @@ -107,6 +110,28 @@ void CS_MAIN( { particle.vTranslation += vector( sin(particle.vLifeTime.x * 3.141592 * 2.f) * particleValue.vSinAmount, 0.f); } + + if (IsTurn == true) + { + /* ROTATE */ + float4x4 RotateXMat = RotateX(particleValue.vDeltaAngle.x * fTimeDelta); + float4x4 RotateYMat = RotateY(particleValue.vDeltaAngle.y * fTimeDelta); + float4x4 RotateZMat = RotateZ(particleValue.vDeltaAngle.z * fTimeDelta); + + + float4x4 CombinedRotMat = mul(RotateZMat, mul(RotateYMat, RotateXMat)); + + float4x4 CurRotatemat = {particle.vRight, particle.vUp, particle.vLook, vector(0.f , 0.f, 0.f, 1.f)}; + + + + CurRotatemat = mul(CombinedRotMat, CurRotatemat); + + particle.vRight = CurRotatemat[0].xyzw; + particle.vUp = CurRotatemat[1].xyzw; + particle.vLook = CurRotatemat[2].xyzw; + + } //애니메이션 속도 , 인덱스 diff --git a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp index ddbd98b00..74a59ff4b 100644 --- a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp +++ b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp @@ -84,7 +84,7 @@ vector CComputeShader::Dispatch(_uint iSRVIndex, _uint if (SUCCEEDED(m_pContext->Map(m_pOutputStagingBuffer[i], 0, D3D11_MAP_READ, 0, &StagingSubResource))) { - + CInstance_Model::CS_PARTICLE_VALUE_DESC* pValueDesc = static_cast(StagingSubResource.pData); StagingSubResources.push_back(StagingSubResource); diff --git a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp index ec9722a80..a2e9948d9 100644 --- a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp @@ -232,7 +232,7 @@ HRESULT CInstance_Model::Create_CS() }; m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext, - L"../Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl", "CS_MAIN", m_iNumInstance, 2, 2, CS_OutputStrides, CS_InputStrides); + L"../Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl", "CS_MAIN", m_iNumInstance, 2, 2, CS_InputStrides, CS_OutputStrides); if (m_pComputeShader == nullptr) return E_FAIL; @@ -277,6 +277,7 @@ void CInstance_Model::Drop(_float fTimeDelta) pDesc->fTimeDelta = fTimeDelta; pDesc->isLoop = m_InstanceDesc.isLoop; pDesc->isDrop = m_InstanceDesc.isDrop; + pDesc->isTurn = m_InstanceDesc.isTurn; pDesc->isMoveForward = m_InstanceDesc.isMoveForward; pDesc->isSinWave = m_InstanceDesc.isSinWave; @@ -315,6 +316,7 @@ void CInstance_Model::Drop(_float fTimeDelta) memcpy(ParticleValueResource.pData, OutSubResources[1].pData, sizeof(CS_PARTICLE_VALUE_DESC) * m_InstanceDesc.iNumInstance); // 아웃풋 버퍼에 들어온 값들을 전부 복사한다. + m_pContext->Unmap(m_pParticleValueBuffer, 0); } @@ -399,6 +401,13 @@ void CInstance_Model::Instane_Buffer_ReStruct() pParticleValues[i].vSinAmount = vSinAmount; + _float3 vDeltaAngle = _float3( + m_pGameInstance->Random_Float(m_InstanceDesc.vDeltaAngleMin.x, m_InstanceDesc.vDeltaAngleMax.x), + m_pGameInstance->Random_Float(m_InstanceDesc.vDeltaAngleMin.y, m_InstanceDesc.vDeltaAngleMax.y), + m_pGameInstance->Random_Float(m_InstanceDesc.vDeltaAngleMin.z, m_InstanceDesc.vDeltaAngleMax.z) + ); + + pParticleValues[i].vDeltaAngle = vDeltaAngle; //라이프 타임 설정 pVertices[i].vLifeTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vLifeTime.x, m_InstanceDesc.vLifeTime.y)); @@ -413,7 +422,6 @@ void CInstance_Model::Instane_Buffer_ReStruct() pParticleValues[i].vAniIndex = _float2(0.f, m_InstanceDesc.vAniIndex.y); pParticleValues[i].fGravity = m_pGameInstance->Random_Float(m_InstanceDesc.vGravity.x, m_InstanceDesc.vGravity.y); - memcpy(&pParticleValues[i].vOriginRight, SRMatrix.m[0], sizeof(_float4)); memcpy(&pParticleValues[i].vOriginUp, SRMatrix.m[1], sizeof(_float4)); memcpy(&pParticleValues[i].vOriginLook, SRMatrix.m[2], sizeof(_float4)); @@ -520,6 +528,11 @@ void CInstance_Model::Describe_Entity() Instane_Buffer_ReStruct(); } + if (GUI::Checkbox("Turn", &m_InstanceDesc.isTurn)) + { + Instane_Buffer_ReStruct(); + } + if (ImGui::DragFloat3("SizeMin", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMin))) { Instane_Buffer_ReStruct(); @@ -611,6 +624,16 @@ void CInstance_Model::Describe_Entity() Instane_Buffer_ReStruct(); } + if (ImGui::DragFloat3("DeltaAngleMin", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAngleMin))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat3("DeltaAngleMax", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAngleMax))) + { + Instane_Buffer_ReStruct(); + } + ImGui::PopItemWidth(); ImGui::TreePop(); diff --git a/Jusin154_Team3D/Engine/Public/ComputeShader.h b/Jusin154_Team3D/Engine/Public/ComputeShader.h index 0f179343f..51f35ed4d 100644 --- a/Jusin154_Team3D/Engine/Public/ComputeShader.h +++ b/Jusin154_Team3D/Engine/Public/ComputeShader.h @@ -27,7 +27,7 @@ class ENGINE_DLL CComputeShader final : public CBase HRESULT CreateComputeShader(const _tchar* pShaderFilePath, const _char* pStartFunctionName); private: - ID3D11Device* m_pDevice = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; ID3D11DeviceContext* m_pContext = { nullptr }; class CGameInstance* m_pGameInstance = { nullptr }; diff --git a/Jusin154_Team3D/Engine/Public/Instance_Model.h b/Jusin154_Team3D/Engine/Public/Instance_Model.h index dee49ef0f..d49ced981 100644 --- a/Jusin154_Team3D/Engine/Public/Instance_Model.h +++ b/Jusin154_Team3D/Engine/Public/Instance_Model.h @@ -32,10 +32,16 @@ class ENGINE_DLL CInstance_Model final : public CComponent _bool isMoveForward = {}; _float2 vGravity = { 0.f , 9.8f }; + _bool isSinWave = {}; _float3 vSinMinAmount = { 0.f , 0.f , 0.f}; _float3 vSinMaxAmount = { 0.f , 0.f , 0.f }; + _bool isTurn; + _float3 vDeltaAngleMin = {}; + _float3 vDeltaAngleMax = {}; + + }INSTANCE_DESC; typedef struct tagPreInstanceDesc @@ -64,9 +70,15 @@ class ENGINE_DLL CInstance_Model final : public CComponent _bool isMoveForward = {}; _float2 vGravity = { 0.f , 9.8f }; + _bool isSinWave = {}; _float3 vSinMinAmount = { 0.f , 0.f , 0.f }; _float3 vSinMaxAmount = { 0.f , 0.f , 0.f }; + + _bool isTurn; + _float3 vDeltaAngleMin = {}; + _float3 vDeltaAngleMax = {}; + }PRE_INSTANCE_DESC; typedef struct tagCSParticleDesc @@ -78,11 +90,17 @@ class ENGINE_DLL CInstance_Model final : public CComponent _int isMoveForward = {}; _int isSinWave = {}; + _int isTurn = {}; + _int isPadding1 = {}; + _int isPadding2 = {}; + _int isPadding3 = {}; + _float fTimeDelta = {}; _float fPadding2 = {}; _float fPadding3 = {}; _float fPadding4 = {}; + }CS_PARTICLE_DESC; typedef struct tagCSParticleValueDesc @@ -104,7 +122,8 @@ class ENGINE_DLL CInstance_Model final : public CComponent _float2 vAniIndex = {}; _float fGravity = {}; - _float3 vSinAmount = {}; + _float3 vSinAmount = {}; + _float3 vDeltaAngle = {}; }CS_PARTICLE_VALUE_DESC;