251125_
Commit
This commit is contained in:
@@ -50,7 +50,7 @@ RWStructuredBuffer<ParticleValue> g_ParticleValueOutput : register(u1);
|
||||
|
||||
cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐이더 바인딩할때 인덱스가 동일해야함
|
||||
{
|
||||
row_major matrix CamViewInvMatrix;
|
||||
row_major matrix WorldMatrix;
|
||||
|
||||
bool isLoop; // 상수 버퍼에서 불값은 4바이트로 처리되기 때문에 반드시 클라에서는 int형으로 선언해라
|
||||
bool isDrop;
|
||||
@@ -61,6 +61,11 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐
|
||||
bool isAxisTurn;
|
||||
bool isPivotMove;
|
||||
bool isSizeMove;
|
||||
|
||||
bool isNoWorld;
|
||||
bool isPadding0;
|
||||
bool isPadding1;
|
||||
bool isPadding2;
|
||||
|
||||
float fTimeDelta;
|
||||
float fPadding1; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다.
|
||||
@@ -84,14 +89,30 @@ void CS_MAIN(
|
||||
|
||||
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)
|
||||
@@ -100,7 +121,6 @@ void CS_MAIN(
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
//초기화
|
||||
particle.vRight = particleValue.vOriginRight;
|
||||
particle.vUp = particleValue.vOriginUp;
|
||||
@@ -111,6 +131,8 @@ void CS_MAIN(
|
||||
particleValue.vAniIndex.x = 0.f;
|
||||
particleValue.vDelay.x = 0.f;
|
||||
|
||||
|
||||
|
||||
g_VBInstanceOutput[iIndex] = particle;
|
||||
g_ParticleValueOutput[iIndex] = particleValue;
|
||||
|
||||
@@ -239,6 +261,7 @@ void CS_MAIN(
|
||||
particle.vLook = normalize(particle.vLook) * CurLength.z;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//애니메이션 속도 , 인덱스
|
||||
|
||||
|
||||
@@ -30,10 +30,17 @@ float2 g_fCurrent_Size;
|
||||
float2 g_fHpBG;
|
||||
|
||||
float4 g_fNine_Slice;
|
||||
float4 g_fImageUV;
|
||||
float4 g_fImageUV1;
|
||||
|
||||
float2 g_fPosition[4];
|
||||
float4 g_fImagesUV[4];
|
||||
|
||||
Texture2D g_Texture;
|
||||
Texture2D g_Texture1;
|
||||
Texture2D g_Texture2;
|
||||
Texture2D g_Texture3;
|
||||
Texture2D g_Texture4;
|
||||
Texture2D g_DiffuseTexture;
|
||||
Texture2D g_MaskingTexture;
|
||||
|
||||
@@ -97,6 +104,8 @@ PS_OUT PS_AlphaBlend(PS_IN In)
|
||||
|
||||
float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
Color.rgb *= 1.5f;
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
@@ -548,6 +557,125 @@ PS_OUT PS_HpBar(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_Magic_Meter(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
float3 Blue = float3(41.f, 165.f, 255.f) / 255.f;
|
||||
|
||||
float4 color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord);
|
||||
float4 tex2 = g_Texture1.Sample(ClampSampler, In.vTexcoord);
|
||||
|
||||
float2 reverseuv = 1.f - In.vTexcoord;
|
||||
|
||||
color = tex1;
|
||||
tex2.rgb *= Blue * 1.5f;
|
||||
|
||||
if (reverseuv.x >= g_fHp)
|
||||
{
|
||||
tex2.rgb = float3(0.f, 0.f, 0.f);
|
||||
}
|
||||
|
||||
if (all(color.rgb >= float3(65.f / 255.f, 65.f / 255.f, 65.f / 255.f)))
|
||||
color = tex2;
|
||||
|
||||
color.a *= Alpha;
|
||||
|
||||
Out.vColor = color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
|
||||
PS_OUT PS_Magic_Icon(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
|
||||
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord);
|
||||
float2 uv = In.vTexcoord;
|
||||
float2 center = float2(0.5, 0.5);
|
||||
float scale = 1.2;
|
||||
|
||||
uv = (uv - center) * scale + center;
|
||||
float4 tex2 = g_Texture1.Sample(ClampSampler, uv);
|
||||
|
||||
Color = tex1;
|
||||
|
||||
Color = tex1 * (1 - tex2.a) + tex2;
|
||||
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_RemapUV(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
|
||||
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
|
||||
float2 startUV = g_fImageUV.xy;
|
||||
float2 endUV = g_fImageUV.zw;
|
||||
|
||||
float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV);
|
||||
|
||||
float4 tex1 = g_Texture.Sample(DefaultSampler, atlasUV);
|
||||
|
||||
Color = tex1;
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_Revelio(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
|
||||
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
float2 UV = In.vTexcoord;
|
||||
|
||||
float2 Position[4];
|
||||
float2 startUV[4];
|
||||
float2 endUV[4];
|
||||
|
||||
float2 Atlases[4];
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
Position[i] = g_fPosition[i];
|
||||
startUV[i] = g_fImagesUV[i].xy;
|
||||
endUV[i] = g_fImagesUV[i].zw;
|
||||
|
||||
Atlases[i] = startUV[i] + UV * (endUV[i] - startUV[i]);
|
||||
}
|
||||
|
||||
float4 tex1 = g_Texture.Sample(DefaultSampler, UV);
|
||||
float4 tex2 = g_Texture1.Sample(DefaultSampler, Atlases[0]);
|
||||
float4 tex3 = g_Texture1.Sample(DefaultSampler, Atlases[1]);
|
||||
float4 tex4 = g_Texture2.Sample(DefaultSampler, Atlases[2]);
|
||||
float4 tex5 = g_Texture2.Sample(DefaultSampler, Atlases[3]);
|
||||
|
||||
|
||||
|
||||
//float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV);
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
technique11 PosTexTechnique11
|
||||
{
|
||||
pass Default
|
||||
@@ -688,4 +816,44 @@ technique11 PosTexTechnique11
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_HpBar();
|
||||
}
|
||||
pass Magic_Meter
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Magic_Meter();
|
||||
}
|
||||
|
||||
pass Magic_Icon
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Magic_Icon();
|
||||
}
|
||||
|
||||
pass RemapUV
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_RemapUV();
|
||||
}
|
||||
|
||||
pass Revelio
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Revelio();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ HRESULT CEffectObject::Render()
|
||||
for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++)
|
||||
{
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::NON_NOMALMAP)))) {
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(m_EffectInfo.eShaderPass)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -76,11 +76,23 @@ HRESULT CEffectObject::Render_Blur()
|
||||
|
||||
|
||||
|
||||
|
||||
SHADER_PASS_INSTANCE_MODEL BlurPass = {};
|
||||
|
||||
if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NON_WORLD)
|
||||
{
|
||||
BlurPass = SHADER_PASS_INSTANCE_MODEL::BLUR_NO_WORLD;
|
||||
}
|
||||
else
|
||||
{
|
||||
BlurPass = SHADER_PASS_INSTANCE_MODEL::BLUR;
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++)
|
||||
{
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::BLUR)))) {
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(BlurPass)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -96,8 +108,6 @@ HRESULT CEffectObject::Render_Blur()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -461,6 +471,12 @@ HRESULT CEffectObject::Bind_ShaderResources()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isEmissiveDissolveReverse", &m_EffectInfo.isEmissiveDissolveReverse, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_EffectInfo.vColor, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -498,7 +514,7 @@ HRESULT CEffectObject::Bind_ShaderResources()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVCutting", &m_EffectInfo.vUVCutting, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity()))))
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Broom_Model"),
|
||||
|
||||
@@ -43,11 +43,7 @@ void CTrailObject::Update(_float fTimeDelta)
|
||||
return;
|
||||
|
||||
|
||||
m_CombinedMat = m_pParentTransformCom->Get_XMWorldMatrix();
|
||||
|
||||
m_CombinedMat.r[3] += m_vOffset;
|
||||
|
||||
m_pTrailCom->Trail_Update(fTimeDelta, m_CombinedMat);
|
||||
m_pTrailCom->Trail_Update(fTimeDelta, m_pParentTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
|
||||
if (m_TrailInfo.vDistortionTime.y == 0)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "TrailObject.h"
|
||||
#include "EffectParts.h"
|
||||
|
||||
CWand::CWand(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CPartObject(pDevice, pContext)
|
||||
@@ -41,10 +42,16 @@ HRESULT CWand::Initialize(void* pArg)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(pTrail->Load_Trail("../Bin/Resources/Data/Effect/Decendo/Proj_Trail" , static_cast<LEVEL>(NEXT_LEVEL))))
|
||||
if (FAILED(pTrail->Load_Trail("../Bin/Resources/Data/Effect/Trail/Bombard_Trail" , static_cast<LEVEL>(NEXT_LEVEL))))
|
||||
return E_FAIL;
|
||||
|
||||
pTrail->Set_Target(m_pModelCom->Get_BoneMatrixPtr("root" ), XMVectorSet(0.f, 1.f, 0.f , 0.f));
|
||||
pTrail->Set_Target(m_pModelCom->Get_BoneMatrixPtr("Effect"), XMVectorSet(0.f, 0.f, 0.f , 0.f));
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CEffectParts>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Trail"), &PartsDesc, this, &pEffectParts))) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -67,6 +74,10 @@ void CWand::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CWand::Update(_float fTimeDelta)
|
||||
{
|
||||
_float4x4 WorldMat = *m_pModelCom->Get_BoneMatrixPtr("Effect");
|
||||
|
||||
pEffectParts->Get_Component<CTransform>()->Set_WorldMatrix(WorldMat);
|
||||
pEffectParts->Set_Visible(true);
|
||||
}
|
||||
|
||||
void CWand::Late_Update(_float fTimeDelta)
|
||||
@@ -175,6 +186,8 @@ void CWand::Free()
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
SAFE_RELEASE(pEffectParts);
|
||||
SAFE_RELEASE(pTrail);
|
||||
}
|
||||
|
||||
void CWand::Describe_Entity()
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Client
|
||||
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, END };
|
||||
enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, BLUR_NO_WORLD, END };
|
||||
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 };
|
||||
|
||||
@@ -51,7 +51,7 @@ class CEffectObject abstract : public CPartObject
|
||||
_bool isMaskUVMove = {};
|
||||
_bool isBlur = {};
|
||||
_bool isBillboard = {};
|
||||
|
||||
|
||||
|
||||
_float4 vEmissive = { 0.f ,0.f ,0.f ,0.f };
|
||||
_float fDiffuseAlpha = { 1.f };
|
||||
@@ -73,17 +73,19 @@ class CEffectObject abstract : public CPartObject
|
||||
_bool isNoiseAlpha = { false };
|
||||
_bool isNomalDissolve = {};
|
||||
|
||||
_float fSoftenExp = { 1.31429f };
|
||||
_float fSoftStrength = {};
|
||||
_float fCoreBoost = {};
|
||||
_float fRadius = {};
|
||||
_float fSoftenExp = { 1.31429f };
|
||||
_float fSoftStrength = {};
|
||||
_float fCoreBoost = {};
|
||||
_float fRadius = {};
|
||||
|
||||
_float fSoftMaskEdge = {};
|
||||
_float fSoftMask = {};
|
||||
_float fSoftMaskEdge = {};
|
||||
_float fSoftMask = {};
|
||||
|
||||
_bool isEmissiveDissolveReverse = { false };
|
||||
_bool isOnlyBlur = { false };
|
||||
|
||||
SHADER_PASS_INSTANCE_MODEL eShaderPass = { SHADER_PASS_INSTANCE_MODEL::NON_NOMALMAP };
|
||||
|
||||
}EFFECT_INFO;
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ class CWand final : public CPartObject
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
|
||||
class CTrailObject* pTrail = { nullptr };
|
||||
class CEffectParts* pEffectParts = { nullptr };
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
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.
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.
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.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
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.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -50,7 +50,7 @@ RWStructuredBuffer<ParticleValue> g_ParticleValueOutput : register(u1);
|
||||
|
||||
cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐이더 바인딩할때 인덱스가 동일해야함
|
||||
{
|
||||
row_major matrix CamViewInvMatrix;
|
||||
row_major matrix WorldMatrix;
|
||||
|
||||
bool isLoop; // 상수 버퍼에서 불값은 4바이트로 처리되기 때문에 반드시 클라에서는 int형으로 선언해라
|
||||
bool isDrop;
|
||||
@@ -61,6 +61,11 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐
|
||||
bool isAxisTurn;
|
||||
bool isPivotMove;
|
||||
bool isSizeMove;
|
||||
|
||||
bool isNoWorld;
|
||||
bool isPadding0;
|
||||
bool isPadding1;
|
||||
bool isPadding2;
|
||||
|
||||
float fTimeDelta;
|
||||
float fPadding1; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다.
|
||||
@@ -84,14 +89,30 @@ void CS_MAIN(
|
||||
|
||||
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)
|
||||
@@ -100,7 +121,6 @@ void CS_MAIN(
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
//초기화
|
||||
particle.vRight = particleValue.vOriginRight;
|
||||
particle.vUp = particleValue.vOriginUp;
|
||||
@@ -111,6 +131,8 @@ void CS_MAIN(
|
||||
particleValue.vAniIndex.x = 0.f;
|
||||
particleValue.vDelay.x = 0.f;
|
||||
|
||||
|
||||
|
||||
g_VBInstanceOutput[iIndex] = particle;
|
||||
g_ParticleValueOutput[iIndex] = particleValue;
|
||||
|
||||
@@ -239,6 +261,7 @@ void CS_MAIN(
|
||||
particle.vLook = normalize(particle.vLook) * CurLength.z;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//애니메이션 속도 , 인덱스
|
||||
|
||||
|
||||
@@ -177,6 +177,36 @@ VS_OUT VS_MAIN(VS_IN In, uint iGPUIndex : SV_InstanceID)
|
||||
return Out;
|
||||
}
|
||||
|
||||
VS_OUT VS_NOWORLD(VS_IN In, uint iGPUIndex : SV_InstanceID)
|
||||
{
|
||||
VS_OUT Out = (VS_OUT) 0;
|
||||
|
||||
matrix matW, matWV, matWVP;
|
||||
|
||||
row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation);
|
||||
|
||||
matW = TransformMatrix;
|
||||
matWV = mul(matW, g_ViewMatrix);
|
||||
matWVP = mul(matWV, g_ProjMatrix);
|
||||
|
||||
|
||||
|
||||
vector vPosition = mul(vector(In.vPosition, 1.f), matWVP);
|
||||
|
||||
Out.vPosition = vPosition;
|
||||
Out.vNormal = normalize(mul(vector(In.vNormal, 0.f), matW));
|
||||
Out.vTangent = normalize(mul(vector(In.vTangent, 0.f), matW)).xyz;
|
||||
Out.vBinormal = normalize(mul(vector(In.vBinormal, 0.f), matW)).xyz;
|
||||
Out.vTexcoord = In.vTexcoord;
|
||||
Out.vLifeTime = In.vLifeTime;
|
||||
Out.vWorldPos = mul(vector(In.vPosition, 1.f), matW);
|
||||
Out.iGPUIndex = iGPUIndex;
|
||||
Out.vProjPos = vPosition;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
|
||||
struct PS_IN
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
@@ -359,8 +389,7 @@ PS_OUT PS_NON_NORMALMAP(PS_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);
|
||||
@@ -397,7 +426,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
if (vMtrlDiffuse.a <= FLT_EPSILON5)
|
||||
discard;
|
||||
|
||||
if (g_isDissolve == true)
|
||||
@@ -514,6 +543,29 @@ VS_BLUR_OUT VS_BLUR(VS_IN In, uint iGPUIndex : SV_InstanceID)
|
||||
return Out;
|
||||
}
|
||||
|
||||
VS_BLUR_OUT VS_BLUR_NOWORLD(VS_IN In, uint iGPUIndex : SV_InstanceID)
|
||||
{
|
||||
VS_BLUR_OUT Out = (VS_BLUR_OUT) 0;
|
||||
|
||||
row_major matrix matW, matWV, matWVP;
|
||||
|
||||
row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation);
|
||||
|
||||
matW = TransformMatrix;
|
||||
matWV = mul(matW, g_ViewMatrix);
|
||||
matWVP = mul(matWV, g_ProjMatrix);
|
||||
|
||||
vector vPosition = mul(vector(In.vPosition, 1.f), matWVP);
|
||||
|
||||
Out.vPosition = vPosition;
|
||||
Out.vTexcoord = In.vTexcoord;
|
||||
Out.vLifeTime = In.vLifeTime;
|
||||
Out.iGPUIndex = iGPUIndex;
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_BLUR_IN
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
@@ -780,6 +832,36 @@ technique11 DefaultTechnique
|
||||
PixelShader = compile ps_5_0 PS_BLUR();
|
||||
}
|
||||
|
||||
pass WEIGHTBLEND
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_WB_Acc, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_NON_NORMALMAP();
|
||||
}
|
||||
|
||||
pass NO_WORLD
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_NOWORLD();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_NON_NORMALMAP();
|
||||
}
|
||||
|
||||
pass BLUR_NO_WORLD
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_Effect, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_BLUR_NOWORLD();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_BLUR();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -181,6 +181,9 @@ PS_TRAILOUT PS_Trail(PS_IN In)
|
||||
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, vDiffuseTexcoord);
|
||||
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
}
|
||||
@@ -211,15 +214,14 @@ PS_TRAILOUT PS_Trail(PS_IN In)
|
||||
// 마스크 디스토션
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV);
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fDistortionIntensity;
|
||||
|
||||
|
||||
vMaskTexcoord = saturate(vMaskTexcoord);
|
||||
}
|
||||
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
@@ -238,12 +240,10 @@ PS_TRAILOUT PS_Trail(PS_IN In)
|
||||
|
||||
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
/* 디퓨즈 알파 컷*/
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
if (vMtrlDiffuse.a <= FLT_EPSILON5)
|
||||
discard;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -305,10 +305,9 @@ PS_BLUR_OUT PS_TRAIL_BLUR(PS_BLUR_IN In)
|
||||
|
||||
if (g_isDiffuse == true)
|
||||
{
|
||||
/* 디퓨즈 디스토션 */
|
||||
|
||||
float2 vDiffuseTexcoord = In.vTexcoord;
|
||||
|
||||
|
||||
/* 디퓨즈 디스토션 */
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 vDistortion = In.vTexcoord + SelectLerpUV(g_vDiffuseDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
@@ -327,6 +326,9 @@ PS_BLUR_OUT PS_TRAIL_BLUR(PS_BLUR_IN In)
|
||||
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, vDiffuseTexcoord);
|
||||
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
}
|
||||
@@ -352,21 +354,19 @@ PS_BLUR_OUT PS_TRAIL_BLUR(PS_BLUR_IN In)
|
||||
|
||||
if (g_isMask == true)
|
||||
{
|
||||
|
||||
float2 vMaskTexcoord = In.vTexcoord;
|
||||
|
||||
// 마스크 디스토션
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV);
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fDistortionIntensity;
|
||||
|
||||
|
||||
vMaskTexcoord = saturate(vMaskTexcoord);
|
||||
}
|
||||
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
@@ -375,22 +375,20 @@ PS_BLUR_OUT PS_TRAIL_BLUR(PS_BLUR_IN In)
|
||||
|
||||
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 = vector(1.f, 1.f, 1.f, 1.f);
|
||||
vMtrlMask.r = 1.f;
|
||||
|
||||
|
||||
|
||||
|
||||
/* 디퓨즈 알파 컷*/
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
if (vMtrlDiffuse.a <= FLT_EPSILON5)
|
||||
discard;
|
||||
|
||||
|
||||
///* 이미시브 */
|
||||
|
||||
//float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f);
|
||||
@@ -462,7 +460,7 @@ technique11 PosTexTechnique11
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_WB_Acc, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Trail();
|
||||
|
||||
@@ -65,6 +65,22 @@ void CEditEffect::Late_Update(_float fTimeDelta)
|
||||
return;
|
||||
|
||||
|
||||
|
||||
|
||||
if (m_isGoStraight == true)
|
||||
{
|
||||
m_fAccTime += fTimeDelta;
|
||||
|
||||
if (m_fAccTime > 1.f)
|
||||
{
|
||||
m_fAccTime = 0.f;
|
||||
m_iSign *= -1;
|
||||
}
|
||||
|
||||
m_pTransformCom->Go_Straight(3 * fTimeDelta * m_iSign);
|
||||
}
|
||||
|
||||
|
||||
if (m_EffectInfo.isBlur == true)
|
||||
{
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this);
|
||||
@@ -387,9 +403,11 @@ void CEditEffect::Describe_Entity()
|
||||
const char* pLerp[] = { "Linear" , "EaseInQuad", "EaseOutQuad", "EaseInCubic" , "EaseOutCubic" , "EaseInOutSin" , "EaseInBack" , "Expo" , "Circle" };
|
||||
const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" , "UI" };
|
||||
const char* pEffectType[] = { "EFFECT" , "TRAIL" };
|
||||
const char* pShaderPass[] = { "DEFAULT" , "NON_NOMALMAP" , "BLUR" , "WEIGHTBLEND" , "NON_WORLD" , "NON_WORLD_BLUR"};
|
||||
|
||||
_int iCurrentItem = static_cast<_int>(m_EffectInfo.eRenderOrder);
|
||||
_int iCurrentType = static_cast<_int>(m_EffectInfo.eEffectType);
|
||||
_int iCurrentPass = static_cast<_int>(m_EffectInfo.eShaderPass);
|
||||
|
||||
if (ImGui::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END)))
|
||||
{
|
||||
@@ -401,7 +419,14 @@ void CEditEffect::Describe_Entity()
|
||||
m_EffectInfo.eEffectType = static_cast<EFFECT_TYPE>(iCurrentType);
|
||||
}
|
||||
|
||||
if (ImGui::Combo("Shader Pass", &iCurrentPass, pShaderPass, ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::END)))
|
||||
{
|
||||
m_EffectInfo.eShaderPass = static_cast<SHADER_PASS_INSTANCE_MODEL>(iCurrentPass);
|
||||
}
|
||||
|
||||
|
||||
GUI::Checkbox("Visible", &m_bVisible);
|
||||
GUI::Checkbox("GO", &m_isGoStraight);
|
||||
|
||||
m_pTransformCom->Describe_Entity();
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ HRESULT CEffectObject::Render()
|
||||
for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++)
|
||||
{
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::NON_NOMALMAP)))) {
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(m_EffectInfo.eShaderPass)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -75,13 +75,22 @@ HRESULT CEffectObject::Render_Blur()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
SHADER_PASS_INSTANCE_MODEL BlurPass = {};
|
||||
|
||||
if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NON_WORLD)
|
||||
{
|
||||
BlurPass = SHADER_PASS_INSTANCE_MODEL::BLUR_NO_WORLD;
|
||||
}
|
||||
else
|
||||
{
|
||||
BlurPass = SHADER_PASS_INSTANCE_MODEL::BLUR;
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++)
|
||||
{
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::BLUR)))) {
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(BlurPass)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
@@ -554,7 +554,7 @@ void CTrailObject::Describe_Entity()
|
||||
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
if (GUI::TreeNode("NOISE TEX"))
|
||||
if (GUI::TreeNode("DISTORTION TEX"))
|
||||
{
|
||||
|
||||
strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DISTORTION_TEXTURE", (CComponent**)&m_pDistortion_TextureCom, nullptr, this);
|
||||
@@ -664,6 +664,7 @@ HRESULT CTrailObject::Bind_ShaderResources()
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 이미시브 */
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_TrailInfo.vEmissive, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
@@ -713,7 +714,7 @@ HRESULT CTrailObject::Bind_ShaderResources()
|
||||
|
||||
if (m_pDistortion_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pMasking_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DistortionTexture", 0))) {
|
||||
if (FAILED(m_pDistortion_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DistortionTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,11 @@ class CEditEffect final : public CEffectObject
|
||||
_int m_iSelectTextureNum = {};
|
||||
vector<_float> m_ValueVector = {};
|
||||
_float m_fInputValue = {};
|
||||
|
||||
_bool m_isGoStraight = {};
|
||||
_float m_fAccTime = {};
|
||||
_int m_iSign = { 1 };
|
||||
|
||||
public:
|
||||
static CEditEffect* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Editor
|
||||
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, END };
|
||||
enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND ,NON_WORLD , BLUR_NO_WORLD ,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,END };
|
||||
enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, END };
|
||||
|
||||
|
||||
@@ -83,6 +83,9 @@ class CEffectObject abstract : public CPartObject
|
||||
|
||||
_bool isEmissiveDissolveReverse = { false };
|
||||
_bool isOnlyBlur = { false };
|
||||
|
||||
SHADER_PASS_INSTANCE_MODEL eShaderPass = { SHADER_PASS_INSTANCE_MODEL::NON_NOMALMAP };
|
||||
|
||||
}EFFECT_INFO;
|
||||
|
||||
typedef struct tagPreEffectInfo
|
||||
@@ -145,6 +148,11 @@ class CEffectObject abstract : public CPartObject
|
||||
_float fSoftMaskEdge = {};
|
||||
_float fSoftMask = {};
|
||||
|
||||
_bool isEmissiveDissolveReverse = { false };
|
||||
_bool isOnlyBlur = { false };
|
||||
|
||||
SHADER_PASS_INSTANCE_MODEL eShaderPass = { SHADER_PASS_INSTANCE_MODEL::NON_NOMALMAP };
|
||||
|
||||
}PRE_EFFECT_INFO;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -50,7 +50,7 @@ RWStructuredBuffer<ParticleValue> g_ParticleValueOutput : register(u1);
|
||||
|
||||
cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐이더 바인딩할때 인덱스가 동일해야함
|
||||
{
|
||||
row_major matrix CamViewInvMatrix;
|
||||
row_major matrix WorldMatrix;
|
||||
|
||||
bool isLoop; // 상수 버퍼에서 불값은 4바이트로 처리되기 때문에 반드시 클라에서는 int형으로 선언해라
|
||||
bool isDrop;
|
||||
@@ -61,6 +61,11 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐
|
||||
bool isAxisTurn;
|
||||
bool isPivotMove;
|
||||
bool isSizeMove;
|
||||
|
||||
bool isNoWorld;
|
||||
bool isPadding0;
|
||||
bool isPadding1;
|
||||
bool isPadding2;
|
||||
|
||||
float fTimeDelta;
|
||||
float fPadding1; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다.
|
||||
@@ -84,14 +89,30 @@ void CS_MAIN(
|
||||
|
||||
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)
|
||||
@@ -100,7 +121,6 @@ void CS_MAIN(
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
//초기화
|
||||
particle.vRight = particleValue.vOriginRight;
|
||||
particle.vUp = particleValue.vOriginUp;
|
||||
@@ -111,6 +131,8 @@ void CS_MAIN(
|
||||
particleValue.vAniIndex.x = 0.f;
|
||||
particleValue.vDelay.x = 0.f;
|
||||
|
||||
|
||||
|
||||
g_VBInstanceOutput[iIndex] = particle;
|
||||
g_ParticleValueOutput[iIndex] = particleValue;
|
||||
|
||||
@@ -239,6 +261,7 @@ void CS_MAIN(
|
||||
particle.vLook = normalize(particle.vLook) * CurLength.z;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//애니메이션 속도 , 인덱스
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "GameInstance.h"
|
||||
#include "ComputeShader.h"
|
||||
#include "Bone.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
CInstance_Model::CInstance_Model(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CComponent{ pDevice , pContext }
|
||||
@@ -283,6 +284,9 @@ void CInstance_Model::Drop(_float fTimeDelta)
|
||||
pDesc->isSinWave = m_InstanceDesc.isSinWave;
|
||||
pDesc->isPivotMove = m_InstanceDesc.isPivotMove;
|
||||
pDesc->isSizeLerp = m_InstanceDesc.isSizeLerp;
|
||||
pDesc->isNoWorld = m_InstanceDesc.isNoWorld;
|
||||
pDesc->WorldMatrix = *m_pOwner->Get_Component<CTransform>()->Get_WorldMatrixPtr();
|
||||
|
||||
|
||||
m_pContext->Unmap(m_pConstantBuffer, 0);
|
||||
}
|
||||
@@ -580,7 +584,10 @@ void CInstance_Model::Describe_Entity()
|
||||
Instane_Buffer_ReStruct();
|
||||
}
|
||||
|
||||
|
||||
if (GUI::Checkbox("NoWorld", &m_InstanceDesc.isNoWorld))
|
||||
{
|
||||
Instane_Buffer_ReStruct();
|
||||
}
|
||||
|
||||
|
||||
if (ImGui::DragFloat3("SizeMin", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMin)))
|
||||
|
||||
@@ -56,6 +56,7 @@ class ENGINE_DLL CInstance_Model final : public CComponent
|
||||
|
||||
_float2 vDelay = {};
|
||||
|
||||
_bool isNoWorld = {};
|
||||
}INSTANCE_DESC;
|
||||
|
||||
typedef struct tagPreInstanceDesc
|
||||
@@ -112,7 +113,7 @@ class ENGINE_DLL CInstance_Model final : public CComponent
|
||||
|
||||
typedef struct tagCSParticleDesc
|
||||
{
|
||||
_float4x4 CamViewInvMatrix = {};
|
||||
_float4x4 WorldMatrix = {};
|
||||
|
||||
_int isLoop = {};
|
||||
_int isDrop = {};
|
||||
@@ -124,6 +125,12 @@ class ENGINE_DLL CInstance_Model final : public CComponent
|
||||
_int isPivotMove = {};
|
||||
_int isSizeLerp = {};
|
||||
|
||||
|
||||
_int isNoWorld = {};
|
||||
_int isPadding0 = {};
|
||||
_int isPadding1 = {};
|
||||
_int isPadding2 = {};
|
||||
|
||||
_float fTimeDelta = {};
|
||||
_float fPadding2 = {};
|
||||
_float fPadding3 = {};
|
||||
|
||||
Reference in New Issue
Block a user