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