251124_19:24
commit
@@ -242,7 +242,7 @@ float4x4 RotateAxis(float4 _vAxis , float fAngle)
|
||||
);
|
||||
}
|
||||
|
||||
float3 vAxis = normalize(_vAxis);
|
||||
float3 vAxis = normalize(_vAxis.rgb);
|
||||
|
||||
float fCos = cos(radians(fAngle));
|
||||
float fSin = sin(radians(fAngle));
|
||||
@@ -264,5 +264,45 @@ float4x4 RotateAxis(float4 _vAxis , float fAngle)
|
||||
|
||||
}
|
||||
|
||||
float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption)
|
||||
{
|
||||
if (iSelectOption < 0)
|
||||
return float2(0, 0);
|
||||
|
||||
float fRatio = _fRatio;
|
||||
switch (iSelectOption)
|
||||
{
|
||||
case 0:
|
||||
fRatio = fRatio; // Linear
|
||||
break;
|
||||
case 1:
|
||||
fRatio = fRatio * fRatio; // EaseInQuad 후반에 속도 증가
|
||||
break;
|
||||
case 2:
|
||||
fRatio = 1 - (1 - fRatio * fRatio); // EaseOutQuad 초반에 속도 증가
|
||||
break;
|
||||
case 3:
|
||||
fRatio = fRatio * fRatio * fRatio; // EaseInCubic 더 강하게 후반 속도 증가
|
||||
break;
|
||||
case 4:
|
||||
fRatio = 1 - (1 - fRatio * fRatio * fRatio); // EaseOutCubic 더 강하게 초반 속도 증가
|
||||
break;
|
||||
case 5:
|
||||
fRatio = 0.5f * (1 - cos(PI * fRatio)); // EaseInOutSin 사인 곡선
|
||||
break;
|
||||
case 6:
|
||||
fRatio = sin(13 * PI * fRatio) * (1 - fRatio) * (1 - fRatio); // EaseInBack 뒤로갔다가 앞으로
|
||||
break;
|
||||
case 7:
|
||||
fRatio = pow(2, 10 * (fRatio - 1)); // Expo 지수 함수
|
||||
break;
|
||||
case 8:
|
||||
fRatio = 1 - pow(1 - fRatio * fRatio, 0.5); // 원형 궤적
|
||||
break;
|
||||
}
|
||||
|
||||
return fAmount * fRatio;
|
||||
|
||||
}
|
||||
|
||||
#endif // ENGINE_SHADER_FUNCTIONS_HLSLI
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
#include "Engine_Shader_Functions.hlsli"
|
||||
|
||||
struct ParticleValue
|
||||
{
|
||||
@@ -66,6 +67,7 @@ int g_iNoiseMoveLerpOption;
|
||||
float2 g_vDiffuseDistortionUVGainAmount;
|
||||
float2 g_vMaskDistortionUVGainAmount;
|
||||
|
||||
|
||||
int g_iMaskDistortionMoveLerpOption;
|
||||
int g_iDiffuseDistortionMoveLerpOption;
|
||||
//
|
||||
@@ -116,46 +118,7 @@ bool g_isNomalDissolve;
|
||||
|
||||
float g_fFar;
|
||||
|
||||
float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption)
|
||||
{
|
||||
if (iSelectOption < 0)
|
||||
return float2(0 , 0);
|
||||
|
||||
float fRatio = _fRatio;
|
||||
switch (iSelectOption)
|
||||
{
|
||||
case 0:
|
||||
fRatio = fRatio; // Linear
|
||||
break;
|
||||
case 1:
|
||||
fRatio = fRatio * fRatio; // EaseInQuad 후반에 속도 증가
|
||||
break;
|
||||
case 2:
|
||||
fRatio = 1 - (1 - fRatio * fRatio); // EaseOutQuad 초반에 속도 증가
|
||||
break;
|
||||
case 3:
|
||||
fRatio = fRatio * fRatio * fRatio; // EaseInCubic 더 강하게 후반 속도 증가
|
||||
break;
|
||||
case 4:
|
||||
fRatio = 1 - (1 - fRatio * fRatio * fRatio); // EaseOutCubic 더 강하게 초반 속도 증가
|
||||
break;
|
||||
case 5:
|
||||
fRatio = 0.5f * (1 - cos(PI * fRatio)); // EaseInOutSin 사인 곡선
|
||||
break;
|
||||
case 6:
|
||||
fRatio = sin(13 * PI * fRatio) * (1 - fRatio) * (1 - fRatio); // EaseInBack 뒤로갔다가 앞으로
|
||||
break;
|
||||
case 7:
|
||||
fRatio = pow(2, 10 * (fRatio - 1)); // Expo 지수 함수
|
||||
break;
|
||||
case 8:
|
||||
fRatio = 1 - pow(1 - fRatio * fRatio, 0.5); // 원형 궤적
|
||||
break;
|
||||
}
|
||||
|
||||
return fAmount * fRatio;
|
||||
|
||||
}
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
@@ -358,7 +321,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
vMtrlDiffuse = saturate(g_vColor + vMtrlDiffuse);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -382,7 +345,8 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r);
|
||||
|
||||
if (g_isNoiseColor)
|
||||
vMtrlDiffuse *= vMtrlNoise;
|
||||
vMtrlDiffuse.rgb *= vMtrlNoise.rgb;
|
||||
|
||||
}
|
||||
|
||||
/* 마스크 */
|
||||
@@ -403,7 +367,6 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
if (g_isMaskUVMove)
|
||||
@@ -415,7 +378,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
if (g_isMaskClampSample == true)
|
||||
vMtrlMask = g_MaskingTexture.Sample(ClampSampler, vMaskTexcoord);
|
||||
else
|
||||
vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord);
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
|
||||
float fSoftMask;
|
||||
@@ -431,13 +394,12 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
vMtrlMask.r = 1.f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (g_isDissolve == true)
|
||||
{
|
||||
if (g_isNomalDissolve)
|
||||
@@ -484,8 +446,6 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
float fDistance = saturate(length(CenteredUV) / g_fRadius); // 마스크의 크기를 어느정도할지
|
||||
|
||||
float fMaskAlpha = vMtrlMask.a;
|
||||
|
||||
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 중심강조
|
||||
@@ -506,15 +466,18 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
if (g_isEmissiveDissolve == true)
|
||||
{
|
||||
fEmissiveStrength *= (1.f - In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
if (fEmissiveStrength <= 0.05f)
|
||||
fEmissiveStrength = 0;
|
||||
|
||||
}
|
||||
|
||||
if (g_isEmissiveDissolveReverse == true)
|
||||
{
|
||||
fEmissiveStrength *= (In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Out.vColorTarget = vEmissiveMtrl * fEmissive * fEmissiveStrength; // 이미시브 스트랭스
|
||||
|
||||
return Out;
|
||||
@@ -684,7 +647,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
if (g_isMaskClampSample == true)
|
||||
vMtrlMask = g_MaskingTexture.Sample(ClampSampler, vMaskTexcoord);
|
||||
else
|
||||
vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord);
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
|
||||
float fSoftMask;
|
||||
@@ -693,9 +656,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask);
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask);
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -703,6 +664,9 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
@@ -764,6 +728,16 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
if (g_isEmissiveDissolve == true)
|
||||
{
|
||||
fEmissiveStrength *= (1.f - In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
if (fEmissiveStrength <= 0)
|
||||
fEmissiveStrength = 0;
|
||||
|
||||
}
|
||||
|
||||
if (g_isEmissiveDissolveReverse == true)
|
||||
{
|
||||
fEmissiveStrength *= (In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -790,7 +764,7 @@ technique11 DefaultTechnique
|
||||
{
|
||||
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_NON_NORMALMAP();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
#include "Engine_Shader_Functions.hlsli"
|
||||
|
||||
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
Texture2D g_DepthTexture;
|
||||
@@ -11,14 +12,46 @@ uint g_iIndexU;
|
||||
uint g_iIndexV;
|
||||
|
||||
Texture2D g_Texture;
|
||||
|
||||
Texture2D g_DiffuseTexture;
|
||||
Texture2D g_MaskingTexture;
|
||||
Texture2D g_NoiseTexture;
|
||||
Texture2D g_DistortionTexture;
|
||||
|
||||
bool g_isDiffuse;
|
||||
bool g_isNoise;
|
||||
/* 디퓨즈 */
|
||||
bool g_isDiffuse;
|
||||
float g_fDiffuseAlpha;
|
||||
float4 g_vColor;
|
||||
|
||||
/* 마스크 */
|
||||
bool g_isMask;
|
||||
float g_fSoftMaskEdge;
|
||||
float g_fSoftMask;
|
||||
|
||||
/* 노이즈 */
|
||||
bool g_isNoise;
|
||||
bool g_isNoiseColor;
|
||||
bool g_isNoiseAlpha;
|
||||
float g_fNoiseStrength;
|
||||
|
||||
/* 디스토션 */
|
||||
|
||||
bool g_isDistortion;
|
||||
float2 g_vDistortionTime;
|
||||
float2 g_vDiffuseDistortionUVGainAmount;
|
||||
float2 g_vMaskDistortionUVGainAmount;
|
||||
float g_fDistortionIntensity; // 디스토션 왜곡 세기
|
||||
|
||||
/* 이미시브 */
|
||||
float4 g_vEmissive;
|
||||
float g_fEmissiveStrength;
|
||||
float g_fSoftenExp;
|
||||
float g_fSoftStrength;
|
||||
float g_fCoreBoost;
|
||||
float g_fRadius;
|
||||
|
||||
/* 블러 */
|
||||
float g_fBlurIntensity;
|
||||
float g_iBlurWeight;
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
@@ -121,37 +154,263 @@ PS_TRAILOUT PS_Trail(PS_IN In)
|
||||
vector vMtrlDiffuse;
|
||||
vector vMtrlMask;
|
||||
vector vMtrlNoise;
|
||||
vector vMtrlDistortion;
|
||||
|
||||
/* 디퓨즈 */
|
||||
|
||||
if (g_isDiffuse == true)
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
{
|
||||
float2 vDiffuseTexcoord = In.vTexcoord;
|
||||
|
||||
/* 디퓨즈 디스토션 */
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 vDistortion = In.vTexcoord + SelectLerpUV(g_vDiffuseDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortion);
|
||||
|
||||
//0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다.
|
||||
vMtrlDistortion.rg -= 0.5f;
|
||||
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
|
||||
vDiffuseTexcoord = vDiffuseTexcoord + (vMtrlDistortion).rg * g_fDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, vDiffuseTexcoord);
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
}
|
||||
else
|
||||
vMtrlDiffuse = vector(0.f, 0.f, 0.f, 1.f);
|
||||
vMtrlDiffuse = g_vColor;
|
||||
|
||||
if (g_isMask == true)
|
||||
vMtrlMask = g_MaskingTexture.Sample(PointSampler, In.vTexcoord);
|
||||
else
|
||||
vMtrlMask = vector(1.f, 1.f, 1.f, 1.f);
|
||||
/* 노이즈 */
|
||||
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (g_isNoiseAlpha)
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r) * g_fNoiseStrength;
|
||||
|
||||
//vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r);
|
||||
if (g_isNoiseColor)
|
||||
vMtrlDiffuse.rgb *= vMtrlNoise.rgb * g_fNoiseStrength;
|
||||
|
||||
vMtrlDiffuse *= vMtrlNoise;
|
||||
}
|
||||
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r);
|
||||
|
||||
|
||||
/* 마스크 */
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
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;
|
||||
|
||||
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
/* 디퓨즈 알파 컷*/
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* 웨이트 블랜드 */
|
||||
|
||||
float fWeight = clamp(pow(In.vProjPos.w, -2.5f), 1.0f, 1000.0f);
|
||||
|
||||
|
||||
Out.vDiffuse = vector(vMtrlDiffuse.rgb * vMtrlDiffuse.a, vMtrlDiffuse.a) * fWeight;
|
||||
|
||||
Out.vDiffuse = vector(vMtrlDiffuse.rgb, vMtrlDiffuse.a) * fWeight;
|
||||
Out.vRevealage.r = vMtrlDiffuse.a;
|
||||
Out.vColorTarget = 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;
|
||||
|
||||
float fDistance = saturate(length(CenteredUV) / g_fRadius); // 마스크의 크기를 어느정도할지
|
||||
|
||||
float fMaskAlpha = vMtrlMask.a;
|
||||
|
||||
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 fEmissive = fSoftEdge + fCore;
|
||||
|
||||
vEmissiveMtrl = g_vEmissive;
|
||||
|
||||
Out.vColorTarget = vEmissiveMtrl * fEmissive * g_fEmissiveStrength; // 이미시브 스트랭스
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_BLUR_IN
|
||||
{
|
||||
float4 vPosition : SV_Position;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct PS_BLUR_OUT
|
||||
{
|
||||
float4 vDiffuse : SV_TARGET0;
|
||||
float4 vBlurWeight : SV_TARGET1;
|
||||
};
|
||||
|
||||
PS_BLUR_OUT PS_TRAIL_BLUR(PS_BLUR_IN In)
|
||||
{
|
||||
PS_BLUR_OUT Out;
|
||||
|
||||
vector vMtrlDiffuse;
|
||||
vector vMtrlMask;
|
||||
vector vMtrlNoise;
|
||||
vector vMtrlDistortion;
|
||||
|
||||
/* 디퓨즈 */
|
||||
|
||||
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);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortion);
|
||||
|
||||
//0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다.
|
||||
vMtrlDistortion.rg -= 0.5f;
|
||||
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
|
||||
vDiffuseTexcoord = vDiffuseTexcoord + (vMtrlDistortion).rg * g_fDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, vDiffuseTexcoord);
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
}
|
||||
else
|
||||
vMtrlDiffuse = g_vColor;
|
||||
|
||||
/* 노이즈 */
|
||||
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (g_isNoiseAlpha)
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r) * g_fNoiseStrength;
|
||||
|
||||
if (g_isNoiseColor)
|
||||
vMtrlDiffuse.rgb *= vMtrlNoise.rgb * g_fNoiseStrength;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* 마스크 */
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
float fSoftMask;
|
||||
|
||||
if (g_fSoftMask > FLT_EPSILON5)
|
||||
fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask);
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask);
|
||||
}
|
||||
else
|
||||
vMtrlMask = vector(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
|
||||
|
||||
|
||||
/* 디퓨즈 알파 컷*/
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
///* 이미시브 */
|
||||
|
||||
//float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
//float2 CenteredUV = In.vTexcoord - 0.5f;
|
||||
|
||||
//float fDistance = saturate(length(CenteredUV) / g_fRadius); // 마스크의 크기를 어느정도할지
|
||||
|
||||
//float fMaskAlpha = vMtrlMask.a;
|
||||
|
||||
//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 fEmissive = fSoftEdge + fCore;
|
||||
|
||||
//vEmissiveMtrl = g_vEmissive;
|
||||
|
||||
Out.vDiffuse = vector(vMtrlDiffuse.rgb * g_fBlurIntensity, vMtrlDiffuse.a); // 이미시브 스트랭스
|
||||
Out.vBlurWeight = g_iBlurWeight / 128.f;
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -203,10 +462,20 @@ technique11 PosTexTechnique11
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
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_Trail();
|
||||
}
|
||||
|
||||
pass TrailBlur
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 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_TRAIL_BLUR();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 139 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 70 KiB |
@@ -167,6 +167,7 @@
|
||||
<ClInclude Include="..\public\AlphaMap.h" />
|
||||
<ClInclude Include="..\Public\Body.h" />
|
||||
<ClInclude Include="..\public\Active_Icon.h" />
|
||||
<ClInclude Include="..\Public\Decendo.h" />
|
||||
<ClInclude Include="..\Public\Broom.h" />
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_Behavior.h" />
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_HitReport.h" />
|
||||
@@ -294,6 +295,7 @@
|
||||
<ClCompile Include="..\private\AlphaMap.cpp" />
|
||||
<ClCompile Include="..\Private\Body.cpp" />
|
||||
<ClCompile Include="..\private\Active_Icon.cpp" />
|
||||
<ClCompile Include="..\Private\Decendo.cpp" />
|
||||
<ClCompile Include="..\Private\Broom.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_Behavior.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_HitReport.cpp" />
|
||||
|
||||
@@ -349,6 +349,9 @@
|
||||
<Filter Include="02.GameObjects\Env\05.AlphaMap">
|
||||
<UniqueIdentifier>{54eef1b7-a5ee-444f-9577-44ffc8c3d8bc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Layer_Effect\Effect\07.Decendo">
|
||||
<UniqueIdentifier>{a94e6a94-cc46-4c16-8518-5032bfdbd235}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Editor.h">
|
||||
@@ -684,6 +687,9 @@
|
||||
<ClInclude Include="..\public\AlphaMap.h">
|
||||
<Filter>02.GameObjects\Env\05.AlphaMap</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Decendo.h">
|
||||
<Filter>02.GameObjects\Layer_Effect\Effect\07.Decendo</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Editor.ico">
|
||||
@@ -1012,6 +1018,9 @@
|
||||
<ClCompile Include="..\private\AlphaMap.cpp">
|
||||
<Filter>02.GameObjects\Env\05.AlphaMap</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Decendo.cpp">
|
||||
<Filter>02.GameObjects\Layer_Effect\Effect\07.Decendo</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Editor.rc">
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
#include "pch.h"
|
||||
#include "Decendo.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "EditEffect.h"
|
||||
#include "Dummy_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(Ready_Child()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Load_Directory("../Bin/Resources/Data/Effect/Decendo/")))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
m_wstrEffectName = L"Bombard";
|
||||
|
||||
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());
|
||||
|
||||
Get_PartObject<CTrailObject>()->Set_Target(m_pProjectile->Get_Component<CTransform>());
|
||||
|
||||
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 을 만듬
|
||||
_vector 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(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;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
_vector vOwnerLook = m_pOwner->Get_Component<CTransform>()->Get_State(STATE::LOOK);
|
||||
|
||||
m_pProjectile_Blur->Get_Component<CTransform>()->Translation(vOwnerLook * 1.f);
|
||||
m_pProjectile->Get_Component<CTransform>()->Translation(vOwnerLook * 1.f);
|
||||
|
||||
|
||||
if (m_fAccTime > XM_PI)
|
||||
return;
|
||||
|
||||
m_fAccTime += fTimeDelta * 3.f;
|
||||
|
||||
m_pProjectile_Blur->Get_Component<CTransform>()->Translation(m_vRotateUp * 1.f * sinf(m_fAccTime));
|
||||
m_pProjectile->Get_Component<CTransform>()->Translation(m_vRotateUp * 1.f * sinf(m_fAccTime));
|
||||
|
||||
}
|
||||
|
||||
void CDecendo::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CDecendo::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDecendo::Ready_Child()
|
||||
{
|
||||
CDummy_PhysXEffectHitBox::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));
|
||||
|
||||
Desc.vRotRPY = { 0.f, 0.f, 0.f };
|
||||
Desc.iSubKind = 70;
|
||||
Desc.vDeltaPos = { 0.f, 0.f, 1.f };
|
||||
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);
|
||||
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);
|
||||
|
||||
|
||||
Get_PartObject<CEditEffect>("Decendo_Cricle_S")->Set_Visible(false);
|
||||
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()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CDecendo::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "Bombard.h"
|
||||
|
||||
#include "TrailObject.h"
|
||||
#include "Decendo.h"
|
||||
|
||||
CDummy_PhysXPlayable::CDummy_PhysXPlayable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext):
|
||||
CGameObject(pDevice, pContext)
|
||||
@@ -62,6 +63,15 @@ void CDummy_PhysXPlayable::Update(_float fTimeDelta)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pGameInstance->Key_Up(DIK_P)) {
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDecendo>(ENUM_CLASS(LEVEL::EFFECT), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) {
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
}
|
||||
|
||||
@@ -457,6 +457,7 @@ void CEditEffect::Describe_Entity()
|
||||
|
||||
GUI::Checkbox("EmissiveTex", &m_EffectInfo.isEmissive);
|
||||
GUI::Checkbox("EmissiveDissolve", &m_EffectInfo.isEmissiveDissolve);
|
||||
GUI::Checkbox("EmissiveDissolveReverse", &m_EffectInfo.isEmissiveDissolveReverse);
|
||||
|
||||
if (m_EffectInfo.isEmissive)
|
||||
{
|
||||
|
||||
@@ -57,188 +57,6 @@ void CEffect_Container::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
HRESULT CEffect_Container::Save_Package(const _char* pPath)
|
||||
{
|
||||
_string strPerfectFilePath = pPath;
|
||||
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(0);
|
||||
|
||||
_int iObjectCount = (_int)m_PartObjects.size();
|
||||
|
||||
if (!WriteFile(hFile, &iObjectCount, sizeof(_int), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// 자식 개수 저장
|
||||
|
||||
for (auto& pPartObejct : m_PartObjects)
|
||||
{
|
||||
CEditEffect* pEffectObject = dynamic_cast<CEditEffect*>(pPartObejct.second);
|
||||
CTrailObject* pTrailObject = {};
|
||||
|
||||
if (pEffectObject == nullptr) // 이펙트 오브젝트가 아닐 경우
|
||||
{
|
||||
pTrailObject = dynamic_cast<CTrailObject*>(pPartObejct.second);
|
||||
|
||||
pTrailObject->Save_Path(hFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
pEffectObject->Save_Path(hFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
|
||||
MessageBox(NULL, L"패키징 성공", L"System Message", MB_OK);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
HRESULT CEffect_Container::Load_Package(const _char* pPath)
|
||||
{
|
||||
_string strPerfectFilePath = pPath;
|
||||
|
||||
strPerfectFilePath += ".bin";
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
_int iObjectCount = {};
|
||||
|
||||
if (!ReadFile(hFile, &iObjectCount, sizeof(_int), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < iObjectCount; i++)
|
||||
{
|
||||
EFFECT_TYPE eEffectType = {};
|
||||
|
||||
if (!ReadFile(hFile, &eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
size_t iFilePathLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iFilePathLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_char szFilePath[MAX_PATH] = {};
|
||||
|
||||
if (iFilePathLength != 0)
|
||||
{
|
||||
if (!ReadFile(hFile, szFilePath, sizeof(_char) * ((DWORD)iFilePathLength + 1), &dwByte, nullptr)) {
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
_string strPath = szFilePath;
|
||||
size_t iPos;
|
||||
|
||||
while ((iPos = strPath.find(".bin")) != std::string::npos) {
|
||||
strPath.erase(iPos, 4);
|
||||
};
|
||||
|
||||
|
||||
CPartObject::PARTOBJECT_DESC PartsDesc{};
|
||||
CEditEffect* pEditEffect = {};
|
||||
CTrailObject* pTrailEffect = {};
|
||||
switch (eEffectType)
|
||||
{
|
||||
case EFFECT_TYPE::EFFECT:
|
||||
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
|
||||
if (FAILED(Add_PartObject<CEditEffect>("EffectObject" + i, ENUM_CLASS(LEVEL::EFFECT), &pEditEffect, &PartsDesc)))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(pEditEffect->Load(strPath.c_str(), LEVEL::EFFECT)))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
SAFE_RELEASE(pEditEffect);
|
||||
|
||||
break;
|
||||
|
||||
case EFFECT_TYPE::TRAIL:
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
|
||||
if (FAILED(Add_PartObject<CTrailObject>("TrailObject" + i, ENUM_CLASS(LEVEL::EFFECT), &pTrailEffect, &PartsDesc)))
|
||||
{
|
||||
CloseHandle(hFile);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
pTrailEffect->Load_Trail(strPath.c_str(), LEVEL::EFFECT);
|
||||
|
||||
SAFE_RELEASE(pTrailEffect);
|
||||
|
||||
break;
|
||||
case EFFECT_TYPE::END:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEffect_Container::Load_Directory(const _char* pPath)
|
||||
{
|
||||
|
||||
@@ -249,13 +67,52 @@ HRESULT CEffect_Container::Load_Directory(const _char* pPath)
|
||||
|
||||
string ext = file.path().extension().string();
|
||||
|
||||
if (strcmp(ext.c_str(), ".bin"))
|
||||
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());
|
||||
|
||||
/* Trail */
|
||||
|
||||
if (!strcmp(ext.c_str(), ".trail"))
|
||||
{
|
||||
CTrailObject* pTrail = nullptr;
|
||||
|
||||
CPartObject::PARTOBJECT_DESC PartsDesc{};
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
|
||||
_wstring wstrFileName = file.path().stem().wstring(); //이름 넣기
|
||||
|
||||
if (FAILED(Add_PartObject<CTrailObject>(CMyTools::ToString(wstrFileName), NEXT_LEVEL, &pTrail, &PartsDesc))) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
/*이펙트 로드 로드*/
|
||||
size_t iPos = {};
|
||||
_string strFilePath = szFilePath;
|
||||
|
||||
while ((iPos = strFilePath.find(".trail")) != std::string::npos) {
|
||||
strFilePath.erase(iPos, 6);
|
||||
};
|
||||
|
||||
|
||||
if (FAILED(pTrail->Load_Trail(strFilePath.c_str(), LEVEL::EFFECT)))
|
||||
{
|
||||
Safe_Release(pTrail);
|
||||
continue;
|
||||
}
|
||||
|
||||
Safe_Release(pTrail);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
|
||||
@@ -619,22 +619,12 @@ void CEffect_Editor::Describe_Entity()
|
||||
ReSaveFile(m_strSavePath.c_str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
GUI::InputTextMultiline("PACKAGE FILE PATH", m_szPackageBuffer, sizeof(m_szPackageBuffer), ImVec2(250, 25));
|
||||
GUI::InputTextMultiline("DIRECTORY PATH", m_szPackageBuffer, sizeof(m_szPackageBuffer), ImVec2(250, 25));
|
||||
|
||||
m_strPackageSavePath = m_szPackageBuffer;
|
||||
|
||||
if (GUI::Button("PACKAING"))
|
||||
{
|
||||
Save_Package(m_strPackageSavePath.c_str());
|
||||
}
|
||||
|
||||
GUI::SameLine();
|
||||
|
||||
if (GUI::Button("LOAD DIRECTORY"))
|
||||
{
|
||||
|
||||
if (SUCCEEDED(Load_Directory(m_strPackageSavePath.c_str())))
|
||||
{
|
||||
MessageBox(NULL, L"파일 로드 성공", L"System Message", MB_OK);
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
#include "TrailObject.h"
|
||||
#include "NomalJap.h"
|
||||
#include "Bombard.h"
|
||||
#include "Decendo.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -769,7 +770,10 @@ HRESULT CLoader::Loading_For_Effect()
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CBombard>(ENUM_CLASS(LEVEL::EFFECT), CBombard::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDecendo>(ENUM_CLASS(LEVEL::EFFECT), CDecendo::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
m_strMessage = TEXT("Loading Success!");
|
||||
|
||||
|
||||
@@ -35,8 +35,6 @@ HRESULT CNomalJap::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Child()))
|
||||
return E_FAIL;
|
||||
|
||||
Load_Package("../Bin/Resources/Data/Effect/Package/Jap3");
|
||||
|
||||
m_wstrEffectName = L"Nomal_Jap";
|
||||
|
||||
m_PartObjects.begin()->second->Set_Visible(true);
|
||||
|
||||
@@ -28,8 +28,6 @@ HRESULT CTrailObject::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
//Load_Trail("")
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -41,48 +39,61 @@ void CTrailObject::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CTrailObject::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
m_pTrailCom->Trail_Update(fTimeDelta, m_pParentTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
|
||||
if (m_TrailInfo.vDistortionTime.y == 0)
|
||||
return;
|
||||
|
||||
m_TrailInfo.vDistortionTime.x += fTimeDelta;
|
||||
|
||||
if (m_TrailInfo.vDistortionTime.x > m_TrailInfo.vDistortionTime.y)
|
||||
{
|
||||
m_TrailInfo.vDistortionTime.x = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
void CTrailObject::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
if (m_TrailInfo.isBlur == true)
|
||||
{
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this);
|
||||
}
|
||||
|
||||
if (m_TrailInfo.isOnlyBlur == true)
|
||||
return;
|
||||
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::EFFECT, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
HRESULT CTrailObject::Save_Path(HANDLE hFile)
|
||||
void CTrailObject::Set_Target(CTransform* pTargetTransform)
|
||||
{
|
||||
DWORD dwByte;
|
||||
|
||||
size_t iObjectLength = m_strPath.length();
|
||||
const _char* pFilePath = m_strPath.c_str();
|
||||
SAFE_RELEASE(m_pParentTransformCom);
|
||||
|
||||
if (!WriteFile(hFile, &m_eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (!WriteFile(hFile, &iObjectLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (pFilePath != 0)
|
||||
{
|
||||
if (!WriteFile(hFile, pFilePath, sizeof(_char) * ((DWORD)iObjectLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
if(pTargetTransform != nullptr)
|
||||
m_pParentTransformCom = pTargetTransform;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
HRESULT CTrailObject::Save_Trail(const _char* pPath)
|
||||
{
|
||||
_string strPerfectFilePath = pPath;
|
||||
strPerfectFilePath += ".bin";
|
||||
|
||||
m_strPath = pPath;
|
||||
|
||||
strPerfectFilePath += ".trail";
|
||||
|
||||
HANDLE hFile = CreateFile(CMyTools::ToWstring(strPerfectFilePath).c_str(),
|
||||
GENERIC_WRITE,
|
||||
@@ -97,15 +108,7 @@ HRESULT CTrailObject::Save_Trail(const _char* pPath)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strPath = strPerfectFilePath;
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
if (!WriteFile(hFile, &m_eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
DWORD dwByte;
|
||||
|
||||
size_t iComponentLength = m_strTrailDiffuseName.length();
|
||||
const _char* pFileComponentPath = m_strTrailDiffuseName.c_str();
|
||||
@@ -150,8 +153,27 @@ HRESULT CTrailObject::Save_Trail(const _char* pPath)
|
||||
}
|
||||
}
|
||||
|
||||
iComponentLength = m_strTrailDistortionName.length();
|
||||
pFileComponentPath = m_strTrailDistortionName.c_str();
|
||||
|
||||
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
m_pTrailCom->Save_Trail(hFile);
|
||||
|
||||
|
||||
if (!WriteFile(hFile, &m_TrailInfo, sizeof(TRAIL_INFO), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
MessageBox(NULL, L"트레일 저장 성공", L"System Message", MB_OK);
|
||||
@@ -165,10 +187,11 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
SAFE_RELEASE(m_pDistortion_TextureCom);
|
||||
|
||||
_string strPerfectFilePath = pPath;
|
||||
|
||||
strPerfectFilePath += ".bin";
|
||||
strPerfectFilePath += ".trail";
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
@@ -189,11 +212,6 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &m_eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
@@ -210,13 +228,9 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
|
||||
m_strTrailDiffuseName = szName;
|
||||
|
||||
m_isDiffuse = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailDiffuseName),
|
||||
reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
@@ -233,8 +247,6 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
|
||||
m_strTrailNoiseName = szName;
|
||||
|
||||
m_isNoise = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailNoiseName),
|
||||
reinterpret_cast<CComponent**>(&m_pNoise_TextureCom))))
|
||||
return E_FAIL;
|
||||
@@ -255,20 +267,42 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
|
||||
m_strTrailMaskingName = szName;
|
||||
|
||||
m_isMask = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailMaskingName),
|
||||
reinterpret_cast<CComponent**>(&m_pMasking_TextureCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strTrailDistortionName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailDistortionName),
|
||||
reinterpret_cast<CComponent**>(&m_pDistortion_TextureCom))))
|
||||
return E_FAIL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
m_pTrailCom->Load_Trail(hFile);
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &m_TrailInfo, sizeof(TRAIL_INFO), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
|
||||
MessageBox(NULL, L"트레일 로드 성공", L"System Message", MB_OK);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -310,6 +344,28 @@ HRESULT CTrailObject::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Render_Blur()
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::TRAIL_BLUR))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_TrailInfo.fBlurIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_TrailInfo.iBlurWeight, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Bind_ShaderResources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pTrailCom->Render()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -346,6 +402,7 @@ void CTrailObject::Free()
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
SAFE_RELEASE(m_pDistortion_TextureCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pTrailCom);
|
||||
}
|
||||
@@ -357,15 +414,63 @@ void CTrailObject::Describe_Entity()
|
||||
{
|
||||
m_pTrailCom->Describe_Entity();
|
||||
|
||||
GUI::Checkbox("Diffuse", &m_isDiffuse);
|
||||
GUI::Checkbox("Masking", &m_isMask);
|
||||
GUI::Checkbox("Noise", &m_isNoise);
|
||||
m_pShaderCom->Describe_Entity();
|
||||
|
||||
if (m_isDiffuse == true)
|
||||
GUI::Checkbox("Diffuse", &m_TrailInfo.isDiffuse);
|
||||
GUI::Checkbox("Masking", &m_TrailInfo.isMask);
|
||||
GUI::Checkbox("Noise", &m_TrailInfo.isNoise);
|
||||
GUI::Checkbox("Distortion", &m_TrailInfo.isDistortion);
|
||||
|
||||
|
||||
GUI::ColorEdit4("MixColor", (_float*)&m_TrailInfo.vColor);
|
||||
|
||||
if (GUI::TreeNode("TRAIL BLUR"))
|
||||
{
|
||||
GUI::Checkbox("Blur", &m_TrailInfo.isBlur);
|
||||
GUI::Checkbox("OnlyBlur", &m_TrailInfo.isOnlyBlur);
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::DragFloat("BlurIntensity", &m_TrailInfo.fBlurIntensity, 0.005f, 0.f, 1.f);
|
||||
GUI::DragInt("BlurWeight", &m_TrailInfo.iBlurWeight, 2.f, 0, 128);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
/* 이미시브 */
|
||||
if (GUI::TreeNode("TRAIL EMISSIVE"))
|
||||
{
|
||||
GUI::ColorEdit4("MixColor", (_float*)&m_TrailInfo.vEmissive);
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
|
||||
GUI::DragFloat("EmissiveStrength", &m_TrailInfo.fEmissiveStrength, 0.01f, 0.f);
|
||||
GUI::DragFloat("SoftenExp", &m_TrailInfo.fSoftenExp, 0.01f, 0.f);
|
||||
GUI::DragFloat("SoftStrength", &m_TrailInfo.fSoftStrength, 0.01f, 0.f);
|
||||
GUI::DragFloat("CoreBoost", &m_TrailInfo.fCoreBoost, 0.01f, 0.f);
|
||||
GUI::DragFloat("Radius", &m_TrailInfo.fRadius, 0.01f, 0.f , 1.f);
|
||||
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
if (m_TrailInfo.isDiffuse == true)
|
||||
{
|
||||
if (GUI::TreeNode("TRAIL DIFFUSE"))
|
||||
{
|
||||
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this);
|
||||
_string strName = {};
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::DragFloat("Diffuse Alpha", &m_TrailInfo.fDiffuseAlpha, 0.01f, 0.f, 1.f);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
if (GUI::TreeNode("DIFFUSE TEX"))
|
||||
{
|
||||
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this);
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailDiffuseName = strName;
|
||||
@@ -375,34 +480,98 @@ void CTrailObject::Describe_Entity()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_isMask == true)
|
||||
if (m_TrailInfo.isMask == true)
|
||||
{
|
||||
if (GUI::TreeNode("TRAIL MASK"))
|
||||
{
|
||||
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "MASK_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this);
|
||||
_string strName = {};
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailMaskingName = strName;
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::DragFloat("SoftMask", &m_TrailInfo.fSoftMask, 0.01f, 0.f);
|
||||
GUI::DragFloat("fSoftMaskEdge", &m_TrailInfo.fSoftMaskEdge, 0.01f, 0.f);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
if (GUI::TreeNode("MASK TEX"))
|
||||
{
|
||||
|
||||
strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "MASK_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailMaskingName = strName;
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_isNoise == true)
|
||||
if (m_TrailInfo.isNoise == true)
|
||||
{
|
||||
if (GUI::TreeNode("TRAIL NOISE"))
|
||||
{
|
||||
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this);
|
||||
_string strName = {};
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailNoiseName = strName;
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::Checkbox("NoiseColor", &m_TrailInfo.isNoiseColor);
|
||||
GUI::Checkbox("NoiseAlpha", &m_TrailInfo.isNoiseAlpha);
|
||||
GUI::DragFloat("NoiseStrength", &m_TrailInfo.fNoiseStrength, 0.01f, 0.f);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
if (GUI::TreeNode("NOISE TEX"))
|
||||
{
|
||||
|
||||
strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailNoiseName = strName;
|
||||
}
|
||||
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_TrailInfo.isDistortion == true)
|
||||
{
|
||||
if (GUI::TreeNode("TRAIL DISTORTION"))
|
||||
{
|
||||
_string strName = {};
|
||||
|
||||
_float2 vDiffuseDistortioUVAmount = {};
|
||||
_float2 vMaskDistortionUVAmount = {};
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::DragFloat("DistortionIntensity", &m_TrailInfo.fDistortionIntensity, 0.005f, 0.f, 1.f);
|
||||
GUI::InputFloat("DistortionTime", &m_TrailInfo.vDistortionTime.y, 0.1f, 0.f);
|
||||
|
||||
GUI::DragFloat2("DiffuseDistortionUVAmount", (_float*)&m_TrailInfo.vDiffuseDistortioUVAmount, 0.1f);
|
||||
GUI::DragFloat2("MaskDistortionUVAmount", (_float*)&m_TrailInfo.vMaskDistortionUVAmount, 0.1f);
|
||||
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
if (GUI::TreeNode("NOISE TEX"))
|
||||
{
|
||||
|
||||
strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DISTORTION_TEXTURE", (CComponent**)&m_pDistortion_TextureCom, nullptr, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strTrailDistortionName = strName;
|
||||
}
|
||||
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
@@ -424,22 +593,103 @@ HRESULT CTrailObject::Bind_ShaderResources()
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_isDiffuse, sizeof(_bool)))) {
|
||||
/* 디퓨즈 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_TrailInfo.isDiffuse, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMask", &m_isMask, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDiffuseAlpha", &m_TrailInfo.fDiffuseAlpha, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_isNoise, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_TrailInfo.vColor, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 마스크 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMask", &m_TrailInfo.isMask, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMask", &m_TrailInfo.fSoftMask, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMaskEdge", &m_TrailInfo.fSoftMaskEdge, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 노이즈 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_TrailInfo.isNoise, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseColor", &m_TrailInfo.isNoiseColor, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseAlpha", &m_TrailInfo.isNoiseAlpha, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseStrength", &m_TrailInfo.fNoiseStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 디스토션 */
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDistortion", &m_TrailInfo.isDistortion, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDistortionTime", &m_TrailInfo.vDistortionTime, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseDistortionUVGainAmount", &m_TrailInfo.vDiffuseDistortioUVAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDistortionIntensity", &m_TrailInfo.fDistortionIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskDistortionUVGainAmount", &m_TrailInfo.vMaskDistortionUVAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
/* 이미시브 */
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_TrailInfo.vEmissive, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveStrength", &m_TrailInfo.fEmissiveStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftenExp", &m_TrailInfo.fSoftenExp, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftStrength", &m_TrailInfo.fSoftStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fCoreBoost", &m_TrailInfo.fCoreBoost, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fRadius", &m_TrailInfo.fRadius, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (m_pDiffuse_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DiffuseTexture", 0))) {
|
||||
@@ -461,5 +711,12 @@ HRESULT CTrailObject::Bind_ShaderResources()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pDistortion_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pMasking_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DistortionTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "Effect_Container.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
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;
|
||||
|
||||
|
||||
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 CDummy_PhysXEffectHitBox* m_pPhysHitBox = {};
|
||||
|
||||
class CPartObject* m_pProjectile = {};
|
||||
class CPartObject* m_pProjectile_Blur = {};
|
||||
|
||||
_vector m_vRotateUp = {};
|
||||
_float m_fAccTime = {};
|
||||
_float m_fLerpAmount = {};
|
||||
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
|
||||
@@ -23,7 +23,7 @@ namespace Editor
|
||||
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_NORTEX { DEFAULT, TERRAIN, END };
|
||||
enum class SHADER_PASS_PARTICLE { EXPLOSION, END };
|
||||
enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, 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_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, SPELLTYPE, HPBAR, END };
|
||||
|
||||
|
||||
@@ -21,11 +21,7 @@ class CEffect_Container abstract : public CContainerObject
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override;
|
||||
public:
|
||||
#ifdef _DEBUG
|
||||
HRESULT Save_Package(const _char* pPath);
|
||||
#endif
|
||||
HRESULT Load_Package(const _char* pPath);
|
||||
HRESULT Load_Directory(const _char* pPath);
|
||||
HRESULT Load_Directory(const _char* pPath);
|
||||
protected:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
@@ -47,7 +47,7 @@ class CEffect_Editor final : public CEffect_Container
|
||||
|
||||
_char m_szBuffer[MAX_PATH] = { "../Bin/Resources/Data/Effect/"};
|
||||
_char m_szTrailBuffer[MAX_PATH] = { "../Bin/Resources/Data/Effect/Trail/" };
|
||||
_char m_szPackageBuffer[MAX_PATH] = { "../Bin/Resources/Data/Effect/Package/" };
|
||||
_char m_szPackageBuffer[MAX_PATH] = { "../Bin/Resources/Data/Effect/" };
|
||||
|
||||
_string m_strSavePath = {};
|
||||
_string m_strTrailSavePath = {};
|
||||
|
||||
@@ -7,12 +7,57 @@ NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CTexture;
|
||||
class CTrail;
|
||||
class CTransform;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CTrailObject final : public CPartObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagTrailInfo
|
||||
{
|
||||
EFFECT_TYPE eEffectType = { EFFECT_TYPE::TRAIL };
|
||||
/* 디퓨즈 */
|
||||
_bool isDiffuse = {};
|
||||
_float fDiffuseAlpha = { 1.f };
|
||||
_float4 vColor = { 0.f ,0.f ,0.f ,1.f };
|
||||
|
||||
/* 마스크 */
|
||||
_bool isMask = {};
|
||||
_float fSoftMaskEdge = {};
|
||||
_float fSoftMask = {};
|
||||
|
||||
/* 노이즈 */
|
||||
_bool isNoise = {};
|
||||
_bool isNoiseColor = { false };
|
||||
_bool isNoiseAlpha = { false };
|
||||
_float fNoiseStrength = {};
|
||||
|
||||
/* 디스 토션 */
|
||||
_bool isDistortion = {};
|
||||
_float2 vDistortionTime = {};
|
||||
_float2 vDiffuseDistortioUVAmount = {};
|
||||
_float2 vMaskDistortionUVAmount = {};
|
||||
_float fDistortionIntensity = {};
|
||||
|
||||
/* 이미시브 */
|
||||
_float4 vEmissive = { 0.f ,0.f ,0.f ,0.f };
|
||||
|
||||
_float fEmissiveStrength = { 0.f };
|
||||
_float fSoftenExp = { 1.31429f };
|
||||
_float fSoftStrength = {};
|
||||
_float fCoreBoost = {};
|
||||
_float fRadius = {};
|
||||
|
||||
|
||||
/* 블러 */
|
||||
_bool isBlur = {};
|
||||
_bool isOnlyBlur = { false };
|
||||
_float fBlurIntensity = {};
|
||||
_int iBlurWeight = {};
|
||||
|
||||
}TRAIL_INFO;
|
||||
private:
|
||||
CTrailObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CTrailObject(const CTrailObject& rhs);
|
||||
@@ -23,9 +68,10 @@ class CTrailObject final : public CPartObject
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
|
||||
public:
|
||||
void Set_Target(class CTransform* pTargetTransform);
|
||||
public:
|
||||
#ifdef _DEBUG
|
||||
HRESULT Save_Path(HANDLE hFile);
|
||||
HRESULT Save_Trail(const _char* pPath);
|
||||
#endif
|
||||
HRESULT Load_Trail(const _char* pPath, LEVEL eLevel);
|
||||
@@ -35,6 +81,8 @@ class CTrailObject final : public CPartObject
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Blur() override;
|
||||
|
||||
|
||||
public:
|
||||
static CTrailObject* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
@@ -46,6 +94,7 @@ class CTrailObject final : public CPartObject
|
||||
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 };
|
||||
@@ -53,15 +102,14 @@ class CTrailObject final : public CPartObject
|
||||
_string m_strTrailDiffuseName = {};
|
||||
_string m_strTrailNoiseName = {};
|
||||
_string m_strTrailMaskingName = {};
|
||||
_string m_strTrailDistortionName = {};
|
||||
|
||||
_string m_strPath = {};
|
||||
_string m_strName = {};
|
||||
|
||||
_bool m_isDiffuse = {};
|
||||
_bool m_isNoise = {};
|
||||
_bool m_isMask = {};
|
||||
TRAIL_INFO m_TrailInfo = {};
|
||||
|
||||
|
||||
EFFECT_TYPE m_eEffectType = { EFFECT_TYPE::TRAIL };
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -264,5 +264,45 @@ float4x4 RotateAxis(float4 _vAxis , float fAngle)
|
||||
|
||||
}
|
||||
|
||||
float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption)
|
||||
{
|
||||
if (iSelectOption < 0)
|
||||
return float2(0, 0);
|
||||
|
||||
float fRatio = _fRatio;
|
||||
switch (iSelectOption)
|
||||
{
|
||||
case 0:
|
||||
fRatio = fRatio; // Linear
|
||||
break;
|
||||
case 1:
|
||||
fRatio = fRatio * fRatio; // EaseInQuad 후반에 속도 증가
|
||||
break;
|
||||
case 2:
|
||||
fRatio = 1 - (1 - fRatio * fRatio); // EaseOutQuad 초반에 속도 증가
|
||||
break;
|
||||
case 3:
|
||||
fRatio = fRatio * fRatio * fRatio; // EaseInCubic 더 강하게 후반 속도 증가
|
||||
break;
|
||||
case 4:
|
||||
fRatio = 1 - (1 - fRatio * fRatio * fRatio); // EaseOutCubic 더 강하게 초반 속도 증가
|
||||
break;
|
||||
case 5:
|
||||
fRatio = 0.5f * (1 - cos(PI * fRatio)); // EaseInOutSin 사인 곡선
|
||||
break;
|
||||
case 6:
|
||||
fRatio = sin(13 * PI * fRatio) * (1 - fRatio) * (1 - fRatio); // EaseInBack 뒤로갔다가 앞으로
|
||||
break;
|
||||
case 7:
|
||||
fRatio = pow(2, 10 * (fRatio - 1)); // Expo 지수 함수
|
||||
break;
|
||||
case 8:
|
||||
fRatio = 1 - pow(1 - fRatio * fRatio, 0.5); // 원형 궤적
|
||||
break;
|
||||
}
|
||||
|
||||
return fAmount * fRatio;
|
||||
|
||||
}
|
||||
|
||||
#endif // ENGINE_SHADER_FUNCTIONS_HLSLI
|
||||
|
||||
@@ -23,6 +23,7 @@ HRESULT CPartObject::Initialize(void* pArg)
|
||||
if (FAILED(__super::Initialize(pArg))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
PARTOBJECT_DESC* pDesc = static_cast<PARTOBJECT_DESC*>(pArg);
|
||||
|
||||
m_pParentTransformCom = pDesc->pParentTransform;
|
||||
|
||||