[Fix] 컴쉐2패스로 수정

[Add] 란록 추가
This commit is contained in:
hyunbin14
2025-12-18 15:46:16 +09:00
parent f4cd67a71e
commit 2e2c2ac0ea
47 changed files with 3019 additions and 989 deletions
@@ -0,0 +1,333 @@
struct KeyFrame
{
float3 vScale;
float4 vRotation;
float3 vTranslation;
float fTrackPosition;
};
struct Channel
{
uint StartIndex;
uint KeyCount;
uint BoneIndex;
};
struct BoneLocal
{
row_major float4x4 BoneLocal;
};
StructuredBuffer<KeyFrame> g_KeyFrameBuffer : register(t0);
StructuredBuffer<Channel> g_ChannelBuffer : register(t1);
StructuredBuffer<KeyFrame> g_PrevKeyFrameBuffer : register(t2);
StructuredBuffer<Channel> g_PrevChannelBuffer : register(t3);
StructuredBuffer<int> g_ParentBuffer : register(t4);
StructuredBuffer<BoneLocal> g_BoneLocalBuffer : register(t5);
StructuredBuffer<uint> g_BoneRemap : register(t6);
RWStructuredBuffer<float4x4> g_LocalMatrixOut : register(u0);
cbuffer AnimCB : register(b0)
{
float CurrentTime;
float Duration;
uint MeshBoneCount;
uint BoneCount;
uint CurrentAnimIndex;
uint PrevAnimIndex;
float PrevTime;
float BlendRatio;
int RootBoneIndex;
float3 _pad0;
row_major float4x4 PreTransformMatrix;
float4 RootInitRot;
};
static const float EPS = 1e-6f;
float4 QuatNormalize(float4 q)
{
return q * rsqrt(max(dot(q, q), EPS));
}
float4 QuatSlerp(float4 a, float4 b, float t)
{
a = QuatNormalize(a);
b = QuatNormalize(b);
float cosTheta = dot(a, b);
if (cosTheta < 0.0f)
{
b = -b;
cosTheta = -cosTheta;
}
if (cosTheta > 0.9995f)
return QuatNormalize(lerp(a, b, t));
float theta = acos(clamp(cosTheta, -1.0f, 1.0f));
float sinTheta = max(sin(theta), EPS);
float w0 = sin((1.0f - t) * theta) / sinTheta;
float w1 = sin(t * theta) / sinTheta;
return a * w0 + b * w1;
}
row_major float4x4 MakeAffine(float3 scale, float4 rot, float3 trans)
{
rot = QuatNormalize(rot);
float xx = rot.x * rot.x;
float yy = rot.y * rot.y;
float zz = rot.z * rot.z;
float xy = rot.x * rot.y;
float xz = rot.x * rot.z;
float yz = rot.y * rot.z;
float wx = rot.w * rot.x;
float wy = rot.w * rot.y;
float wz = rot.w * rot.z;
float3 r0 = float3(1.0f - 2.0f * (yy + zz), 2.0f * (xy + wz), 2.0f * (xz - wy));
float3 r1 = float3(2.0f * (xy - wz), 1.0f - 2.0f * (xx + zz), 2.0f * (yz + wx));
float3 r2 = float3(2.0f * (xz + wy), 2.0f * (yz - wx), 1.0f - 2.0f * (xx + yy));
r0 *= scale.x;
r1 *= scale.y;
r2 *= scale.z;
row_major float4x4 M;
M[0] = float4(r0, 0.0f);
M[1] = float4(r1, 0.0f);
M[2] = float4(r2, 0.0f);
M[3] = float4(trans, 1.0f);
return M;
}
void DecomposeAffine_RowMajor(row_major float4x4 M, out float3 S, out float4 R, out float3 T)
{
T = float3(M._41, M._42, M._43);
float3 r0 = float3(M._11, M._12, M._13);
float3 r1 = float3(M._21, M._22, M._23);
float3 r2 = float3(M._31, M._32, M._33);
S = float3(length(r0), length(r1), length(r2));
float3 invS = 1.0f / max(S, float3(EPS, EPS, EPS));
r0 *= invS.x;
r1 *= invS.y;
r2 *= invS.z;
float trace = r0.x + r1.y + r2.z;
float4 q;
if (trace > 0.0f)
{
float s = sqrt(trace + 1.0f) * 2.0f;
q.w = 0.25f * s;
q.x = (r1.z - r2.y) / s;
q.y = (r2.x - r0.z) / s;
q.z = (r0.y - r1.x) / s;
}
else if (r0.x > r1.y && r0.x > r2.z)
{
float s = sqrt(1.0f + r0.x - r1.y - r2.z) * 2.0f;
q.w = (r1.z - r2.y) / s;
q.x = 0.25f * s;
q.y = (r1.x + r0.y) / s;
q.z = (r2.x + r0.z) / s;
}
else if (r1.y > r2.z)
{
float s = sqrt(1.0f + r1.y - r0.x - r2.z) * 2.0f;
q.w = (r2.x - r0.z) / s;
q.x = (r1.x + r0.y) / s;
q.y = 0.25f * s;
q.z = (r2.y + r1.z) / s;
}
else
{
float s = sqrt(1.0f + r2.z - r0.x - r1.y) * 2.0f;
q.w = (r0.y - r1.x) / s;
q.x = (r2.x + r0.z) / s;
q.y = (r2.y + r1.z) / s;
q.z = 0.25f * s;
}
R = QuatNormalize(q);
}
uint FindKeyIndexCur(uint start, uint count, float t)
{
uint lo = 0;
uint hi = count - 1;
float tLast = g_KeyFrameBuffer[start + hi].fTrackPosition;
if (t >= tLast)
return hi - 1;
while (lo + 1 < hi)
{
uint mid = (lo + hi) >> 1;
float tm = g_KeyFrameBuffer[start + mid].fTrackPosition;
if (t < tm)
hi = mid;
else
lo = mid;
}
return lo;
}
uint FindKeyIndexPrev(uint start, uint count, float t)
{
uint lo = 0;
uint hi = count - 1;
float tLast = g_PrevKeyFrameBuffer[start + hi].fTrackPosition;
if (t >= tLast)
return hi - 1;
while (lo + 1 < hi)
{
uint mid = (lo + hi) >> 1;
float tm = g_PrevKeyFrameBuffer[start + mid].fTrackPosition;
if (t < tm)
hi = mid;
else
lo = mid;
}
return lo;
}
void SampleLocalTRS_Cur(uint bone, float t, out float3 S, out float4 R, out float3 T)
{
Channel ch = g_ChannelBuffer[bone];
if (ch.KeyCount == 0)
{
DecomposeAffine_RowMajor(g_BoneLocalBuffer[bone].BoneLocal, S, R, T);
return;
}
uint idx0 = FindKeyIndexCur(ch.StartIndex, ch.KeyCount, t);
uint idx1 = idx0 + 1;
KeyFrame k0 = g_KeyFrameBuffer[ch.StartIndex + idx0];
KeyFrame k1 = g_KeyFrameBuffer[ch.StartIndex + idx1];
float denom = max(k1.fTrackPosition - k0.fTrackPosition, EPS);
float a = saturate((t - k0.fTrackPosition) / denom);
S = lerp(k0.vScale, k1.vScale, a);
T = lerp(k0.vTranslation, k1.vTranslation, a);
R = QuatSlerp(k0.vRotation, k1.vRotation, a);
}
void SampleLocalTRS_Prev(uint bone, float t, out float3 S, out float4 R, out float3 T)
{
Channel ch = g_PrevChannelBuffer[bone];
if (ch.KeyCount == 0)
{
DecomposeAffine_RowMajor(g_BoneLocalBuffer[bone].BoneLocal, S, R, T);
return;
}
uint idx0 = FindKeyIndexPrev(ch.StartIndex, ch.KeyCount, t);
uint idx1 = idx0 + 1;
KeyFrame k0 = g_PrevKeyFrameBuffer[ch.StartIndex + idx0];
KeyFrame k1 = g_PrevKeyFrameBuffer[ch.StartIndex + idx1];
float denom = max(k1.fTrackPosition - k0.fTrackPosition, EPS);
float a = saturate((t - k0.fTrackPosition) / denom);
S = lerp(k0.vScale, k1.vScale, a);
T = lerp(k0.vTranslation, k1.vTranslation, a);
R = QuatSlerp(k0.vRotation, k1.vRotation, a);
}
row_major float4x4 SampleBlendedLocal(uint bone)
{
if (CurrentAnimIndex == PrevAnimIndex)
{
float3 S;
float4 R;
float3 T;
SampleLocalTRS_Cur(bone, CurrentTime, S, R, T);
if ((int) bone == RootBoneIndex)
{
T = 0;
R = RootInitRot;
}
return MakeAffine(S, R, T);
}
float br = saturate(BlendRatio);
if (br <= 0.0f)
{
float3 S;
float4 R;
float3 T;
SampleLocalTRS_Prev(bone, PrevTime, S, R, T);
if ((int) bone == RootBoneIndex)
{
T = 0;
R = RootInitRot;
}
return MakeAffine(S, R, T);
}
if (br >= 1.0f)
{
float3 S;
float4 R;
float3 T;
SampleLocalTRS_Cur(bone, CurrentTime, S, R, T);
if ((int) bone == RootBoneIndex)
{
T = 0;
R = RootInitRot;
}
return MakeAffine(S, R, T);
}
float3 sA, sB, tA, tB;
float4 rA, rB;
SampleLocalTRS_Prev(bone, PrevTime, sA, rA, tA);
SampleLocalTRS_Cur(bone, CurrentTime, sB, rB, tB);
float3 S = lerp(sA, sB, br);
float3 T = lerp(tA, tB, br);
float4 R = QuatSlerp(rA, rB, br);
if ((int) bone == RootBoneIndex)
{
T = 0;
R = RootInitRot;
}
return MakeAffine(S, R, T);
}
[numthreads(256, 1, 1)]
void CS_LOCAL(uint3 DTid : SV_DispatchThreadID)
{
uint bone = DTid.x;
if (bone >= BoneCount)
return;
g_LocalMatrixOut[bone] = SampleBlendedLocal(bone);
}
@@ -1,37 +1,13 @@
struct KeyFrame
{
float3 vScale;
float4 vRotation;
float3 vTranslation;
float fTrackPosition;
};
struct Channel
{
uint StartIndex;
uint KeyCount;
uint BoneIndex;
};
struct LocalPos
{
row_major float4x4 Local;
row_major float4x4 Combined;
row_major float4x4 Local;
row_major float4x4 LocalCombined;
};
struct BoneLocal
{
row_major float4x4 BoneLocal;
};
StructuredBuffer<KeyFrame> g_KeyFrameBuffer : register(t0);
StructuredBuffer<Channel> g_ChannelBuffer : register(t1);
StructuredBuffer<KeyFrame> g_PrevKeyFrameBuffer : register(t2);
StructuredBuffer<Channel> g_PrevChannelBuffer : register(t3);
StructuredBuffer<int> g_ParentBuffer : register(t4);
StructuredBuffer<BoneLocal> g_BoneLocalBuffer : register(t5);
StructuredBuffer<uint> g_BoneRemap : register(t6);
StructuredBuffer<float4x4> g_LocalMatIn : register(t0);
StructuredBuffer<int> g_ParentBuffer : register(t1);
StructuredBuffer<uint> g_BoneRemap : register(t2);
RWStructuredBuffer<LocalPos> g_LocalPosOutput : register(u0);
@@ -39,378 +15,43 @@ cbuffer AnimCB : register(b0)
{
float CurrentTime;
float Duration;
int MeshBoneCount;
int BoneCount;
uint MeshBoneCount;
uint BoneCount;
int RootBoneIndex;
int padding1;
uint CurrentAnimIndex;
uint PrevAnimIndex;
float PrevTime;
float BlendRatio;
int RootBoneIndex;
float3 _pad0;
row_major float4x4 PreTransformMatrix;
float4 RootInitRot;
};
static const float EPS = 1e-6f;
float4 QuatNormalize(float4 q)
{
return q * rsqrt(max(dot(q, q), EPS));
}
float4 QuatSlerp(float4 a, float4 b, float t)
{
a = QuatNormalize(a);
b = QuatNormalize(b);
float cosTheta = dot(a, b);
if (cosTheta < 0.0f)
{
b = -b;
cosTheta = -cosTheta;
}
if (cosTheta > 0.9995f)
return QuatNormalize(lerp(a, b, t));
float theta = acos(saturate(cosTheta));
float sinTheta = max(sin(theta), EPS);
float w0 = sin((1.0f - t) * theta) / sinTheta;
float w1 = sin(t * theta) / sinTheta;
return a * w0 + b * w1;
}
float4x4 MakeAffine(float3 scale, float4 rot, float3 trans)
{
rot = QuatNormalize(rot);
float xx = rot.x * rot.x;
float yy = rot.y * rot.y;
float zz = rot.z * rot.z;
float xy = rot.x * rot.y;
float xz = rot.x * rot.z;
float yz = rot.y * rot.z;
float wx = rot.w * rot.x;
float wy = rot.w * rot.y;
float wz = rot.w * rot.z;
float4x4 M;
M._11 = (1 - 2 * (yy + zz)) * scale.x;
M._12 = (2 * (xy + wz)) * scale.x;
M._13 = (2 * (xz - wy)) * scale.x;
M._14 = 0;
M._21 = (2 * (xy - wz)) * scale.y;
M._22 = (1 - 2 * (xx + zz)) * scale.y;
M._23 = (2 * (yz + wx)) * scale.y;
M._24 = 0;
M._31 = (2 * (xz + wy)) * scale.z;
M._32 = (2 * (yz - wx)) * scale.z;
M._33 = (1 - 2 * (xx + yy)) * scale.z;
M._34 = 0;
M._41 = trans.x;
M._42 = trans.y;
M._43 = trans.z;
M._44 = 1;
return M;
}
uint FindKeyIndexCur(uint start, uint count, float t)
{
uint lo = 0;
uint hi = count - 1;
float t0 = g_KeyFrameBuffer[start + 0].fTrackPosition;
if (t <= t0)
return 0;
float tLast = g_KeyFrameBuffer[start + hi].fTrackPosition;
if (t >= tLast)
return hi - 1;
while (hi - lo > 1)
{
uint mid = (lo + hi) >> 1;
float tm = g_KeyFrameBuffer[start + mid].fTrackPosition;
if (t < tm)
hi = mid;
else
lo = mid;
}
return lo;
}
uint FindKeyIndexPrev(uint start, uint count, float t)
{
uint lo = 0;
uint hi = count - 1;
float t0 = g_PrevKeyFrameBuffer[start + 0].fTrackPosition;
if (t <= t0)
return 0;
float tLast = g_PrevKeyFrameBuffer[start + hi].fTrackPosition;
if (t >= tLast)
return hi - 1;
while (hi - lo > 1)
{
uint mid = (lo + hi) >> 1;
float tm = g_PrevKeyFrameBuffer[start + mid].fTrackPosition;
if (t < tm)
hi = mid;
else
lo = mid;
}
return lo;
}
float3 GetRow3(float4 v)
{
return v.xyz;
}
float4x4 SampleLocalPrev(uint bone, float t)
{
Channel ch = g_PrevChannelBuffer[bone];
if (ch.KeyCount == 0)
return g_BoneLocalBuffer[bone].BoneLocal;
uint start = ch.StartIndex;
uint count = ch.KeyCount;
if (count == 1)
{
KeyFrame k = g_PrevKeyFrameBuffer[start];
float3 trans = k.vTranslation;
float4 rot = k.vRotation;
if (bone == RootBoneIndex)
{
trans = 0;
rot = RootInitRot;
}
return MakeAffine(k.vScale, rot, trans);
}
uint i0 = FindKeyIndexPrev(start, count, t);
uint i1 = i0 + 1;
KeyFrame k0 = g_PrevKeyFrameBuffer[start + i0];
KeyFrame k1 = g_PrevKeyFrameBuffer[start + i1];
float denom = max(EPS, (k1.fTrackPosition - k0.fTrackPosition));
float ratio = saturate((t - k0.fTrackPosition) / denom);
float3 scale = lerp(k0.vScale, k1.vScale, ratio);
float3 trans = lerp(k0.vTranslation, k1.vTranslation, ratio);
float4 rot = QuatSlerp(k0.vRotation, k1.vRotation, ratio);
if (bone == RootBoneIndex)
{
trans = 0;
rot = RootInitRot;
}
return MakeAffine(scale, rot, trans);
}
float4x4 SampleLocal(uint bone, float t)
{
Channel ch = g_ChannelBuffer[bone];
if (ch.KeyCount == 0)
return g_BoneLocalBuffer[bone].BoneLocal;
uint start = ch.StartIndex;
uint count = ch.KeyCount;
if (count == 1)
{
KeyFrame k = g_KeyFrameBuffer[start];
float3 trans = k.vTranslation;
float4 rot = k.vRotation;
if (bone == RootBoneIndex)
{
trans = 0;
rot = RootInitRot;
}
return MakeAffine(k.vScale, rot, trans);
}
uint i0 = FindKeyIndexCur(start, count, t);
uint i1 = i0 + 1;
KeyFrame k0 = g_KeyFrameBuffer[start + i0];
KeyFrame k1 = g_KeyFrameBuffer[start + i1];
float denom = max(EPS, (k1.fTrackPosition - k0.fTrackPosition));
float ratio = saturate((t - k0.fTrackPosition) / denom);
float3 scale = lerp(k0.vScale, k1.vScale, ratio);
float3 trans = lerp(k0.vTranslation, k1.vTranslation, ratio);
float4 rot = QuatSlerp(k0.vRotation, k1.vRotation, ratio);
if (bone == RootBoneIndex)
{
trans = 0;
rot = RootInitRot;
}
return MakeAffine(scale, rot, trans);
}
void SampleLocalTRS_Cur(uint bone, float t, out float3 S, out float4 R, out float3 T)
{
Channel ch = g_ChannelBuffer[bone];
if (ch.KeyCount == 0)
{
S = float3(1, 1, 1);
R = float4(0, 0, 0, 1);
T = float3(0, 0, 0);
return;
}
uint start = ch.StartIndex;
uint count = ch.KeyCount;
if (count == 1)
{
KeyFrame k = g_KeyFrameBuffer[start];
S = k.vScale;
R = QuatNormalize(k.vRotation);
T = k.vTranslation;
}
else
{
uint i0 = FindKeyIndexCur(start, count, t);
uint i1 = i0 + 1;
KeyFrame k0 = g_KeyFrameBuffer[start + i0];
KeyFrame k1 = g_KeyFrameBuffer[start + i1];
float denom = max(EPS, (k1.fTrackPosition - k0.fTrackPosition));
float ratio = saturate((t - k0.fTrackPosition) / denom);
S = lerp(k0.vScale, k1.vScale, ratio);
T = lerp(k0.vTranslation, k1.vTranslation, ratio);
R = QuatSlerp(k0.vRotation, k1.vRotation, ratio);
}
if (bone == RootBoneIndex)
{
T = 0;
R = RootInitRot;
}
}
void SampleLocalTRS_Prev(uint bone, float t, out float3 S, out float4 R, out float3 T)
{
Channel ch = g_PrevChannelBuffer[bone];
if (ch.KeyCount == 0)
{
S = float3(1, 1, 1);
R = float4(0, 0, 0, 1);
T = float3(0, 0, 0);
return;
}
uint start = ch.StartIndex;
uint count = ch.KeyCount;
if (count == 1)
{
KeyFrame k = g_PrevKeyFrameBuffer[start];
S = k.vScale;
R = QuatNormalize(k.vRotation);
T = k.vTranslation;
}
else
{
uint i0 = FindKeyIndexPrev(start, count, t);
uint i1 = i0 + 1;
KeyFrame k0 = g_PrevKeyFrameBuffer[start + i0];
KeyFrame k1 = g_PrevKeyFrameBuffer[start + i1];
float denom = max(EPS, (k1.fTrackPosition - k0.fTrackPosition));
float ratio = saturate((t - k0.fTrackPosition) / denom);
S = lerp(k0.vScale, k1.vScale, ratio);
T = lerp(k0.vTranslation, k1.vTranslation, ratio);
R = QuatSlerp(k0.vRotation, k1.vRotation, ratio);
}
if (bone == RootBoneIndex)
{
T = 0;
R = RootInitRot;
}
}
float4x4 SampleBlendedLocal(uint bone)
{
float br = saturate(BlendRatio);
if (br <= 0.0f)
return SampleLocalPrev(bone, PrevTime);
if (br >= 1.0f)
return SampleLocal(bone, CurrentTime);
float3 sA, sB, tA, tB;
float4 rA, rB;
SampleLocalTRS_Prev(bone, PrevTime, sA, rA, tA);
SampleLocalTRS_Cur(bone, CurrentTime, sB, rB, tB);
float3 s = lerp(sA, sB, br);
float3 t = lerp(tA, tB, br);
float4 r = QuatSlerp(rA, rB, br);
if (bone == RootBoneIndex)
{
t = 0;
r = RootInitRot;
}
return MakeAffine(s, r, t);
}
[numthreads(256, 1, 1)]
void CS_MAIN(uint3 DTid : SV_DispatchThreadID)
{
uint globalBone = DTid.x;
if (globalBone >= (uint) BoneCount)
uint local = DTid.x;
if (local >= MeshBoneCount)
return;
float4x4 localMat = SampleBlendedLocal(globalBone);
g_LocalPosOutput[globalBone].Local = localMat;
uint global = g_BoneRemap[local];
float4x4 combined = localMat;
int p = g_ParentBuffer[globalBone];
row_major float4x4 combined = g_LocalMatIn[global];
int p = g_ParentBuffer[global];
while (p != -1)
{
combined = mul(combined, SampleBlendedLocal((uint) p));
p = g_ParentBuffer[p];
combined = mul(combined, g_LocalMatIn[(uint) p]);
p = g_ParentBuffer[(uint) p];
}
combined = mul(combined, PreTransformMatrix);
g_LocalPosOutput[globalBone].Combined = combined;
for (uint local = 0; local < (uint) MeshBoneCount; ++local)
{
if (g_BoneRemap[local] == globalBone)
{
g_LocalPosOutput[local].LocalCombined = combined;
}
}
g_LocalPosOutput[local].Combined = combined;
g_LocalPosOutput[local].LocalCombined = combined;
g_LocalPosOutput[local].Local = g_LocalMatIn[global];
}
@@ -646,6 +646,7 @@ call Update_Lib.bat
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Effect</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">5.0</ShaderModel>
</FxCompile>
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_Local_Compute.hlsl" />
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_Mesh_Compute.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Effect</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">5.0</ShaderModel>
@@ -1326,5 +1326,8 @@
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_Distortion.hlsl">
<Filter>99.Define\01.SHADER</Filter>
</FxCompile>
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_Local_Compute.hlsl">
<Filter>99.Define\01.SHADER</Filter>
</FxCompile>
</ItemGroup>
</Project>
+24 -18
View File
@@ -164,11 +164,11 @@ void CChannel::Update_TransformationMatirx(
vTranslation = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&vSourTranslation), XMLoadFloat3(&vDestTranslation), fRatio), 1.f);
}
if (!bIsSpine)
/*if (!bIsSpine)
{
m_IsUpper = BoneMask[m_iBoneIndex];
m_ilayerIndex = m_IsUpper ? 1 : 0;
}
}*/
if (m_iBoneIndex == RootBoneIndex)
{
if (vector)
@@ -177,25 +177,31 @@ void CChannel::Update_TransformationMatirx(
vector[1] = vRotation;
vector[2] = vTranslation;
}
}
if (bIsSpine)
{
m_BoneTransformationMatrix =
XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix);
}
else
{
if (m_ilayerIndex == 1)
{
m_BoneTransformationMatrix =
XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix);
}
}
m_BoneTransformationMatrix =
XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix);
//if (bIsSpine)
//{
// m_BoneTransformationMatrix =
// XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
// Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix);
//}
//else
//{
// if (m_ilayerIndex == 1)
// {
// m_BoneTransformationMatrix =
// XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
// Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix);
// }
//}
}
}
+216 -79
View File
@@ -172,11 +172,6 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform)
m_iPreAnimIndex = m_iCurrentAnimIndex;
}
for (_uint i = 0; i < Get_NumMeshes(); i++)
{
ComputeAnimation(m_iCurrentAnimIndex, i);
}
if (m_bIsFinishedAnim)
{
@@ -185,10 +180,18 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform)
m_bLoopRestarted = true;
m_vPrevRootPos = { 0,0,0 };
}
else{
else {
XMStoreFloat3(&m_vPrevRootPos, m_vector[2]);
}
}
ComputeAnimation(m_iCurrentAnimIndex, 0);
if (m_bIsFinishedAnim)
{
m_vPrevRootRot = { 0.f,0.f,0.f,0.f };
m_bInitialRootRotSaved = false;
}
if (m_bRatio) {
Update_RootBone(m_fAmount * m_fRatio);
@@ -198,11 +201,6 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform)
Update_RootBone(m_fAmount);
}
if (m_bIsFinishedAnim)
{
m_vPrevRootRot = { 0.f,0.f,0.f,0.f };
m_bInitialRootRotSaved = false;
}
m_Bones[m_iRootBoneIndex]->Update_CombinedTransformationMatrix(m_Bones, XMLoadFloat4x4(&m_PreTransformMatrix));
@@ -367,7 +365,7 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop, _float fAmount, _boo
m_bInitialRootRotSaved = false;
m_bInitialRootPos = false;
if (m_iCurrentAnimIndex != -1)
if (m_iCurrentAnimIndex != -1 && m_iPreAnimIndex != m_iCurrentAnimIndex)
{
m_iPreAnimIndex = m_iCurrentAnimIndex;
@@ -427,7 +425,7 @@ void CModel::Set_Second_AnimationIndex(_uint BoneIndex, _uint iIndex, _bool isLo
void CModel::Update_RootBone(_float Amount)
{
if (m_Bones[m_iRootBoneIndex]->Compare_Name("Reference")&&
if (m_Bones[m_iRootBoneIndex]->Compare_Name("Reference")|| m_Bones[m_iRootBoneIndex]->Compare_Name("root") &&
m_pTransform != nullptr)
{
_float4x4 Root = m_Bones[m_iRootBoneIndex]->Get_TransformationMatrix();
@@ -502,58 +500,6 @@ void CModel::Update_RootBone(_float Amount)
local = XMMatrixAffineTransformation(scale, XMVectorSet(0.f, 0.f, 0.f, 1.f), rot, trans);
m_Bones[m_iRootBoneIndex]->Set_TransformationMatrix(local);
}
else if (m_Bones[m_iRootBoneIndex]->Compare_Name("root") &&
m_pTransform != nullptr)
{
_float4x4 Root = m_Bones[m_iRootBoneIndex]->Get_TransformationMatrix();
_matrix local = XMLoadFloat4x4(&Root);
_matrix pre = XMLoadFloat4x4(&m_PreTransformMatrix);
_float4 curRotF4;
XMStoreFloat4(&curRotF4, m_vector[1]);
_vector qCur = XMLoadFloat4(&curRotF4);
if (!m_bInitialRootRotSaved)
{
m_vInitialRootRot = curRotF4;
m_vPrevRootRot = curRotF4;
m_bInitialRootRotSaved = true;
}
else
{
_vector qPrev = XMLoadFloat4(&m_vPrevRootRot);
_vector qInvPrev = XMQuaternionInverse(qPrev);
_vector qDelta = XMQuaternionMultiply(qInvPrev, qCur);
_vector axisLocal;
_float angle = 0.f;
XMQuaternionToAxisAngle(&axisLocal, &angle, qDelta);
_vector axisWorld = XMVector3TransformNormal(axisLocal, pre);
axisWorld = XMVector3Normalize(axisWorld);
_float4 axis;
XMStoreFloat4(&axis, axisWorld);
swap(axis.z, axis.y);
m_pTransform->TurnAngle(XMLoadFloat4(&axis), angle);
}
XMStoreFloat4(&m_vPrevRootRot, qCur);
_vector qInit = XMLoadFloat4(&m_vInitialRootRot);
_vector scale, rot, trans;
XMMatrixDecompose(&scale, &rot, &trans, local);
rot = qInit;
trans = XMVectorZero();
local = XMMatrixAffineTransformation(scale, XMVectorSet(0.f, 0.f, 0.f, 1.f), rot, trans);
m_Bones[m_iRootBoneIndex]->Set_TransformationMatrix(local);
}
}
@@ -598,6 +544,53 @@ void CModel::Mark_CPUChain(_int boneIdx)
}
}
//void CModel::Create_BoneStagingBuffer()
//{
// D3D11_BUFFER_DESC desc{};
// desc.Usage = D3D11_USAGE_STAGING;
// desc.ByteWidth = sizeof(BONE_DESC) * (_uint)m_Bones.size();
// desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
// desc.BindFlags = 0;
// desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
// desc.StructureByteStride = sizeof(BONE_DESC);
//
// HRESULT hr = m_pDevice->CreateBuffer(&desc, nullptr, &m_pBoneStagingBuffer);
//}
//const _float4x4 CModel::Get_BoneMatrix_GPU(_uint boneIndex)
//{
//
// m_pContext->CopyResource(m_pBoneStagingBuffer, m_pBoneMatrixBuffer);
//
// D3D11_MAPPED_SUBRESOURCE mapped{};
// m_pContext->Map(
// m_pBoneStagingBuffer,
// 0,
// D3D11_MAP_READ,
// 0,
// &mapped
// );
//
// BONE_DESC*pBone = static_cast<BONE_DESC*>(mapped.pData);
//
// m_pContext->Unmap(m_pBoneStagingBuffer, 0);
//
// return pBone->Combined;
//}
//const _float4x4* CModel::Get_BoneMatrixPtr_Socket(const _char* name)
//{
// _int idx = Find_BoneIndex(name);
// if (idx < 0)
// return nullptr;
//
// _float4x4 mat = Get_BoneMatrix_GPU(idx);
// m_SocketCache[name] = mat;
//
// return &m_SocketCache[name];
//}
const _float4x4* CModel::Get_BoneMatrixPtr(const _char* pBoneName)
{
_int boneIdx = Get_BoneIndex(pBoneName);
@@ -658,6 +651,20 @@ void CModel::Combined_BoneMatrix()
}
}
_int CModel::Find_BoneIndex(const _char* pBoneName)
{
if (pBoneName == nullptr)
return -1;
for (_uint i = 0; i < m_Bones.size(); ++i)
{
if (m_Bones[i] && m_Bones[i]->Compare_Name(pBoneName))
return (_int)i;
}
return -1;
}
void CModel::Set_CurrentTrackPosition(_float TrackPosition)
{
@@ -1432,6 +1439,36 @@ void CModel::Initialize_BoneMasks()
}
HRESULT CModel::Create_ComputeShader()
{
_uint CS_InputStrides[] = {
sizeof(_float4x4),
sizeof(int),
sizeof(_uint)
};
_uint CS_OutputStrides[] = {
sizeof(BONE_DESC),
};
CComputeShader::CS_INFO CS_Desc = {};
CS_Desc.iNumElement = (_uint)m_Bones.size();
CS_Desc.iNumInputBuffer = 3;
CS_Desc.iNumOutputBuffer = 1;
CS_Desc.iInputStructStride = CS_InputStrides;
CS_Desc.iOutputStructStride = CS_OutputStrides;
m_pComputeShader = (CComputeShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, TEXT("CS_Model"), &CS_Desc, nullptr);
if (nullptr == m_pComputeShader) {
return E_FAIL;
}
return S_OK;
}
HRESULT CModel::Create_ComputeShaderLocal()
{
_uint CS_InputStrides[] = {
sizeof(KEYFRAME_DESC), // 키프레임
@@ -1456,9 +1493,9 @@ HRESULT CModel::Create_ComputeShader()
CS_Desc.iInputStructStride = CS_InputStrides;
CS_Desc.iOutputStructStride = CS_OutputStrides;
m_pComputeShader = (CComputeShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, TEXT("CS_Model"), &CS_Desc, nullptr);
m_pCS_AnimLocal = (CComputeShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, TEXT("CS_Local"), &CS_Desc, nullptr);
if (nullptr == m_pComputeShader) {
if (nullptr == m_pCS_AnimLocal) {
return E_FAIL;
}
@@ -1538,6 +1575,15 @@ HRESULT CModel::Create_BoneMatrixVB()
&m_pBoneMatrixUAV
);
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc1 = {};
srvDesc1.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;
srvDesc1.Format = DXGI_FORMAT_UNKNOWN;
srvDesc1.Buffer.FirstElement = 0;
srvDesc1.Buffer.NumElements = (_uint)m_Bones.size();
if (FAILED(m_pDevice->CreateShaderResourceView(m_pBoneMatrixBuffer, &srvDesc1, &m_pBoneMatrixSRV)))
return E_FAIL;
return S_OK;
}
@@ -1571,14 +1617,7 @@ HRESULT CModel::Create_ParentSrv()
if (FAILED(m_pDevice->CreateShaderResourceView(m_pParentBuffer, &srvDesc, &m_pParentSRV)))
return E_FAIL;
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc1 = {};
srvDesc1.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;
srvDesc1.Format = DXGI_FORMAT_UNKNOWN;
srvDesc1.Buffer.FirstElement = 0;
srvDesc1.Buffer.NumElements = (_uint)m_Bones.size();
if (FAILED(m_pDevice->CreateShaderResourceView(m_pBoneMatrixBuffer, &srvDesc1, &m_pBoneMatrixSRV)))
return E_FAIL;
return S_OK;
}
@@ -1597,7 +1636,89 @@ HRESULT CModel::Create_BoneLocalSrv()
return S_OK;
}
HRESULT CModel::Create_Local()
{
_uint iCount = (_uint)m_Bones.size();
_uint iStride = sizeof(_float4x4);
D3D11_BUFFER_DESC desc = {};
desc.Usage = D3D11_USAGE_DEFAULT;
desc.ByteWidth = iStride * iCount;
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS;
desc.CPUAccessFlags = 0;
desc.StructureByteStride = iStride;
desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
HRESULT hr = m_pDevice->CreateBuffer(&desc, nullptr, &m_pLocalMatrixBuffer);
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;
srvDesc.Format = DXGI_FORMAT_UNKNOWN;
srvDesc.Buffer.FirstElement = 0;
srvDesc.Buffer.NumElements = (_uint)m_Bones.size();
if (FAILED(m_pDevice->CreateShaderResourceView(m_pLocalMatrixBuffer, &srvDesc, &m_pLocalMatrixSRV)))
return E_FAIL;
D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc{};
uavDesc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER;
uavDesc.Format = DXGI_FORMAT_UNKNOWN;
uavDesc.Buffer.FirstElement = 0;
uavDesc.Buffer.NumElements = (_uint)m_Bones.size();
m_pDevice->CreateUnorderedAccessView(
m_pLocalMatrixBuffer,
&uavDesc,
&m_pLocalMatrixUAV
);
return S_OK;
}
void CModel::ComputeAnimation(_uint AnimIndex,_uint MeshIndex)
{
ComputeLocal(AnimIndex,MeshIndex);
if (m_pComputeShader == nullptr)
return;
_uint meshBoneCount = m_Meshes[MeshIndex]->Get_NumBone();
_uint iGroupCountX = (meshBoneCount + 255) / 256;
ID3D11Buffer* CSBuffers[] =
{
m_pLocalMatrixBuffer,
m_pParentBuffer,
m_Meshes[MeshIndex]->Get_BoneRemapBuffer()
};
ID3D11ShaderResourceView* srvs[] =
{
m_pLocalMatrixSRV,
m_pParentSRV,
m_Meshes[MeshIndex]->Get_BoneRemapSRV()
};
ID3D11UnorderedAccessView* uavs[] =
{
m_pBoneMatrixUAV
};
m_pComputeShader->Dispatch_ExternalSRV_UAV(
0,
0,
_float3((_float)iGroupCountX, 1.f, 1.f),
srvs,
3,
uavs,
1,
m_pConstantBuffer
);
}
void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex)
{
D3D11_MAPPED_SUBRESOURCE ConstantSubResource = {};
@@ -1610,15 +1731,18 @@ void CModel::ComputeAnimation(_uint AnimIndex,_uint MeshIndex)
pDesc->Duration = anim->Get_Duration();
pDesc->MeshBoneCount = m_Meshes[MeshIndex]->Get_NumBone();
pDesc->BoneCount = (_uint)m_Bones.size();
pDesc->RootBoneIndex = m_iRootBoneIndex;
pDesc->CurrentAnimIndex = m_iCurrentAnimIndex;
pDesc->PrevAnimIndex = m_iPreAnimIndex;
pDesc->PrevTime = m_Animations[m_iPreAnimIndex]->Get_CurrentTrackPosition();
pDesc->BlendRatio = m_fRatio;
pDesc->RootBoneIndex = m_iRootBoneIndex;
pDesc->PreTransformMatrix = m_PreTransformMatrix;
pDesc->RootInitRot = m_vInitialRootRot;
m_pContext->Unmap(m_pConstantBuffer, 0);
}
if (m_pComputeShader == nullptr)
if (m_pCS_AnimLocal == nullptr)
return;
_uint iGroupCountX = (_uint)(m_Bones.size() + 255) / 256;
@@ -1648,10 +1772,10 @@ void CModel::ComputeAnimation(_uint AnimIndex,_uint MeshIndex)
ID3D11UnorderedAccessView* uavs[] =
{
m_pBoneMatrixUAV
m_pLocalMatrixUAV
};
m_pComputeShader->Dispatch_ExternalSRV_UAV(
m_pCS_AnimLocal->Dispatch_ExternalSRV_UAV(
0,
0,
_float3((_float)iGroupCountX, 1.f, 1.f),
@@ -1661,6 +1785,11 @@ void CModel::ComputeAnimation(_uint AnimIndex,_uint MeshIndex)
1,
m_pConstantBuffer
);
ID3D11UnorderedAccessView* nullUAV[1] = { nullptr };
UINT counts[1] = { 0 };
m_pContext->CSSetUnorderedAccessViews(0, 1, nullUAV, counts);
}
@@ -2121,6 +2250,7 @@ HRESULT CModel::Initialize(void* pArg)
m_BoneLocal[i] = m_Bones[i]->Get_TransformationMatrix();
}
Create_Local();
Create_Const();
Create_Temp();
Create_BoneMatrixVB();
@@ -2128,10 +2258,13 @@ HRESULT CModel::Initialize(void* pArg)
Create_BoneLocalVB();
Create_ParentSrv();
Create_BoneLocalSrv();
//Create_BoneStagingBuffer();
if (FAILED(Create_ComputeShaderLocal()))
return E_FAIL;
if (FAILED(Create_ComputeShader()))
return E_FAIL;
}
@@ -2239,14 +2372,18 @@ void CModel::Free()
SAFE_RELEASE(m_pComputeShader);
SAFE_RELEASE(m_pCS_AnimLocal);
SAFE_RELEASE(m_pConstantBuffer);
SAFE_RELEASE(m_pParentBuffer);
SAFE_RELEASE(m_pBoneLocalBuffer);
SAFE_RELEASE(m_pBoneMatrixBuffer);
SAFE_RELEASE(m_pLocalMatrixBuffer);
SAFE_RELEASE(m_pParentSRV);
SAFE_RELEASE(m_pBoneLocalSRV);
SAFE_RELEASE(m_pBoneMatrixSRV);
SAFE_RELEASE(m_pBoneMatrixUAV);
SAFE_RELEASE(m_pLocalMatrixSRV);
SAFE_RELEASE(m_pLocalMatrixUAV);
for (auto& pAnimation : m_Animations) {
SAFE_RELEASE(pAnimation);
@@ -156,6 +156,13 @@ HRESULT CPrototype_Manager::Ready_EngineAssets()
}
if (FAILED(Add_Asset_Prototype(g_iStaticLevel, TEXT("CS_Local"),
CComputeShader::Create(m_pDevice, m_pContext,
L"../Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl", "CS_LOCAL")))) {
return E_FAIL;
}
#pragma endregion
return S_OK;
@@ -39,6 +39,7 @@ class ENGINE_DLL CAnimation : public CBase
_uint Get_ChannelCount() { return m_iNumChannels; }
_uint Get_KeyFrameCount() { return m_iKeyframeCount; }
_float Get_Duration() { return m_fDuration; }
_float Get_AnimTime() { return m_fTempTrack; }
ID3D11Buffer* Get_KeyFrameBuffer() { return m_pKeyFrameBuffer; }
ID3D11Buffer* Get_ChannelBuffer() { return m_pChannelBuffer; }
@@ -130,6 +130,7 @@ enum class PXOBJECT : _uint {
GOBLIN_THEIF,
TROLL,
PENSIVE_GUARDIAN,
RANRAK,
#pragma endregion
#pragma region HOSTILE_HITBOX
@@ -417,8 +417,8 @@ typedef struct tagChannelDesc
typedef struct tagBoneMatrix
{
_float4x4 Local;
_float4x4 Combined;
_float4x4 Local;
_float4x4 LocalCombined;
}BONE_DESC;
+5
View File
@@ -43,6 +43,11 @@ enum ESTATE : _u64Flag
FLY = 1ULL << 36,
TURBOFLY = 1ULL << 37,
PARRY = 1ULL << 38,
FIREBREATH = 1ULL << 39,
FIREBALL = 1ULL << 40,
PULSE = 1ULL << 41,
TUCKED = 1ULL << 42,
ANCIENT_SPELL = 1ULL << 43,
END
};
NS_END
+30 -3
View File
@@ -14,14 +14,20 @@ class ENGINE_DLL CModel final : public CComponent
_int MeshBoneCount;
_int BoneCount;
_int RootBoneIndex;
_int Padding;
_int CurrentAnimIndex;
_int PrevAnimIndex;
_float PrevTime;
_float BlendRatio;
_int RootBoneIndex;
_float3 padding;
_float4x4 PreTransformMatrix;
_float4 RootInitRot;
}ANIMSTATE_DESC;
private:
CModel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CModel(const CModel& rhs);
@@ -72,6 +78,8 @@ class ENGINE_DLL CModel final : public CComponent
vector<_float4x4> Get_OffsetMatrix(_int iIndex);
void Apply_CPUMask_ToBones();
void Mark_CPUChain(_int boneIdx);
void Create_BoneStagingBuffer();
void Copy_BoneToStaging(_uint boneIndex);
#pragma endregion
#pragma region Bone
HRESULT Bind_BoneMatrices(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName);
@@ -82,6 +90,8 @@ class ENGINE_DLL CModel final : public CComponent
_int Get_BoneIndex(const _char* pBoneName) const;
_matrix Get_BoneMatrix(_uint iBoneIndex);
void Combined_BoneMatrix();
_int Find_BoneIndex(const _char* pBoneName);
#pragma endregion
#pragma region Material
HRESULT Bind_Material(_uint iMeshIndex, class CShader* pShader);
@@ -89,6 +99,8 @@ class ENGINE_DLL CModel final : public CComponent
#pragma endregion
void ComputeAnimation(_uint AnimIndex, _uint MeshIndex);
void ComputeLocal(_uint AnimIndex, _uint MeshIndex);
void ReadbackBoneMatrices();
void Bind_OutPut_SRV_VS(_uint iIndex, _uint iBufferIndex);
void ComputeAnimation_Second(_uint AnimIndex);
void InItialize_BoneIndex();
@@ -137,7 +149,7 @@ class ENGINE_DLL CModel final : public CComponent
_int m_iPreAnimIndex = { -1 };
_float m_fBlendTime = { 0.f };
_float m_fBlendDuration = { 0.3f };
_float m_fBlendDuration = { 0.35f };
_float3 m_vRadiusOffset = {}; // 컬링용 Radius Offset
_float m_fSecondBlendTime = {};
@@ -182,6 +194,8 @@ class ENGINE_DLL CModel final : public CComponent
_bool m_bRatio = { false };
_bool m_bRootBone = {};
_float4x4 m_RootMatrix = {};
unordered_map<_string, _float4x4> m_SocketCache;
private:
#ifdef EDITOR_PROJECT
@@ -194,6 +208,7 @@ class ENGINE_DLL CModel final : public CComponent
private:
HRESULT Create_ComputeShader();
HRESULT Create_ComputeShaderLocal();
HRESULT Create_ParentVB();
HRESULT Create_BoneLocalVB();
HRESULT Create_Temp();
@@ -202,6 +217,8 @@ class ENGINE_DLL CModel final : public CComponent
HRESULT Create_ParentSrv();
HRESULT Create_BoneLocalSrv();
HRESULT Create_Local();
_uint m_iNumBuffer = {};
vector<_int> m_Parent = {};
@@ -209,17 +226,27 @@ class ENGINE_DLL CModel final : public CComponent
vector<ANIMSTATE_DESC> m_AnimRanges;
vector<_float4x4> m_BoneMatrixCPU;
class CComputeShader* m_pComputeShader = nullptr;
class CComputeShader* m_pCS_AnimLocal = nullptr;
ID3D11Buffer* m_pConstantBuffer = { nullptr };
ID3D11Buffer* m_pParentBuffer = { nullptr };
ID3D11Buffer* m_pBoneMatrixBuffer = { nullptr };
ID3D11Buffer* m_pBoneLocalBuffer = { nullptr };
ID3D11Buffer* m_pLocalMatrixBuffer = { nullptr };
ID3D11ShaderResourceView* m_pParentSRV = {};
ID3D11ShaderResourceView* m_pBoneLocalSRV = {};
ID3D11ShaderResourceView* m_pBoneMatrixSRV = {};
ID3D11ShaderResourceView* m_pLocalMatrixSRV = {};
ID3D11UnorderedAccessView* m_pBoneMatrixUAV = {};
ID3D11UnorderedAccessView* m_pLocalMatrixUAV = {};
#pragma endregion
private:
+6
View File
@@ -20,6 +20,7 @@ enum ESTATE
MAPHELP,POTION,
ACCIO,DESCENDO,DIFFINDO,DEPULSO,LUMOS,LUMOS_STOP,DISILLUSION_ENTER,DISILLUSION_EXIT, ANCIENT_THROW,
SPELL_FAIL, SPELL_CHARGE,
ANCIENT_LIGHTNING_CHARGE, ANCIENT_LIGHTNING,
PARRY_180,PARRY2, PARRY3, PARRY4,
BROOM_IDLE,BROOM_FWD,BROOM_LEFT,BROOM_RIGHT,BROOM_DOWN,BROOM_UP, BROOM_REVELIO, BROOM_HOVER_IDLE, BROOM_HOVER_FWD, BROOM_HOVER_LEFT, BROOM_HOVER_RIGHT, BROOM_HOVER_START, BROOM_HOVER_REVELIO,BROOM_MOUNT, BROOM_MOUNT_END,BROOM_DISMOUNT,BROOM_TURBO_FWD, BROOM_TURBO_DOWN, BROOM_TURBO_UP, BROOM_TURBO_LEFT, BROOM_TURBO_RIGHT,
RUSH_START,RUSH_LOOP,RUSH_END,
@@ -37,6 +38,11 @@ enum ESTATE
STUN,
FLINCH_BWD,FLINCH_FWD, FLINCH_LEFT, FLINCH_RIGHT,
STUMBLE_BWD_L,STUMBLE_BWD_R,STUMBLE_FWD,
HOVER_LOOP,HOVER_DASH_FWD, HOVER_DASH_BWD, HOVER_DASH_LEFT, HOVER_DASH_RIGHT,
FIREBALL1,FIREBALL2,
FIREBREATH,FIREBREATH_COOLDOWN,FIREBREATH_WINDUP,
PULSE,
TUCKED,
////////////////////////// 빗자루
BROOM_MOUNT_B, BROOM_HOVER_IDLE_B, BROOM_HOVER_STOP_B,BROOM_HOVER_DOWN_B,BROOM_HOVER_UP_B,BROOM_HOVER_LEFT_B,BROOM_HOVER_RIGHT_B,BROOM_FLY_DOWN_B, BROOM_FLY_LEFT_B, BROOM_FLY_RIGHT_B, BROOM_FLY_UP_B,BROOM_FLY_B,BROOM_ADD,
/// ////////////////////////////