This commit is contained in:
GiJungSUk
2025-12-31 22:10:34 +09:00
parent 3e79f666eb
commit b70cd3c342
8 changed files with 110 additions and 25 deletions
@@ -59,6 +59,11 @@ struct ParticleValue
float3 vWolrdOffset;
float fLoopCount; /* 현재 몇번째 루프중인지 */
float fRoundRangeLength;
float fAzimuthAngle;
float fPolarAngle;
float fRoundLengthLerpSpeed;
row_major matrix PreWorldMatrix;
row_major matrix LocalMatrixInv;
};
@@ -99,7 +104,7 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐
bool isNoResetTime;
bool isLocal_Located_Not_TakeDelay;
bool isCompute_LocalInverse;
bool isPadding2;
bool isRoundLengthLerp;
float fTimeDelta;
float fSizeLerpOption; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다.
@@ -160,6 +165,7 @@ void CS_MAIN(
if (isNoPos)
{
particle.vTranslation.xyz += WorldMatrix[3].xyz;
/* 월드 오프셋 */
@@ -170,6 +176,22 @@ void CS_MAIN(
}
}
if (isRoundLengthLerp == true)
{
if(particle.vLifeTime.x < particle.vLifeTime.y)
{
float3 vRoundRange = float3(
particleValue.fRoundRangeLength * cos(particleValue.fAzimuthAngle) * sin(particleValue.fPolarAngle),
particleValue.fRoundRangeLength * sin(particleValue.fAzimuthAngle) * sin(particleValue.fPolarAngle),
particleValue.fRoundRangeLength * cos(particleValue.fPolarAngle)
);
particleValue.vOriginTranslation.xyz += particleValue.fRoundLengthLerpSpeed * vRoundRange * fTimeDelta;
particle.vTranslation.xyz += particleValue.fRoundLengthLerpSpeed * vRoundRange * fTimeDelta;
}
}
particleValue.vDelay.x += fTimeDelta;
if (particleValue.vDelay.x < particleValue.vDelay.y)
@@ -271,6 +293,7 @@ void CS_MAIN(
return ;
}
if (isDrop == true)
{
@@ -49,6 +49,12 @@ struct ParticleValue
float3 vWolrdOffset;
float fLoopCount; /* 현재 몇번째 루프중인지 */
float fRoundRangeLength;
float fAzimuthAngle;
float fPolarAngle;
float fRoundLengthLerpSpeed;
row_major matrix PreWorldMatrix;
row_major matrix LocalMatrixInv;
};
@@ -1770,7 +1776,7 @@ technique11 DefaultTechnique
pass Default_NonPos
{
SetRasterizerState(RS_Nocull);
SetDepthStencilState(DSS_None, 0);
SetDepthStencilState(DSS_Default, 0);
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN_NO_POS();
GeometryShader = NULL;
@@ -59,6 +59,11 @@ struct ParticleValue
float3 vWolrdOffset;
float fLoopCount; /* 현재 몇번째 루프중인지 */
float fRoundRangeLength;
float fAzimuthAngle;
float fPolarAngle;
float fRoundLengthLerpSpeed;
row_major matrix PreWorldMatrix;
row_major matrix LocalMatrixInv;
};
@@ -99,7 +104,7 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐
bool isNoResetTime;
bool isLocal_Located_Not_TakeDelay;
bool isCompute_LocalInverse;
bool isPadding2;
bool isRoundLengthLerp;
float fTimeDelta;
float fSizeLerpOption; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다.
@@ -160,6 +165,7 @@ void CS_MAIN(
if (isNoPos)
{
particle.vTranslation.xyz += WorldMatrix[3].xyz;
/* 월드 오프셋 */
@@ -170,6 +176,22 @@ void CS_MAIN(
}
}
if (isRoundLengthLerp == true)
{
if(particle.vLifeTime.x < particle.vLifeTime.y)
{
float3 vRoundRange = float3(
particleValue.fRoundRangeLength * cos(particleValue.fAzimuthAngle) * sin(particleValue.fPolarAngle),
particleValue.fRoundRangeLength * sin(particleValue.fAzimuthAngle) * sin(particleValue.fPolarAngle),
particleValue.fRoundRangeLength * cos(particleValue.fPolarAngle)
);
particleValue.vOriginTranslation.xyz += particleValue.fRoundLengthLerpSpeed * vRoundRange * fTimeDelta;
particle.vTranslation.xyz += particleValue.fRoundLengthLerpSpeed * vRoundRange * fTimeDelta;
}
}
particleValue.vDelay.x += fTimeDelta;
if (particleValue.vDelay.x < particleValue.vDelay.y)
@@ -271,6 +293,7 @@ void CS_MAIN(
return ;
}
if (isDrop == true)
{
@@ -581,6 +581,8 @@ void CInstance_Model::Compute_CS(_float fTimeDelta)
pDesc->isNoResetTime = m_InstanceDesc.isNoResetTime;
pDesc->isLocal_Located_Not_TakeDelay = m_InstanceDesc.isLocal_Located_Not_TakeDelay;
pDesc->isCompute_LocalInverse = m_InstanceDesc.isCompute_LocalInverse;
pDesc->isRoundLengthLerp = m_InstanceDesc.isRoundLengthLerp;
pDesc->WorldMatrix = *m_pOwner->Get_Component<CTransform>()->Get_WorldMatrixPtr();
@@ -697,6 +699,12 @@ void CInstance_Model::Instane_Buffer_ReStruct()
+ fRoundRange * cosf(XMConvertToRadians(fPolarAngle)),
1.f);
pParticleValues[i].fRoundRangeLength = fRoundRange;
pParticleValues[i].fAzimuthAngle = XMConvertToRadians(fAzimuthAngle);
pParticleValues[i].fPolarAngle = XMConvertToRadians(fPolarAngle);
pParticleValues[i].fRoundLengthLerpSpeed = m_InstanceDesc.fRoundLengthLerpSpeed;
_float3 vSinAmount = _float3(
m_pGameInstance->Random_Float(m_InstanceDesc.vSinMinAmount.x, m_InstanceDesc.vSinMaxAmount.x),
@@ -922,7 +930,6 @@ void CInstance_Model::Describe_Entity()
}
if (GUI::TreeNode("Transform"))
{
@@ -956,20 +963,6 @@ void CInstance_Model::Describe_Entity()
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("RoundRangeLength", reinterpret_cast<_float*>(&m_InstanceDesc.vRoundRangeLength)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("AzimuthAngle", reinterpret_cast<_float*>(& m_InstanceDesc.vAzimuthAngle)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("PolarAngle", reinterpret_cast<_float*>(&m_InstanceDesc.vPolarAngle)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat3("WolrdOffsetMin", reinterpret_cast<_float*>(&m_InstanceDesc.vWolrdOffsetMin)))
{
@@ -981,6 +974,39 @@ void CInstance_Model::Describe_Entity()
Instane_Buffer_ReStruct();
}
if (GUI::TreeNode("Round Range"))
{
if (ImGui::DragFloat2("RoundRangeLength", reinterpret_cast<_float*>(&m_InstanceDesc.vRoundRangeLength)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("AzimuthAngle", reinterpret_cast<_float*>(&m_InstanceDesc.vAzimuthAngle)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("PolarAngle", reinterpret_cast<_float*>(&m_InstanceDesc.vPolarAngle)))
{
Instane_Buffer_ReStruct();
}
if (GUI::Checkbox("RoundLengthLerp", &m_InstanceDesc.isRoundLengthLerp))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat("fRoundLengthLerpSpeed", reinterpret_cast<_float*>(&m_InstanceDesc.fRoundLengthLerpSpeed)))
{
Instane_Buffer_ReStruct();
}
GUI::TreePop();
}
GUI::TreePop();
}
@@ -632,7 +632,6 @@ void CRenderer::Free()
void CRenderer::Describe_Entitiy()
{
GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG);
GUI::SetColumnWidth(180.f);
if (GUI::CollapsingHeader("RENDERER")) {
if (GUI::CollapsingHeader("PostProcessing_Bloom"))
{
@@ -78,15 +78,15 @@ class ENGINE_DLL CInstance_Model final : public CComponent
_bool isNoResetTime = {};
_bool isLocal_Located_Not_TakeDelay = {};
_bool isCompute_LocalInverse = {};
_bool isPadding3 = {};
_bool isRoundLengthLerp = {};
_float fTimeMult = { 1.f };
_float2 vRoundRangeLength = {};
_float2 vAzimuthAngle = {};
_float2 vPolarAngle = {};
_float fRoundLengthLerpSpeed = {};
_float4 vPadding6 = {};
_float3 vPadding6 = {};
_bool isRandomAniIndex = {};
_bool isMoveUp = {};
@@ -193,7 +193,7 @@ class ENGINE_DLL CInstance_Model final : public CComponent
_int isNoResetTime = {};
_int isLocal_Located_Not_TakeDelay = {};
_int isCompute_LocalInverse = {};
_int isPadding2 = {};
_int isRoundLengthLerp = {};
_float fTimeDelta = {};
_float fSizeLerpOption = {};
@@ -254,6 +254,11 @@ class ENGINE_DLL CInstance_Model final : public CComponent
_float3 vWolrdOffset = {};
_float fLoopCount = {};
_float fRoundRangeLength = {};
_float fAzimuthAngle = {};
_float fPolarAngle = {};
_float fRoundLengthLerpSpeed = {};
_float4x4 PreWorldMatrix = {};
_float4x4 LocalMatrixInv = {};