@@ -1,13 +1,26 @@
|
||||
#sln
|
||||
|
||||
# h 저장형식 지정
|
||||
[*.h]
|
||||
charset = utf-8-bom
|
||||
insert_final_newline = true
|
||||
end_of_line = crlf
|
||||
|
||||
# cpp 저장형식 지정
|
||||
[*.cpp]
|
||||
charset = utf-8-bom
|
||||
insert_final_newline = true
|
||||
end_of_line = crlf
|
||||
|
||||
|
||||
# hlsl 저장형식 지정
|
||||
[*.hlsl]
|
||||
charset = utf-8
|
||||
charset = utf-8-bom
|
||||
insert_final_newline = true
|
||||
end_of_line = crlf
|
||||
|
||||
# hlsli 저장형식 지정
|
||||
[*.hlsli]
|
||||
charset = utf-8
|
||||
charset = utf-8-bom
|
||||
insert_final_newline = true
|
||||
end_of_line = crlf
|
||||
|
||||
@@ -16,6 +16,7 @@ Texture2D g_Texture;
|
||||
float g_fLightRange;
|
||||
float g_fSpotInnerAngle;
|
||||
float g_fSpotOuterAngle;
|
||||
|
||||
vector g_vLightDir;
|
||||
vector g_vLightPos;
|
||||
vector g_vCamPosition;
|
||||
@@ -29,6 +30,7 @@ Texture2D g_ShadowTexture;
|
||||
Texture2D g_PreShadowTexture;
|
||||
Texture2D g_BlurTexture;
|
||||
Texture2D g_BlurXTexture;
|
||||
Texture2D g_BlurWeightTexture;
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +38,8 @@ vector g_vLightDiffuse;
|
||||
vector g_vLightAmbient;
|
||||
vector g_vLightSpecular;
|
||||
|
||||
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
float3 vPosition : POSITION;
|
||||
@@ -219,13 +223,15 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
float g_fWeights[13] =
|
||||
float g_fWeights[32] =
|
||||
{
|
||||
0.0090, 0.0218, 0.0448, 0.0784, 0.1169,
|
||||
0.1486, 0.1610, 0.1486, 0.1169, 0.0784,
|
||||
0.0448, 0.0218, 0.0090
|
||||
0.000400, 0.000700, 0.001200, 0.002000, 0.003200, 0.005000, 0.007500, 0.011000,
|
||||
0.015700, 0.021700, 0.029000, 0.037300, 0.046200, 0.055200, 0.063600, 0.070800,
|
||||
0.075900, 0.078500, 0.078500, 0.075900, 0.070800, 0.063600, 0.055200, 0.046200,
|
||||
0.037300, 0.029000, 0.021700, 0.015700, 0.011000, 0.007500, 0.005000, 0.003200
|
||||
};
|
||||
|
||||
|
||||
PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
@@ -295,15 +301,31 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
//{
|
||||
// Out.vBackBuffer *= 0.5f;
|
||||
//}
|
||||
|
||||
float4 vColor = 0.f;
|
||||
|
||||
for (int i = -6; i < 7; ++i)
|
||||
//int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f;
|
||||
|
||||
//int iBlurMin;
|
||||
//int iBlurMax;
|
||||
|
||||
//if (iBlurWeight % 2 == 0)
|
||||
//{
|
||||
// iBlurMin = -1 * iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// iBlurMin = -iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2 + 1;
|
||||
//}
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
for (int i = -15; i < 16; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
vTexcoord.y = In.vTexcoord.y + (float)i / g_vResolution.y;
|
||||
vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBackBuffer += vColor;
|
||||
@@ -324,12 +346,32 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In)
|
||||
float2 vTexcoord;
|
||||
float4 vColor = 0.f;
|
||||
|
||||
for (int i = -6; i < 7; ++i)
|
||||
//TODO 블러 조절 해보려햇는데 실패함..
|
||||
|
||||
//int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f;
|
||||
|
||||
//int iBlurMin;
|
||||
//int iBlurMax;
|
||||
|
||||
//if (iBlurWeight % 2 == 0)
|
||||
//{
|
||||
// iBlurMin = -1 * iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// iBlurMin = -iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2 + 1;
|
||||
//}
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
|
||||
for (int i = -15; i < 16; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x;
|
||||
vTexcoord.y = In.vTexcoord.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 15] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBlurX = vColor;
|
||||
|
||||
@@ -50,10 +50,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
|
||||
Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
vector vDiffuseTexture = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
vector vColorTexture = g_ColorTexture.Sample(ClampSampler, In.vTexcoord);
|
||||
|
||||
if (0.f == vColorTexture.a)
|
||||
{
|
||||
@@ -66,7 +63,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
switch (iOption)
|
||||
{
|
||||
case 1:
|
||||
Out.vBackBuffer.rgb = vColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb /= vColorTexture.rgb;
|
||||
break;
|
||||
case 2:
|
||||
Out.vBackBuffer.rgb += vColorTexture.rgb;
|
||||
@@ -78,7 +75,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
Out.vBackBuffer.rgb *= vColorTexture.rgb;
|
||||
break;
|
||||
case 5:
|
||||
Out.vBackBuffer.rgb /= vColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb = vColorTexture.rgb;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
|
After Width: | Height: | Size: 6.0 MiB |
|
After Width: | Height: | Size: 14 MiB |
|
After Width: | Height: | Size: 8.2 MiB |
|
After Width: | Height: | Size: 14 MiB |
|
After Width: | Height: | Size: 7.5 MiB |
|
After Width: | Height: | Size: 4.6 MiB |
|
After Width: | Height: | Size: 8.7 MiB |
|
After Width: | Height: | Size: 6.6 MiB |
|
After Width: | Height: | Size: 2.7 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 6.8 MiB |
@@ -16,6 +16,7 @@ Texture2D g_Texture;
|
||||
float g_fLightRange;
|
||||
float g_fSpotInnerAngle;
|
||||
float g_fSpotOuterAngle;
|
||||
|
||||
vector g_vLightDir;
|
||||
vector g_vLightPos;
|
||||
vector g_vCamPosition;
|
||||
@@ -29,6 +30,7 @@ Texture2D g_ShadowTexture;
|
||||
Texture2D g_PreShadowTexture;
|
||||
Texture2D g_BlurTexture;
|
||||
Texture2D g_BlurXTexture;
|
||||
Texture2D g_BlurWeightTexture;
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +38,8 @@ vector g_vLightDiffuse;
|
||||
vector g_vLightAmbient;
|
||||
vector g_vLightSpecular;
|
||||
|
||||
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
float3 vPosition : POSITION;
|
||||
@@ -219,13 +223,15 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
float g_fWeights[13] =
|
||||
float g_fWeights[32] =
|
||||
{
|
||||
0.0090, 0.0218, 0.0448, 0.0784, 0.1169,
|
||||
0.1486, 0.1610, 0.1486, 0.1169, 0.0784,
|
||||
0.0448, 0.0218, 0.0090
|
||||
0.000400, 0.000700, 0.001200, 0.002000, 0.003200, 0.005000, 0.007500, 0.011000,
|
||||
0.015700, 0.021700, 0.029000, 0.037300, 0.046200, 0.055200, 0.063600, 0.070800,
|
||||
0.075900, 0.078500, 0.078500, 0.075900, 0.070800, 0.063600, 0.055200, 0.046200,
|
||||
0.037300, 0.029000, 0.021700, 0.015700, 0.011000, 0.007500, 0.005000, 0.003200
|
||||
};
|
||||
|
||||
|
||||
PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
@@ -295,15 +301,31 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
//{
|
||||
// Out.vBackBuffer *= 0.5f;
|
||||
//}
|
||||
|
||||
float4 vColor = 0.f;
|
||||
|
||||
for (int i = -6; i < 7; ++i)
|
||||
//int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f;
|
||||
|
||||
//int iBlurMin;
|
||||
//int iBlurMax;
|
||||
|
||||
//if (iBlurWeight % 2 == 0)
|
||||
//{
|
||||
// iBlurMin = -1 * iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// iBlurMin = -iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2 + 1;
|
||||
//}
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
for (int i = -15; i < 16; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
vTexcoord.y = In.vTexcoord.y + (float)i / g_vResolution.y;
|
||||
vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBackBuffer += vColor;
|
||||
@@ -324,12 +346,32 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In)
|
||||
float2 vTexcoord;
|
||||
float4 vColor = 0.f;
|
||||
|
||||
for (int i = -6; i < 7; ++i)
|
||||
//TODO 블러 조절 해보려햇는데 실패함..
|
||||
|
||||
//int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f;
|
||||
|
||||
//int iBlurMin;
|
||||
//int iBlurMax;
|
||||
|
||||
//if (iBlurWeight % 2 == 0)
|
||||
//{
|
||||
// iBlurMin = -1 * iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// iBlurMin = -iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2 + 1;
|
||||
//}
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
|
||||
for (int i = -15; i < 16; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x;
|
||||
vTexcoord.y = In.vTexcoord.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 15] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBlurX = vColor;
|
||||
|
||||
@@ -50,10 +50,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
|
||||
Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
vector vDiffuseTexture = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
vector vColorTexture = g_ColorTexture.Sample(ClampSampler, In.vTexcoord);
|
||||
|
||||
if (0.f == vColorTexture.a)
|
||||
{
|
||||
@@ -66,7 +63,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
switch (iOption)
|
||||
{
|
||||
case 1:
|
||||
Out.vBackBuffer.rgb = vColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb /= vColorTexture.rgb;
|
||||
break;
|
||||
case 2:
|
||||
Out.vBackBuffer.rgb += vColorTexture.rgb;
|
||||
@@ -78,7 +75,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
Out.vBackBuffer.rgb *= vColorTexture.rgb;
|
||||
break;
|
||||
case 5:
|
||||
Out.vBackBuffer.rgb /= vColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb = vColorTexture.rgb;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -304,9 +304,6 @@ PS_OUT PS_MAIN_TEST(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
technique11 DefaultTechnique
|
||||
{
|
||||
pass Default
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
|
||||
float PI = 3.141592;
|
||||
|
||||
struct ParticleValue
|
||||
{
|
||||
@@ -41,10 +42,18 @@ float2 g_vMaskingUVGainAmount;
|
||||
float2 g_vDiffuseNoiseUVGainAmount;
|
||||
float2 g_vMaskNoiseUVGainAmount;
|
||||
|
||||
//
|
||||
int g_iMaskMoveLerpOption;
|
||||
int g_iDiffuseMoveLerpOption;
|
||||
int g_iMaskNoiseMoveLerpOption;
|
||||
int g_iDiffuseNoiseMoveLerpOption;
|
||||
//
|
||||
|
||||
float2 g_vUVCutting;
|
||||
float2 g_vUVMaskCutting;
|
||||
|
||||
|
||||
int g_iBlurWeight; // 블러 강도
|
||||
float g_fBlurIntensity; //블러 세기
|
||||
float g_fNoiseDistortionIntensity; // 노이즈 왜곡 세기
|
||||
|
||||
@@ -62,6 +71,47 @@ bool g_isMaskUVMove;
|
||||
|
||||
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
|
||||
{
|
||||
@@ -188,14 +238,15 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
UV = UV_Cutting(In.vTexcoord, g_vUVCutting, int(fAnimIndex.x));
|
||||
|
||||
if (g_isDiffuseUVMove)
|
||||
{
|
||||
UV += (g_vDiffuseUVGainAmount / g_vUVCutting) * (vDiffuseTime.x / vDiffuseTime.y);
|
||||
{
|
||||
UV += SelectLerpUV((g_vDiffuseUVGainAmount / g_vUVCutting), (vDiffuseTime.x / vDiffuseTime.y), g_iDiffuseMoveLerpOption);
|
||||
}
|
||||
|
||||
/* 노이즈 */
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
float2 vNoiseUV = In.vTexcoord + (g_vDiffuseNoiseUVGainAmount) * (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y);
|
||||
|
||||
float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vDiffuseNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iDiffuseNoiseMoveLerpOption);
|
||||
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV);
|
||||
|
||||
@@ -235,8 +286,8 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
float2 vNoiseUV = In.vTexcoord + (g_vMaskNoiseUVGainAmount) * (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y);
|
||||
|
||||
float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vMaskNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iMaskNoiseMoveLerpOption);
|
||||
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV);
|
||||
|
||||
@@ -247,7 +298,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
if (g_isMaskUVMove)
|
||||
{
|
||||
if (vMaskingTime.y > 0)
|
||||
vMaskTexcoord += g_vMaskingUVGainAmount * (vMaskingTime.x / vMaskingTime.y);
|
||||
vMaskTexcoord += SelectLerpUV(g_vMaskingUVGainAmount / g_vUVMaskCutting, (vMaskingTime.x / vMaskingTime.y), g_iMaskMoveLerpOption);
|
||||
}
|
||||
|
||||
vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord);
|
||||
@@ -324,6 +375,7 @@ struct PS_BLUR_IN
|
||||
struct PS_BLUR_OUT
|
||||
{
|
||||
float4 vDiffuse : SV_TARGET0;
|
||||
float4 vBlurWeight : SV_TARGET1;
|
||||
};
|
||||
|
||||
|
||||
@@ -332,6 +384,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
|
||||
PS_BLUR_OUT Out;
|
||||
|
||||
|
||||
vector vMtrlDiffuse;
|
||||
vector vMtrlMask;
|
||||
vector vMtrlNoise;
|
||||
@@ -344,31 +397,20 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
|
||||
if (g_isDiffuse == true)
|
||||
{
|
||||
float2 UV = In.vTexcoord; // 이미지의 UV값
|
||||
|
||||
int iTotalFrame = g_vUVCutting.x * g_vUVCutting.y; // 이미지의 최대 프레임 (몇 곱하기 몇인지)
|
||||
|
||||
int iCurrentFrame = int(fAnimIndex.x); // 현재 프레임이 어디 위치인지
|
||||
|
||||
int iFrameX = iCurrentFrame % (int) g_vUVCutting.x; // 현재 x축의 위치(현재 이미지의 몇번째 칸을 보여줄 지)
|
||||
int iFrameY = iCurrentFrame / (int) g_vUVCutting.x; // 현재 y축의 위치(현재 이미지의 몇번째 줄을 보여줄 지)
|
||||
|
||||
float fFreamWidth = 1.0 / g_vUVCutting.x; // 1.0 나누기 이미지 갯수를 해서 한칸에 얼마나 갈지 정해준다.
|
||||
float fFreamHeight = 1.0 / g_vUVCutting.y; // 1.0 나누기 이미지 갯수를 해서 한줄에 얼마나 갈지 정해준다.
|
||||
|
||||
UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; // 먼저 uv를 0~1이 아닌 0~fFrameWidth로 만든 다음에 한칸씩 옆으로 밀어준다.
|
||||
UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; // 먼저 uv를 0~1이 아닌 0~fFrameHeight로 만든 다음에 한줄씩 밑으로 내려준다.
|
||||
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
UV = UV_Cutting(In.vTexcoord, g_vUVCutting, int(fAnimIndex.x));
|
||||
|
||||
if (g_isDiffuseUVMove)
|
||||
{
|
||||
UV += (g_vDiffuseUVGainAmount / g_vUVCutting) * (vDiffuseTime.x / vDiffuseTime.y);
|
||||
UV += SelectLerpUV((g_vDiffuseUVGainAmount / g_vUVCutting), (vDiffuseTime.x / vDiffuseTime.y), g_iDiffuseMoveLerpOption);
|
||||
}
|
||||
|
||||
/* 노이즈 */
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
float2 vNoiseUV = In.vTexcoord + (g_vDiffuseNoiseUVGainAmount) * (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y);
|
||||
|
||||
float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vDiffuseNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iDiffuseNoiseMoveLerpOption);
|
||||
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV);
|
||||
|
||||
@@ -387,7 +429,8 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
/* 최종 색깔 */
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, UV);
|
||||
|
||||
vMtrlDiffuse += g_vColor;
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
|
||||
if (vMtrlDiffuse.a < 0.3f)
|
||||
discard;
|
||||
@@ -402,10 +445,13 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
{
|
||||
float2 vMaskTexcoord = In.vTexcoord;
|
||||
|
||||
vMaskTexcoord = UV_Cutting(In.vTexcoord, g_vUVMaskCutting, int(fAnimIndex.x));
|
||||
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
|
||||
float2 vNoiseUV = In.vTexcoord + (g_vMaskNoiseUVGainAmount) * (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y);
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
float2 vNoiseUV = In.vTexcoord + SelectLerpUV(g_vMaskNoiseUVGainAmount, (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y), g_iMaskNoiseMoveLerpOption);
|
||||
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV);
|
||||
|
||||
@@ -416,7 +462,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
if (g_isMaskUVMove)
|
||||
{
|
||||
if (vMaskingTime.y > 0)
|
||||
vMaskTexcoord += g_vMaskingUVGainAmount * (vMaskingTime.x / vMaskingTime.y);
|
||||
vMaskTexcoord += SelectLerpUV(g_vMaskingUVGainAmount / g_vUVMaskCutting, (vMaskingTime.x / vMaskingTime.y), g_iMaskMoveLerpOption);
|
||||
}
|
||||
|
||||
vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord);
|
||||
@@ -428,6 +474,17 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
|
||||
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r);
|
||||
|
||||
if (g_isDissolve == true)
|
||||
{
|
||||
vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (vMtrlDissolve.r < (In.vLifeTime.x / In.vLifeTime.y))
|
||||
discard;
|
||||
}
|
||||
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r);
|
||||
|
||||
if (g_isDissolve == true)
|
||||
@@ -439,6 +496,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
}
|
||||
|
||||
Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity;
|
||||
Out.vBlurWeight.r = g_iBlurWeight / 32.f;
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -477,3 +535,7 @@ technique11 DefaultTechnique
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -172,6 +172,7 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Effect_Editor.h" />
|
||||
<ClInclude Include="..\Public\EditEffect.h" />
|
||||
<ClInclude Include="..\Public\Information.h" />
|
||||
<ClInclude Include="..\public\Level_MapViewer.h" />
|
||||
<ClInclude Include="..\Public\LoadingWidget.h" />
|
||||
<ClInclude Include="..\public\MapContainer.h" />
|
||||
@@ -188,8 +189,6 @@
|
||||
<ClInclude Include="..\Public\EffectObject.h" />
|
||||
<ClInclude Include="..\Public\DummyRect.h" />
|
||||
<ClInclude Include="..\Public\Dummy_Cube.h" />
|
||||
<ClInclude Include="..\Public\Dummy_Goblin.h" />
|
||||
<ClInclude Include="..\Public\Dummy_Goblin_Head.h" />
|
||||
<ClInclude Include="..\Public\Editor_Define.h" />
|
||||
<ClInclude Include="..\Public\Editor_Macro.h" />
|
||||
<ClInclude Include="..\Public\Editor_Struct.h" />
|
||||
@@ -238,6 +237,7 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Effect_Editor.cpp" />
|
||||
<ClCompile Include="..\Private\EditEffect.cpp" />
|
||||
<ClCompile Include="..\Private\Information.cpp" />
|
||||
<ClCompile Include="..\private\Level_MapViewer.cpp" />
|
||||
<ClCompile Include="..\Private\LoadingWidget.cpp" />
|
||||
<ClCompile Include="..\private\MapContainer.cpp" />
|
||||
@@ -254,7 +254,6 @@
|
||||
<ClCompile Include="..\Private\EffectObject.cpp" />
|
||||
<ClCompile Include="..\Private\DummyRect.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Cube.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Goblin.cpp" />
|
||||
<ClCompile Include="..\Private\Hair.cpp" />
|
||||
<ClCompile Include="..\Private\Loader.cpp" />
|
||||
<ClCompile Include="..\Private\Level_EffectViewer.cpp" />
|
||||
@@ -263,7 +262,6 @@
|
||||
<ClCompile Include="..\private\Loading_Panel.cpp" />
|
||||
<ClCompile Include="..\private\MiniMap_Panel.cpp" />
|
||||
<ClCompile Include="..\private\MiniMap_TrimBorder.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Goblin_Head.cpp" />
|
||||
<ClCompile Include="..\Private\Head.cpp" />
|
||||
<ClCompile Include="..\private\Mission_Panel.cpp" />
|
||||
<ClCompile Include="..\Private\Level_Loading.cpp" />
|
||||
|
||||
@@ -67,12 +67,6 @@
|
||||
<Filter Include="50.UI\Mouse_Cursor">
|
||||
<UniqueIdentifier>{b5d188ff-5925-40bd-8da4-2ed00c89f730}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummy_Goblin">
|
||||
<UniqueIdentifier>{0ebb9c08-69b0-49b6-bac3-c827ca13319a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummy_Goblin\Dummy_Goblin_Head">
|
||||
<UniqueIdentifier>{69af10ea-e8f1-4455-9435-93857b7eb198}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\ModelParts">
|
||||
<UniqueIdentifier>{a04e88c3-dabb-4a91-8b9f-ce7f5562def6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -252,18 +246,12 @@
|
||||
<ClInclude Include="..\public\Mouse_Cursor.h">
|
||||
<Filter>50.UI\Mouse_Cursor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_Goblin.h">
|
||||
<Filter>02.GameObjects\Dummy_Goblin</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Level_ObjectViewer.h">
|
||||
<Filter>01.Level\20.ObjectViewer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_Cube.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyCube</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_Goblin_Head.h">
|
||||
<Filter>02.GameObjects\Dummy_Goblin\Dummy_Goblin_Head</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Body.h">
|
||||
<Filter>02.GameObjects\ModelParts\Body</Filter>
|
||||
</ClInclude>
|
||||
@@ -405,6 +393,9 @@
|
||||
<ClInclude Include="..\public\DummySkyBox.h">
|
||||
<Filter>02.GameObjects\Dummys\DummySkyBox</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Information.h">
|
||||
<Filter>03.Information</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Editor.ico">
|
||||
@@ -445,18 +436,12 @@
|
||||
<ClCompile Include="..\private\Mouse_Cursor.cpp">
|
||||
<Filter>50.UI\Mouse_Cursor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_Goblin.cpp">
|
||||
<Filter>02.GameObjects\Dummy_Goblin</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Level_ObjectViewer.cpp">
|
||||
<Filter>01.Level\20.ObjectViewer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_Cube.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyCube</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_Goblin_Head.cpp">
|
||||
<Filter>02.GameObjects\Dummy_Goblin\Dummy_Goblin_Head</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Body.cpp">
|
||||
<Filter>02.GameObjects\ModelParts\Body</Filter>
|
||||
</ClCompile>
|
||||
@@ -604,6 +589,9 @@
|
||||
<ClCompile Include="..\private\DummySkyBox.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummySkyBox</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Information.cpp">
|
||||
<Filter>03.Information</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Editor.rc">
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_Goblin.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
|
||||
CDummy_Goblin::CDummy_Goblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject( pDevice, pContext )
|
||||
{
|
||||
}
|
||||
|
||||
CDummy_Goblin::CDummy_Goblin(const CDummy_Goblin& Prototype)
|
||||
: CGameObject( Prototype )
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDummy_Goblin::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CDummy_Goblin::Update(_float fTimeDelta)
|
||||
{
|
||||
//m_pModelCom->Play_Animation(fTimeDelta);
|
||||
}
|
||||
|
||||
void CDummy_Goblin::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
_float4 vPos;
|
||||
XMStoreFloat4(&vPos, Get_WorldPostion());
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f);
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
//m_pShaderCom->Bind_SRV("g_NormalTexture", nullptr);
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin::Ready_Components()
|
||||
{
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinBody_Model"),
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))){
|
||||
return E_FAIL;
|
||||
}
|
||||
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_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_bRimLight", &m_bRimLight, sizeof(_bool)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimStrength", &m_fRimLightStrength, sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimPower", &m_fRimLightPower, sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_vRimColor", &m_vRimLightColor, sizeof(_float3)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDummy_Goblin* CDummy_Goblin::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDummy_Goblin* pInstance = new CDummy_Goblin(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummy_Goblin");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDummy_Goblin::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDummy_Goblin* pInstance = new CDummy_Goblin(*this);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummy_Goblin");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDummy_Goblin::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_Goblin::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_Goblin_Head.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
|
||||
CDummy_Goblin_Head::CDummy_Goblin_Head(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CDummy_Goblin_Head::CDummy_Goblin_Head(const CDummy_Goblin_Head& Prototype)
|
||||
: CGameObject(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin_Head::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin_Head::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDummy_Goblin_Head::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CDummy_Goblin_Head::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pOwner->Get_Component<CModel>()->Play_Animation(fTimeDelta);
|
||||
m_pModelCom->Play_Animation(fTimeDelta);
|
||||
}
|
||||
|
||||
void CDummy_Goblin_Head::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
_float4 vPos;
|
||||
XMStoreFloat4(&vPos, Get_WorldPostion());
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f);
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin_Head::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin_Head::Ready_Components()
|
||||
{
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinHead_Model"),
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Goblin_Head::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
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_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_bRimLight", &m_bRimLight, sizeof(_bool)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimStrength", &m_fRimLightStrength, sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimPower", &m_fRimLightPower, sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_vRimColor", &m_vRimLightColor, sizeof(_float3)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDummy_Goblin_Head* CDummy_Goblin_Head::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDummy_Goblin_Head* pInstance = new CDummy_Goblin_Head(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummy_Goblin_Head");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDummy_Goblin_Head::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDummy_Goblin_Head* pInstance = new CDummy_Goblin_Head(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummy_Goblin_Head");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDummy_Goblin_Head::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_Goblin_Head::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -43,8 +43,9 @@ void CDummy_PhysXBox::Update(_float fTimeDelta)
|
||||
|
||||
void CDummy_PhysXBox::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
//_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
|
||||
//m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
_float4 vPos;
|
||||
XMStoreFloat4(&vPos, Get_WorldPostion());
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f);
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXBox::Render()
|
||||
@@ -53,26 +54,21 @@ HRESULT CDummy_PhysXBox::Render()
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
|
||||
//_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
//for (_uint i = 0; i < iNumMeshes; i++)
|
||||
//{
|
||||
// if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
// if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
|
||||
// if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::SKYBOX)))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
|
||||
// if (FAILED(m_pModelCom->Render(i))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
//if (FAILED(m_pModelCom->Bind_Material(0, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
//if (FAILED(m_pModelCom->Render(0))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(m_pRigidBody->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
return S_OK;
|
||||
@@ -91,39 +87,40 @@ HRESULT CDummy_PhysXBox::Ready_Components(void* pArg)
|
||||
|
||||
{ // RIGID_BODY
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.tRigidDynamicDesc.bIsKinematic = false;
|
||||
Desc.tRigidDynamicDesc.fDensity = 1000.f;
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pActor = m_pGameInstance->Add_DynamicActor(*m_pRigidBody);
|
||||
if (nullptr == m_pActor) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_PhysXBox::Bind_ShaderResources()
|
||||
{
|
||||
//if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//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_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
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_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -158,8 +155,8 @@ void CDummy_PhysXBox::Free()
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pRigidBody);
|
||||
//SAFE_RELEASE(m_pModelCom);
|
||||
//SAFE_RELEASE(m_pShaderCom);
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_PhysXBox::Describe_Entity()
|
||||
|
||||
@@ -34,32 +34,6 @@ HRESULT CDummy_PhysXMesh::Initialize(void* pArg)
|
||||
|
||||
void CDummy_PhysXMesh::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_F2)) {
|
||||
CModel* pModel = Get_Component<CModel>();
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
pModel->Save_PhysXTriMeshes("../Bin/Resources/Models/River/River.bin");
|
||||
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
for (_uint i = 0; i < iNumMesh; ++i)
|
||||
{ // RIGID_BODY
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
|
||||
Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(pModel->Get_MeshName(i)).c_str(), nullptr, &Desc);
|
||||
}
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_F3)) {
|
||||
CModel* pModel = Get_Component<CModel>();
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
for (_uint i = 0; i < iNumMesh; ++i)
|
||||
{ // RIGID_BODY
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
|
||||
Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(pModel->Get_MeshName(i)).c_str(), nullptr, &Desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CDummy_PhysXMesh::Update(_float fTimeDelta)
|
||||
|
||||
@@ -16,29 +16,32 @@ CDummy_PhysXPlayable::CDummy_PhysXPlayable(const CDummy_PhysXPlayable& rhs):
|
||||
void CDummy_PhysXPlayable::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
}
|
||||
|
||||
void CDummy_PhysXPlayable::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f));
|
||||
if (m_pGameInstance->Key_Pressing(DIK_UPARROW)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f));
|
||||
if (m_pGameInstance->Key_Pressing(DIK_LEFT)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_S)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f));
|
||||
if (m_pGameInstance->Key_Pressing(DIK_DOWN)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f));
|
||||
if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_SPACE)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 10.f, 0.f, 0.f));
|
||||
if (m_pGameInstance->Key_Pressing(DIK_LCONTROL)) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_SPACE)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_C)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_C)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -10.f, 0.f, 0.f));
|
||||
}
|
||||
//m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY, 0.f, 0.f));
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
}
|
||||
|
||||
@@ -52,34 +55,25 @@ void CDummy_PhysXPlayable::Late_Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CDummy_PhysXPlayable::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
//if (FAILED(Bind_ShaderResources())) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
//if (FAILED(m_pModelCom->Bind_Material(0, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
//if (FAILED(m_pModelCom->Render(0))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(m_pCharacter_Controller->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
//m_pShaderCom->Bind_SRV("g_NormalTexture", nullptr);
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
//if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -104,9 +98,16 @@ HRESULT CDummy_PhysXPlayable::Initialize(void* pArg)
|
||||
|
||||
HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(nullptr))) {
|
||||
CTransform::TRANSFORM_DESC TransformDesc{};
|
||||
TransformDesc.fRadius = 100.f;
|
||||
TransformDesc.fRotationPerSec = XMConvertToRadians(60.f);
|
||||
TransformDesc.fSpeedPerSec = 30.f;
|
||||
if (FAILED(__super::Ready_Components(&TransformDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
PlayableSTARTPOS_DESC* pDesc = static_cast<PlayableSTARTPOS_DESC*>(pArg);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPos), 1.f));
|
||||
m_pTransformCom->Rotation(pDesc->vRotRPY.x, pDesc->vRotRPY.y, pDesc->vRotRPY.z);
|
||||
{
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
|
||||
@@ -116,22 +117,24 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
|
||||
Desc.fMaterial = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.bAutoStepping = { false };
|
||||
Desc.fStepOffset = { 0.05f };
|
||||
Desc.tCapsuleInfo.fRadius = 1.5f;
|
||||
Desc.tCapsuleInfo.fHeight = 3.0f;
|
||||
Desc.tCapsuleInfo.fRadius = 0.5f;
|
||||
Desc.tCapsuleInfo.fHeight = 1.0f;
|
||||
Desc.tCapsuleInfo.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION));
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
//m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ void CEditEffect::Priority_Update(_float fTimeDelta)
|
||||
void CEditEffect::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
Reference_Mat_For_EditEffect();
|
||||
|
||||
|
||||
if (m_isBillboard)
|
||||
m_pGameInstance->BillBoard(m_pTransformCom);
|
||||
@@ -69,7 +69,7 @@ void CEditEffect::Late_Update(_float fTimeDelta)
|
||||
|
||||
void CEditEffect::Reference_Mat_For_EditEffect()
|
||||
{
|
||||
ImGui::Begin("Reference Material");
|
||||
|
||||
|
||||
const char* pCompute[] = { "DIFFUSE" , "MASK", "NOISE", "DISSOLVE" };
|
||||
|
||||
@@ -93,7 +93,7 @@ void CEditEffect::Reference_Mat_For_EditEffect()
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ImGui::End();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -148,12 +148,7 @@ 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" };
|
||||
|
||||
_int iCurrentItem = static_cast<_int>(m_eRenderOrder);
|
||||
@@ -169,7 +164,7 @@ void CEditEffect::Describe_Entity()
|
||||
GUI::Checkbox("Masking", &m_isMasking);
|
||||
GUI::Checkbox("Dissolve", &m_isDissolve);
|
||||
GUI::Checkbox("Noise", &m_isNoise);
|
||||
GUI::Checkbox("Blur", &m_isBlur);
|
||||
|
||||
|
||||
if (GUI::Checkbox("Billboard", &m_isBillboard))
|
||||
{
|
||||
@@ -184,8 +179,13 @@ void CEditEffect::Describe_Entity()
|
||||
|
||||
if (GUI::TreeNode("BLUR"))
|
||||
{
|
||||
GUI::Checkbox("Blur", &m_isBlur);
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::DragFloat("BlurIntensity", &m_fBlurIntensity, 0.005f, 0.f, 1.f);
|
||||
GUI::DragInt("BlurWeight", &m_iBlurWeight, 1.f, 0, 32);
|
||||
|
||||
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
GUI::TreePop();
|
||||
@@ -194,11 +194,11 @@ void CEditEffect::Describe_Entity()
|
||||
|
||||
if (GUI::TreeNode("EMISSIVE"))
|
||||
{
|
||||
const char* pCompute[] = { "EQUL" , "PLUS", "SUBSTRACT", "MULTY" , "DIV" };
|
||||
const char* pCompute[] = {"NONE", "DIV" , "PLUS", "SUBSTRACT", "MULTY" , "EQUL" };
|
||||
|
||||
_int iColorOption = (_int)m_fColorOption;
|
||||
|
||||
if (ImGui::Combo("OPTION", &iColorOption, pCompute, 5))
|
||||
if (ImGui::Combo("OPTION", &iColorOption, pCompute , 6))
|
||||
{
|
||||
m_fColorOption = (_float)iColorOption;
|
||||
}
|
||||
@@ -243,12 +243,28 @@ void CEditEffect::Describe_Entity()
|
||||
GUI::Checkbox("DiffuseUVMove", &m_isDiffuseUVMove);
|
||||
GUI::InputFloat2("DiffuseUVCutting", (_float*)&m_vUVCutting);
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
GUI::DragFloat2("DiffuseUVGainAmount", (_float*)&m_vDiffuseUVGainAmount, 0.01f);
|
||||
GUI::DragFloat2("DiffuseNoiseUVGainAmount", (_float*)&m_vDiffuseNoiseUVGainAmount, 0.01f);
|
||||
|
||||
|
||||
|
||||
_int iDiffuseMoveLerpOption = (_int)m_iDiffuseMoveLerpOption;
|
||||
|
||||
if (ImGui::Combo("Lerp DiffuseMove Option", &iDiffuseMoveLerpOption, pLerp, 9))
|
||||
{
|
||||
m_iDiffuseMoveLerpOption = iDiffuseMoveLerpOption;
|
||||
}
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this);
|
||||
if (GUI::TreeNode("DIFFUSE_TEX"))
|
||||
{
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this);
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
GUI::Separator(); GUI::Spacing();
|
||||
|
||||
@@ -267,11 +283,27 @@ void CEditEffect::Describe_Entity()
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::DragFloat2("MaskingUVGainAmount", (_float*)&m_vMaskingUVGainAmount, 0.01f);
|
||||
GUI::DragFloat2("MaskNoiseUVGainAmount", (_float*)&m_vMaskNoiseUVGainAmount, 0.01f);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "MASKING_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this);
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
|
||||
_int iMaskMoveLerpOption = (_int)m_iMaskMoveLerpOption;
|
||||
|
||||
if (ImGui::Combo("Lerp MaskMove Option", &iMaskMoveLerpOption, pLerp, 9))
|
||||
{
|
||||
m_iMaskMoveLerpOption = iMaskMoveLerpOption;
|
||||
}
|
||||
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
if (GUI::TreeNode("MASKING_TEX"))
|
||||
{
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "MASKING_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this);
|
||||
GUI::TreePop();
|
||||
}
|
||||
GUI::Separator(); GUI::Spacing();
|
||||
|
||||
GUI::TreePop();
|
||||
@@ -282,8 +314,11 @@ void CEditEffect::Describe_Entity()
|
||||
{
|
||||
if (GUI::TreeNode("DISSOLVE"))
|
||||
{
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DISSOLVE_TEXTURE", (CComponent**)&m_pDissolve_TextureCom, nullptr, this);
|
||||
|
||||
if (GUI::TreeNode("DISSOLV_TEX"))
|
||||
{
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DISSOLVE_TEXTURE", (CComponent**)&m_pDissolve_TextureCom, nullptr, this);
|
||||
GUI::TreePop();
|
||||
}
|
||||
GUI::Separator(); GUI::Spacing();
|
||||
|
||||
GUI::TreePop();
|
||||
@@ -295,11 +330,40 @@ void CEditEffect::Describe_Entity()
|
||||
if (GUI::TreeNode("NOISE"))
|
||||
{
|
||||
ImGui::PushItemWidth(80);
|
||||
|
||||
GUI::DragFloat("NoiseDistortionIntensity", &m_fNoiseDistortionIntensity, 0.005f, 0.f, 1.f);
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
GUI::DragFloat2("DiffuseNoiseUVGainAmount", (_float*)&m_vDiffuseNoiseUVGainAmount, 0.01f);
|
||||
|
||||
_int iDiffuseNoiseMoveLerpOption = (_int)m_iDiffuseNoiseMoveLerpOption;
|
||||
|
||||
if (ImGui::Combo("Lerp DiffuseNoiseMove Option", &iDiffuseNoiseMoveLerpOption, pLerp, 9))
|
||||
{
|
||||
m_iDiffuseNoiseMoveLerpOption = iDiffuseNoiseMoveLerpOption;
|
||||
}
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
GUI::DragFloat2("MaskNoiseUVGainAmount", (_float*)&m_vMaskNoiseUVGainAmount, 0.01f);
|
||||
|
||||
_int iMaskNoiseMoveLerpOption = (_int)m_iMaskNoiseMoveLerpOption;
|
||||
|
||||
if (ImGui::Combo("Lerp MaskNoiseMove Option", &iMaskNoiseMoveLerpOption, pLerp, 9))
|
||||
{
|
||||
m_iMaskNoiseMoveLerpOption = iMaskNoiseMoveLerpOption;
|
||||
}
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this);
|
||||
if (GUI::TreeNode("NOISE_TEX"))
|
||||
{
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this);
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
GUI::Separator(); GUI::Spacing();
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include "GameInstance.h"
|
||||
|
||||
CEffectObject::CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CGameObject(pDevice, pContext)
|
||||
:CPartObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CEffectObject::CEffectObject(const CEffectObject& rhs)
|
||||
:CGameObject(rhs)
|
||||
:CPartObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -66,6 +66,12 @@ HRESULT CEffectObject::Render_Blur()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_iBlurWeight, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++)
|
||||
{
|
||||
|
||||
@@ -174,6 +180,26 @@ HRESULT CEffectObject::Bind_ShaderResources()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskMoveLerpOption", &m_iMaskMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseMoveLerpOption", &m_iDiffuseMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskNoiseMoveLerpOption", &m_iMaskNoiseMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseNoiseMoveLerpOption", &m_iDiffuseNoiseMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (m_pDiffuse_TextureCom != nullptr)
|
||||
{
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
#include <sstream>
|
||||
|
||||
CEffect_Editor::CEffect_Editor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CEffectObject{ pDevice, pContext }
|
||||
: CContainerObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CEffect_Editor::CEffect_Editor(const CEffect_Editor& rhs)
|
||||
: CEffectObject(rhs)
|
||||
: CContainerObject(rhs)
|
||||
, m_MatFiles(rhs.m_MatFiles)
|
||||
{
|
||||
|
||||
@@ -23,8 +23,8 @@ HRESULT CEffect_Editor::Initialize_Prototype()
|
||||
{
|
||||
|
||||
|
||||
ReadMaterials("../Bin/Resources/VFX/ParticleMaterials/Base_Mat");
|
||||
ReadMaterials("../Bin/Resources/VFX/ParticleMaterials/Mat_Instance");
|
||||
ReadMaterials("../Bin/Resources/VFX/Particles/Magic/Protego");
|
||||
|
||||
|
||||
for (auto iter : m_MatFiles)
|
||||
{
|
||||
@@ -38,6 +38,7 @@ HRESULT CEffect_Editor::Initialize_Prototype()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
}
|
||||
@@ -60,17 +61,19 @@ HRESULT CEffect_Editor::Initialize(void* pArg)
|
||||
|
||||
void CEffect_Editor::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CEffect_Editor::Update(_float fTimeDelta)
|
||||
{
|
||||
Describe_Entity();
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
}
|
||||
|
||||
void CEffect_Editor::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CEffect_Editor::Ready_Components(void* pArg)
|
||||
@@ -84,9 +87,20 @@ HRESULT CEffect_Editor::Ready_Components(void* pArg)
|
||||
|
||||
HRESULT CEffect_Editor::Ready_Child()
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CEditEffect>(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_EFFECT, nullptr, this, reinterpret_cast<CEditEffect**>(&m_pEditEffect))))
|
||||
|
||||
|
||||
CPartObject::PARTOBJECT_DESC PartsDesc{};
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
if (FAILED(Add_PartObject<CEditEffect>("EffectObject" + to_string(m_iNumPart++), ENUM_CLASS(LEVEL::EFFECT), &m_pEditEffect, &PartsDesc)))
|
||||
return E_FAIL;
|
||||
|
||||
m_strCurrentEffectName = "EffectObject0";
|
||||
SAFE_RELEASE(m_pEditEffect);
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -310,17 +324,136 @@ CGameObject* CEffect_Editor::Clone(void* pArg, CGameObject* pOwner)
|
||||
void CEffect_Editor::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pEditEffect);
|
||||
}
|
||||
|
||||
void CEffect_Editor::Describe_Entity()
|
||||
{
|
||||
ImGui::Begin("Effect Editor");
|
||||
|
||||
GUI::TextColored(ImVec4(1.f, 0.f, 1.f, 1.f), m_strCurrentEffectName.c_str());
|
||||
|
||||
if (m_pEditEffect != nullptr)
|
||||
m_pEditEffect->Describe_Entity();
|
||||
|
||||
ImGui::End();
|
||||
|
||||
ImGui::Begin("Reference Material");
|
||||
|
||||
if (m_pEditEffect != nullptr)
|
||||
m_pEditEffect->Reference_Mat_For_EditEffect();
|
||||
|
||||
ImGui::End();
|
||||
|
||||
ImGui::Begin("Effect Hierarchy");
|
||||
|
||||
#pragma region PopUp
|
||||
|
||||
if (ImGui::IsItemClicked(ImGuiMouseButton_Right))
|
||||
ImGui::OpenPopup("Effect Hierarchy");
|
||||
|
||||
|
||||
if (ImGui::BeginPopup("Effect Hierarchy"))
|
||||
{
|
||||
if (ImGui::MenuItem("Create Effect"))
|
||||
{
|
||||
|
||||
CPartObject::PARTOBJECT_DESC PartsDesc{};
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
if (FAILED(Add_PartObject<CEditEffect>("EffectObject" + to_string(m_iNumPart++), ENUM_CLASS(LEVEL::EFFECT), nullptr, &PartsDesc)))
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
|
||||
_int iIndex = {};
|
||||
|
||||
for (auto& pPartObject : m_PartObjects)
|
||||
{
|
||||
_string strName = "EffectObject" + to_string(iIndex);
|
||||
|
||||
if (GUI::TreeNode(strName.c_str()))
|
||||
{
|
||||
|
||||
#pragma region PopUp
|
||||
|
||||
if (GUI::IsItemClicked(ImGuiMouseButton_Right))
|
||||
GUI::OpenPopup(strName.c_str());
|
||||
|
||||
|
||||
if (GUI::BeginPopup(strName.c_str()))
|
||||
{
|
||||
|
||||
if (ImGui::MenuItem("Delete Effect"))
|
||||
{
|
||||
auto iter = m_PartObjects.begin();
|
||||
advance(iter, iIndex); // 이터레이터를 증가시킨다
|
||||
|
||||
SAFE_RELEASE(pPartObject.second);
|
||||
m_PartObjects.erase(iter);
|
||||
|
||||
GUI::EndPopup();
|
||||
GUI::TreePop();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
GUI::EndPopup();
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
if (GUI::IsItemClicked()) // 선택창에 띄우기
|
||||
{
|
||||
CEditEffect* pSelectedEffectObject = dynamic_cast<CEditEffect*>(pPartObject.second);
|
||||
|
||||
if (pSelectedEffectObject == nullptr)
|
||||
{
|
||||
GUI::TreePop();
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (m_pEditEffect == pSelectedEffectObject)
|
||||
{
|
||||
GUI::TreePop();
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Safe_Release(m_pEditEffect);
|
||||
|
||||
m_pEditEffect = pSelectedEffectObject;
|
||||
|
||||
Safe_AddRef(pSelectedEffectObject);
|
||||
|
||||
m_strCurrentEffectName = strName;
|
||||
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
iIndex++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
HRESULT CEffect_Editor::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
#include "pch.h"
|
||||
|
||||
#include "Information.h"
|
||||
|
||||
IMPLEMENT_SINGLETON(CInformation)
|
||||
|
||||
|
||||
HRESULT CInformation::Initialize_Info(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
m_pDevice = pDevice;
|
||||
m_pContext = pContext;
|
||||
SAFE_ADDREF(m_pDevice);
|
||||
SAFE_ADDREF(m_pContext);
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInformation::Release_Info()
|
||||
{
|
||||
if (nullptr == s_pInstance) {
|
||||
return S_OK;
|
||||
}
|
||||
DestroyInstance();
|
||||
|
||||
//SAFE_RELEASE();
|
||||
//SAFE_RELEASE();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_bool CInformation::strListBox(const _char* Label, _int& iCurrentIndex, vector<_string>& contents)
|
||||
{
|
||||
assert(iCurrentIndex < contents.size());
|
||||
assert(iCurrentIndex >= 0);
|
||||
return GUI::ListBox(Label, &iCurrentIndex, [](void* data, _int iIndex)->const _char*
|
||||
{
|
||||
auto vec = static_cast<vector<_string>*>(data);
|
||||
return (*vec)[iIndex].c_str();
|
||||
}, &contents, (_int)(contents.size())
|
||||
);
|
||||
}
|
||||
|
||||
_bool CInformation::wstrListBox(const _char* Label, _int& iCurrentIndex, vector<_wstring>& contents)
|
||||
{
|
||||
assert(iCurrentIndex < contents.size());
|
||||
assert(iCurrentIndex >= 0);
|
||||
return GUI::ListBox(Label, &iCurrentIndex, [](void* data, _int iIndex)->const _char*
|
||||
{
|
||||
auto vec = static_cast<vector<_wstring>*>(data);
|
||||
return CMyTools::ToString((*vec)[iIndex]).c_str();
|
||||
}, &contents, (_int)(contents.size())
|
||||
);
|
||||
}
|
||||
|
||||
void CInformation::Log_Render()
|
||||
{
|
||||
GUI::Begin("Log");
|
||||
GUI::Text(m_strLog.c_str());
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
void CInformation::Log_Push(const _char* pContents)
|
||||
{
|
||||
m_strLog.append(_string("\n") + pContents);
|
||||
}
|
||||
|
||||
void CInformation::Log_Clear()
|
||||
{
|
||||
m_strLog.clear();
|
||||
}
|
||||
|
||||
CInformation::CInformation()
|
||||
{
|
||||
}
|
||||
|
||||
void CInformation::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
|
||||
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
SAFE_RELEASE(m_pContext);
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "Layer.h"
|
||||
#include "GameObject.h"
|
||||
#include "DummyObject.h"
|
||||
#include "DummySkyBox.h"
|
||||
|
||||
CLevel_ObjectViewer::CLevel_ObjectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
@@ -46,7 +47,9 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta)
|
||||
|
||||
Show_AnimList();
|
||||
|
||||
Object_Setting();
|
||||
Dummy_Object_Setting();
|
||||
|
||||
Parts_Object_Setting();
|
||||
}
|
||||
|
||||
HRESULT CLevel_ObjectViewer::Render()
|
||||
@@ -76,19 +79,20 @@ void CLevel_ObjectViewer::Add_Parts()
|
||||
{
|
||||
if (GUI::BeginTabBar("##MaleTabBar"))
|
||||
{
|
||||
if (GUI::BeginTabItem("Head"))
|
||||
if (GUI::BeginTabItem("Body"))
|
||||
{
|
||||
Category_PartsModelList("Human/Head/Male", "Head");
|
||||
Category_PartsModelList("Human/Body/Male", "Body");
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
|
||||
_bool bDisabled = {};
|
||||
if (m_HumanRoot)
|
||||
bDisabled = (m_HumanRoot->Get_MainModel());
|
||||
if (!bDisabled) GUI::BeginDisabled();
|
||||
if (GUI::BeginTabItem("Body"))
|
||||
if (GUI::BeginTabItem("Head"))
|
||||
{
|
||||
Category_PartsModelList("Human/Body/Male", "Body");
|
||||
Category_PartsModelList("Human/Head/Male", "Head");
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
@@ -97,6 +101,9 @@ void CLevel_ObjectViewer::Add_Parts()
|
||||
{
|
||||
Category_PartsModelList("Human/Hair/Male", "Hair");
|
||||
|
||||
if (m_HumanRoot)
|
||||
m_HumanRoot->Get_ModelParts(ENUM_CLASS(CRootModelPart::PARTSTYPE::HAIR))->Describe_Entity();
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
if (!bDisabled) GUI::EndDisabled();
|
||||
@@ -109,19 +116,20 @@ void CLevel_ObjectViewer::Add_Parts()
|
||||
{
|
||||
if (GUI::BeginTabBar("##FeMaleTabBar"))
|
||||
{
|
||||
if (GUI::BeginTabItem("Head"))
|
||||
if (GUI::BeginTabItem("Body"))
|
||||
{
|
||||
Category_PartsModelList("Human/Head/FeMale", "Head");
|
||||
Category_PartsModelList("Human/Body/FeMale", "Body");
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
|
||||
_bool bDisabled = {};
|
||||
if (m_HumanRoot)
|
||||
bDisabled = (m_HumanRoot->Get_MainModel());
|
||||
if (!bDisabled) GUI::BeginDisabled();
|
||||
if (GUI::BeginTabItem("Body"))
|
||||
if (GUI::BeginTabItem("Head"))
|
||||
{
|
||||
Category_PartsModelList("Human/Body/FeMale", "Body");
|
||||
Category_PartsModelList("Human/Head/FeMale", "Head");
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
@@ -130,6 +138,9 @@ void CLevel_ObjectViewer::Add_Parts()
|
||||
{
|
||||
Category_PartsModelList("Human/Hair/FeMale", "Hair");
|
||||
|
||||
if (m_HumanRoot)
|
||||
m_HumanRoot->Get_ModelParts(ENUM_CLASS(CRootModelPart::PARTSTYPE::HAIR))->Describe_Entity();
|
||||
|
||||
GUI::EndTabItem();
|
||||
}
|
||||
if (!bDisabled) GUI::EndDisabled();
|
||||
@@ -149,6 +160,8 @@ void CLevel_ObjectViewer::Show_ModelFilePath()
|
||||
Category_ModelList("Monster");
|
||||
|
||||
Category_ModelList("Human");
|
||||
|
||||
Category_ModelList("Object");
|
||||
}
|
||||
GUI::EndTabBar();
|
||||
GUI::End();
|
||||
@@ -214,8 +227,6 @@ void CLevel_ObjectViewer::Category_PartsModelList(const _char* Category, const _
|
||||
{
|
||||
if (GUI::Button(szCategory))
|
||||
{
|
||||
Save_LayerName(Layer);
|
||||
|
||||
CGameObject* pTempObject = { nullptr };
|
||||
|
||||
CDummyObject::PARTS_OBJECT_DESC Desc = {};
|
||||
@@ -225,10 +236,10 @@ void CLevel_ObjectViewer::Category_PartsModelList(const _char* Category, const _
|
||||
m_HumanRoot->Set_ModelName(szCategory);
|
||||
|
||||
_uint iIndex = 0;
|
||||
if (strstr(szCategory,"Head"))
|
||||
iIndex = ENUM_CLASS(CRootModelPart::PARTSTYPE::HEAD);
|
||||
else if (strstr(szCategory,"Body"))
|
||||
if (strstr(szCategory,"Body"))
|
||||
iIndex = ENUM_CLASS(CRootModelPart::PARTSTYPE::BODY);
|
||||
else if (strstr(szCategory,"Head"))
|
||||
iIndex = ENUM_CLASS(CRootModelPart::PARTSTYPE::HEAD);
|
||||
else if (strstr(szCategory,"Hair"))
|
||||
iIndex = ENUM_CLASS(CRootModelPart::PARTSTYPE::HAIR);
|
||||
|
||||
@@ -250,6 +261,7 @@ void CLevel_ObjectViewer::Show_AnimList()
|
||||
if (GUI::Button(pModel->Get_AnimList(i)))
|
||||
{
|
||||
pModel->Set_AnimationIndex(i);
|
||||
pModel->Set_CurrentTrackPosition(0.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -281,7 +293,7 @@ void CLevel_ObjectViewer::Show_ObjectList()
|
||||
}
|
||||
}
|
||||
|
||||
void CLevel_ObjectViewer::Object_Setting()
|
||||
void CLevel_ObjectViewer::Dummy_Object_Setting()
|
||||
{
|
||||
GUI::Begin("Object_Info");
|
||||
if (!m_Objects.empty())
|
||||
@@ -308,15 +320,20 @@ void CLevel_ObjectViewer::Object_Setting()
|
||||
}
|
||||
}
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
void CLevel_ObjectViewer::Parts_Object_Setting()
|
||||
{
|
||||
GUI::Begin("PartsObject_Info");
|
||||
if (m_HumanRoot)
|
||||
{
|
||||
CModel* pModel = m_HumanRoot->Get_MainModel();
|
||||
if (pModel)
|
||||
{
|
||||
_float AnimTrack = pModel->Get_CurrentTrackPosition();
|
||||
GUI::DragFloat("AnimTrack", &AnimTrack);
|
||||
GUI::Button(pModel->Get_AnimList(pModel->Get_AnimIndex()));
|
||||
|
||||
_float KeyFrame = pModel->Get_CurrentTrackPosition();
|
||||
GUI::DragFloat("KeyFrame", &KeyFrame);
|
||||
|
||||
_float AnimSpeed = pModel->Get_AnimSpeed();
|
||||
GUI::DragFloat("AnimSpeed", &AnimSpeed, 0.1f);
|
||||
@@ -328,36 +345,64 @@ void CLevel_ObjectViewer::Object_Setting()
|
||||
pModel->Set_PlayAnim(bPlayAnim);
|
||||
}
|
||||
|
||||
if (GUI::Button("Add Event"))
|
||||
if (GUI::Button("Load KeyFrame"))
|
||||
{
|
||||
m_fAnimFrame = m_HumanRoot->Get_MainModel()->Get_CurrentTrackPosition();
|
||||
Load_KeyFrame();
|
||||
}
|
||||
|
||||
GUI::DragFloat("Anim Frame", &m_fAnimFrame);
|
||||
GUI::SameLine();
|
||||
if(GUI::Button("Event"))
|
||||
{
|
||||
static _char EventName[64] = {};
|
||||
|
||||
GUI::InputText("EventName", EventName, sizeof(EventName));
|
||||
GUI::SameLine();
|
||||
|
||||
if (GUI::Button("Save KeyFrame"))
|
||||
{
|
||||
if (m_HumanRoot && m_HumanRoot->Get_MainModel())
|
||||
{
|
||||
_float fKeyFrame = m_HumanRoot->Get_MainModel()->Get_CurrentTrackPosition();
|
||||
m_KeyFrame.push_back(fKeyFrame);
|
||||
m_Events.emplace_back(EventName);
|
||||
|
||||
FILE* fp = nullptr;
|
||||
fopen_s(&fp, "../Bin/Resources/Models/KeyFrame.bin", "wb");
|
||||
if (!fp) return;
|
||||
|
||||
_uint KeyFrameSize = (_uint)m_KeyFrame.size();
|
||||
|
||||
fwrite(&KeyFrameSize, sizeof(_uint), 1, fp);
|
||||
|
||||
for (size_t i = 0; i < m_KeyFrame.size(); i++)
|
||||
{
|
||||
_uint EventSize = (_uint)m_Events[i].size();
|
||||
fwrite(&m_KeyFrame[i], sizeof(_float), 1, fp);
|
||||
fwrite(&EventSize, sizeof(_uint), 1, fp);
|
||||
fwrite(&m_Events[i], sizeof(_string), 1, fp);
|
||||
}
|
||||
|
||||
|
||||
fclose(fp);
|
||||
|
||||
EventName[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < m_KeyFrame.size(); ++i)
|
||||
{
|
||||
ImDrawList* draw = ImGui::GetForegroundDrawList();
|
||||
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
|
||||
float scale = 50.f;
|
||||
|
||||
draw->AddLine(center, ImVec2(center.x + scale, center.y), IM_COL32(255, 0, 0, 255), 2.0f);
|
||||
draw->AddLine(center, ImVec2(center.x, center.y - scale), IM_COL32(0, 255, 0, 255), 2.0f);
|
||||
draw->AddLine(center, ImVec2(center.x + scale * 0.5f, center.y + scale * 0.5f), IM_COL32(0, 0, 255, 255), 2.0f);
|
||||
GUI::DragFloat(m_Events[i].c_str(), &m_KeyFrame[i]);
|
||||
}
|
||||
|
||||
|
||||
if (GUI::Button("Delete"))
|
||||
{
|
||||
m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Root"))->Clear_Layer();
|
||||
m_HumanRoot = nullptr;
|
||||
m_KeyFrame.clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_HumanRoot)
|
||||
|
||||
m_HumanRoot->Get_ModelParts(ENUM_CLASS(CRootModelPart::PARTSTYPE::HAIR))->Describe_Entity();
|
||||
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
@@ -386,6 +431,30 @@ _wchar* CLevel_ObjectViewer::Save_ModelName(const _char* Category)
|
||||
return m_wszName;
|
||||
}
|
||||
|
||||
void CLevel_ObjectViewer::Load_KeyFrame()
|
||||
{
|
||||
FILE* fp = nullptr;
|
||||
fopen_s(&fp, "../Bin/Resources/Models/KeyFrame.bin", "rb");
|
||||
if (!fp) return;
|
||||
|
||||
_uint KeyFameSize = {};
|
||||
_uint EventLen = {};
|
||||
|
||||
fread(&KeyFameSize, sizeof(_uint), 1, fp);
|
||||
|
||||
for (size_t i = 0; i < KeyFameSize; i++)
|
||||
{
|
||||
fread(&m_fKeyFrame, sizeof(_float), 1, fp);
|
||||
fread(&EventLen, sizeof(_uint), 1, fp);
|
||||
fread(&m_strEvent, sizeof(_string), 1, fp);
|
||||
|
||||
m_Events.push_back(m_strEvent);
|
||||
m_KeyFrame.push_back(m_fKeyFrame);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
{
|
||||
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
|
||||
@@ -428,7 +497,7 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_UI(const _wstring& strLayerTag)
|
||||
|
||||
HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_Cube>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummySkyBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -97,24 +97,24 @@ HRESULT CLevel_PhysXLab::Ready_Layer_Terrain(const _wstring& strLayerTag)
|
||||
|
||||
HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag)
|
||||
{
|
||||
//for (int i = 0; i < 50; ++i) {
|
||||
// CDummy_PhysXBox::BOXSTARTPOS_DESC Desc{};
|
||||
// Desc.vPos = { m_pGameInstance->Random_Float(0.f, 30.f), m_pGameInstance->Random_Float(3.f, 33.f), m_pGameInstance->Random_Float(0.f, 30.f) };
|
||||
// Desc.vRotRPY = { m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI) };
|
||||
for (int i = 0; i < 50; ++i) {
|
||||
CDummy_PhysXBox::BOXSTARTPOS_DESC Desc{};
|
||||
Desc.vPos = { m_pGameInstance->Random_Float(0.f, 30.f), m_pGameInstance->Random_Float(3.f, 33.f), m_pGameInstance->Random_Float(0.f, 30.f) };
|
||||
Desc.vRotRPY = { m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI) };
|
||||
|
||||
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//{
|
||||
// CDummy_PhysXPlayable::BOXSTARTPOS_DESC Desc{};
|
||||
// Desc.vPos = { 0.f, 10.f, 0.f };
|
||||
// Desc.vRotRPY = { 0.f, 0.f, 0.f };
|
||||
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXPlayable>(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER, &Desc))) {
|
||||
// return E_FAIL;
|
||||
// }
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
CDummy_PhysXPlayable::PlayableSTARTPOS_DESC Desc{};
|
||||
Desc.vPos = { 0.f, 100.f, 0.f };
|
||||
Desc.vRotRPY = { 0.f, 0.f, 0.f };
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXPlayable>(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
//{
|
||||
// CDummy_PhysXMesh::BOXSTARTPOS_DESC Desc{};
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "Head.h"
|
||||
#include "Body.h"
|
||||
#include "Hair.h"
|
||||
#include "Dummy_Goblin.h"
|
||||
#include "DummySkyBox.h"
|
||||
#include "DummyObject.h"
|
||||
#include <filesystem>
|
||||
@@ -438,7 +437,7 @@ HRESULT CLoader::Loading_For_Effect()
|
||||
Asset_FileLoad("../Bin/Resources/Models/Effect/ParticleMesh", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) {
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::EFFECT), wstrFileName,
|
||||
CInstance_Model::Create(m_pDevice, m_pContext, pFilePath, MODEL::NONANIM, XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity(), 0))))
|
||||
CInstance_Model::Create(m_pDevice, m_pContext, pFilePath, MODEL::NONANIM, XMMatrixScaling(0.1f, 0.1f, 0.1f) * XMMatrixIdentity(), 0))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
@@ -496,23 +495,23 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
|
||||
{
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
Desc.tRigidDynamicDesc.bExclusive = false;
|
||||
Desc.tRigidDynamicDesc.vhalfGeometryInfo = { 0.5f, 0.5f, 0.5f };
|
||||
Desc.tRigidDynamicDesc.vMatInfo = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.tRigidDynamicDesc.ePxShapeFlag = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
|
||||
{
|
||||
Desc.eType = ACTOR::BOX;
|
||||
Desc.ePxRigidBodyFlags = {};
|
||||
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
|
||||
Desc.vMatInfo = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.fContactOffset = { 0.05f };
|
||||
Desc.vhalfGeometryInfo = { 1.f, 1.f, 1.f };
|
||||
Desc.fDensity = 10.f;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
//if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_River_Col_Model"),
|
||||
// //CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
|
||||
// CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
{
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), CCharacter_Controller::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -527,17 +526,17 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
m_strMessage = TEXT("Model Loading..");
|
||||
|
||||
|
||||
//if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Box"),
|
||||
// CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))){
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Box"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#ifdef 기무리
|
||||
vector<_wstring> ModelPrototypeTags = {};
|
||||
vector<filesystem::path> ModelPrototypePath = {};
|
||||
|
||||
//for (const auto& file : filesystem::directory_iterator("..\\Bin\\Resources\\Models\\MapMesh"))
|
||||
for (const auto& file : filesystem::directory_iterator("C:\\Users\\kimnuri\\Desktop\\Hogwart\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain"))
|
||||
for (const auto& file : filesystem::directory_iterator("C:\\Users\\kimnuri\\Desktop\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain"))
|
||||
{
|
||||
if (file.is_directory()){
|
||||
continue;
|
||||
@@ -570,10 +569,16 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
for (_uint i = 0; i < iNumMesh; ++i) {
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
Desc.tRigidStaticDesc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(Desc.tRigidStaticDesc.szMeshName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
|
||||
{
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
Desc.ePxRigidBodyFlags = {};
|
||||
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT;
|
||||
Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
|
||||
Desc.fContactOffset = 0.f;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -709,16 +714,9 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_F_Hair1_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/FeMale/F_Hair1/F_Hair1.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
#pragma endregion
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinHead_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/GoblinHead.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinBody_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/GoblinBody.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
#pragma region MONSTER
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/TombProtector/TombProtector.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
@@ -728,6 +726,21 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Troll/Troll.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Dragon_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Dragon/Dragon.bin", XMMatrixScaling(0.0005f, 0.0005f, 0.0005f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
#pragma endregion
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Broom_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_SkyboxModel */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Desc_Box"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixIdentity()))))
|
||||
@@ -763,8 +776,8 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummyObject>(g_iStaticLevel, CDummyObject::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Dummy_Cube */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Cube>(g_iStaticLevel, CDummy_Cube::Create(m_pDevice, m_pContext))))
|
||||
/* For.Prototype_GameObject_DummySkyBox */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummySkyBox>(g_iStaticLevel, CDummySkyBox::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
m_strMessage = TEXT("Loading Success!");
|
||||
@@ -827,12 +840,19 @@ HRESULT CLoader::Loading_For_MapViewer()
|
||||
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
|
||||
|
||||
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
|
||||
for (_uint i = 0; i < iNumMesh; ++i) {
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
Desc.tRigidStaticDesc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(Desc.tRigidStaticDesc.szMeshName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
|
||||
{
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
Desc.ePxRigidBodyFlags = {};
|
||||
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
|
||||
Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT;
|
||||
Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
|
||||
Desc.fContactOffset = 0.f;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,22 +284,21 @@ void CMapObject_LOD::Describe_Entity()
|
||||
GUI::SameLine();
|
||||
if (GUI::Button("Bake!!!")) {
|
||||
CMapObject_Manager* pManager = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_MAPOBJECTMANAGER)->Get_Object<CMapObject_Manager>();
|
||||
for (_uint i = 0; i < (_uint)m_ModelPrototypeTags.size(); ++i) {
|
||||
for (_uint i = 0; i < (_uint)m_ModelPathIndices.size(); ++i) {
|
||||
filesystem::path filePath = pManager->Get_PrototypePath(m_ModelPathIndices[i]);
|
||||
|
||||
CModel* pModel = m_pModelComs[i];
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
pModel->Save_PhysXTriMeshes(filePath.string().c_str());
|
||||
|
||||
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
|
||||
for (_uint i = 0; i < iNumMesh; ++i)
|
||||
{ // RIGID_BODY
|
||||
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
|
||||
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
|
||||
Desc.szMeshName = strDestName.c_str();
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(pModel->Get_MeshName(i)).c_str(), nullptr, &Desc))) {
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), nullptr, &Desc))) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "MapObject_Manager.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -374,7 +374,7 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
|
||||
#pragma endregion
|
||||
|
||||
|
||||
// 저장
|
||||
// ÀúÀå
|
||||
if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) {
|
||||
MSG_BOX("Failed to Save File");
|
||||
}
|
||||
@@ -451,7 +451,7 @@ HRESULT CMapObject_Manager::Save_ContainerData(const _char* pFileName, const _ch
|
||||
|
||||
for (_uint i = 0; i < pMapObject->Get_LodLevel() + 1; ++i)
|
||||
{
|
||||
// <PrototypeTag>텍스트</PrototypeTag>
|
||||
// <PrototypeTag>ÅØ½ºÆ®</PrototypeTag>
|
||||
tinyxml2::XMLElement* proto = doc.NewElement("PrototypeTag");
|
||||
proto->SetText(CMyTools::ToString(pMapObject->Get_PrototypeTag(i)).c_str());
|
||||
PartObject->InsertEndChild(proto);
|
||||
@@ -498,7 +498,7 @@ HRESULT CMapObject_Manager::Save_ContainerData(const _char* pFileName, const _ch
|
||||
m_pSelectObject = nullptr;
|
||||
#pragma endregion
|
||||
|
||||
// 저장
|
||||
// ÀúÀå
|
||||
if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) {
|
||||
MSG_BOX("Failed to Save File");
|
||||
}
|
||||
@@ -1117,4 +1117,4 @@ void CMapObject_Manager::Free()
|
||||
|
||||
void CMapObject_Manager::Describe_Entity()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,13 +254,11 @@ void CMapObject_Static::Describe_Entity()
|
||||
_uint iNumMesh = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
CRigidBody::RIGIDBODY_DESC Desc{};
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
|
||||
for (_uint i = 0; i < iNumMesh; ++i)
|
||||
{ // RIGID_BODY
|
||||
Desc.tRigidStaticDesc.szMeshName = m_pModelCom->Get_MeshName(i);
|
||||
Desc.szMeshName = _string(m_pModelCom->Get_MeshName(i) + to_string(i)).c_str();
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(m_pModelCom->Get_MeshName(i)).c_str(), nullptr, &Desc))) {
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(Desc.szMeshName).c_str(), nullptr, &Desc))) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ HRESULT CModelParts::Bind_ShaderResources()
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,17 +101,18 @@ void CRootModelPart::Change_Model(_uint iIndex)
|
||||
pModel->Set_CurrentTrackPosition(m_fTrackPosition);
|
||||
pModel->Play_Animation(0.f);
|
||||
|
||||
|
||||
if (iIndex == ENUM_CLASS(PARTSTYPE::HEAD))
|
||||
if (iIndex == ENUM_CLASS(PARTSTYPE::BODY))
|
||||
{
|
||||
Set_MainModel(m_ModelParts[iIndex]->Get_Component<CModel>());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CRootModelPart::Set_Animation(_uint iAnimIndex)
|
||||
{
|
||||
m_pMainModel->Set_AnimationIndex(iAnimIndex);
|
||||
|
||||
m_pMainModel->Set_CurrentTrackPosition(0.f);
|
||||
m_pMainModel->Play_Animation(0.f);
|
||||
for (auto& PartObject : m_ModelParts)
|
||||
{
|
||||
CModel* pModel = PartObject->Get_Component<CModel>();
|
||||
@@ -119,6 +120,7 @@ void CRootModelPart::Set_Animation(_uint iAnimIndex)
|
||||
{
|
||||
pModel->Set_AnimationIndex(m_pMainModel->Get_AnimIndex());
|
||||
pModel->Set_CurrentTrackPosition(m_pMainModel->Get_CurrentTrackPosition());
|
||||
pModel->Play_Animation(0.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,12 +141,12 @@ HRESULT CRootModelPart::Ready_PartObjects()
|
||||
|
||||
CModelParts* pModelPartsObject = { nullptr };
|
||||
|
||||
if (FAILED(Add_PartObject<CHead>("Human_Head", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast<CHead**>(&pModelPartsObject), &PartsDesc)))
|
||||
if (FAILED(Add_PartObject<CBody>("Human_Body", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast<CBody**>(&pModelPartsObject), &PartsDesc)))
|
||||
return E_FAIL;
|
||||
|
||||
m_ModelParts.push_back(pModelPartsObject);
|
||||
|
||||
if (FAILED(Add_PartObject<CBody>("Human_Body", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast<CBody**>(&pModelPartsObject), &PartsDesc)))
|
||||
if (FAILED(Add_PartObject<CHead>("Human_Head", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast<CHead**>(&pModelPartsObject), &PartsDesc)))
|
||||
return E_FAIL;
|
||||
|
||||
m_ModelParts.push_back(pModelPartsObject);
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CModel;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CDummy_Goblin final : public CGameObject
|
||||
{
|
||||
private:
|
||||
CDummy_Goblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_Goblin(const CDummy_Goblin& Prototype);
|
||||
virtual ~CDummy_Goblin() = default;
|
||||
|
||||
public:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
_bool m_bRimLight = { true };
|
||||
_float m_fRimLightPower = { 3.2f };
|
||||
_float m_fRimLightStrength = { 3.04f };
|
||||
_float3 m_vRimLightColor = { 69.f / 255.f, 5.f / 255.f, 10.f / 255.f };
|
||||
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
static CDummy_Goblin* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -1,47 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CModel;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CDummy_Goblin_Head final : public CGameObject
|
||||
{
|
||||
private:
|
||||
CDummy_Goblin_Head(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_Goblin_Head(const CDummy_Goblin_Head& Prototype);
|
||||
virtual ~CDummy_Goblin_Head() = default;
|
||||
|
||||
public:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
_bool m_bRimLight = { true };
|
||||
_float m_fRimLightPower = { 3.2f };
|
||||
_float m_fRimLightStrength = { 3.04f };
|
||||
_float3 m_vRimLightColor = { 69.f / 255.f, 5.f / 255.f, 10.f / 255.f };
|
||||
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
static CDummy_Goblin_Head* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -33,8 +33,8 @@ class CDummy_PhysXBox final : public CGameObject
|
||||
private:
|
||||
CRigidBody* m_pRigidBody = { nullptr };
|
||||
const PSX::PxRigidDynamic* m_pActor = { nullptr };
|
||||
//CModel* m_pModelCom = { nullptr };
|
||||
//CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -14,11 +14,11 @@ NS_BEGIN(Editor)
|
||||
class CDummy_PhysXPlayable final : public CGameObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagBoxStartPos
|
||||
typedef struct tagPlayableStartPos
|
||||
{
|
||||
_float3 vPos = {};
|
||||
_float3 vRotRPY = {};
|
||||
}BOXSTARTPOS_DESC;
|
||||
}PlayableSTARTPOS_DESC;
|
||||
private:
|
||||
CDummy_PhysXPlayable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_PhysXPlayable(const CDummy_PhysXPlayable& rhs);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
#include "PartObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CInstance_Model;
|
||||
@@ -11,7 +11,7 @@ NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CEffectObject abstract : public CGameObject
|
||||
class CEffectObject abstract : public CPartObject
|
||||
{
|
||||
protected:
|
||||
CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
@@ -51,6 +51,13 @@ class CEffectObject abstract : public CGameObject
|
||||
_float2 m_vUVCutting = { 1.f ,1.f };
|
||||
_float2 m_vUVMaskCutting = { 1.f ,1.f };
|
||||
|
||||
_int m_iMaskMoveLerpOption = { 0 };
|
||||
_int m_iDiffuseMoveLerpOption = { 0 };
|
||||
_int m_iMaskNoiseMoveLerpOption = { 0 };
|
||||
_int m_iDiffuseNoiseMoveLerpOption = { 0 };
|
||||
_int m_iBlurWeight = { 0 };
|
||||
|
||||
|
||||
_bool m_isDiffuse = {};
|
||||
_bool m_isMasking = {};
|
||||
_bool m_isDissolve = {};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "EffectObject.h"
|
||||
#include "ContainerObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
@@ -10,7 +10,7 @@ NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CEffect_Editor final : public CEffectObject
|
||||
class CEffect_Editor final : public CContainerObject
|
||||
{
|
||||
private:
|
||||
CEffect_Editor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
@@ -30,18 +30,24 @@ class CEffect_Editor final : public CEffectObject
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
HRESULT Ready_Child();
|
||||
HRESULT Bind_ShaderResources() override;
|
||||
private:
|
||||
void ReadMaterials(const char* pDirectoryName);
|
||||
void ReadMaterial(_wstring wstrFileName, const char* pFilePath);
|
||||
|
||||
private:
|
||||
CGameObject* m_pEditEffect = { nullptr };
|
||||
map<_wstring, vector<pair<_wstring, _wstring>>> m_MatFiles = {}; // map<머테리얼 이름, vector<텍스쳐이름 , 텍스쳐 경로>>
|
||||
_string m_strCurrentEffectName = {};
|
||||
_uint m_iNumPart = { 0 };
|
||||
class CEditEffect* m_pEditEffect = { nullptr };
|
||||
map<_wstring, vector<pair<_wstring, _wstring>>> m_MatFiles = {}; // map<머테리얼 이름, vector<텍스쳐이름 , 텍스쳐 경로>>
|
||||
|
||||
public:
|
||||
static CEffect_Editor* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,60 @@
|
||||
#pragma once
|
||||
|
||||
#include "Base.h"
|
||||
#include "Editor_Define.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
typedef class CInformation final : public CBase
|
||||
{
|
||||
DECLARE_SINGLETON(CInformation)
|
||||
public:
|
||||
HRESULT Initialize_Info(ID3D11Device* pDevice = nullptr, ID3D11DeviceContext* pContext = nullptr);
|
||||
HRESULT Release_Info();
|
||||
#pragma region WHOLEPART
|
||||
_bool strListBox(const _char* Label, _int& iCurrentIndex, vector<_string>& contents);
|
||||
_bool wstrListBox(const _char* Label, _int& iCurrentIndex, vector<_wstring>& contents);
|
||||
|
||||
#pragma endregion // Àü¿ª
|
||||
|
||||
#pragma region OBJECTVIEWER
|
||||
|
||||
#pragma endregion
|
||||
#pragma region MAPVIEWER
|
||||
|
||||
#pragma endregion
|
||||
#pragma region EFFECTVIEWER
|
||||
|
||||
#pragma endregion
|
||||
#pragma region UIVIEWER
|
||||
|
||||
#pragma endregion
|
||||
#pragma region PHYSXVIEWER
|
||||
|
||||
#pragma endregion
|
||||
#pragma region COMBINEDVIEWER
|
||||
|
||||
#pragma endregion
|
||||
|
||||
public:
|
||||
#pragma region LOG
|
||||
void Log_Render();
|
||||
void Log_Push(const _char* pContents);
|
||||
void Log_Clear();
|
||||
#pragma endregion
|
||||
|
||||
private:
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
class CGameInstance* m_pGameInstance = { nullptr };
|
||||
|
||||
_string m_strLog = {};
|
||||
|
||||
|
||||
private:
|
||||
CInformation();
|
||||
virtual ~CInformation() = default;
|
||||
virtual void Free() override;
|
||||
}INFO;
|
||||
|
||||
NS_END
|
||||
@@ -34,9 +34,12 @@ class CLevel_ObjectViewer final : public CLevel
|
||||
void Category_PartsModelList(const _char* Category, const _char* Layer);
|
||||
void Show_AnimList();
|
||||
void Show_ObjectList();
|
||||
void Object_Setting();
|
||||
void Dummy_Object_Setting();
|
||||
void Parts_Object_Setting();
|
||||
void Save_LayerName(const _char* Layer);
|
||||
_wchar* Save_ModelName(const _char* Category);
|
||||
void Load_KeyFrame();
|
||||
|
||||
|
||||
private:
|
||||
vector<CGameObject*> m_Objects;
|
||||
@@ -44,8 +47,10 @@ class CLevel_ObjectViewer final : public CLevel
|
||||
class CRootModelPart* m_HumanRoot = { nullptr };
|
||||
_int m_iObjectIndex = { 0 };
|
||||
_int m_iPartsObjectIndex = { 0 };
|
||||
|
||||
_float m_fAnimFrame = {};
|
||||
_float m_fKeyFrame = {};
|
||||
vector<_float> m_KeyFrame;
|
||||
vector<_string> m_Events;
|
||||
_string m_strEvent;
|
||||
_char m_szName[MAX_PATH];
|
||||
_wchar m_wszName[MAX_PATH];
|
||||
_wchar m_wszLayer[MAX_PATH];
|
||||
|
||||
@@ -12,8 +12,7 @@ class CRootModelPart final : public CContainerObject
|
||||
{
|
||||
|
||||
public:
|
||||
enum class PARTSTYPE{HEAD,BODY,HAIR,END};
|
||||
|
||||
enum class PARTSTYPE{ BODY,HEAD,HAIR,END};
|
||||
public:
|
||||
void Set_PrototypeModelName(const _wchar* PrototypeModelName) { m_PrototypeModelName = PrototypeModelName; }
|
||||
void Set_ModelName(const _char* Name) { m_ModelName = Name; }
|
||||
|
||||
@@ -16,6 +16,7 @@ Texture2D g_Texture;
|
||||
float g_fLightRange;
|
||||
float g_fSpotInnerAngle;
|
||||
float g_fSpotOuterAngle;
|
||||
|
||||
vector g_vLightDir;
|
||||
vector g_vLightPos;
|
||||
vector g_vCamPosition;
|
||||
@@ -29,6 +30,7 @@ Texture2D g_ShadowTexture;
|
||||
Texture2D g_PreShadowTexture;
|
||||
Texture2D g_BlurTexture;
|
||||
Texture2D g_BlurXTexture;
|
||||
Texture2D g_BlurWeightTexture;
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +38,8 @@ vector g_vLightDiffuse;
|
||||
vector g_vLightAmbient;
|
||||
vector g_vLightSpecular;
|
||||
|
||||
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
float3 vPosition : POSITION;
|
||||
@@ -219,13 +223,15 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
float g_fWeights[13] =
|
||||
float g_fWeights[32] =
|
||||
{
|
||||
0.0090, 0.0218, 0.0448, 0.0784, 0.1169,
|
||||
0.1486, 0.1610, 0.1486, 0.1169, 0.0784,
|
||||
0.0448, 0.0218, 0.0090
|
||||
0.000400, 0.000700, 0.001200, 0.002000, 0.003200, 0.005000, 0.007500, 0.011000,
|
||||
0.015700, 0.021700, 0.029000, 0.037300, 0.046200, 0.055200, 0.063600, 0.070800,
|
||||
0.075900, 0.078500, 0.078500, 0.075900, 0.070800, 0.063600, 0.055200, 0.046200,
|
||||
0.037300, 0.029000, 0.021700, 0.015700, 0.011000, 0.007500, 0.005000, 0.003200
|
||||
};
|
||||
|
||||
|
||||
PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
@@ -295,15 +301,31 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
//{
|
||||
// Out.vBackBuffer *= 0.5f;
|
||||
//}
|
||||
|
||||
float4 vColor = 0.f;
|
||||
|
||||
for (int i = -6; i < 7; ++i)
|
||||
//int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f;
|
||||
|
||||
//int iBlurMin;
|
||||
//int iBlurMax;
|
||||
|
||||
//if (iBlurWeight % 2 == 0)
|
||||
//{
|
||||
// iBlurMin = -1 * iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// iBlurMin = -iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2 + 1;
|
||||
//}
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
for (int i = -15; i < 16; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
vTexcoord.y = In.vTexcoord.y + (float)i / g_vResolution.y;
|
||||
vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBackBuffer += vColor;
|
||||
@@ -324,12 +346,32 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In)
|
||||
float2 vTexcoord;
|
||||
float4 vColor = 0.f;
|
||||
|
||||
for (int i = -6; i < 7; ++i)
|
||||
//TODO 블러 조절 해보려햇는데 실패함..
|
||||
|
||||
//int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f;
|
||||
|
||||
//int iBlurMin;
|
||||
//int iBlurMax;
|
||||
|
||||
//if (iBlurWeight % 2 == 0)
|
||||
//{
|
||||
// iBlurMin = -1 * iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// iBlurMin = -iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2 + 1;
|
||||
//}
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
|
||||
for (int i = -15; i < 16; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x;
|
||||
vTexcoord.y = In.vTexcoord.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 15] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBlurX = vColor;
|
||||
|
||||
@@ -50,10 +50,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
|
||||
Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
vector vDiffuseTexture = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
vector vColorTexture = g_ColorTexture.Sample(ClampSampler, In.vTexcoord);
|
||||
|
||||
if (0.f == vColorTexture.a)
|
||||
{
|
||||
@@ -66,7 +63,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
switch (iOption)
|
||||
{
|
||||
case 1:
|
||||
Out.vBackBuffer.rgb = vColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb /= vColorTexture.rgb;
|
||||
break;
|
||||
case 2:
|
||||
Out.vBackBuffer.rgb += vColorTexture.rgb;
|
||||
@@ -78,7 +75,7 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
Out.vBackBuffer.rgb *= vColorTexture.rgb;
|
||||
break;
|
||||
case 5:
|
||||
Out.vBackBuffer.rgb /= vColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb = vColorTexture.rgb;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -144,7 +144,8 @@ void CChannel::Update_TransformationMatirx(const vector<CBone*>& Bones, _float f
|
||||
}
|
||||
_matrix BoneTransformationMatrix = XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
|
||||
|
||||
Bones[m_iBoneIndex]->Set_TransformationMatrix(BoneTransformationMatrix);
|
||||
if(Bones.size()>m_iBoneIndex)
|
||||
Bones[m_iBoneIndex]->Set_TransformationMatrix(BoneTransformationMatrix);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,54 @@ CCharacter_Controller::CCharacter_Controller(const CCharacter_Controller& rhs)
|
||||
{
|
||||
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
HRESULT CCharacter_Controller::Render()
|
||||
{
|
||||
_vector vPos = Get_Position();
|
||||
_float3 vVolume = Get_Volume();
|
||||
_matrix WorldMatrix = XMMatrixTranslationFromVector(vPos);
|
||||
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f);
|
||||
|
||||
switch (m_eBodyType)
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
{
|
||||
// vVolume = half-extents(Hx,Hy,Hz) ¶ó°í °¡Á¤
|
||||
const _matrix ScaleMatrix =
|
||||
XMMatrixScaling(vVolume.x / 0.5f,
|
||||
vVolume.y / 0.5f,
|
||||
vVolume.z / 0.5f);
|
||||
m_pMainShape->Draw(ScaleMatrix * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
case ACTOR::CAPSULE:
|
||||
{
|
||||
_float fHalf = vVolume.y;
|
||||
|
||||
_matrix ScaleMatrix =
|
||||
XMMatrixScaling(vVolume.x / 0.5f,
|
||||
fHalf / (2.f * 0.5f),
|
||||
vVolume.x / 0.5f);
|
||||
m_pMainShape->Draw(ScaleMatrix * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
|
||||
_matrix ScaleSphereMatrix = XMMatrixScaling(vVolume.x / 0.5f, vVolume.x / 0.5f, vVolume.x / 0.5f);
|
||||
|
||||
_matrix WorldUp = XMMatrixTranslation(0.f, +fHalf * 0.5f, 0.f);
|
||||
_matrix WorldDown = XMMatrixTranslation(0.f, -fHalf * 0.5f, 0.f);
|
||||
|
||||
m_pSubShape->Draw(ScaleSphereMatrix * WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
m_pSubShape->Draw(ScaleSphereMatrix * WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
void CCharacter_Controller::Modify_Volume(_float3 fVolume)
|
||||
{
|
||||
@@ -111,6 +159,12 @@ void CCharacter_Controller::Set_Position(_fvector vNewPos)
|
||||
m_pController->setPosition(pxLVec3NewPos);
|
||||
}
|
||||
|
||||
_vector CCharacter_Controller::Get_Position()
|
||||
{
|
||||
PSX::PxExtendedVec3 pxVPos = m_pController->getPosition();
|
||||
return XMVectorSet((_float)pxVPos.x, (_float)pxVPos.y, (_float)pxVPos.z, 1.f);
|
||||
}
|
||||
|
||||
_float3 CCharacter_Controller::Get_FootPosition()
|
||||
{
|
||||
PSX::PxExtendedVec3 pxLVecfootPos = m_pController->getFootPosition();
|
||||
@@ -143,8 +197,12 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
|
||||
Desc.halfSideExtent = {};
|
||||
Desc.halfForwardExtent = {};
|
||||
Desc.contactOffset = pDesc->fContactOffset;
|
||||
Desc.material = m_pGameInstance->Get_Material(pDesc->fMaterial);
|
||||
Desc.material = m_pGameInstance->Get_Material(&pDesc->fMaterial);
|
||||
m_pController = m_pGameInstance->Add_BoxController(Desc);
|
||||
#ifdef _DEBUG
|
||||
_float3 vVolume = Get_Volume();
|
||||
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, vVolume, false, false));
|
||||
#endif // _DEBUG
|
||||
} break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
{
|
||||
@@ -153,8 +211,13 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
|
||||
Desc.height = pDesc->tCapsuleInfo.fHeight;
|
||||
Desc.climbingMode = pDesc->tCapsuleInfo.eClimbingMode; // 񃧯 eEASY
|
||||
Desc.contactOffset = pDesc->fContactOffset;
|
||||
Desc.material = m_pGameInstance->Get_Material(pDesc->fMaterial);
|
||||
Desc.material = m_pGameInstance->Get_Material(&pDesc->fMaterial);
|
||||
m_pController = m_pGameInstance->Add_CapsuleController(Desc);
|
||||
#ifdef _DEBUG
|
||||
_float3 vVolume = Get_Volume();
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, vVolume.x, 10, false, false));
|
||||
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, vVolume.y, vVolume.x, 10, false));
|
||||
#endif // _DEBUG
|
||||
} break;
|
||||
default:
|
||||
assert(false); // PhysX¿¡¼ ºÒ°¡´É
|
||||
|
||||
@@ -345,6 +345,7 @@ void CComputeShader::Free()
|
||||
Safe_Release(m_pOutputUAV[i]);
|
||||
Safe_Release(m_pOutputBuffer[i]);
|
||||
Safe_Release(m_pOutputSRV[i]);
|
||||
Safe_Release(m_pOutputStagingBuffer[i]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -559,7 +559,7 @@ SaveModel* CGameInstance::Load_SaveModel(const _char* filePath)
|
||||
}
|
||||
|
||||
#pragma region PhysX_Manager
|
||||
PSX::PxMaterial* CGameInstance::Get_Material(_float3& vMatInfo)
|
||||
PSX::PxMaterial* CGameInstance::Get_Material(_float3* vMatInfo)
|
||||
{
|
||||
return m_pPhysX_Manager->Get_Material(vMatInfo);
|
||||
}
|
||||
@@ -569,10 +569,6 @@ void CGameInstance::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTr
|
||||
return m_pPhysX_Manager->RegistTriMesh(pName, pPxTriMesh);
|
||||
}
|
||||
|
||||
PSX::PxShape* CGameInstance::Create_Shape(ACTOR eType, _float3& vhalfGeometryInfo, PSX::PxMaterial& pxMaterial, _bool bExclusive, PSX::PxShapeFlags ePxShapeFlag)
|
||||
{
|
||||
return m_pPhysX_Manager->Create_Shape(eType, vhalfGeometryInfo, pxMaterial, bExclusive, ePxShapeFlag);
|
||||
}
|
||||
const PSX::PxRigidDynamic* CGameInstance::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
{
|
||||
return m_pPhysX_Manager->Add_DynamicActor(RigidBody);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Mesh.h"
|
||||
#include "GameInstance.h"
|
||||
#include "ComputeShader.h"
|
||||
#include "Bone.h"
|
||||
|
||||
CInstance_Model::CInstance_Model(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CComponent{ pDevice , pContext }
|
||||
@@ -427,6 +428,9 @@ void CInstance_Model::Free()
|
||||
for (auto& pMesh : m_Meshes)
|
||||
Safe_Release(pMesh);
|
||||
|
||||
for (auto& pBone : m_Bones)
|
||||
Safe_Release(pBone);
|
||||
|
||||
Safe_Release(m_pComputeShader);
|
||||
Safe_Release(m_pConstantBuffer);
|
||||
Safe_Release(m_pParticleValueBuffer);
|
||||
|
||||
@@ -405,85 +405,6 @@ HRESULT CMaterial::Bind_SRV(CShader* pShader, const _char* pConstantName, _uint
|
||||
return pShader->Bind_SRV(pConstantName, m_SRVs[iType][iTextureIndex]);
|
||||
}
|
||||
|
||||
|
||||
HRESULT CMaterial::Initialize(const _char* pModelFilePath, HANDLE hFile, DWORD& dwByte)
|
||||
{
|
||||
for (int i = 0; i < AI_TEXTURE_TYPE_MAX; ++i) {
|
||||
_uint iNumSrv = { 0 };
|
||||
if (!ReadFile(hFile, &i, sizeof(_uint), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (!ReadFile(hFile, &iNumSrv, sizeof(_uint), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (iNumSrv == 0) {
|
||||
continue;
|
||||
}
|
||||
m_SRVs[i].reserve(iNumSrv);
|
||||
|
||||
ID3D11ShaderResourceView* pSRV = { nullptr };
|
||||
HRESULT hr = {};
|
||||
|
||||
for (_uint j = 0; j < iNumSrv; ++j) {
|
||||
_uint strLength = { 0 };
|
||||
if (!ReadFile(hFile, &strLength, sizeof(_uint), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
_char szTextureName[MAX_PATH] = {};
|
||||
if (!ReadFile(hFile, szTextureName, strLength, &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_char szTextureDir[MAX_PATH] = {};
|
||||
_char szDrive[MAX_PATH] = {};
|
||||
_char szDir[MAX_PATH] = {};
|
||||
_splitpath_s(pModelFilePath, szDrive, MAX_PATH, szDir, MAX_PATH, nullptr, 0, nullptr, 0);
|
||||
strcpy_s(szTextureDir, sizeof(_char) * MAX_PATH, szDrive);
|
||||
strcat_s(szTextureDir, sizeof(_char) * MAX_PATH, szDir);
|
||||
strcat_s(szTextureDir, sizeof(_char) * MAX_PATH, szTextureName);
|
||||
|
||||
|
||||
{
|
||||
_char szTextureFileName[MAX_PATH] = {};
|
||||
_char szTextureFilePath[MAX_PATH] = {};
|
||||
_char szDrive[MAX_PATH] = {};
|
||||
_char szDir[MAX_PATH] = {};
|
||||
_char szFileName[MAX_PATH] = {};
|
||||
_char szEXT[MAX_PATH] = {};
|
||||
_splitpath_s(szTextureDir, szDrive, MAX_PATH, szDir, MAX_PATH, szFileName, MAX_PATH, szEXT, MAX_PATH);
|
||||
strcpy_s(szTextureFileName, szDrive);
|
||||
strcat_s(szTextureFileName, szDir);
|
||||
strcat_s(szTextureFileName, szFileName);
|
||||
|
||||
strcat_s(szTextureFilePath, szTextureFileName);
|
||||
strcat_s(szTextureFilePath, ".dds");
|
||||
|
||||
hr = CreateDDSTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV); // 일단 dds로 시도하고
|
||||
if (FAILED(hr)) {
|
||||
memset(szTextureFilePath, 0, sizeof(_char) * MAX_PATH); // 실패하면 원래 확장자로 다시 시도
|
||||
strcat_s(szTextureFilePath, szTextureFileName);
|
||||
strcat_s(szTextureFilePath, szEXT);
|
||||
|
||||
if (false == strcmp(".tga", szEXT)) {
|
||||
assert(false); // trying to Load TGA
|
||||
hr = S_OK;
|
||||
}
|
||||
else {
|
||||
hr = CreateWICTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (FAILED(hr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_SRVs[i].push_back(pSRV);
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMaterial::Initialize(const _char* pModelFilePath, const SaveMaterial& _SaveMaterial)
|
||||
{
|
||||
for (size_t type = 0; type < 27; type++)
|
||||
@@ -524,19 +445,6 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const SaveMaterial& _
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, HANDLE hFile, DWORD& dwByte) {
|
||||
CMaterial* pInstance = new CMaterial(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pModelFilePath, hFile, dwByte)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMaterial");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, const SaveMaterial& _SaveMaterial)
|
||||
{
|
||||
CMaterial* pInstance = new CMaterial(pDevice, pContext);
|
||||
|
||||
@@ -607,7 +607,7 @@ HRESULT CMesh::SaveAsBinary(HANDLE hFile, DWORD& dwByte)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _fmatrix WorldMatrix)
|
||||
PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _matrix WorldMatrix)
|
||||
{
|
||||
PSX::PxTriangleMeshDesc tMeshDesc = {};
|
||||
vector<PSX::PxVec3> Vertices = {};
|
||||
@@ -616,7 +616,7 @@ PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam,
|
||||
tMeshDesc.points.count = m_iNumVertices;
|
||||
tMeshDesc.points.stride = sizeof(PSX::PxVec3);
|
||||
Vertices.resize(m_iNumVertices);
|
||||
XMVector3TransformCoordStream(reinterpret_cast<_float3*>(Vertices.data()), sizeof(PSX::PxVec3), (_float3*)m_pVertexPositions, sizeof(_float3), m_iNumVertices, WorldMatrix);
|
||||
memcpy(Vertices.data(), m_pVertexPositions, sizeof(PSX::PxVec3) * m_iNumVertices);
|
||||
tMeshDesc.points.data = Vertices.data();
|
||||
}
|
||||
{
|
||||
|
||||
@@ -351,7 +351,7 @@ HRESULT CModel::Ready_PhysXMeshes()
|
||||
|
||||
m_TriMeshes.reserve(m_iNumMeshes);
|
||||
|
||||
m_pGameInstance->ConvertToTriMeshes(m_Meshes, m_TriMeshes, m_pTransform->Get_XMWorldMatrix());
|
||||
m_pGameInstance->ConvertToTriMeshes(m_Meshes, m_TriMeshes);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -362,7 +362,7 @@ HRESULT CModel::Save_PhysXTriMeshes(const _char* pModelFilePath)
|
||||
return E_FAIL;
|
||||
}
|
||||
for (_uint i = 0; i < m_iNumMeshes; ++i) {
|
||||
m_pGameInstance->RegistTriMesh(m_Meshes[i]->Get_Name(), m_TriMeshes[i]);
|
||||
m_pGameInstance->RegistTriMesh((m_Meshes[i]->Get_Name() + to_string(i)).c_str(), m_TriMeshes[i]);
|
||||
}
|
||||
return m_pGameInstance->SaveTriMeshes(pModelFilePath, m_TriMeshes);
|
||||
}
|
||||
@@ -410,7 +410,7 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
|
||||
if (!file.is_open())
|
||||
{
|
||||
//MSG_BOX("Failed to Open Mesh File");
|
||||
/* LOD */
|
||||
///* LOD */
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -856,7 +856,9 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _
|
||||
strcpy_s(Temp, szDir);
|
||||
strcat_s(Temp, szName);
|
||||
strcat_s(Temp, ".bin");
|
||||
Assimp_Model_Load(pModelFilePath, eType, PreTransformMatrix, 0);
|
||||
if (FAILED(Assimp_Model_Load(pModelFilePath, eType, PreTransformMatrix, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
SaveAssimpModel(Temp);
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "RigidBody.h"
|
||||
#include "Mesh.h"
|
||||
|
||||
static PSX::PxTransform XMWorldToPx(const _matrix& WorldMatrix)
|
||||
static PSX::PxTransform XMWorldToPx_NoScale(const _matrix& WorldMatrix)
|
||||
{
|
||||
_vector vPos, vRotq, vScale;
|
||||
XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix);
|
||||
@@ -15,7 +15,6 @@ static PSX::PxTransform XMWorldToPx(const _matrix& WorldMatrix)
|
||||
PSX::PxTransform out;
|
||||
XMStoreFloat3((_float3*)&out.p, vPos);
|
||||
XMStoreFloat4((_float4*)&out.q, vRotq);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -31,22 +30,57 @@ CPhysX_Manager::CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pCont
|
||||
|
||||
const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
{
|
||||
_matrix WorldMatrix = RigidBody.Get_PxTransformPtr()->Get_XMWorldMatrix();
|
||||
_matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix();
|
||||
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx(WorldMatrix);
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix);
|
||||
|
||||
// PxRigidDynamic 씬의 동적 바디 인터페이스
|
||||
PSX::PxRigidDynamic* pActorDynamic = m_pPhysics->createRigidDynamic(pxWorldMatrix);
|
||||
pActorDynamic->userData = &RigidBody;
|
||||
pActorDynamic->attachShape(*RigidBody.Get_ShapePtr());
|
||||
if (RigidBody.Is_Kinematic()) {
|
||||
pActorDynamic->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, true);
|
||||
|
||||
PSX::PxShape* pClone = nullptr;
|
||||
PSX::PxGeometryHolder geoHolder = {};
|
||||
|
||||
_float3 vVolume = RigidBody.Get_HalfGeometryInfo();
|
||||
|
||||
switch (RigidBody.Get_Type()) {
|
||||
case ACTOR::BOX:
|
||||
geoHolder = PSX::PxBoxGeometry(PSX::PxVec3(vVolume.x, vVolume.y, vVolume.z));
|
||||
pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.box(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
assert(nullptr != pClone);
|
||||
break;
|
||||
case ACTOR::CAPSULE:
|
||||
geoHolder = PSX::PxCapsuleGeometry(vVolume.x, vVolume.y);
|
||||
pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.capsule(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
assert(nullptr != pClone);
|
||||
break;
|
||||
case ACTOR::SPHERE:
|
||||
geoHolder = PSX::PxCapsuleGeometry(vVolume.x);
|
||||
pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.sphere(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
assert(nullptr != pClone);
|
||||
break;
|
||||
default:
|
||||
assert(false); break;
|
||||
}
|
||||
|
||||
pClone->setFlags(RigidBody.Get_ShapeFlags());
|
||||
pClone->setContactOffset(RigidBody.Get_ContactOffset());
|
||||
pClone->setRestOffset(0.f);
|
||||
|
||||
|
||||
pActorDynamic->attachShape(*pClone);
|
||||
PSX::PxRigidBodyFlags pxRigidFlags = RigidBody.Get_RigidBodyFlags();
|
||||
pActorDynamic->setRigidBodyFlags(pxRigidFlags);
|
||||
|
||||
|
||||
|
||||
if (pxRigidFlags.isSet(PSX::PxRigidBodyFlag::eKINEMATIC)) {
|
||||
|
||||
}
|
||||
else {
|
||||
PSX::PxRigidBodyExt::updateMassAndInertia(*pActorDynamic, (PSX::PxReal)RigidBody.Get_Density());
|
||||
}
|
||||
|
||||
|
||||
m_RigidBodys.emplace_back(&RigidBody, pActorDynamic);
|
||||
m_pScene->addActor(*pActorDynamic);
|
||||
|
||||
@@ -55,12 +89,12 @@ const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBod
|
||||
|
||||
const PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody)
|
||||
{
|
||||
_matrix WorldMatrix = RigidBody.Get_PxTransformPtr()->Get_XMWorldMatrix();
|
||||
_matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix();
|
||||
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx(WorldMatrix);
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix);
|
||||
|
||||
// PxRigidStatic 씬의 정적 바디 인터페이스
|
||||
const PSX::PxTriangleMesh* pPxMesh = { nullptr };
|
||||
PSX::PxTriangleMesh* pPxMesh = { nullptr };
|
||||
{
|
||||
auto iter = m_TriangleMeshes.find(RigidBody.Get_PxMeshKey());
|
||||
if (m_TriangleMeshes.end() == iter) {
|
||||
@@ -69,18 +103,27 @@ const PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody)
|
||||
}
|
||||
pPxMesh = iter->second;
|
||||
}
|
||||
const PSX::PxTriangleMeshGeometry* pPxMeshGeometry = { nullptr };
|
||||
_vector vPos, vRotq, vScale;
|
||||
XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix);
|
||||
|
||||
vRotq = XMQuaternionNormalize(vRotq);
|
||||
|
||||
PSX::PxTransform out;
|
||||
XMStoreFloat3((_float3*)&out.p, vPos);
|
||||
XMStoreFloat4((_float4*)&out.q, vRotq);
|
||||
PSX::PxMeshScale meshScale(
|
||||
PSX::PxVec3(fabsf(vScale.m128_f32[0]), fabsf(vScale.m128_f32[1]), fabsf(vScale.m128_f32[2])),
|
||||
PSX::PxQuat(PSX::PxIdentity) // 스케일 축은 로컬 기준(보통 Identity가 가장 안전)
|
||||
);
|
||||
PSX::PxTriangleMeshGeometry* pPxMeshGeometry = new PSX::PxTriangleMeshGeometry(pPxMesh, meshScale);
|
||||
{
|
||||
auto iter = m_TriangleMeshGeometry.find(RigidBody.Get_PxMeshKey());
|
||||
if (m_TriangleMeshGeometry.end() == iter) {
|
||||
assert(false);
|
||||
return nullptr;
|
||||
}
|
||||
pPxMeshGeometry = iter->second;
|
||||
pPxMeshGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED;
|
||||
PX_ASSERT(pPxMeshGeometry.isValid()); // 유효성 체크
|
||||
m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry);
|
||||
}
|
||||
|
||||
PSX::PxRigidStatic* pActor = m_pPhysics->createRigidStatic(pxWorldMatrix);
|
||||
PSX::PxShape* pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *RigidBody.Get_PxMaterial());
|
||||
PSX::PxShape* pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]);
|
||||
|
||||
pShape->setFlag(PSX::PxShapeFlag::eSCENE_QUERY_SHAPE, true);
|
||||
pShape->setFlag(PSX::PxShapeFlag::eSIMULATION_SHAPE, true);
|
||||
@@ -92,41 +135,15 @@ const PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody)
|
||||
return pActor;
|
||||
}
|
||||
|
||||
PSX::PxMaterial* CPhysX_Manager::Get_Material(_float3& vMatInfo)
|
||||
PSX::PxMaterial* CPhysX_Manager::Get_Material(const _float3* vMatInfo)
|
||||
{
|
||||
PSX::PxMaterial* pPxMaterial = m_pPhysics->createMaterial(vMatInfo.x, vMatInfo.y, vMatInfo.z);
|
||||
PSX::PxMaterial* pPxMaterial = m_pPhysics->createMaterial(vMatInfo->x, vMatInfo->y, vMatInfo->z);
|
||||
return pPxMaterial;
|
||||
}
|
||||
|
||||
PSX::PxShape* CPhysX_Manager::Create_Shape(ACTOR eType, _float3& vhalfGeometryInfo, PSX::PxMaterial& pxMaterial, _bool bExclusive, PSX::PxShapeFlags ePxShapeFlag)
|
||||
{
|
||||
PSX::PxShape* pShape = { nullptr };
|
||||
switch (eType)
|
||||
{
|
||||
case Engine::ACTOR::BOX:
|
||||
pShape = m_pPhysics->createShape(PSX::PxBoxGeometry(vhalfGeometryInfo.x, vhalfGeometryInfo.y, vhalfGeometryInfo.z), pxMaterial,
|
||||
bExclusive, ePxShapeFlag);
|
||||
break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
pShape = m_pPhysics->createShape(PSX::PxCapsuleGeometry(vhalfGeometryInfo.x, vhalfGeometryInfo.y), pxMaterial,
|
||||
bExclusive, ePxShapeFlag);
|
||||
break;
|
||||
case Engine::ACTOR::SPHERE:
|
||||
pShape = m_pPhysics->createShape(PSX::PxSphereGeometry(vhalfGeometryInfo.x), pxMaterial,
|
||||
bExclusive, ePxShapeFlag);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return pShape;
|
||||
}
|
||||
|
||||
void CPhysX_Manager::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh) {
|
||||
m_TriangleMeshes.emplace(CMyTools::ToWstring(pName), pPxTriMesh);
|
||||
|
||||
PSX::PxTriangleMeshGeometry* pGeometry = new PSX::PxTriangleMeshGeometry(pPxTriMesh);
|
||||
pGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED;
|
||||
m_TriangleMeshGeometry.emplace(CMyTools::ToWstring(pName), pGeometry);
|
||||
}
|
||||
|
||||
HRESULT CPhysX_Manager::ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix)
|
||||
@@ -274,9 +291,10 @@ void CPhysX_Manager::Update_Kinematic()
|
||||
if (pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC)
|
||||
{
|
||||
CRigidBody* pBody = pairBody.first;
|
||||
const CTransform* pTransform = pBody->Get_PxTransformPtr();
|
||||
const CTransform* pTransform = pBody->Get_TransformPtr();
|
||||
|
||||
|
||||
pActor->setKinematicTarget(XMWorldToPx(pTransform->Get_XMWorldMatrix()));
|
||||
pActor->setKinematicTarget(XMWorldToPx_NoScale(pTransform->Get_XMWorldMatrix()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -294,11 +312,12 @@ void CPhysX_Manager::Update(_float fTimeDelta)
|
||||
_bool bResult = m_pScene->fetchResults(true);
|
||||
}
|
||||
{ // Post
|
||||
Update_Dynamic();
|
||||
// Update_Dynamic_ActiveActors();
|
||||
Update_Dynamic_AllActors();
|
||||
}
|
||||
}
|
||||
|
||||
void CPhysX_Manager::Update_Dynamic()
|
||||
void CPhysX_Manager::Update_Dynamic_ActiveActors()
|
||||
{
|
||||
PSX::PxU32 iNumActiveActor = {};
|
||||
PSX::PxActor** ppActiveActors = m_pScene->getActiveActors(iNumActiveActor);
|
||||
@@ -310,7 +329,7 @@ void CPhysX_Manager::Update_Dynamic()
|
||||
if (nullptr == ppActiveActors[i]->userData) {
|
||||
continue;
|
||||
}
|
||||
CTransform* pTransform = ((CRigidBody*)ppActiveActors[i]->userData)->Get_PxTransformPtr();
|
||||
CTransform* pTransform = ((CRigidBody*)ppActiveActors[i]->userData)->Get_TransformPtr();
|
||||
|
||||
PSX::PxTransform pPrevPxTransform;
|
||||
PSX::PxTransform pPxTransform = pActorDynamic->getGlobalPose();
|
||||
@@ -319,7 +338,27 @@ void CPhysX_Manager::Update_Dynamic()
|
||||
|
||||
WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), XMLoadFloat4((_float4*)&pPxTransform.q), XMLoadFloat3((_float3*)&pPxTransform.p));
|
||||
pTransform->Set_WorldMatrix(WorldMatrix);
|
||||
}
|
||||
}
|
||||
//_uint iNumActor = (_uint)m_RigidBodys.size();
|
||||
//for (_uint i = 0; i < iNumActor; ++i) {
|
||||
//for (auto& pairBody : m_RigidBodys)
|
||||
// pairBody.second->userData
|
||||
//}
|
||||
}
|
||||
|
||||
void CPhysX_Manager::Update_Dynamic_AllActors()
|
||||
{
|
||||
for (pair<CRigidBody*, PSX::PxActor*>& pairActors : m_RigidBodys) {
|
||||
PSX::PxRigidDynamic* pActorDynamic = pairActors.second->is<PSX::PxRigidDynamic>();
|
||||
if (nullptr != pActorDynamic) {
|
||||
CTransform* pTransform = ((CRigidBody*)(pActorDynamic->userData))->Get_TransformPtr();
|
||||
|
||||
PSX::PxTransform pxTransform = pActorDynamic->getGlobalPose();
|
||||
_float3 vOriginalScale = pTransform->Get_Scale();
|
||||
_matrix WorldMatrix = {};
|
||||
WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), XMLoadFloat4((_float4*)&pxTransform.q), XMLoadFloat3((_float3*)&pxTransform.p));
|
||||
pTransform->Set_WorldMatrix(WorldMatrix);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -410,7 +449,7 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
|
||||
sceneDesc.filterShader = PSX::PxDefaultSimulationFilterShader;
|
||||
|
||||
sceneDesc.flags = PSX::PxSceneFlag::eENABLE_PCM | PSX::PxSceneFlag::eENABLE_ACTIVE_ACTORS | PSX::PxSceneFlag::eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS;
|
||||
sceneDesc.flags = PSX::PxSceneFlag::eENABLE_PCM | PSX::PxSceneFlag::eENABLE_CCD| PSX::PxSceneFlag::eENABLE_ACTIVE_ACTORS | PSX::PxSceneFlag::eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS;
|
||||
if (false == sceneDesc.isValid()) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
@@ -431,9 +470,10 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
// m_pScene->overlap();??????
|
||||
|
||||
#ifdef 기무리
|
||||
physx::PxMaterial* pMaterial = m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f);
|
||||
//physx::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 90), *pMaterial);
|
||||
//m_pScene->addActor(*pGroundPlane);
|
||||
m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END));
|
||||
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
|
||||
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
|
||||
m_pScene->addActor(*pGroundPlane);
|
||||
|
||||
//{
|
||||
// float halfExtent = .5f;
|
||||
@@ -451,7 +491,6 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//pMaterial->release();
|
||||
#endif // 기무리
|
||||
|
||||
|
||||
|
||||
@@ -113,8 +113,8 @@ void CRenderer::Render()
|
||||
Render_Effect();
|
||||
Render_NonLight();
|
||||
Render_Blend();
|
||||
Render_UI();
|
||||
Render_LastColor();
|
||||
Render_UI();
|
||||
|
||||
#ifdef _DEBUG
|
||||
if(m_pGameInstance->Key_Pressing(DIK_F10))
|
||||
@@ -301,6 +301,10 @@ void CRenderer::Render_Combined()
|
||||
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_X"), m_pShader, "g_BlurXTexture"))) {
|
||||
return;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_Weight"), m_pShader, "g_BlurWeightTexture"))) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::COMBINED));
|
||||
@@ -379,6 +383,11 @@ void CRenderer::Render_Blur()
|
||||
return;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_Weight"), m_pShader, "g_BlurWeightTexture"))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::BLUR));
|
||||
|
||||
m_pVIBuffer->Bind_Resources();
|
||||
@@ -588,6 +597,12 @@ HRESULT CRenderer::Initialize()
|
||||
}
|
||||
|
||||
/* Target_Blur */
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Blur_Weight"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM, _float4(0.0f, 0.0f, 0.0f, 1.0f)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Blur"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) {
|
||||
return E_FAIL;
|
||||
@@ -648,6 +663,10 @@ HRESULT CRenderer::Initialize()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Blur"), TEXT("Target_Blur_Weight")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* MRT_Blur_X */
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Blur_X"), TEXT("Target_Blur_X")))) {
|
||||
return E_FAIL;
|
||||
@@ -695,25 +714,27 @@ HRESULT CRenderer::Initialize()
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Specular"), 225.f, 225.f, 150.0f, 150.0f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Color"), 375.f, 225.f, 450.f, 450.0f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Color"),75.f , 1080 - 75.f, 150.f, 150.f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Shadow"), Viewport.Width - 150.0f, 150.0f, 300.f, 300.f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_PreShadow"), Viewport.Width - 150.0f, Viewport.Height - 150.0f, 300.f, 300.f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur_Weight"), 75.f, 75.f, 150.0f, 150.0f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur"), 150.0f, Viewport.Height - 150.0f, 300.f, 300.f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur"), 75.f, 225.f, 150.0f, 150.0f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur_X"), Viewport.Width * 0.75f, Viewport.Height * 0.75f, Viewport.Width * 0.5f, Viewport.Height * 0.5f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur_X"), 225.f, 75.f, 150.0f, 150.0f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,52 +8,67 @@ CRigidBody::CRigidBody(ID3D11Device* pDevice, ID3D11DeviceContext* pContext):
|
||||
{
|
||||
}
|
||||
|
||||
CRigidBody::CRigidBody(const CRigidBody& rhs):
|
||||
CRigidBody::CRigidBody(const CRigidBody& rhs) :
|
||||
CComponent(rhs),
|
||||
m_pMaterial(rhs.m_pMaterial),
|
||||
m_eActorType(rhs.m_eActorType),
|
||||
m_vhalfGeometryInfo(rhs.m_vhalfGeometryInfo),
|
||||
m_pShape(rhs.m_pShape),
|
||||
m_wstrMeshKey(rhs.m_wstrMeshKey),
|
||||
m_bExclusive(rhs.m_bExclusive),
|
||||
m_bKinematic(rhs.m_bKinematic)
|
||||
m_vMatInfo(rhs.m_vMatInfo),
|
||||
m_ePxRigidBodyFlags(rhs.m_ePxRigidBodyFlags),
|
||||
m_ePxShapeFlags(rhs.m_ePxShapeFlags),
|
||||
m_eMatType(rhs.m_eMatType),
|
||||
m_fContactOffset(rhs.m_fContactOffset)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc)
|
||||
#ifdef _DEBUG
|
||||
HRESULT CRigidBody::Render()
|
||||
{
|
||||
m_eActorType = Desc.eType;
|
||||
_matrix WorldMatrix = m_pTransform->Get_XMWorldMatrix();
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f);
|
||||
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
case ACTOR::CAPSULE:
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
_matrix WorldUp = XMMatrixTranslationFromVector(m_pTransform->Get_State(STATE::UP) * m_vhalfGeometryInfo.y);
|
||||
_matrix WorldDown = XMMatrixTranslationFromVector(m_pTransform->Get_State(STATE::UP) * -m_vhalfGeometryInfo.y);
|
||||
m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
case ACTOR::SPHERE:
|
||||
m_pMaterial = m_pGameInstance->Get_Material(Desc.tRigidDynamicDesc.vMatInfo);
|
||||
m_vhalfGeometryInfo = Desc.tRigidDynamicDesc.vhalfGeometryInfo;
|
||||
m_bExclusive = Desc.tRigidDynamicDesc.bExclusive;
|
||||
m_pShape = m_pGameInstance->Create_Shape(m_eActorType, m_vhalfGeometryInfo, *m_pMaterial, m_bExclusive, Desc.tRigidDynamicDesc.ePxShapeFlag);
|
||||
if (nullptr == m_pShape) {
|
||||
assert(false);
|
||||
m_pMaterial->release();
|
||||
m_pMaterial = nullptr;
|
||||
return E_FAIL;
|
||||
}
|
||||
break;
|
||||
case ACTOR::PLANE:
|
||||
break;
|
||||
case ACTOR::TRIANGLEMESH:
|
||||
{
|
||||
m_pMaterial = m_pGameInstance->Get_Material(Desc.tRigidDynamicDesc.vMatInfo);
|
||||
m_wstrMeshKey = CMyTools::ToWstring(Desc.tRigidStaticDesc.szMeshName);
|
||||
}
|
||||
break;
|
||||
case ACTOR::HEIGHTFIELD:
|
||||
break;
|
||||
{
|
||||
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
return S_OK;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc)
|
||||
{
|
||||
m_eActorType = Desc.eType;
|
||||
m_ePxRigidBodyFlags = Desc.ePxRigidBodyFlags;
|
||||
m_ePxShapeFlags = Desc.ePxShapeFlags;
|
||||
m_eMatType = Desc.ePxMaterialTypes;
|
||||
m_vMatInfo = Desc.vMatInfo;
|
||||
m_fContactOffset = Desc.fContactOffset;
|
||||
m_vhalfGeometryInfo = Desc.vhalfGeometryInfo;
|
||||
m_fDensity = Desc.fDensity;
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(Add_DebugShape())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -64,9 +79,6 @@ HRESULT CRigidBody::Initialize(void* pArg)
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (true == m_bExclusive) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pTransform = m_pOwner->Get_Component<CTransform>();
|
||||
SAFE_ADDREF(m_pTransform);
|
||||
@@ -76,8 +88,6 @@ HRESULT CRigidBody::Initialize(void* pArg)
|
||||
case Engine::ACTOR::BOX:
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
case Engine::ACTOR::SPHERE:
|
||||
m_fDensity = pDesc->tRigidDynamicDesc.fDensity;
|
||||
m_bKinematic = pDesc->tRigidDynamicDesc.bIsKinematic;
|
||||
m_pRigidBody = m_pGameInstance->Add_DynamicActor(*this);
|
||||
break;
|
||||
case Engine::ACTOR::PLANE:
|
||||
@@ -92,12 +102,39 @@ HRESULT CRigidBody::Initialize(void* pArg)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
Add_DebugShape();
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
HRESULT CRigidBody::Add_DebugShape()
|
||||
{
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, m_vhalfGeometryInfo, false, false));
|
||||
break;
|
||||
case ACTOR::CAPSULE:
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x, 10, false, false));
|
||||
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, m_vhalfGeometryInfo.y, m_vhalfGeometryInfo.x, 10, false));
|
||||
break;
|
||||
case ACTOR::SPHERE:
|
||||
m_pMainShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x, 10, false, false));
|
||||
break;
|
||||
case ACTOR::PLANE:
|
||||
case ACTOR::TRIANGLEMESH:
|
||||
case ACTOR::HEIGHTFIELD:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
CRigidBody* CRigidBody::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, RIGIDBODY_PROTOTYPEDESC& Desc)
|
||||
{
|
||||
CRigidBody* pInstance = new CRigidBody(pDevice, pContext);
|
||||
|
||||
@@ -43,13 +43,19 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
CCharacter_Controller(const CCharacter_Controller& rhs);
|
||||
virtual ~CCharacter_Controller() = default;
|
||||
public:
|
||||
#ifdef _DEBUG
|
||||
virtual HRESULT Render() override;
|
||||
#endif
|
||||
|
||||
_float Get_ContactOffset() const { return m_pController->getContactOffset(); }
|
||||
void Set_ContactOffset(_float fValue) const { return m_pController->setContactOffset((PSX::PxF32)fValue); }
|
||||
|
||||
void Move(_float fTimeDelta); // 이동
|
||||
void Set_Position(_fvector vNewPos); // 순간이동
|
||||
_vector Get_Position();
|
||||
_float3 Get_FootPosition(); // ContactOffset이 고려된 발바닥 위치( 실제보다 더 아래에 위치한다는 뜻 )
|
||||
|
||||
|
||||
void Resize_Volume(_float fHeight); // 높이를 수정하고 바닥에 붙임
|
||||
void Modify_Volume(_float3 fVolume);
|
||||
_float3 Get_Volume();
|
||||
@@ -65,6 +71,11 @@ class ENGINE_DLL CCharacter_Controller final :
|
||||
function<void()> m_funcHitCallback = { nullptr };
|
||||
function<void()> m_funcBehaviorCallback = { nullptr };
|
||||
PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {};;
|
||||
#ifdef _DEBUG
|
||||
unique_ptr<GeometricPrimitive> m_pMainShape = { nullptr };
|
||||
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
|
||||
#endif // _DEBUG
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
@@ -16,7 +16,10 @@ enum class TEXTURE_LOAD_TYPE {
|
||||
PATH, // original/
|
||||
END
|
||||
};
|
||||
|
||||
enum class PXMATERIAL {
|
||||
DEFAULT,
|
||||
END,
|
||||
};
|
||||
|
||||
|
||||
enum class MOUSEKEYSTATE { LBUTTON, RBUTTON, WBUTTON, XBUTTON };
|
||||
@@ -77,4 +80,98 @@ enum class PHYSX_KIND {
|
||||
BODY_DYNAMIC = 4,
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
//enum PxRigidBodyFlag::Enum // createBody에 들어감
|
||||
//{
|
||||
// // 해당 바디는 키네마틱 모드가 됨.
|
||||
// // 중력, 힘, 모멘텀에 영향을 안받고 무한질량으로 취급함
|
||||
// // 다른 다이나믹 바디는 밀어내지만
|
||||
// // 스태틱, 키네마틱과는 충돌x, CCT도 이걸 씀
|
||||
// // 직접 개발자가 이동시켜줘야 함
|
||||
// // CCD와 호환되지 않음, 자동으로 한쪽이 꺼짐
|
||||
// // 키는 순간 바디는 sleep 상태가 되고 속도도 0이 됨
|
||||
// [eKINEMATIC]
|
||||
//
|
||||
// // 주의 * 다음 프레임에 적용됨 *
|
||||
// // 씬 쿼리를 세팅하고 이미 움직인 것 처럼 씬 쿼리를 하고 싶을 때 씀
|
||||
// [eUSE_KINEMATIC_TARGET_FOR_SCENE_QUERIES]
|
||||
//
|
||||
// // 고속 이동으로 인한 튕김/뚫림 방지를 이 바디에 등록함
|
||||
// // 이 플래그가 필요한 shape 페어에는 eDetect_ccd_contact도 켜야 됨
|
||||
// // 키네마틱과 호환되지 않음
|
||||
// // 많이 키면 렉걸림
|
||||
// [eENABLE_CCD]
|
||||
//
|
||||
// // CCD에 마찰을 활성화 시킴
|
||||
// // 총알이 표면을 스치면서 마찰로 속도감소 등
|
||||
// [eENABLE_CCD_FRICTION]
|
||||
//
|
||||
// // contact offset을 바디 속도에 따라 키워서
|
||||
// // 관통을 줄이는 방식의 CCD
|
||||
// // 엄밀히 CCD는 아니지만 터널링을 줄일 순 있음
|
||||
// [eENABLE_SPECULATIVE_CCD]
|
||||
//
|
||||
// // 물리 결과를 scene.fetchResult 도중에 얻을 수 있음
|
||||
// // 콜백으로 받게 됨, 물리 결과를 미리 반영하고 싶을 때 사용
|
||||
// [eENABLE_POSE_INTEGRATION_PREVIEW]
|
||||
//
|
||||
// // 충돌 시 적용되는 최대 임펄스 수를 제한?
|
||||
// // 일반 접촉에만 적용되던 걸 CCD에도 적용하게끔 만듬
|
||||
// // 보통 off라고 함
|
||||
// [eENABLE_CCD_MAX_CONTACT_IMPULSE]
|
||||
//
|
||||
// // 힘/가속도가 다음 시뮬레이션에서도 계속해서 쓰임
|
||||
// // addForce(), addTorque() 등으로 준 것들은 원래는 시뮬 끝나면 지워짐
|
||||
// // 레일건 같은 총알이나 우주선 등
|
||||
// [eRETAIN_ACCELERATIONS]
|
||||
//
|
||||
// // 키네마틱페어를 전체적으로 없애는
|
||||
// // PxSceneDesc::kineKineFilteringMode가 켜져 있어도
|
||||
// // 키네마틱 페어를 서로 충돌이벤트 발생시키게 함
|
||||
// // 런타임에 바꾸면 씬에서 제거하고 다시 추가하기 전까지 반영 안됨
|
||||
// [eFORCE_KINE_KINE_NOTIFICATIONS]
|
||||
//
|
||||
// // 위랑 똑같은데 위에껀 키네마틱 페어라면
|
||||
// // 이건 스태틱-키네마틱 페어임
|
||||
// [eFORCE_STATIC_KINE_NOTIFICATIONS]
|
||||
//
|
||||
// // 강하게 회전하는 바디에서 관성에 의한 보정을 더 엄밀히 계산함
|
||||
// // 비용증가, 운동량 안정화
|
||||
// [eENABLE_GYROSCOPIC_FORCES]
|
||||
//
|
||||
// // 예약 플래그임. 안써야함
|
||||
// [eRESERVED]
|
||||
//};
|
||||
//
|
||||
|
||||
|
||||
//enum PxShapeFlag::Enum // createShape에 들어감
|
||||
//{
|
||||
// // 물리 시뮬레이션에서 충돌/접촉 계산에 참여,
|
||||
// // PxSimulationEventCallback::onContact 접촉 이벤트도 이 플래그 들 끼리의 충돌에서 나옴
|
||||
// // eTrigger_Shape와 동시에 킬 수 없음
|
||||
// // (default = on)
|
||||
// [eSIMULATION_SHAPE],
|
||||
//
|
||||
//
|
||||
// // 씬쿼리 대상이 됨, 레이케스트, 오버랩, 스윕 등
|
||||
// // 충돌시뮬레이션과는 별도의 동작
|
||||
// // (default = on)
|
||||
// [eSCENE_QUERY_SHAPE],
|
||||
//
|
||||
// // 다른 shape가 들어오고 나갈 때 onTrigger 콜백을 발생시킴
|
||||
// // 통과가능한 shape이며 이벤트만 발생시킴
|
||||
// // TriangleMesh, HeightField는 트리거사용불가
|
||||
// // (default = off)
|
||||
// [eTRIGGER_SHAPE],
|
||||
//
|
||||
// // 디버그용, 전용디버거 PVD에 이 shape를 그리게 함
|
||||
// // 꺼도 되고, 키면 PxScene에서 설정을 해줘야함
|
||||
// // (default = on)
|
||||
// [eVISUALIZATION],
|
||||
//
|
||||
// // PhysX Particle들이 닿는 순간 그 파티클을 '흡수'해서 제거함
|
||||
// // (default = off)
|
||||
// [ePARTICLE_DRAIN],
|
||||
//};
|
||||
@@ -82,7 +82,7 @@ struct SaveBone
|
||||
string BoneName;
|
||||
|
||||
unsigned int BoneNameSize = {};
|
||||
XMFLOAT4X4 OffsetMatrix;
|
||||
_float4x4 OffsetMatrix = {};
|
||||
int BoneIndex = {};
|
||||
unsigned int WeightsCount = {};
|
||||
vector<SaveBoneWeight>Weights = {};
|
||||
@@ -95,7 +95,7 @@ struct SaveNode
|
||||
unsigned int NodeNameSize = {};
|
||||
int ParentIndex = {};
|
||||
unsigned int ChildrenCount = {};
|
||||
XMFLOAT4X4 Transformation;
|
||||
_float4x4 Transformation = {};
|
||||
vector<int> ChildrenIndices;
|
||||
};
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void Asset_Description(_uint iLevel, const _char* pComponentName, CComponent** ppOut, void* pDesc, class CGameObject* pOwner = nullptr, _wstring wstrGroupName = L"")
|
||||
void Asset_Description(_uint iLevel, const _char* pComponentName, Engine::CComponent** ppOut, void* pDesc, class CGameObject* pOwner = nullptr, _wstring wstrGroupName = L"")
|
||||
{
|
||||
return m_pPrototype_Manager->CPrototype_Manager::Asset_Description<T>(iLevel, pComponentName, ppOut, pDesc, pOwner, wstrGroupName);
|
||||
}
|
||||
@@ -178,9 +178,8 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
_bool isPicking(_float3* pOut);
|
||||
#pragma endregion
|
||||
#pragma region PhysX_Manager
|
||||
PSX::PxMaterial* Get_Material(_float3& vMatInfo);
|
||||
PSX::PxMaterial* Get_Material(_float3* vMatInfo);
|
||||
void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh);
|
||||
PSX::PxShape* Create_Shape(ACTOR eType, _float3& vhalfGeometryInfo, PSX::PxMaterial& pxMaterial, _bool bExclusive = false, PSX::PxShapeFlags ePxShapeFlag = PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE);
|
||||
const PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody& RigidBody);
|
||||
const PSX::PxRigidStatic* Add_StaticActor(CRigidBody& RigidBody);
|
||||
|
||||
@@ -190,7 +189,7 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
PSX::PxController* Get_Controller(_uint iControllerIndex);
|
||||
void ReleaseController(_uint iControllerIndex);
|
||||
|
||||
HRESULT ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<class PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix);
|
||||
HRESULT ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<class PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix = XMMatrixIdentity());
|
||||
HRESULT SaveTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes);
|
||||
HRESULT LoadTriMeshes(const _char* pPath, vector<PSX::PxTriangleMesh*>& TriMeshes); // 모델 불러왔던 경로에 그대로 있음
|
||||
#pragma endregion
|
||||
|
||||
@@ -96,7 +96,7 @@ class ENGINE_DLL CInstance_Model final : public CComponent
|
||||
HRESULT Create_SubResource_Buffer();
|
||||
|
||||
private:
|
||||
ID3D11Buffer* m_pVBInstance = { nullptr };
|
||||
ID3D11Buffer* m_pVBInstance = { nullptr };
|
||||
|
||||
INSTANCE_DESC m_InstanceDesc = {};
|
||||
|
||||
@@ -114,9 +114,9 @@ class ENGINE_DLL CInstance_Model final : public CComponent
|
||||
vector<class CBone*> m_Bones = {}; // 나중에 혹시 애님메쉬를 인스턴싱 할 일이 있을지도 모르니 남겨놓음
|
||||
|
||||
private:
|
||||
class CComputeShader* m_pComputeShader = {};
|
||||
ID3D11Buffer* m_pConstantBuffer = { nullptr }; // 컴퓨트 쉐이드 전용 상수버퍼
|
||||
ID3D11Buffer* m_pParticleValueBuffer = { nullptr }; // 컴퓨트 쉐이드 두번째 버퍼 (스피드, 로테이션)
|
||||
class CComputeShader* m_pComputeShader = {};
|
||||
ID3D11Buffer* m_pConstantBuffer = { nullptr }; // 컴퓨트 쉐이드 전용 상수버퍼
|
||||
ID3D11Buffer* m_pParticleValueBuffer = { nullptr }; // 컴퓨트 쉐이드 두번째 버퍼 (스피드, 로테이션)
|
||||
|
||||
public:
|
||||
#ifdef EDITOR_PROJECT
|
||||
|
||||
@@ -34,13 +34,11 @@ class ENGINE_DLL CMaterial final : public CBase
|
||||
HRESULT Add_Texture(const _char* pTextureFolderPath, string& FileType);
|
||||
#endif // EDITOR_PROJECT
|
||||
|
||||
virtual HRESULT Initialize(const _char* pModelFilePath, HANDLE hFile, DWORD& dwByte);
|
||||
// 바이너리
|
||||
HRESULT Initialize(const _char* pModelFilePath, const SaveMaterial& _SaveMaterial);
|
||||
//
|
||||
|
||||
public:
|
||||
static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, HANDLE hFile, DWORD& dwByte);
|
||||
// 바이너리
|
||||
static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePathconst, const SaveMaterial& _SaveMaterial);
|
||||
//
|
||||
|
||||
@@ -28,7 +28,7 @@ class ENGINE_DLL CMesh final : public CVIBuffer
|
||||
public:
|
||||
static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, vector<class CBone*>& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix);
|
||||
HRESULT SaveAsBinary(HANDLE hFile, DWORD& dwByte);
|
||||
PSX::PxTriangleMesh* ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _fmatrix WorldMatrix);
|
||||
PSX::PxTriangleMesh* ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _matrix WorldMatrix);
|
||||
#endif // EDITOR_PROJECT
|
||||
|
||||
public:
|
||||
|
||||
@@ -12,50 +12,59 @@ class ENGINE_DLL CModel final : public CComponent
|
||||
virtual ~CModel() = default;
|
||||
|
||||
public:
|
||||
static _int Get_BoneIndex(const _char* pBoneName, vector<class CBone*> Bones); // 본의 벡터와 이름을 넘겨주면 인덱스를 넘겨줌 ( n 순회 )
|
||||
_int Get_BoneIndex(const _char* pBoneName) const;
|
||||
void Set_RootBoneIndex(_int iIndex) { m_iRootBoneIndex = iIndex; }
|
||||
#pragma region Model
|
||||
MODEL Get_Type() const { return m_eType; }
|
||||
_float4x4* Get_PreTransformMatrixPtr() { return &m_PreTransformMatrix; }
|
||||
_float4x4 Get_PreTransformMatrix() const { return m_PreTransformMatrix; };
|
||||
virtual HRESULT Render(_uint iMeshIndex);
|
||||
virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation);
|
||||
#pragma endregion
|
||||
#pragma region Animation
|
||||
void Change_AnimationIndex(_int iAnimationIndex, _bool bIsLoop, _float fLerpDuration, _bool bIgnoreCurrentIndex = false); // 애니메이션을 다른 인덱스로 변경함
|
||||
_bool Play_Animation(_float fTimeDelta); // 애니메이션에 델타타임을 넣어줌
|
||||
void Set_AnimationIndex(_uint iIndex, _bool isLoop = true);
|
||||
void RefreshAnim(); // 애님을 현재 애님의 초기상태로 되돌림
|
||||
void Set_AnimationIndex(_uint iIndex, _bool isLoop = true);
|
||||
void Stop_Animation(); // 애니메이션을 정지 (초기상태로)
|
||||
_bool IsFinishedAnim() const { return m_bIsFinishedAnim; }
|
||||
_bool IsFinishedLerp() const { return m_bIsFinishedLerp; }
|
||||
void RefreshAnim(); // 애님을 현재 애님의 초기상태로 되돌림
|
||||
_float Get_AnimProgressRatio();
|
||||
_int Get_AnimProgressPostion(const char* pAnimChannelName);
|
||||
_float Get_AnimEstimatedDuration();
|
||||
void Set_AnimProgressPostion(const _char* pChannelName, _uint iPosition);
|
||||
void Set_AnimPauseState(_bool bValue);// 애님을 현재상태로 정지
|
||||
void ReallocateResources(class CTransform* pTransform = nullptr); // 애님 이동의 대상 트랜스폼(이동시켜야할 트랜스폼)을 재지정함
|
||||
_int Get_RootBoneIndex() const { return m_iRootBoneIndex; }
|
||||
const _float4x4* Get_BoneMatrixPtr(const _char* pBoneName) const;
|
||||
_uint Get_NumMeshes() const { return m_iNumMeshes; }
|
||||
const _char* Get_MeshName(_uint iIndex);
|
||||
MODEL Get_Type() const { return m_eType; }
|
||||
_matrix Get_BoneMatrix(_uint iBoneIndex);
|
||||
|
||||
_float4x4* Get_PreTransformMatrixPtr() { return &m_PreTransformMatrix; }
|
||||
_float4x4 Get_PreTransformMatrix() const { return m_PreTransformMatrix; };
|
||||
void Get_BoneMatrices(_float4x4* pOut);
|
||||
_uint Get_BonesNum() const { return (_uint)m_Bones.size(); }
|
||||
|
||||
void Set_CurrentTrackPosition(_float TrackPosition);
|
||||
const _char* Get_AnimList(_uint iIndex);
|
||||
size_t Get_AnimSize() { return m_Animations.size(); }
|
||||
_float Get_CurrentTrackPosition();
|
||||
void Set_PlayAnim(_bool bPlayAnim) { m_bPlayAnim = bPlayAnim; }
|
||||
_bool Get_PlayAnim() { return m_bPlayAnim; }
|
||||
_int Get_AnimIndex() { return m_iCurrentAnimIndex; }
|
||||
_bool Get_PlayAnim() const { return m_bPlayAnim; }
|
||||
_int Get_AnimIndex() const { return m_iCurrentAnimIndex; }
|
||||
_float Get_AnimSpeed();
|
||||
void Set_AnimSpeed(_float fSpeed);
|
||||
#pragma endregion
|
||||
#pragma region Mesh
|
||||
const _char* Get_MeshName(_uint iIndex);
|
||||
_uint Get_NumMeshes() const { return m_iNumMeshes; }
|
||||
#pragma endregion
|
||||
#pragma region Bone
|
||||
HRESULT Bind_BoneMatrices(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName);
|
||||
void Get_BoneMatrices(_float4x4* pOut);
|
||||
_uint Get_BonesNum() const { return (_uint)m_Bones.size(); }
|
||||
const _float4x4* Get_BoneMatrixPtr(const _char* pBoneName) const;
|
||||
_int Get_RootBoneIndex() const { return m_iRootBoneIndex; }
|
||||
void Set_RootBoneIndex(_int iIndex) { m_iRootBoneIndex = iIndex; }
|
||||
static _int Get_BoneIndex(const _char* pBoneName, vector<class CBone*> Bones); // 본의 벡터와 이름을 넘겨주면 인덱스를 넘겨줌 ( n 순회 )
|
||||
_int Get_BoneIndex(const _char* pBoneName) const;
|
||||
_matrix Get_BoneMatrix(_uint iBoneIndex);
|
||||
#pragma endregion
|
||||
#pragma region Material
|
||||
HRESULT Bind_Material(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName, _uint iType, _uint iTextureIndex);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
|
||||
public:
|
||||
HRESULT Bind_Material(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName, _uint iType, _uint iTextureIndex);
|
||||
HRESULT Bind_BoneMatrices(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName);
|
||||
virtual HRESULT Render(_uint iMeshIndex);
|
||||
virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation);
|
||||
|
||||
#ifdef EDITOR_PROJECT
|
||||
HRESULT Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex);
|
||||
HRESULT Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fmatrix& PreTransformMatrix);
|
||||
|
||||